<div dir="ltr">Thanks for all your help!<br><br>I am getting close to what I need.<br><br>As Bill suggested I uesd same (GDCM) reader for reading CT and dose with FileLowerLeftOn().Now they both seem to be in the same coordinate system, but the images are upside down.CT is rotated 180 in the Y direction (becomes FFP).<br>
<br>As David G suggested I should use a vtkMatrix4x4 to do the rotations along with the ImageOrientationPatient.<br><br>But I am confused of using these vtkmatrix4x4 <br><br>I have <br><br><span style="font-family: 'Times New Roman'; font-size: 10pt; color: rgb(0, 0, 0);">Image position: -275 -524 -122.441 <br>
<br></span><span style=" font-family:'Times New Roman'; font-size:10pt; color:#000000;">ImageOrient: 1 0 -1.22465e-16 0 1 0 </span><br><br>now how to create a vtk4x4 matrix to flip these images upsideDown. (I tried vtkImageFlip, but it invalidates the dicom coordinate system as David G pointed out).<br>
<br>Can I use this amtrix in the vtkImageReslice itself?<br><br>Thanks<br><br>Jothy<br><br><br><br><br><div class="gmail_quote">On Fri, Feb 25, 2011 at 4:49 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Fri, Feb 25, 2011 at 8:50 AM, Mathieu Malaterre<br>
<<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>
><br>
> You have to turn the FileLowerLeft before calling update to preserve<br>
> DICOM coordinate system. eg.<br>
><br>
> reader->FileLowerLeftOn();<br>
> reader->Update();<br>
<br>
</div>I just want to emphasize this. The first step in matching VTK to patient<br>
coords is setting FileLowerLeftOn() in the reader. It isn't the only the<br>
only step, but it is certain that if you leave FileLowerLeft=Off then<br>
everything becomes much more difficult.<br>
<br>
Then the Origin will be equal to ImagePositionPatient and the only thing left to<br>
worry about is the ImageOrientationPatient. One way to deal with orientation is<br>
to take the direction cosines matrix, and use it to generate a 4x4 matrix<br>
that performs a rotation around the ImagePositionPatient (x0,y0,z0) point.<br>
This matrix can then be used whenever you want to go back and forth between<br>
vtkImageData coords and DICOM patient coords.<br>
<br>
VTK itself is agnostic about coordinate systems, except for vtkActor2D, which<br>
most people never use, and the image readers, which have the unfortunate<br>
default behaviour of flipping the images.<br>
<font color="#888888"><br>
- David<br>
</font></blockquote></div><br></div>