VMTK
Loading...
Searching...
No Matches
vtkvmtkUnstructuredGridCenterlineGroupsClipper Class Reference

Split an unstructured grid into groups/branches corresponding to their proximity to the polyball line of a branched centerline. More...

#include <vtkvmtkUnstructuredGridCenterlineGroupsClipper.h>

Inheritance diagram for vtkvmtkUnstructuredGridCenterlineGroupsClipper:
[legend]
Collaboration diagram for vtkvmtkUnstructuredGridCenterlineGroupsClipper:
[legend]

Public Types

typedef vtkUnstructuredGridAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkUnstructuredGridCenterlineGroupsClipper * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
vtkUnstructuredGrid * GetClippedOutput ()
virtual void SetCenterlines (vtkPolyData *)
virtual vtkPolyData * GetCenterlines ()
virtual void SetCenterlineGroupIds (vtkIdList *)
virtual vtkIdList * GetCenterlineGroupIds ()
virtual void SetCenterlineGroupIdsArrayName (const char *)
virtual char * GetCenterlineGroupIdsArrayName ()
virtual void SetCenterlineRadiusArrayName (const char *)
virtual char * GetCenterlineRadiusArrayName ()
virtual void SetGroupIdsArrayName (const char *)
virtual char * GetGroupIdsArrayName ()
virtual void SetBlankingArrayName (const char *)
virtual char * GetBlankingArrayName ()
virtual void SetClipAllCenterlineGroupIds (int)
virtual int GetClipAllCenterlineGroupIds ()
virtual void ClipAllCenterlineGroupIdsOn ()
virtual void ClipAllCenterlineGroupIdsOff ()
virtual void SetGenerateClippedOutput (int)
virtual int GetGenerateClippedOutput ()
virtual void GenerateClippedOutputOn ()
virtual void GenerateClippedOutputOff ()
virtual void SetCutoffRadiusFactor (double)
virtual double GetCutoffRadiusFactor ()
virtual void SetClipValue (double)
virtual double GetClipValue ()
virtual void SetUseRadiusInformation (int)
virtual int GetUseRadiusInformation ()
virtual void UseRadiusInformationOn ()
virtual void UseRadiusInformationOff ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkUnstructuredGridCenterlineGroupsClipper * SafeDownCast (vtkObjectBase *o)
static vtkvmtkUnstructuredGridCenterlineGroupsClipper * New ()

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkUnstructuredGridCenterlineGroupsClipper ()
 ~vtkvmtkUnstructuredGridCenterlineGroupsClipper ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override

Protected Attributes

vtkPolyData * Centerlines
vtkIdList * CenterlineGroupIds
char * CenterlineGroupIdsArrayName
char * CenterlineRadiusArrayName
char * GroupIdsArrayName
char * BlankingArrayName
int ClipAllCenterlineGroupIds
double CutoffRadiusFactor
double ClipValue
int GenerateClippedOutput
int UseRadiusInformation

Detailed Description

Split an unstructured grid into groups/branches corresponding to their proximity to the polyball line of a branched centerline.

The vtkUnstructuredGrid counterpart of vtkvmtkPolyDataCenterlineGroupsClipper: for each mesh point, evaluates which branch group's polyball-line tube function (see vtkvmtkPolyBallLine) it is closest to, using this as an implicit clipping function to cut a volumetric mesh along the boundaries between branches. This is the filter behind the vmtkmeshbranchclipper pype script.

See also
vtkvmtkPolyDataCenterlineGroupsClipper, vtkvmtkPolyBallLine

Definition at line 40 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkUnstructuredGridCenterlineGroupsClipper()

vtkvmtkUnstructuredGridCenterlineGroupsClipper::vtkvmtkUnstructuredGridCenterlineGroupsClipper ( )
protected

Definition at line 42 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.cxx.

43{
44 this->Centerlines = NULL;
45 this->CenterlineGroupIdsArrayName = NULL;
46 this->CenterlineRadiusArrayName = NULL;
47 this->GroupIdsArrayName = NULL;
48 this->BlankingArrayName = NULL;
49 this->CenterlineGroupIds = NULL;
52 this->ClipValue = 0.0;
53 this->UseRadiusInformation = 1;
54
55 this->SetNumberOfOutputPorts(2);
56 this->GenerateClippedOutput = 0;
57 vtkUnstructuredGrid *output2 = vtkUnstructuredGrid::New();
58 this->GetExecutive()->SetOutputData(1, output2);
59 output2->Delete();
60}
#define VTK_VMTK_LARGE_DOUBLE

