Reputation: 63
I want to set Windows Width/ Windows Center value when use vtkImageActor/vtkActor. But I could not find the way to solve it. (If I use vtkActor2d, it's okay, but I don't want to use it)
Upvotes: 0
Views: 1416
Reputation: 1611
Attach a vtkWindowLevelLookupTable
to your mapper.
Basic Example:
vtkSmartPointer<vtkWindowLevelLookupTable> myLookupTable = vtkSmartPointer<vtkWindowLevelLookupTable>::New();double WindowWidth = myImageReader->GetOutput()->GetScalarRange()[1] - myImageReader->GetOutput()->GetScalarRange()[0]; double WindowLevel = (myImageReader->GetOutput()->GetScalarRange()[1] + myImageReader->GetOutput()->GetScalarRange()[0]) / 2.0;
myLookupTable->SetWindow(WindowWidth); myLookupTable->SetLevel(WindowLevel); myMapper->SetLookupTable(myLookupTable);
Upvotes: 1