Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkImageNeighborhoodFilter.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
10 #ifndef __vtkImageNeighborhoodFilter_h
11 #define __vtkImageNeighborhoodFilter_h
12 
13 #include <vtkImageSpatialAlgorithm.h>
14 
15 #include "vtkMRMLLogicExport.h"
16 
22 class VTK_MRML_LOGIC_EXPORT vtkImageNeighborhoodFilter : public vtkImageSpatialAlgorithm
23 {
24 public:
25  static vtkImageNeighborhoodFilter *New();
26  vtkTypeMacro(vtkImageNeighborhoodFilter,vtkImageSpatialAlgorithm);
27 
32  unsigned char *GetMaskPointer() {return Mask;}
33 
37  void SetNeighborTo8();
38  void SetNeighborTo4();
39 
43  vtkGetMacro(Neighbor, int);
44 
49  void GetRelativeHoodExtent(int &hoodMin0, int &hoodMax0, int &hoodMin1,
50  int &hoodMax1, int &hoodMin2, int &hoodMax2);
51 
54  void GetMaskIncrements(vtkIdType &maskInc0, vtkIdType &maskInc1, vtkIdType &maskInc2);
55 
56 protected:
58  ~vtkImageNeighborhoodFilter() override;
59 
62  void SetKernelSize(int size0, int size1, int size2);
63 
64  int Neighbor;
65  unsigned char *Mask;
66 
67 private:
69  void operator=(const vtkImageNeighborhoodFilter&) = delete;
70 };
71 
72 #endif
Augments vtkImageSpatialFilter with a mask to allow neighborhoods of any shape.