◆ ~vtkvmtkUnstructuredGridCenterlineGroupsClipper()

vtkvmtkUnstructuredGridCenterlineGroupsClipper::~vtkvmtkUnstructuredGridCenterlineGroupsClipper ( )
protected

Definition at line 62 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.cxx.

63{
64 if (this->Centerlines)
65 {
66 this->Centerlines->Delete();
67 this->Centerlines = NULL;
68 }
69
70 if (this->CenterlineGroupIds)
71 {
72 this->CenterlineGroupIds->Delete();
73 this->CenterlineGroupIds = NULL;
74 }
75
77 {
78 delete[] this->CenterlineGroupIdsArrayName;
79 this->CenterlineGroupIdsArrayName = NULL;
80 }
81
83 {
84 delete[] this->CenterlineRadiusArrayName;
85 this->CenterlineRadiusArrayName = NULL;
86 }
87
88 if (this->GroupIdsArrayName)
89 {
90 delete[] this->GroupIdsArrayName;
91 this->GroupIdsArrayName = NULL;
92 }
93
94 if (this->BlankingArrayName)
95 {
96 delete[] this->BlankingArrayName;
97 this->BlankingArrayName = NULL;
98 }
99}

Member Function Documentation

◆ IsTypeOf()

int vtkvmtkUnstructuredGridCenterlineGroupsClipper::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkUnstructuredGridCenterlineGroupsClipper::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkUnstructuredGridCenterlineGroupsClipper * vtkvmtkUnstructuredGridCenterlineGroupsClipper::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkUnstructuredGridCenterlineGroupsClipper::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkUnstructuredGridCenterlineGroupsClipper * vtkvmtkUnstructuredGridCenterlineGroupsClipper::NewInstance ( ) const

◆ PrintSelf()

void vtkvmtkUnstructuredGridCenterlineGroupsClipper::PrintSelf ( std::ostream & os,
vtkIndent indent )
override

Definition at line 364 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.cxx.

365{
366 this->Superclass::PrintSelf(os,indent);
367}

◆ New()

vtkvmtkUnstructuredGridCenterlineGroupsClipper * vtkvmtkUnstructuredGridCenterlineGroupsClipper::New ( )
static

◆ SetCenterlines()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetCenterlines ( vtkPolyData * )
virtual

Set/Get the split, grouped centerlines used to define the clipping. Required input.

◆ GetCenterlines()

virtual vtkPolyData * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetCenterlines ( )
virtual

Set/Get the split, grouped centerlines used to define the clipping. Required input.

◆ SetCenterlineGroupIds()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetCenterlineGroupIds ( vtkIdList * )
virtual

Set/Get the subset of centerline group ids to clip the mesh against. If not set (default, NULL), all group ids present in Centerlines are used (unless ClipAllCenterlineGroupIds restricts further).

◆ GetCenterlineGroupIds()

virtual vtkIdList * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetCenterlineGroupIds ( )
virtual

Set/Get the subset of centerline group ids to clip the mesh against. If not set (default, NULL), all group ids present in Centerlines are used (unless ClipAllCenterlineGroupIds restricts further).

◆ SetCenterlineGroupIdsArrayName()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetCenterlineGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the branch group id of each cell. Required input. Commonly named "GroupIds".

◆ GetCenterlineGroupIdsArrayName()

virtual char * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetCenterlineGroupIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the branch group id of each cell. Required input. Commonly named "GroupIds".

◆ SetCenterlineRadiusArrayName()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetCenterlineRadiusArrayName ( const char * )
virtual

Set/Get the name of the point data array of Centerlines holding the maximum inscribed sphere radius at each point. Used when UseRadiusInformation is on. Commonly named "MaximumInscribedSphereRadius".

◆ GetCenterlineRadiusArrayName()

virtual char * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetCenterlineRadiusArrayName ( )
virtual

Set/Get the name of the point data array of Centerlines holding the maximum inscribed sphere radius at each point. Used when UseRadiusInformation is on. Commonly named "MaximumInscribedSphereRadius".

