VTK: Filters/General/vtkImageMarchingCubes.h Source File

| VTK 9.3.1

vtkImageMarchingCubes.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
36 #ifndef vtkImageMarchingCubes_h
37 #define vtkImageMarchingCubes_h
38
39 #include "vtkFiltersGeneralModule.h" // For export macro
40 #include "vtkPolyDataAlgorithm.h"
41
42 #include "vtkContourValues.h" // Needed for direct access to ContourValues
43
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkCellArray;
46 class vtkFloatArray;
47 class vtkImageData;
48 class vtkPoints;
49
50 class VTKFILTERSGENERAL_EXPORT vtkImageMarchingCubes : public vtkPolyDataAlgorithm
51 {
52 public:
53 static vtkImageMarchingCubes* New();
54 vtkTypeMacro(vtkImageMarchingCubes, vtkPolyDataAlgorithm);
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
58
61 void SetValue(int i, double value);
62 double GetValue(int i);
63 double* GetValues();
64 void GetValues(double* contourValues);
65 void SetNumberOfContours(int number);
66 vtkIdType GetNumberOfContours();
67 void GenerateValues(int numContours, double range[2]);
68 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
70
74 vtkMTimeType GetMTime() override;
75
77
80 vtkSetMacro(ComputeScalars, vtkTypeBool);
81 vtkGetMacro(ComputeScalars, vtkTypeBool);
82 vtkBooleanMacro(ComputeScalars, vtkTypeBool);
84
86
91 vtkSetMacro(ComputeNormals, vtkTypeBool);
92 vtkGetMacro(ComputeNormals, vtkTypeBool);
93 vtkBooleanMacro(ComputeNormals, vtkTypeBool);
95
97
104 vtkSetMacro(ComputeGradients, vtkTypeBool);
105 vtkGetMacro(ComputeGradients, vtkTypeBool);
106 vtkBooleanMacro(ComputeGradients, vtkTypeBool);
108
109 // Should be protected, but the templated functions need these
110 vtkTypeBool ComputeScalars;
111 vtkTypeBool ComputeNormals;
112 vtkTypeBool ComputeGradients;
113 int NeedGradients;
114
115 vtkCellArray* Triangles;
116 vtkFloatArray* Scalars;
117 vtkPoints* Points;
118 vtkFloatArray* Normals;
119 vtkFloatArray* Gradients;
120
121 vtkIdType GetLocatorPoint(int cellX, int cellY, int edge);
122 void AddLocatorPoint(int cellX, int cellY, int edge, vtkIdType ptId);
123 void IncrementLocatorZ();
124
126
131 vtkSetMacro(InputMemoryLimit, vtkIdType);
132 vtkGetMacro(InputMemoryLimit, vtkIdType);
134
135 protected:
136 vtkImageMarchingCubes();
137 ~vtkImageMarchingCubes() override;
138
139 int NumberOfSlicesPerChunk;
140 vtkIdType InputMemoryLimit;
141
142 vtkContourValues* ContourValues;
143
144 vtkIdType* LocatorPointIds;
145 int LocatorDimX;
146 int LocatorDimY;
147 int LocatorMinX;
148 int LocatorMinY;
149
150 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
151 int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
152 int FillInputPortInformation(int port, vtkInformation* info) override;
153
154 void March(vtkImageData* inData, int chunkMin, int chunkMax, int numContours, double* values);
155 void InitializeLocator(int min0, int max0, int min1, int max1);
156 void DeleteLocator();
157 vtkIdType* GetLocatorPointer(int cellX, int cellY, int edge);
158
159 private:
160 vtkImageMarchingCubes(const vtkImageMarchingCubes&) = delete;
161 void operator=(const vtkImageMarchingCubes&) = delete;
162 };
163
168 inline void vtkImageMarchingCubes::SetValue(int i, double value)
169 {
170 this->ContourValues->SetValue(i, value);
171 }
172
176 inline double vtkImageMarchingCubes::GetValue(int i)
177 {
178 return this->ContourValues->GetValue(i);
179 }
180
185 inline double* vtkImageMarchingCubes::GetValues()
186 {
187 return this->ContourValues->GetValues();
188 }
189
195 inline void vtkImageMarchingCubes::GetValues(double* contourValues)
196 {
197 this->ContourValues->GetValues(contourValues);
198 }
199
205 inline void vtkImageMarchingCubes::SetNumberOfContours(int number)
206 {
207 this->ContourValues->SetNumberOfContours(number);
208 }
209
213 inline vtkIdType vtkImageMarchingCubes::GetNumberOfContours()
214 {
215 return this->ContourValues->GetNumberOfContours();
216 }
217
222 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
223 {
224 this->ContourValues->GenerateValues(numContours, range);
225 }
226
231 inline void vtkImageMarchingCubes::GenerateValues(
232 int numContours, double rangeStart, double rangeEnd)
233 {
234 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
235 }
236
237 VTK_ABI_NAMESPACE_END
238 #endif
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:34
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageMarchingCubes
generate isosurface(s) from volume/images
Definition: vtkImageMarchingCubes.h:51
vtkImageMarchingCubes::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkImageMarchingCubes.h:213
vtkImageMarchingCubes::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkImageMarchingCubes.h:106
vtkImageMarchingCubes::LocatorMinY
int LocatorMinY
Definition: vtkImageMarchingCubes.h:148
vtkImageMarchingCubes::Scalars
vtkFloatArray * Scalars
Definition: vtkImageMarchingCubes.h:116
vtkImageMarchingCubes::Gradients
vtkFloatArray * Gradients
Definition: vtkImageMarchingCubes.h:119
vtkImageMarchingCubes::New
static vtkImageMarchingCubes * New()
vtkImageMarchingCubes::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkImageMarchingCubes::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkImageMarchingCubes.h:111
vtkImageMarchingCubes::DeleteLocator
void DeleteLocator()
vtkImageMarchingCubes::Triangles
vtkCellArray * Triangles
Definition: vtkImageMarchingCubes.h:115
vtkImageMarchingCubes::IncrementLocatorZ
void IncrementLocatorZ()
vtkImageMarchingCubes::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkImageMarchingCubes.h:112
vtkImageMarchingCubes::InputMemoryLimit
vtkIdType InputMemoryLimit
Definition: vtkImageMarchingCubes.h:140
vtkImageMarchingCubes::LocatorPointIds
vtkIdType * LocatorPointIds
Definition: vtkImageMarchingCubes.h:144
vtkImageMarchingCubes::March
void March(vtkImageData *inData, int chunkMin, int chunkMax, int numContours, double *values)
vtkImageMarchingCubes::GetLocatorPointer
vtkIdType * GetLocatorPointer(int cellX, int cellY, int edge)
vtkImageMarchingCubes::LocatorDimY
int LocatorDimY
Definition: vtkImageMarchingCubes.h:146
vtkImageMarchingCubes::vtkImageMarchingCubes
vtkImageMarchingCubes()
vtkImageMarchingCubes::Points
vtkPoints * Points
Definition: vtkImageMarchingCubes.h:117
vtkImageMarchingCubes::ContourValues
vtkContourValues * ContourValues
Definition: vtkImageMarchingCubes.h:142
vtkImageMarchingCubes::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkImageMarchingCubes::AddLocatorPoint
void AddLocatorPoint(int cellX, int cellY, int edge, vtkIdType ptId)
vtkImageMarchingCubes::LocatorDimX
int LocatorDimX
Definition: vtkImageMarchingCubes.h:145
vtkImageMarchingCubes::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkImageMarchingCubes.h:176
vtkImageMarchingCubes::GetMTime
vtkMTimeType GetMTime() override
Because we delegate to vtkContourValues & refer to vtkImplicitFunction.
vtkImageMarchingCubes::LocatorMinX
int LocatorMinX
Definition: vtkImageMarchingCubes.h:147
vtkImageMarchingCubes::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkImageMarchingCubes.h:185
vtkImageMarchingCubes::Normals
vtkFloatArray * Normals
Definition: vtkImageMarchingCubes.h:118
vtkImageMarchingCubes::~vtkImageMarchingCubes
~vtkImageMarchingCubes() override
vtkImageMarchingCubes::InitializeLocator
void InitializeLocator(int min0, int max0, int min1, int max1)
vtkImageMarchingCubes::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageMarchingCubes::SetValue
void SetValue(int i, double value)
Methods to set contour values.
Definition: vtkImageMarchingCubes.h:168
vtkImageMarchingCubes::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkImageMarchingCubes.h:205
vtkImageMarchingCubes::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkImageMarchingCubes::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkImageMarchingCubes.h:222
vtkImageMarchingCubes::NeedGradients
int NeedGradients
Definition: vtkImageMarchingCubes.h:113
vtkImageMarchingCubes::GetLocatorPoint
vtkIdType GetLocatorPoint(int cellX, int cellY, int edge)
vtkImageMarchingCubes::NumberOfSlicesPerChunk
int NumberOfSlicesPerChunk
Definition: vtkImageMarchingCubes.h:139
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkContourValues.h
vtkPolyDataAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270