------------------------------------------------------------------------------
| 411 | |
| 412 | //------------------------------------------------------------------------------ |
| 413 | void vtkResliceImageViewer::SetInputData(vtkImageData* in) |
| 414 | { |
| 415 | if (!in) |
| 416 | { |
| 417 | return; |
| 418 | } |
| 419 | |
| 420 | this->WindowLevel->SetInputData(in); |
| 421 | this->GetResliceCursor()->SetImage(in); |
| 422 | this->GetResliceCursor()->SetCenter(in->GetCenter()); |
| 423 | this->UpdateDisplayExtent(); |
| 424 | |
| 425 | double range[2]; |
| 426 | in->GetScalarRange(range); |
| 427 | if (vtkResliceCursorRepresentation* rep = vtkResliceCursorRepresentation::SafeDownCast( |
| 428 | this->ResliceCursorWidget->GetRepresentation())) |
| 429 | { |
| 430 | if (vtkImageReslice* reslice = vtkImageReslice::SafeDownCast(rep->GetReslice())) |
| 431 | { |
| 432 | // default background color is the min value of the image scalar range |
| 433 | reslice->SetBackgroundColor(range[0], range[0], range[0], range[0]); |
| 434 | this->SetColorWindow(range[1] - range[0]); |
| 435 | this->SetColorLevel((range[0] + range[1]) / 2.0); |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | //------------------------------------------------------------------------------ |
| 441 | void vtkResliceImageViewer::SetInputConnection(vtkAlgorithmOutput* input) |
nothing calls this directly
no test coverage detected