VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataCenterlineMetricFilter Class Referenceabstract

Serves as the base class for evaluating metrics over a centerline onto a surface. More...

#include <vtkvmtkPolyDataCenterlineMetricFilter.h>

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

Public Types

typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkPolyDataCenterlineMetricFilter * NewInstance () const
virtual void SetMetricArrayName (const char *)
virtual char * GetMetricArrayName ()
virtual void SetGroupIdsArrayName (const char *)
virtual char * GetGroupIdsArrayName ()
virtual void SetCenterlines (vtkPolyData *)
virtual vtkPolyData * GetCenterlines ()
virtual void SetUseRadiusInformation (int)
virtual int GetUseRadiusInformation ()
virtual void UseRadiusInformationOn ()
virtual void UseRadiusInformationOff ()
virtual void SetRadiusArrayName (const char *)
virtual char * GetRadiusArrayName ()
virtual void SetCenterlineGroupIdsArrayName (const char *)
virtual char * GetCenterlineGroupIdsArrayName ()
virtual void SetCenterlineIdsArrayName (const char *)
virtual char * GetCenterlineIdsArrayName ()
virtual void SetCenterlineTractIdsArrayName (const char *)
virtual char * GetCenterlineTractIdsArrayName ()
virtual void SetBlankingArrayName (const char *)
virtual char * GetBlankingArrayName ()
virtual void SetIncludeBifurcations (int)
virtual int GetIncludeBifurcations ()
virtual void IncludeBifurcationsOn ()
virtual void IncludeBifurcationsOff ()

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkPolyDataCenterlineMetricFilter ()
 ~vtkvmtkPolyDataCenterlineMetricFilter ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
virtual void EvaluateMetric (vtkIdType pointId, double point[3], vtkIdType groupId, vtkDataArray *metricArray)=0

Protected Attributes

char * MetricArrayName
char * BlankingArrayName
char * GroupIdsArrayName
vtkPolyData * Centerlines
char * RadiusArrayName
char * CenterlineGroupIdsArrayName
char * CenterlineIdsArrayName
char * CenterlineTractIdsArrayName
int UseRadiusInformation
int IncludeBifurcations

Detailed Description

Serves as the base class for evaluating metrics over a centerline onto a surface.

For each point of the input surface (already split into branches), finds the nearest point on the corresponding branch of Centerlines and evaluates a per-point scalar metric there, storing the result in the output point data array named MetricArrayName. The actual metric is defined by subclasses overriding EvaluateMetric – see vtkvmtkPolyDataCenterlineAbscissaMetricFilter (arc length along the centerline) and vtkvmtkPolyDataCenterlineAngularMetricFilter (circumferential angle around the centerline). Used by the vmtkbranchmetrics pype script to build the longitudinal/ circumferential parameterization used for centerline-based surface mapping and patching.

See also
vtkvmtkPolyDataCenterlineAbscissaMetricFilter, vtkvmtkPolyDataCenterlineAngularMetricFilter, vtkvmtkPolyDataStretchMappingFilter, vtkvmtkPolyDataPatchingFilter

Definition at line 46 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

Member Typedef Documentation

◆ Superclass

Definition at line 49 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataCenterlineMetricFilter()

vtkvmtkPolyDataCenterlineMetricFilter::vtkvmtkPolyDataCenterlineMetricFilter ( )
protected

Definition at line 34 of file vtkvmtkPolyDataCenterlineMetricFilter.cxx.

35{
36 this->MetricArrayName = NULL;
37 this->BlankingArrayName = NULL;
38
39 this->GroupIdsArrayName = NULL;
40
41 this->Centerlines = NULL;
42
43 this->RadiusArrayName = NULL;
44 this->CenterlineGroupIdsArrayName = NULL;
45 this->CenterlineIdsArrayName = NULL;
46 this->CenterlineTractIdsArrayName = NULL;
47
48 this->UseRadiusInformation = 1;
49 this->IncludeBifurcations = 1;
50}

