MCPcopy Create free account
hub / github.com/Kitware/VTK / SetInputData

Method SetInputData

Interaction/Image/vtkResliceImageViewer.cxx:413–438  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

411
412//------------------------------------------------------------------------------
413void 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//------------------------------------------------------------------------------
441void vtkResliceImageViewer::SetInputConnection(vtkAlgorithmOutput* input)

Callers

nothing calls this directly

Calls 10

GetResliceCursorMethod · 0.95
UpdateDisplayExtentMethod · 0.95
SetColorWindowMethod · 0.95
SetColorLevelMethod · 0.95
SetImageMethod · 0.80
GetRepresentationMethod · 0.80
SetCenterMethod · 0.45
GetCenterMethod · 0.45
GetScalarRangeMethod · 0.45
SetBackgroundColorMethod · 0.45

Tested by

no test coverage detected