[vtkusers] Reset window level and window width (vtkImagevewer2 + vtkInteractorStyleImage)

K O ranjith kor1581 at gmail.com
Mon Jul 31 11:06:22 EDT 2017


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..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170731/9c7716fe/attachment.html>


More information about the vtkusers mailing list