◆ ~vtkvmtkPolyDataCenterlineMetricFilter()

vtkvmtkPolyDataCenterlineMetricFilter::~vtkvmtkPolyDataCenterlineMetricFilter ( )
protected

Definition at line 52 of file vtkvmtkPolyDataCenterlineMetricFilter.cxx.

53{
54 if (this->MetricArrayName)
55 {
56 delete[] this->MetricArrayName;
57 this->MetricArrayName = NULL;
58 }
59
60 if (this->GroupIdsArrayName)
61 {
62 delete[] this->GroupIdsArrayName;
63 this->GroupIdsArrayName = NULL;
64 }
65
66 if (this->Centerlines)
67 {
68 this->Centerlines->Delete();
69 this->Centerlines = NULL;
70 }
71
72 if (this->RadiusArrayName)
73 {
74 delete[] this->RadiusArrayName;
75 this->RadiusArrayName = NULL;
76 }
77
78 if (this->BlankingArrayName)
79 {
80 delete[] this->BlankingArrayName;
81 this->BlankingArrayName = NULL;
82 }
83
85 {
86 delete[] this->CenterlineGroupIdsArrayName;
87 this->CenterlineGroupIdsArrayName = NULL;
88 }
89
91 {
92 delete[] this->CenterlineGroupIdsArrayName;
93 this->CenterlineGroupIdsArrayName = NULL;
94 }
95
96 if (this->CenterlineIdsArrayName)
97 {
98 delete[] this->CenterlineIdsArrayName;
99 this->CenterlineIdsArrayName = NULL;
100 }
101}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataCenterlineMetricFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkPolyDataCenterlineMetricFilter * vtkvmtkPolyDataCenterlineMetricFilter::NewInstance ( ) const

◆ SetMetricArrayName()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetMetricArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the evaluated metric is stored. Commonly named "AbscissaMetric".

◆ GetMetricArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetMetricArrayName ( )
virtual

Set/Get the name of the output point data array where the evaluated metric is stored. Commonly named "AbscissaMetric".

◆ SetGroupIdsArrayName()

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

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

◆ GetGroupIdsArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetGroupIdsArrayName ( )
virtual

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

◆ SetCenterlines()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetCenterlines ( vtkPolyData * )
virtual

Set/Get the split, grouped centerlines corresponding to the input surface. Required input.

◆ GetCenterlines()

virtual vtkPolyData * vtkvmtkPolyDataCenterlineMetricFilter::GetCenterlines ( )
virtual

Set/Get the split, grouped centerlines corresponding to the input surface. Required input.

◆ SetUseRadiusInformation()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetUseRadiusInformation ( int )
virtual

Toggle using the maximum inscribed sphere radius (RadiusArrayName) when locating the nearest centerline point to each surface point, so that the search accounts for local vessel size rather than pure Euclidean distance. Default: on.

◆ GetUseRadiusInformation()

virtual int vtkvmtkPolyDataCenterlineMetricFilter::GetUseRadiusInformation ( )
virtual

Toggle using the maximum inscribed sphere radius (RadiusArrayName) when locating the nearest centerline point to each surface point, so that the search accounts for local vessel size rather than pure Euclidean distance. Default: on.

◆ UseRadiusInformationOn()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::UseRadiusInformationOn ( )
virtual

Toggle using the maximum inscribed sphere radius (RadiusArrayName) when locating the nearest centerline point to each surface point, so that the search accounts for local vessel size rather than pure Euclidean distance. Default: on.

◆ UseRadiusInformationOff()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::UseRadiusInformationOff ( )
virtual

Toggle using the maximum inscribed sphere radius (RadiusArrayName) when locating the nearest centerline point to each surface point, so that the search accounts for local vessel size rather than pure Euclidean distance. Default: on.

