How to set Window Width/Window Centers with vtkImageActor (or vtkActor)?

依然范特西╮ 提交于 2019-12-25 03:49:25

问题


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)


回答1:


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);



来源:https://stackoverflow.com/questions/33011167/how-to-set-window-width-window-centers-with-vtkimageactor-or-vtkactor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!