<div dir="ltr">To change the window name, you have to first call Render() and then set the window name.<br><br>It&#39;s the default behaviour of the vtkInteractorStyleImage to change window level/width on &quot;mouse move&quot; which is used by vtkImageViewer2. If you don&#39;t want this behavoiur, either subclass the interactor style or simplly don&#39;t set the interacator to just display the image.<br>
<br>Jothy<br>
<br><div class="gmail_quote">On Wed, Jul 14, 2010 at 12:23 AM, Prathamesh Kulkarni <span dir="ltr">&lt;<a href="mailto:prathameshmkulkarni@gmail.com" target="_blank">prathameshmkulkarni@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><br>Hello all,<br><br>Following is my code in which I am trying to read a JPEG image and display it:<br><br>    vtkSmartPointer&lt;vtkJPEGReader&gt; jpeg_reader = vtkSmartPointer&lt;vtkJPEGReader&gt;::New();<br>


    <br>    if(jpeg_reader-&gt;CanReadFile(file_path.c_str()))<br>    {<br>        jpeg_reader-&gt;SetFileName(file_path.c_str());<br>        jpeg_reader-&gt;Update(); <br><br>        vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; interactor = vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>


                <br>        vtkSmartPointer&lt;vtkImageViewer2&gt; image_viewer = vtkSmartPointer&lt;vtkImageViewer2&gt;::New();<br>        image_viewer-&gt;SetInput(jpeg_reader-&gt;GetOutput());<br>        image_viewer-&gt;SetupInteractor(interactor);<br>


        image_viewer-&gt;GetRenderer()-&gt;ResetCamera();<br>        image_viewer-&gt;GetRenderer()-&gt;SetBackground(1.0, 1.0, 1.0);<br>        image_viewer-&gt;GetRenderWindow()-&gt;SetWindowName(&quot;My Window&quot;);<br>


            <br>        interactor-&gt;Initialize();<br>        interactor-&gt;Start();<br>   }<br><br><br>The code displays the image but I am having the following issues:<br><br>1. I am not able to change the window name as attempted above. <br>


<br>2. When I hold the left mouse button and drag, I see the image color map changing. I could not understand how to turn this behavior off (if at all this it is not erroneous) by looking at the class references.<br><br>

<br>
Any help will be appreciated.<br><br>Thanks,<br>Prathamesh<br></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>