Reset window level and window width (vtkImagevewer2 + vtkInteractorStyleImage)

classic Classic list List threaded Threaded
1 message Options
ran
Reply | Threaded
Open this post in threaded view
|

Reset window level and window width (vtkImagevewer2 + vtkInteractorStyleImage)

ran
Hello all,
I'm using QVtkWinget+vtkImageviewer2+custom inherited vtkInteractorStyleImage to develop an DICOM imageviewer  ( same as ReadDICOMSeries vtk example). The images in the series are loaded in viewer with mouse scroll. Also left mouse move changes the window level and width.
 In my imageviewer i need to reset the windowlevel and window width in viewer to custom values while loading a new image in series(and also in a predefined even like Crtl+R key). 
The values to be set are default values of DICOM meta data (For that I'm reading the window values from dicom meta data)
The problem is I can't reset the window level and window width values of vtkImageviewer2. I tried with vtkImageViewer2->SetColorWindow  and vtkImageViewer2->SetColorLevel methods, but it working on first image only.
After that while loading the remaining image in the series (using the mouse scroll), the window level & width in viewer remaining in the last  set values, later call to  vtkImageViewer2->SetColorWindow  and vtkImageViewer2->SetColorLevel methods not updating in viewer. (but can change the values through mouse, but intention is to change to a custom value.)
I tried with the below method after setting the window values but nothing updating the new values in viewer.
vtkImageViewer2->Render();
 vtkImageViewer2->RemoveAllObservers();
vtkImageViewer2->GetRenderer()->ResetCamera();
vtkImageViewer2->->RemoveAllObservers();

How can set custom window width and values to the vtkImageViewer2? 
Where  have to set it in vtkImageViewer2/ vtkInteractorStyleImage 
Please help..

  

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers