<div dir="ltr">Hi Victor,<div><br></div><div>I've written dozens of VTK apps for medical image visualization,</div><div>and I haven't used vtkImageViewer2 for any of them, nor have I</div><div>ever used vtkImageMapToWindowLevelColors. I've always used</div><div>one of the following approaches:</div><div><br></div><div>1) Generate an RGB or RGBA image with vtkImageMapToColors,</div><div> (use the Range of vtkLookupTable to control the window/level),</div><div> put the image in a vtkTexture, and then apply the texture to a</div><div> rectangular polygon. This is for 2D images or for image slices</div><div> extracted from a volume with vtkImageReslice.</div><div> </div><div>2) Same as above, but with vtkImageActor instead of vtkTexture.</div><div><br></div><div>3) Recently, I've switched to a new set of classes that I wrote for VTK:</div><div> <a href="https://www.vtk.org/Wiki/VTK/Image_Rendering_Classes">https://www.vtk.org/Wiki/VTK/Image_Rendering_Classes</a></div><div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">VTK's colors are 8-bit, meaning 24-bit RGB or 32-bit RGBA. If you</div><div class="gmail_extra">need something for a 10-bit monitor, that might be difficult. You</div><div class="gmail_extra">wouldn't be able to use vtkLookupTable, because even though you</div><div class="gmail_extra">sets its color components as values in the range [0.0, 1.0], it stores</div><div class="gmail_extra">the values as integers with a range of [0,255].</div><div class="gmail_extra"><br></div><div class="gmail_extra"> - David</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 25, 2018 at 3:08 PM, xVict <span dir="ltr"><<a href="mailto:suharev@roentgenprom.ru" target="_blank">suharev@roentgenprom.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi David!<br>
<br>
1. We want to show the medical image correctly<br>
As a starting point, consider an example:<br>
<a href="https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadDICOM/" rel="noreferrer" target="_blank">https://lorensen.github.io/VTK<wbr>Examples/site/Cxx/IO/ReadDICOM<wbr>/</a><br>
We have next pipeline:<br>
vtkDICOMImageReader->vtkImageV<wbr>iewer2<br>
By mouse we can change windowLevel and windowWidth. <br>
ImageViewer2 internally transform 16bit input gray to output r=g=b color<br>
into the render window.<br>
Internally ImageViewer2 use vtkImageMapToWindowLevelColors for window-level.<br>
<br>
2. I want use the same transformation but with LUT for 10-bit monitor.<br>
Because I pass my LUT to this class. <br>
imgViewer->GetWindowLevel()->S<wbr>etLookupTable(colorLut);<br>
And for tests I using LUT with r=g=b.<br>
If that's wrong, correct me. (Specify the correct example to display 16-bit<br>
images on a 10-bit monitor).<br>
But this does not exclude the incomprehensible code in the<br>
vtkImageMapToWindowLevelColors class. Values less than 16 go to zero.<br>
<br>
Victor</blockquote></div></div></div></div>