◆ SetGroupIdsArrayName()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the group id assigned to each mesh cell is stored. Commonly named "GroupIds".

◆ GetGroupIdsArrayName()

virtual char * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetGroupIdsArrayName ( )
virtual

Set/Get the name of the output cell data array where the group id assigned to each mesh cell is stored. Commonly named "GroupIds".

◆ SetBlankingArrayName()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetBlankingArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract – blanked tracts are excluded when building the per-group polyball clipping functions. Commonly named "Blanking".

◆ GetBlankingArrayName()

virtual char * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetBlankingArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract – blanked tracts are excluded when building the per-group polyball clipping functions. Commonly named "Blanking".

◆ SetClipAllCenterlineGroupIds()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetClipAllCenterlineGroupIds ( int )
virtual

Toggle clipping against every centerline group id present in Centerlines, ignoring CenterlineGroupIds. Default: off.

◆ GetClipAllCenterlineGroupIds()

virtual int vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetClipAllCenterlineGroupIds ( )
virtual

Toggle clipping against every centerline group id present in Centerlines, ignoring CenterlineGroupIds. Default: off.

◆ ClipAllCenterlineGroupIdsOn()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::ClipAllCenterlineGroupIdsOn ( )
virtual

Toggle clipping against every centerline group id present in Centerlines, ignoring CenterlineGroupIds. Default: off.

◆ ClipAllCenterlineGroupIdsOff()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::ClipAllCenterlineGroupIdsOff ( )
virtual

Toggle clipping against every centerline group id present in Centerlines, ignoring CenterlineGroupIds. Default: off.

◆ SetGenerateClippedOutput()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetGenerateClippedOutput ( int )
virtual

Toggle generating a second output containing the complementary (clipped-away) part of the mesh, retrievable with GetClippedOutput(). Default: off.

◆ GetGenerateClippedOutput()

virtual int vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetGenerateClippedOutput ( )
virtual

Toggle generating a second output containing the complementary (clipped-away) part of the mesh, retrievable with GetClippedOutput(). Default: off.

◆ GenerateClippedOutputOn()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::GenerateClippedOutputOn ( )
virtual

Toggle generating a second output containing the complementary (clipped-away) part of the mesh, retrievable with GetClippedOutput(). Default: off.

◆ GenerateClippedOutputOff()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::GenerateClippedOutputOff ( )
virtual

Toggle generating a second output containing the complementary (clipped-away) part of the mesh, retrievable with GetClippedOutput(). Default: off.

◆ GetClippedOutput()

vtkUnstructuredGrid * vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetClippedOutput ( )

Get the complementary (clipped-away) mesh produced when GenerateClippedOutput is on.

Definition at line 101 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.cxx.

102{
103 if (this->GetNumberOfOutputPorts() < 2)
104 {
105 return NULL;
106 }
107
108 return vtkUnstructuredGrid::SafeDownCast(this->GetExecutive()->GetOutputData(1));
109}

◆ SetCutoffRadiusFactor()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetCutoffRadiusFactor ( double )
virtual

Set/Get a cutoff distance, expressed as a multiple of the local maximum inscribed sphere radius, beyond which a mesh point is not considered close to a branch's polyball function. Default: a very large value (effectively unbounded).

◆ GetCutoffRadiusFactor()

virtual double vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetCutoffRadiusFactor ( )
virtual

Set/Get a cutoff distance, expressed as a multiple of the local maximum inscribed sphere radius, beyond which a mesh point is not considered close to a branch's polyball function. Default: a very large value (effectively unbounded).

◆ SetClipValue()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetClipValue ( double )
virtual

Set/Get the implicit-function value at which the mesh is clipped against each branch's polyball function. Default: 0.0.

◆ GetClipValue()

virtual double vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetClipValue ( )
virtual

Set/Get the implicit-function value at which the mesh is clipped against each branch's polyball function. Default: 0.0.

◆ SetUseRadiusInformation()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::SetUseRadiusInformation ( int )
virtual

Toggle using the per-point sphere radii (CenterlineRadiusArrayName) when evaluating each branch's polyball clipping function, so that the tube function's true tapered shape is used rather than a plain distance-to-centerline test. Default: on.

◆ GetUseRadiusInformation()

