VTK  9.5.20251209
vtkImageConnectivityFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2014 David Gobbi
3// SPDX-License-Identifier: BSD-3-Clause
53
54#ifndef vtkImageConnectivityFilter_h
55#define vtkImageConnectivityFilter_h
56
57#include "vtkImageAlgorithm.h"
58#include "vtkImagingMorphologicalModule.h" // For export macro
59
60VTK_ABI_NAMESPACE_BEGIN
61class vtkIdTypeArray;
62class vtkIntArray;
63class vtkDataSet;
64class vtkImageData;
66
67class VTKIMAGINGMORPHOLOGICAL_EXPORT vtkImageConnectivityFilter : public vtkImageAlgorithm
68{
69public:
72 void PrintSelf(ostream& os, vtkIndent indent) override;
73
83
93
95
105
107
117
119
132 vtkSetMacro(LabelScalarType, int);
133 vtkGetMacro(LabelScalarType, int);
135
137
152 const char* GetLabelModeAsString();
153 vtkSetMacro(LabelMode, int);
154 vtkGetMacro(LabelMode, int);
156
158
169 vtkSetMacro(ExtractionMode, int);
170 vtkGetMacro(ExtractionMode, int);
172
174
178 vtkSetMacro(LabelConstantValue, int);
179 vtkGetMacro(LabelConstantValue, int);
181
186
191
192 // Description:
193 // Get the size of each extracted region, as a voxel count.
195
201
208
210
217
219
224 vtkSetVector2Macro(SizeRange, vtkIdType);
225 vtkGetVector2Macro(SizeRange, vtkIdType);
227
229
236 vtkSetVector2Macro(ScalarRange, double);
237 vtkGetVector2Macro(ScalarRange, double);
239
241
244 vtkSetMacro(ActiveComponent, int);
245 vtkGetMacro(ActiveComponent, int);
247
248protected:
251
254
255 double ScalarRange[2];
261
266
267 void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
268
269 int FillInputPortInformation(int port, vtkInformation* info) override;
273
274private:
276 void operator=(const vtkImageConnectivityFilter&) = delete;
277};
278
279VTK_ABI_NAMESPACE_END
280#endif
Proxy object to connect input/output ports.
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
dynamic, self-adjusting array of vtkIdType
void SetExtractionModeToAllRegions()
Set which regions to output from this filter.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void SetExtractionModeToLargestRegion()
Set which regions to output from this filter.
~vtkImageConnectivityFilter() override
virtual void SetExtractionMode(int)
Set which regions to output from this filter.
int FillInputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
const char * GetExtractionModeAsString()
Set which regions to output from this filter.
void SetLabelScalarTypeToShort()
Set the scalar type for the output label image.
const char * GetLabelScalarTypeAsString()
Set the scalar type for the output label image.
virtual void SetLabelScalarType(int)
Set the scalar type for the output label image.
vtkAlgorithmOutput * GetStencilConnection()
The input for a stencil (input port 2).
vtkAlgorithmOutput * GetSeedConnection()
The input for seed locations (input port 1).
vtkIdType GetNumberOfExtractedRegions()
Get the number of extracted regions.
void SetStencilData(vtkImageStencilData *data)
The input for a stencil (input port 2).
vtkIdTypeArray * GetExtractedRegionSeedIds()
Get the PointId of the seed for each region.
void SetSeedData(vtkDataSet *data)
The input for seed locations (input port 1).
const char * GetLabelModeAsString()
Set the mode for applying labels to the output.
static vtkImageConnectivityFilter * New()
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
ExtractionModeEnum
Enum constants for SetExtractionMode().
void SetLabelScalarTypeToInt()
Set the scalar type for the output label image.
void SetSeedConnection(vtkAlgorithmOutput *port)
The input for seed locations (input port 1).
void SetLabelScalarTypeToUnsignedChar()
Set the scalar type for the output label image.
void SetLabelModeToConstantValue()
Set the mode for applying labels to the output.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to translate the update extent requests from each output port ...
LabelModeEnum
Enum constants for SetLabelMode().
vtkIdTypeArray * GetExtractedRegionLabels()
Get the label used for each extracted region.
vtkIntArray * GetExtractedRegionExtents()
Get the extent (a 6-tuples) for each output region.
void SetLabelScalarTypeToUnsignedShort()
Set the scalar type for the output label image.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ComputeInputUpdateExtent(int inExt[6], int outExt[6])
virtual void SetLabelMode(int)
Set the mode for applying labels to the output.
void SetExtractionModeToSeededRegions()
Set which regions to output from this filter.
void SetLabelModeToSeedScalar()
Set the mode for applying labels to the output.
void SetStencilConnection(vtkAlgorithmOutput *port)
The input for a stencil (input port 2).
void SetLabelModeToSizeRank()
Set the mode for applying labels to the output.
topologically and geometrically regular array of data
efficient description of an image stencil
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SHORT
Definition vtkType.h:37
int vtkIdType
Definition vtkType.h:367
#define VTK_UNSIGNED_CHAR
Definition vtkType.h:36
#define VTK_UNSIGNED_SHORT
Definition vtkType.h:38
#define VTK_INT
Definition vtkType.h:39