------------------------------------------------------------------------------
| 112 | |
| 113 | //------------------------------------------------------------------------------ |
| 114 | int vtkDijkstraImageGeodesicPath::RequestData(vtkInformation* vtkNotUsed(request), |
| 115 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 116 | { |
| 117 | vtkInformation* costInfo = inputVector[0]->GetInformationObject(0); |
| 118 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 119 | |
| 120 | vtkImageData* image = vtkImageData::SafeDownCast(costInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 121 | |
| 122 | if (!image) |
| 123 | { |
| 124 | return 0; |
| 125 | } |
| 126 | |
| 127 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 128 | |
| 129 | if (!output) |
| 130 | { |
| 131 | return 0; |
| 132 | } |
| 133 | |
| 134 | if (this->AdjacencyBuildTime.GetMTime() < image->GetMTime()) |
| 135 | { |
| 136 | this->Initialize(image); |
| 137 | } |
| 138 | else |
| 139 | { |
| 140 | // if the filter's static cost weights change, then update them |
| 141 | if (this->RebuildStaticCosts) |
| 142 | { |
| 143 | this->UpdateStaticCosts(image); |
| 144 | } |
| 145 | this->Reset(); |
| 146 | } |
| 147 | |
| 148 | this->ShortestPath(image, this->StartVertex, this->EndVertex); |
| 149 | this->TraceShortestPath(image, output, this->StartVertex, this->EndVertex); |
| 150 | |
| 151 | return 1; |
| 152 | } |
| 153 | |
| 154 | //------------------------------------------------------------------------------ |
| 155 | double vtkDijkstraImageGeodesicPath::CalculateStaticEdgeCost( |
nothing calls this directly
no test coverage detected