virtual int vtkvmtkUnstructuredGridCenterlineGroupsClipper::GetUseRadiusInformation ( )
virtual

Toggle using the per-point sphere radii (CenterlineRadiusArrayName) when evaluating each branch's polyball clipping function, so that the tube function's true tapered shape is used rather than a plain distance-to-centerline test. Default: on.

◆ UseRadiusInformationOn()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::UseRadiusInformationOn ( )
virtual

Toggle using the per-point sphere radii (CenterlineRadiusArrayName) when evaluating each branch's polyball clipping function, so that the tube function's true tapered shape is used rather than a plain distance-to-centerline test. Default: on.

◆ UseRadiusInformationOff()

virtual void vtkvmtkUnstructuredGridCenterlineGroupsClipper::UseRadiusInformationOff ( )
virtual

Toggle using the per-point sphere radii (CenterlineRadiusArrayName) when evaluating each branch's polyball clipping function, so that the tube function's true tapered shape is used rather than a plain distance-to-centerline test. Default: on.

◆ RequestData()

int vtkvmtkUnstructuredGridCenterlineGroupsClipper::RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotectedvirtual

Definition at line 111 of file vtkvmtkUnstructuredGridCenterlineGroupsClipper.cxx.

115{
116 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
117 vtkInformation *outInfo = outputVector->GetInformationObject(0);
118
119 vtkUnstructuredGrid *input = vtkUnstructuredGrid::SafeDownCast(
120 inInfo->Get(vtkDataObject::DATA_OBJECT()));
121 vtkUnstructuredGrid *output = vtkUnstructuredGrid::SafeDownCast(
122 outInfo->Get(vtkDataObject::DATA_OBJECT()));
123
124 vtkDataArray* centerlineGroupIdsArray;
125 vtkIntArray* blankingArray;
126 vtkIntArray* groupIdsArray;
127
128 if (!this->Centerlines)
129 {
130 vtkErrorMacro(<< "Centerlines not set.");
131 return 1;
132 }
133
135 {
136 vtkErrorMacro(<< "CenterlineGroupIds not set.");
137 return 1;
138 }
139
141 {
142 vtkErrorMacro(<< "CenterlineGroupIdsArrayName not set.");
143 return 1;
144 }
145
146 if (!this->GroupIdsArrayName)
147 {
148 vtkErrorMacro(<< "GroupIdsArrayName not set.");
149 return 1;
150 }
151
152 centerlineGroupIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineGroupIdsArrayName);
153
154 if (!centerlineGroupIdsArray)
155 {
156 vtkErrorMacro(<< "CenterlineGroupIdsArray with name specified does not exist");
157 return 1;
158 }
159
160 if (!this->BlankingArrayName)
161 {
162 vtkErrorMacro(<< "BlankingArrayName not set.");
163 return 1;
164 }
165
166 blankingArray = vtkIntArray::SafeDownCast(this->Centerlines->GetCellData()->GetArray(this->BlankingArrayName));
167
168 if (!blankingArray)
169 {
170 vtkErrorMacro(<< "BlankingArrayName with name specified does not exist");
171 return 1;
172 }
173
174 if (!this->CenterlineRadiusArrayName)
175 {
176 vtkErrorMacro(<< "CenterlineRadiusArrayName not set.");
177 return 1;
178 }
179
180 if (!this->Centerlines->GetPointData()->GetArray(this->CenterlineRadiusArrayName))
181 {
182 vtkErrorMacro(<< "CenterlineRadiusArray with name specified does not exist");
183 return 1;
184 }
185
186 if (this->Centerlines->GetNumberOfCells() == 1)
187 {
188 output->DeepCopy(input);
189 groupIdsArray = vtkIntArray::New();
190 groupIdsArray->SetName(this->GroupIdsArrayName);
191 groupIdsArray->SetNumberOfTuples(output->GetNumberOfPoints());
192 groupIdsArray->FillComponent(0,centerlineGroupIdsArray->GetComponent(0,0));
193 output->GetPointData()->AddArray(groupIdsArray);
194 groupIdsArray->Delete();
195 return 1;
196 }
197
198 vtkvmtkAppendFilter* appendBranches = vtkvmtkAppendFilter::New();
199 appendBranches->MergeDuplicatePointsOff();
200 vtkvmtkAppendFilter* appendClippedOutput = NULL;
201 if (this->GenerateClippedOutput)
202 {
203 appendClippedOutput = vtkvmtkAppendFilter::New();
204 appendClippedOutput->MergeDuplicatePointsOff();
205 }
206
207 // for each group, compute the clipping array, clip, add group ids array and append.
208
209 vtkvmtkPolyBallLine* groupTubes = vtkvmtkPolyBallLine::New();
210 groupTubes->SetInput(this->Centerlines);
213
214 vtkvmtkPolyBallLine* nonGroupTubes = vtkvmtkPolyBallLine::New();
215 nonGroupTubes->SetInput(this->Centerlines);
217 nonGroupTubes->SetUseRadiusInformation(this->UseRadiusInformation);
218
219 int numberOfPoints = input->GetNumberOfPoints();
220
221 const char clippingArrayName[] = "ClippingArray";
222
223 vtkDoubleArray* clippingArray = vtkDoubleArray::New();
224 clippingArray->SetNumberOfComponents(1);
225 clippingArray->SetNumberOfTuples(numberOfPoints);
226 clippingArray->FillComponent(0,0.0);
227 clippingArray->SetName(clippingArrayName);
228
229 vtkUnstructuredGrid* clippingInput = vtkUnstructuredGrid::New();
230 clippingInput->DeepCopy(input);
231 clippingInput->GetPointData()->AddArray(clippingArray);
232 clippingInput->GetPointData()->SetActiveScalars(clippingArrayName);
233
234 vtkIdList* groupTubesGroupIds = vtkIdList::New();
235 vtkIdList* nonGroupTubesGroupIds = vtkIdList::New();
236
237 double point[3];
238 double groupTubeValue, nonGroupTubeValue, tubeDifferenceValue;
239
240 vtkIdType groupId;
241
242 vtkIdList* centerlineGroupIds = vtkIdList::New();
243
244 int i;
246 {
247 for (i=0; i<centerlineGroupIdsArray->GetNumberOfTuples(); i++)
248 {
249 if (blankingArray->GetValue(i) == 1)
250 {
251 continue;
252 }
253 centerlineGroupIds->InsertUniqueId(static_cast<vtkIdType>(vtkMath::Round(centerlineGroupIdsArray->GetComponent(i,0))));
254 }
255 }
256 else
257 {
258 centerlineGroupIds->DeepCopy(this->CenterlineGroupIds);
259 }
260
261 for (i=0; i<centerlineGroupIds->GetNumberOfIds(); i++)
262 {
263 groupId = centerlineGroupIds->GetId(i);
264
265 groupTubesGroupIds->Initialize();
266 nonGroupTubesGroupIds->Initialize();
267
268 for (int j=0; j<this->Centerlines->GetNumberOfCells(); j++)
269 {
270 if (blankingArray->GetValue(j) == 1)
271 {
272 continue;
273 }
274 if (static_cast<vtkIdType>(vtkMath::Round(centerlineGroupIdsArray->GetComponent(j,0))) == groupId)
275 {
276 groupTubesGroupIds->InsertNextId(j);
277 }
278 else
279 {
280 nonGroupTubesGroupIds->InsertNextId(j);
281 }
282 }
283
284 if ((groupTubesGroupIds->GetNumberOfIds() == 0) || (nonGroupTubesGroupIds->GetNumberOfIds() == 0))
285 {
286 continue;
287 }
288
289 groupTubes->SetInputCellIds(groupTubesGroupIds);
290 nonGroupTubes->SetInputCellIds(nonGroupTubesGroupIds);
291
292 for (int k=0; k<numberOfPoints; k++)
293 {
294 input->GetPoint(k,point);
295 groupTubeValue = groupTubes->EvaluateFunction(point);
296 if (groupTubeValue > this->CutoffRadiusFactor * this->CutoffRadiusFactor - 1)
297 {
298 groupTubeValue = VTK_VMTK_LARGE_DOUBLE;
299 }
300 nonGroupTubeValue = nonGroupTubes->EvaluateFunction(point);
301 tubeDifferenceValue = nonGroupTubeValue - groupTubeValue;
302 clippingArray->SetValue(k,tubeDifferenceValue);
303 }
304
305 vtkClipDataSet* clipper = vtkClipDataSet::New();
306 clipper->SetInputData(clippingInput);
307 clipper->SetValue(this->ClipValue);
308 clipper->GenerateClipScalarsOff();
309 clipper->SetGenerateClippedOutput(this->GenerateClippedOutput);
310 clipper->Update();
311
312 if (clipper->GetOutput()->GetNumberOfPoints()==0)
313 {
314 clipper->Delete();
315 continue;
316 }
317
318 vtkUnstructuredGrid* clippedBranch = vtkUnstructuredGrid::New();
319 clippedBranch->DeepCopy(clipper->GetOutput());
320
321 if (this->GenerateClippedOutput)
322 {
323 vtkUnstructuredGrid* clippedOutputBranch = vtkUnstructuredGrid::New();
324 clippedOutputBranch->DeepCopy(clipper->GetClippedOutput());
325 appendClippedOutput->AddInputData(clippedOutputBranch);
326 clippedOutputBranch->Delete();
327 }
328
329 groupIdsArray = vtkIntArray::New();
330 groupIdsArray->SetName(this->GroupIdsArrayName);
331 groupIdsArray->SetNumberOfTuples(clippedBranch->GetNumberOfPoints());
332 groupIdsArray->FillComponent(0,groupId);
333
334 clippedBranch->GetPointData()->AddArray(groupIdsArray);
335 appendBranches->AddInputData(clippedBranch);
336 groupIdsArray->Delete();
337 clippedBranch->Delete();
338 clipper->Delete();
339 }
340
341 appendBranches->Update();
342
343 output->DeepCopy(appendBranches->GetOutput());
344
345 if (this->GenerateClippedOutput)
346 {
347 appendClippedOutput->Update();
348 this->GetClippedOutput()->DeepCopy(appendClippedOutput->GetOutput());
349 appendClippedOutput->Delete();
350 }
351
352 clippingArray->Delete();
353 clippingInput->Delete();
354 appendBranches->Delete();
355 groupTubes->Delete();
356 nonGroupTubes->Delete();
357 groupTubesGroupIds->Delete();
358 nonGroupTubesGroupIds->Delete();
359 centerlineGroupIds->Delete();
360
361 return 1;
362}
static vtkvmtkAppendFilter * New()
virtual void MergeDuplicatePointsOff()
virtual void SetInput(vtkPolyData *)
virtual void SetPolyBallRadiusArrayName(const char *)
virtual void SetInputCellIds(vtkIdList *)
virtual void SetUseRadiusInformation(int)
static vtkvmtkPolyBallLine * New()
double EvaluateFunction(double x[3]) override

