vtkbone
vtkboneImageConnectivityFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright 2010-2016, Numerics88 Solutions Ltd.
4  http://www.numerics88.com/
5 
6  Copyright (c) Eric Nodwell and Steven K. Boyd
7  See Copyright.txt for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 =========================================================================*/
13 
28 #ifndef __vtkboneImageConnectivityFilter_h
29 #define __vtkboneImageConnectivityFilter_h
30 
32 #include "vtkboneWin32Header.h"
33 
34 // forward declarations
36 class vtkIdList;
37 class vtkIdTypeArray;
38 
40 {
41 public:
43  vtkTypeMacro(vtkboneImageConnectivityFilter,
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
47  // These match the defines in vtkConnectivityFilter
49  EXTRACT_SEEDED_REGIONS = 2,
50  EXTRACT_SPECIFIED_REGIONS = 3,
51  EXTRACT_LARGEST_REGION = 4,
52  EXTRACT_ALL_REGIONS = 5,
53  EXTRACT_CLOSEST_POINT_REGION = 6,
54  EXTRACT_REGIONS_OF_SPECIFIED_SIZE = 7
55  };
56 
58 
60  vtkSetClampMacro(ExtractionMode,int,
61  EXTRACT_SEEDED_REGIONS,EXTRACT_REGIONS_OF_SPECIFIED_SIZE);
62  vtkGetMacro(ExtractionMode,int);
64  {this->SetExtractionMode(EXTRACT_SEEDED_REGIONS);};
66  {this->SetExtractionMode(EXTRACT_LARGEST_REGION);};
68  {this->SetExtractionMode(EXTRACT_SPECIFIED_REGIONS);};
70  {this->SetExtractionMode(EXTRACT_CLOSEST_POINT_REGION);};
72  {this->SetExtractionMode(EXTRACT_ALL_REGIONS);};
74  {this->SetExtractionMode(EXTRACT_REGIONS_OF_SPECIFIED_SIZE);};
75  const char *GetExtractionModeAsString();
77 
79  void InitializeSeedList();
80 
82  void AddSeed(vtkIdType id);
83 
85  void DeleteSeed(vtkIdType id);
86 
88  void InitializeSpecifiedRegionList();
89 
91  void AddSpecifiedRegion(int id);
92 
94  void DeleteSpecifiedRegion(int id);
95 
97 
99  vtkSetVector3Macro(ClosestPoint,double);
100  vtkGetVectorMacro(ClosestPoint,double,3);
102 
104 
106  vtkSetMacro(MinimumRegionSize,vtkIdType);
107  vtkGetMacro(MinimumRegionSize,vtkIdType);
109 
111 
112  vtkGetMacro(NumberOfExtractedRegions,unsigned int);
114 
115 protected:
118 
119  virtual int RequestData(vtkInformation *,
122 
123  virtual void SimpleExecute(vtkImageData*, vtkImageData*);
124 
125  int CalculateRegionSizes(
126  vtkUnsignedIntArray* cmap_data,
127  unsigned int numRegions,
128  vtkIdTypeArray* regionSizes);
129 
130  int ExtractionMode; //how to extract regions
131  vtkIdList *Seeds; //id's of points or cells used to seed regions
132  vtkIdList *SpecifiedRegionIds; //regions specified for extraction
133  double ClosestPoint[3];
135 
137 
138 private:
139  // Prevent compiler from making default versions of these.
142 };
143 
144 #endif
#define VTKBONE_EXPORT
int vtkIdType
virtual void SimpleExecute(vtkImageData *input, vtkImageData *output)=0
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
mask regions of image data based on geometric connectivity
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkAlgorithm * New()
void operator=(const vtkObjectBase &)