104 vtkInformation *vtkNotUsed(request),
105 vtkInformationVector **inputVector,
106 vtkInformationVector *outputVector)
108 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
109 vtkInformation *outInfo = outputVector->GetInformationObject(0);
111 vtkPolyData *input = vtkPolyData::SafeDownCast(
112 inInfo->Get(vtkDataObject::DATA_OBJECT()));
113 vtkPolyData *output = vtkPolyData::SafeDownCast(
114 outInfo->Get(vtkDataObject::DATA_OBJECT()));
118 vtkErrorMacro(<<
"MetricArrayName not set.");
124 vtkErrorMacro(<<
"GroupIdsArrayName not set.");
128 vtkDataArray* groupIdsArray = input->GetPointData()->GetArray(this->
GroupIdsArrayName);
132 vtkErrorMacro(<<
"GroupIdsArray with name specified does not exist.");
138 vtkErrorMacro(<<
"Centerlines not set");
146 vtkErrorMacro(<<
"RadiusArrayName not set.");
154 vtkErrorMacro(<<
"RadiusArray with name specified does not exist.");
163 vtkErrorMacro(<<
"BlankingArrayName not set.");
171 vtkErrorMacro(<<
"BlankingArray with name specified does not exist.");
177 vtkErrorMacro(<<
"CenterlineIdsArrayName not set.");
183 if (!centerlineIdsArray)
185 vtkErrorMacro(<<
"CenterlineIdsArray with name specified does not exist.");
191 vtkErrorMacro(<<
"CenterlineTractIdsArrayName not set.");
197 if (!centerlineTractIdsArray)
199 vtkErrorMacro(<<
"CenterlineTractIdsArray with name specified does not exist.");
206 vtkErrorMacro(<<
"CenterlineGroupIdsArrayName not set.");
212 if (!centerlineGroupIdsArray)
214 vtkErrorMacro(<<
"CenterlineGroupIdsArrayName with name specified does not exist.");
218 int numberOfInputPoints = input->GetNumberOfPoints();
220 output->DeepCopy(input);
222 vtkDoubleArray* metricArray = vtkDoubleArray::New();
224 metricArray->SetNumberOfComponents(1);
225 metricArray->SetNumberOfTuples(numberOfInputPoints);
226 metricArray->FillComponent(0,0.0);
228 output->GetPointData()->AddArray(metricArray);
231 for (
int i=0; i<numberOfInputPoints; i++)
233 groupId =
static_cast<int>(groupIdsArray->GetComponent(i,0));
237 metricArray->Delete();