<div dir="ltr">You need to setup a proper interaction style.<br><br>Set your interactor style to vtkInteractorStyleImage.<br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 9:54 AM, Kiran Gachchi <span dir="ltr">&lt;<a href="mailto:Kiran.Gachchi@hcl.com" target="_blank">Kiran.Gachchi@hcl.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thanks for your Answer.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I Have one more doubt. Please try to solve this issue.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p><u></u><span>1)<span style="font:7.0pt &quot;Times New Roman&quot;">      </span></span><u></u>I want to read a DICOM image using VTK and display it on MFC picture control.<u></u><u></u></p>
<p class="MsoNormal">I am able to do this. But the problem is, if I drag the image on picture control, it will rotate.  How to resolve it? I have attached the code snippet.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pvtkDICOMImageReaderRef-&gt;SetFileName((LPCTSTR)cstrFileName);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;SetInput(pvtkDICOMImageReaderRef-&gt;GetOutput());<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;SetupInteractor(pvtkMFCWindow_Ref-&gt;GetInteractor());       <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pvtkMFCWindow_Ref-&gt;SetRenderWindow((vtkWin32OpenGLRenderWindow *)pviewer_Ref-&gt;GetRenderWindow());<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;SetColorLevel(128); <u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;SetColorWindow(1500); <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;GetRenderer()-&gt;ResetCamera();           <u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">pviewer_Ref-&gt;Render();<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green"><u></u> <u></u></span></p>
<p><u></u><span>2)<span style="font:7.0pt &quot;Times New Roman&quot;">      </span></span><u></u>I tried one more thing. In this case, the image in MFC picture control will not rotate, but Image won’t fit in the picture control properly.<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:.25in"><u></u> <u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkDICOMImageReaderRef-&gt;SetFileName((LPCTSTR)cstrFileName);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkDICOMImageReaderRef-&gt;Update();<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkImageMapper-&gt;SetInput(<span style="color:blue">this</span>-&gt;pvtkDICOMImageReaderRef-&gt;GetOutput());<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkImageMapper-&gt;SetColorLevel(128);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkImageMapper-&gt;SetColorWindow(1500);<span style="color:green">//8192<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkActor2D-&gt;SetMapper(<span style="color:blue">this</span>-&gt;pvtkImageMapper); <u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkRendererRef-&gt;AddActor(<span style="color:blue">this</span>-&gt;pvtkActor2D);<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkRendererRef-&gt;GetRenderWindow()-&gt;Render();<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:blue">this</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">-&gt;pvtkRendererRef-&gt;ResetCamera();</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal"><span style="color:#1f497d">Kiran </span><span style="font-size:10.0pt"><u></u><u></u></span></p><p class="MsoNormal">
<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Jothybasu Selvaraj [mailto:<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>] <br>
<b>Sent:</b> Friday, November 02, 2012 3:22 PM<br><b>To:</b> Kiran Gachchi<br><b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br><b>Subject:</b> Re: [vtkusers] Changing the color of dicom image while displaying it.<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-bottom:12.0pt">You could use vtkDICOmImageReader and a proper lookup table to color the image.<br><br>Have a look at this example<br><br><a href="http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx</a><br>
<br>Jothy<br><br><u></u><u></u></p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p><div><p class="MsoNormal">On Fri, Nov 2, 2012 at 5:31 AM, Kiran Gachchi &lt;<a href="mailto:Kiran.Gachchi@hcl.com" target="_blank">Kiran.Gachchi@hcl.com</a>&gt; wrote:<u></u><u></u></p>
<div><div><p class="MsoNormal">Hi all,<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I want to read a DICOM image (Gray Scale) in vtk and display it as color image.<u></u><u></u></p><p class="MsoNormal">
Could anyone help me out?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal">Kiran<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">
<span style="color:gray"><br><br></span><span style="font-size:7.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">::DISCLAIMER::<br>----------------------------------------------------------------------------------------------------------------------------------------------------</span><span style="color:gray"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.<br>
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, <br>lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents <br>
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. <br>Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the <br>
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, <br>distribution and / or publication of this message without the prior written consent of authorized representative of <br>
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. <br>Before opening any email and/or attachments, please check them for viruses and other defects.</span><span style="color:gray"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">----------------------------------------------------------------------------------------------------------------------------------------------------</span><span style="color:gray"><u></u><u></u></span></p>
</div><p class="MsoNormal" style="margin-bottom:12.0pt"><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><u></u><u></u></p>
</div><p class="MsoNormal"><br><br clear="all"><br>-- <u></u><u></u></p><div><p class="MsoNormal">Jothybasu Selvaraj<br>PhD Student<br>University of Liverpool<br>UK<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p>
</div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothybasu Selvaraj<br>PhD Student<br>University of Liverpool<br>UK<br></div><br>
</div>