◆ SetRadiusArrayName()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetRadiusArrayName ( 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".

◆ GetRadiusArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetRadiusArrayName ( )
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".

◆ SetCenterlineGroupIdsArrayName()

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

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

◆ GetCenterlineGroupIdsArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetCenterlineGroupIdsArrayName ( )
virtual

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

◆ SetCenterlineIdsArrayName()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetCenterlineIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the id of the original, unsplit centerline that each cell belongs to. Commonly named "CenterlineIds".

◆ GetCenterlineIdsArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetCenterlineIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the id of the original, unsplit centerline that each cell belongs to. Commonly named "CenterlineIds".

◆ SetCenterlineTractIdsArrayName()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetCenterlineTractIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the tract id of each cell. Commonly named "TractIds".

◆ GetCenterlineTractIdsArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::GetCenterlineTractIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the tract id of each cell. Commonly named "TractIds".

◆ SetBlankingArrayName()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::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. Commonly named "Blanking".

◆ GetBlankingArrayName()

virtual char * vtkvmtkPolyDataCenterlineMetricFilter::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. Commonly named "Blanking".

◆ SetIncludeBifurcations()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::SetIncludeBifurcations ( int )
virtual

Toggle including blanked (bifurcation-region) centerline tracts when locating the nearest centerline point to each surface point. Default: on.

◆ GetIncludeBifurcations()

virtual int vtkvmtkPolyDataCenterlineMetricFilter::GetIncludeBifurcations ( )
virtual

Toggle including blanked (bifurcation-region) centerline tracts when locating the nearest centerline point to each surface point. Default: on.

◆ IncludeBifurcationsOn()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::IncludeBifurcationsOn ( )
virtual

Toggle including blanked (bifurcation-region) centerline tracts when locating the nearest centerline point to each surface point. Default: on.

◆ IncludeBifurcationsOff()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::IncludeBifurcationsOff ( )
virtual

Toggle including blanked (bifurcation-region) centerline tracts when locating the nearest centerline point to each surface point. Default: on.

◆ RequestData()

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

Definition at line 103 of file vtkvmtkPolyDataCenterlineMetricFilter.cxx.

107{
108 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
109 vtkInformation *outInfo = outputVector->GetInformationObject(0);
110
111 vtkPolyData *input = vtkPolyData::SafeDownCast(
112 inInfo->Get(vtkDataObject::DATA_OBJECT()));
113 vtkPolyData *output = vtkPolyData::SafeDownCast(
114 outInfo->Get(vtkDataObject::DATA_OBJECT()));
115
116 if (!this->MetricArrayName)
117 {
118 vtkErrorMacro(<<"MetricArrayName not set.");
119 return 1;
120 }
121
122 if (!this->GroupIdsArrayName)
123 {
124 vtkErrorMacro(<<"GroupIdsArrayName not set.");
125 return 1;
126 }
127
128 vtkDataArray* groupIdsArray = input->GetPointData()->GetArray(this->GroupIdsArrayName);
129
130 if (!groupIdsArray)
131 {
132 vtkErrorMacro(<<"GroupIdsArray with name specified does not exist.");
133 return 1;
134 }
135
136 if (!this->Centerlines)
137 {
138 vtkErrorMacro(<<"Centerlines not set");
139 return 1;
140 }
141
142 if (this->UseRadiusInformation)
143 {
144 if (!this->RadiusArrayName)
145 {
146 vtkErrorMacro(<<"RadiusArrayName not set.");
147 return 1;
148 }
149
150 vtkDataArray* radiusArray = this->Centerlines->GetPointData()->GetArray(this->RadiusArrayName);
151
152 if (!radiusArray)
153 {
154 vtkErrorMacro(<<"RadiusArray with name specified does not exist.");
155 return 1;
156 }
157 }
158
159 if (this->IncludeBifurcations)
160 {
161 if (!this->BlankingArrayName)
162 {
163 vtkErrorMacro(<<"BlankingArrayName not set.");
164 return 1;
165 }
166
167 vtkDataArray* blankingArray = this->Centerlines->GetCellData()->GetArray(this->BlankingArrayName);
168
169 if (!blankingArray)
170 {
171 vtkErrorMacro(<<"BlankingArray with name specified does not exist.");
172 return 1;
173 }
174
175 if (!this->CenterlineIdsArrayName)
176 {
177 vtkErrorMacro(<<"CenterlineIdsArrayName not set.");
178 return 1;
179 }
180
181 vtkDataArray* centerlineIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineIdsArrayName);
182
183 if (!centerlineIdsArray)
184 {
185 vtkErrorMacro(<<"CenterlineIdsArray with name specified does not exist.");
186 return 1;
187 }
188
190 {
191 vtkErrorMacro(<<"CenterlineTractIdsArrayName not set.");
192 return 1;
193 }
194
195 vtkDataArray* centerlineTractIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineTractIdsArrayName);
196
197 if (!centerlineTractIdsArray)
198 {
199 vtkErrorMacro(<<"CenterlineTractIdsArray with name specified does not exist.");
200 return 1;
201 }
202 }
203
205 {
206 vtkErrorMacro(<<"CenterlineGroupIdsArrayName not set.");
207 return 1;
208 }
209
210 vtkDataArray* centerlineGroupIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineGroupIdsArrayName);
211
212 if (!centerlineGroupIdsArray)
213 {
214 vtkErrorMacro(<<"CenterlineGroupIdsArrayName with name specified does not exist.");
215 return 1;
216 }
217
218 int numberOfInputPoints = input->GetNumberOfPoints();
219
220 output->DeepCopy(input);
221
222 vtkDoubleArray* metricArray = vtkDoubleArray::New();
223 metricArray->SetName(this->MetricArrayName);
224 metricArray->SetNumberOfComponents(1);
225 metricArray->SetNumberOfTuples(numberOfInputPoints);
226 metricArray->FillComponent(0,0.0);
227
228 output->GetPointData()->AddArray(metricArray);
229
230 vtkIdType groupId;
231 for (int i=0; i<numberOfInputPoints; i++)
232 {
233 groupId = static_cast<int>(groupIdsArray->GetComponent(i,0));
234 this->EvaluateMetric(i,input->GetPoint(i),groupId,metricArray);
235 }
236
237 metricArray->Delete();
238
239 return 1;
240}
virtual void EvaluateMetric(vtkIdType pointId, double point[3], vtkIdType groupId, vtkDataArray *metricArray)=0

◆ EvaluateMetric()

virtual void vtkvmtkPolyDataCenterlineMetricFilter::EvaluateMetric ( vtkIdType pointId,
double point[3],
vtkIdType groupId,
vtkDataArray * metricArray )
protectedpure virtual

Member Data Documentation

◆ MetricArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::MetricArrayName
protected

Definition at line 155 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ BlankingArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::BlankingArrayName
protected

Definition at line 156 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ GroupIdsArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::GroupIdsArrayName
protected

Definition at line 158 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ Centerlines

vtkPolyData* vtkvmtkPolyDataCenterlineMetricFilter::Centerlines
protected

Definition at line 160 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ RadiusArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::RadiusArrayName
protected

Definition at line 162 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ CenterlineGroupIdsArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::CenterlineGroupIdsArrayName
protected

Definition at line 163 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ CenterlineIdsArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::CenterlineIdsArrayName
protected

Definition at line 164 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ CenterlineTractIdsArrayName

char* vtkvmtkPolyDataCenterlineMetricFilter::CenterlineTractIdsArrayName
protected

Definition at line 165 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ UseRadiusInformation

int vtkvmtkPolyDataCenterlineMetricFilter::UseRadiusInformation
protected

Definition at line 167 of file vtkvmtkPolyDataCenterlineMetricFilter.h.

◆ IncludeBifurcations

int vtkvmtkPolyDataCenterlineMetricFilter::IncludeBifurcations
protected

Definition at line 168 of file vtkvmtkPolyDataCenterlineMetricFilter.h.


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