Member Data Documentation

◆ Centerlines

vtkPolyData* vtkvmtkUnstructuredGridCenterlineGroupsClipper::Centerlines
protected

◆ CenterlineGroupIds

vtkIdList* vtkvmtkUnstructuredGridCenterlineGroupsClipper::CenterlineGroupIds
protected

◆ CenterlineGroupIdsArrayName

char* vtkvmtkUnstructuredGridCenterlineGroupsClipper::CenterlineGroupIdsArrayName
protected

◆ CenterlineRadiusArrayName

char* vtkvmtkUnstructuredGridCenterlineGroupsClipper::CenterlineRadiusArrayName
protected

◆ GroupIdsArrayName

char* vtkvmtkUnstructuredGridCenterlineGroupsClipper::GroupIdsArrayName
protected

◆ BlankingArrayName

char* vtkvmtkUnstructuredGridCenterlineGroupsClipper::BlankingArrayName
protected

◆ ClipAllCenterlineGroupIds

int vtkvmtkUnstructuredGridCenterlineGroupsClipper::ClipAllCenterlineGroupIds
protected

◆ CutoffRadiusFactor

double vtkvmtkUnstructuredGridCenterlineGroupsClipper::CutoffRadiusFactor
protected

◆ ClipValue

double vtkvmtkUnstructuredGridCenterlineGroupsClipper::ClipValue
protected

◆ GenerateClippedOutput

int vtkvmtkUnstructuredGridCenterlineGroupsClipper::GenerateClippedOutput
protected

◆ UseRadiusInformation

int vtkvmtkUnstructuredGridCenterlineGroupsClipper::UseRadiusInformation
protected

The documentation for this class was generated from the following files: