Jose,<br><br><br> Please do *not* use FLIP.<br><br><br>The orientation "problem" is simply the result of not thinking<br>on Physical coordinates.<br><br><br>This is a *visualization* problem, not a data processing one.<br>
<br><br>The correct way of visualizing medical data in VTK is to<br>properly place the Camera. Not to fiddle around corrupting<br>the medical data of the image.<br><br><br>The reason why you see the dataset upside down is because<br>
you have not properly oriented the Up vector of the camera,<br>and you may have also placed the camera in the incorrect<br>side of the data set.<br><br>in order to do this properly you should get a lot of coffee and<br>carefully study the following diagrams in this Wiki page:<br>
<br><a href="http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Orientation_-_Lower_Limb_Graphical_Example">http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Orientation_-_Lower_Limb_Graphical_Example</a><br><a href="http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Orientation_-_Full_Body_Graphical_Example">http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Orientation_-_Full_Body_Graphical_Example</a><br>
<a href="http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Differences_in_Visualization_presented_to_Radiologist_and_NeuroSurgeons">http://www.itk.org/Wiki/Proposals:Orientation#DICOM_LPS_Differences_in_Visualization_presented_to_Radiologist_and_NeuroSurgeons</a><br>
<br><br>So....<br><br>Instead of going in a dangerous rampage with the Flip filter,<br>you should start by answering the question:<br><br>A) Are you working for a radiologist ?<br> or are you working for a Neurosurgeon ?<br>
<br>With the answer to this question, go to the third<br>diagram, and that will tell you where to position your camera.<br><br>Then <br><br>B) are you generating Axial slices ? Coronal ?<br><br>If you are generating an Axial Slice for a Neurosurgeon,<br>
you should put the location of the camera at the center<br>of the image + a Z translation larger than the image, and<br>then orient the image with an Up vector equal to -Y, that<br>is (0.0, -1.0, 0.0). the camera should be looking at the<br>
physical center of the image..<br><br><br><br>Once you start thinking in terms of Physical Coordinates,<br>most of this apparent conflicts disappear.<br><br><br><br> Please let us know if you have any questions,<br><br>
<br> Thanks<br><br><br> Luis<br><br><br><br>------------------------------------------------------------------------------<br><div class="gmail_quote">On Tue, Jun 30, 2009 at 10:03 AM, Lic. José M. Rodriguez Bacallao <span dir="ltr"><<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hi, I used vtkImageFlip to do that flip but with WrapITK I could be<br>
use itkFlipImageFilter this way:<br>
<br>
with itk:<br>
<br>
flip = itk.FlipImageFilter[image_type].New(Input = fr.GetOutput())<br>
flip.SetFlipAxes((0,1))<br>
con.SetInput(flip.GetOutput())<br>
<br>
with vtk:<br>
<br>
flip = vtk.vtkImageFlip()<br>
flip.SetFilteredAxis(1)<br>
flip.SetInput(con.GetOutput())<br>
<div><div></div><div class="h5"><br>
On 6/30/09, Amardeep Singh <<a href="mailto:amar.singh@gmx.de">amar.singh@gmx.de</a>> wrote:<br>
> Hi<br>
><br>
> I guess, you could use the itkFlipImageFilter before you pass the image<br>
> to VTK for visualisation.<br>
> Unfortunately, I don't know how to do that in WrapITK, but in the<br>
> following post you can see<br>
> an example of its use in C++:<br>
> <a href="http://www.nabble.com/Re:-Nifti-vs-Dicom-orientation-td23276815.html" target="_blank">http://www.nabble.com/Re:-Nifti-vs-Dicom-orientation-td23276815.html</a><br>
><br>
> The following post might be of interest, as well:<br>
> <a href="http://www.itk.org/pipermail/insight-users/2005-April/012900.html" target="_blank">http://www.itk.org/pipermail/insight-users/2005-April/012900.html</a><br>
><br>
> HTH<br>
> Amardeep<br>
><br>
> Lic. José M. Rodriguez Bacallao wrote:<br>
>> no, I don't miss the answer, in fact, I asked how to display the image<br>
>> in a correct way!!!<br>
>><br>
>> On 6/30/09, Amardeep Singh <<a href="mailto:amar.singh@gmx.de">amar.singh@gmx.de</a>> wrote:<br>
>><br>
>>> Hi<br>
>>><br>
>>> You might have missed Bill Lorensen's answer to your question. Have<br>
>>> another look:<br>
>>> <a href="http://n2.nabble.com/DICOM-and-orientation-td3176010.html#a3176022" target="_blank">http://n2.nabble.com/DICOM-and-orientation-td3176010.html#a3176022</a><br>
>>><br>
>>> Regards<br>
>>> Amardeep<br>
>>><br>
>>> Lic. José M. Rodriguez Bacallao wrote:<br>
>>><br>
>>>> no one?<br>
>>>><br>
>>>> On 6/29/09, Lic. José M. Rodriguez Bacallao <<a href="mailto:jmrbcu@gmail.com">jmrbcu@gmail.com</a>> wrote:<br>
>>>><br>
>>>><br>
>>>>> hi folks, I'm reading a dicom image with itk (WrapITK) and visualizing<br>
>>>>> with vtk but, when I try to visualize it, it show inverted in the<br>
>>>>> screen, this is my code to read and visualize the image:<br>
>>>>><br>
>>>>> image_type = itk.Image[itk.SS, 2]<br>
>>>>><br>
>>>>> image_type = itk.Image[itk.SS, 2]<br>
>>>>> fr = itk.ImageFileReader[image_type].New()<br>
>>>>> con = itk.ImageToVTKImageFilter[image_type].New()<br>
>>>>><br>
>>>>> fr.SetFileName('/home/jmrbcu/temp/IM66.dcm')<br>
>>>>> con.SetInput(fr.GetOutput())<br>
>>>>><br>
>>>>> v = vtk.vtkImageViewer2()<br>
>>>>> ri = vtk.vtkRenderWindowInteractor()<br>
>>>>> v.SetupInteractor(ri)<br>
>>>>> v.SetInput(con.GetOutput())<br>
>>>>><br>
>>>>> v.Render()<br>
>>>>> v.SetColorWindow(255)<br>
>>>>> v.SetColorLevel(128)<br>
>>>>><br>
>>>>> ri.Start()<br>
>>>>><br>
>>>>> --<br>
>>>>> Lic. José M. Rodriguez Bacallao<br>
>>>>> Centro de Biofisica Medica<br>
>>>>> -----------------------------------------------------------------<br>
>>>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo<br>
>>>>> mismo.<br>
>>>>><br>
>>>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
>>>>> por profesionales<br>
>>>>> -----------------------------------------------------------------<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>><br>
>>>><br>
>><br>
>><br>
>><br>
><br>
><br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Lic. José M. Rodriguez Bacallao<br>
Centro de Biofisica Medica<br>
-----------------------------------------------------------------<br>
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.<br>
<br>
Recuerda: El arca de Noe fue construida por aficionados, el titanic<br>
por profesionales<br>
-----------------------------------------------------------------<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<br>
<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 ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>