------------------------------------------------------------------------------
| 260 | |
| 261 | //------------------------------------------------------------------------------ |
| 262 | void vtkResliceCursorPolyDataAlgorithm ::CutAndClip(vtkPolyData* input, vtkPolyData* output) |
| 263 | { |
| 264 | this->ClipWithBox->SetClipFunction(this->Box); |
| 265 | this->ClipWithBox->GenerateClipScalarsOff(); |
| 266 | this->ClipWithBox->GenerateClippedOutputOff(); |
| 267 | this->Box->SetBounds(this->ResliceCursor->GetImage()->GetBounds()); |
| 268 | |
| 269 | double s[3]; |
| 270 | this->ResliceCursor->GetImage()->GetSpacing(s); |
| 271 | const double smax = std::max({ s[0], s[1], s[2] }); |
| 272 | this->ExtrusionFilter1->SetScaleFactor(smax); |
| 273 | this->ExtrusionFilter2->SetScaleFactor(smax); |
| 274 | |
| 275 | this->ClipWithBox->SetInputData(input); |
| 276 | this->ClipWithBox->Update(); |
| 277 | this->ExtrusionFilter1->SetInputData(input); |
| 278 | |
| 279 | double normal[3]; |
| 280 | this->ResliceCursor->GetPlane(this->ReslicePlaneNormal)->GetNormal(normal); |
| 281 | this->ExtrusionFilter1->SetVector(normal); |
| 282 | this->ExtrusionFilter2->SetVector(-normal[0], -normal[1], -normal[2]); |
| 283 | // std::cout << normal[0] << " " << normal[1] << " " << normal[2] << std::endl; |
| 284 | |
| 285 | this->ExtrusionFilter2->Update(); |
| 286 | |
| 287 | output->DeepCopy(this->ExtrusionFilter2->GetOutput()); |
| 288 | } |
| 289 | |
| 290 | //------------------------------------------------------------------------------ |
| 291 | vtkMTimeType vtkResliceCursorPolyDataAlgorithm::GetMTime() |
no test coverage detected