Hello again. After reading the pixels form the memory I store every image in a vtkImageData object and then I use a vtkImageAppend obbject to add all the images there and thus create a volume.Then I set it as input to the vtkImageReslice object(btw do i really need a vtkImport object? ). <br><br>However when I get the slice after the reslicing is prerformed it seems it is a bit squeezed when I compare it with the orthogonal slice I get from the DICOM viewer.&nbsp; Is there a way of "stretching" the image i get? <br><br><b><i>David Gobbi &lt;dgobbi@atamai.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi Emmanouil,<br><br>If you are reading DICOM files from disk, you need to use the<br>vtkDICOMImageReader instead of vtkImageReader2.<br><br>If you search the mailing list archive for "DICOM" you will<br>get lots of information (perhaps an overload) about reading<br>DICOM into VTK.<br><br>
 - David<br><br><br>Emmanouil Moschidis wrote:<br>&gt; Hi again I decided to go the easy way and read from the hard disk. So <br>&gt; I get the path of the already loaded series, but I get the error<br>&gt;<br>&gt;  Could not open file <br>&gt; /Users/osirix/Documents/Emmanouil/MyTestImages/MRkid/05050914/.1<br>&gt;<br>&gt; the path is /Users/osirix/Documents/Emmanouil/MyTestImages/MRkid/05050914/<br>&gt; even when I hardcode the path i get the same result. Do you know what <br>&gt; might be wrong? (btw is the last forward slash necessary ? ) <br>&gt;<br>&gt; */David Gobbi <dgobbi@atamai.com>/* wrote:<br>&gt;<br>&gt;     Hi Emmanouil,<br>&gt;<br>&gt;     One thing you can do is create a vtkImageImport object for each DICOM<br>&gt;     image, this will allow you to create a vtkImageData from each<br>&gt;     DICOM that<br>&gt;     you have stored in memory. Then, you can use vtkImageAppend to create<br>&gt;     an image volume out of the series of images. The output
 of<br>&gt;     vtkImageAppend can be used by vtkImageReslice.<br>&gt;<br>&gt;     - David<br>&gt;<br>&gt;<br>&gt;     Emmanouil Moschidis wrote:<br>&gt;     &gt; Before being able to use some parts of the code I have to solve a<br>&gt;     &gt; different problem. (I posted a new question but either it was not<br>&gt;     &gt; quite clear or nobody has done that before (?) )<br>&gt;     &gt;<br>&gt;     &gt; I work within a DICOM viewer so the DICOM series are already<br>&gt;     loaded (I<br>&gt;     &gt; do not read from a file like in case of the vtkImageReader2).<br>&gt;     Actually<br>&gt;     &gt; every DICOM image is stored in a custom class and all together in a<br>&gt;     &gt; NSArray (yes it is objective-C). So I want to load the images<br>&gt;     from the<br>&gt;     &gt; NSArray to the vtkImageReader2 object... I am not sure how<br>&gt;     should I do<br>&gt;     &gt; that.<br>&gt;     &gt;<br>&gt;     &gt; Maybe first I need to load them into a vtkImageData
 object?<br>&gt;     (still I<br>&gt;     &gt; haven't found any example for that)<br>&gt;     &gt;<br>&gt;     &gt; And then again I have the problem how to get the output<br>&gt;     properly. But<br>&gt;     &gt; I guess these questions do not belong to this class.<br>&gt;     &gt;<br>&gt;     &gt; */David Gobbi /* wrote:<br>&gt;     &gt;<br>&gt;     &gt; Hi Emmanouil,<br>&gt;     &gt;<br>&gt;     &gt; The best example for what you are trying to do is probably this one:<br>&gt;     &gt;<br>&gt;     &gt; VTK/Examples/ImageProcessing/Cxx/ImageSlicing.cxx<br>&gt;     &gt;<br>&gt;     &gt; This example is only in the CVS version of VTK, it isn't in the<br>&gt;     VTK 5<br>&gt;     &gt; release.<br>&gt;     &gt;<br>&gt;     &gt; What I do with tracking systems is use the coordinate/quaternion<br>&gt;     from<br>&gt;     &gt; the tracking system to create a vtkTransform, then I concatenate<br>&gt;     that<br>&gt;     &gt; transform with a vtkMatrix4x4 from the patient
 registration, and<br>&gt;     then<br>&gt;     &gt; feed the resulting transform to vtkImageReslice as the<br>&gt;     &gt; ResliceTransform.<br>&gt;     &gt;<br>&gt;     &gt; If you have looked at the class page for vtkImageReslice, you will<br>&gt;     &gt; notice that there are two methods for setting orientations:<br>&gt;     &gt; SetResliceAxes() and SetResliceTransform().<br>&gt;     &gt;<br>&gt;     &gt; For tracking, I always set ResliceTransform to the<br>&gt;     &gt; position/orientation<br>&gt;     &gt; of the tool (in patient coordinates), and then set the ResliceAxes<br>&gt;     &gt; according to how I want to orient the slice relative to<br>&gt;     &gt; orientation of<br>&gt;     &gt; the tool. In that way, the ResliceAxes is used to choose the tool<br>&gt;     &gt; axes<br>&gt;     &gt; along which you will be extracting the slice.<br>&gt;     &gt;<br>&gt;     &gt; The tricky thing with vtkImageReslice is getting the OutputOrigin,<br>&gt;     &gt;
 OutputSpacing, and OutputExtent set properly for your application.<br>&gt;     &gt; Together, these parameters can be used to describe an output slice<br>&gt;     &gt; plane<br>&gt;     &gt; with a particular pixel spacing. So for example:<br>&gt;     &gt;<br>&gt;     &gt; OutputOrigin = (-127.5, -127.5, 0.0)<br>&gt;     &gt; OutputSpacing = (1.0, 1.0, 1.0)<br>&gt;     &gt; OutputExtent = (0, 255, 0, 255, 0, 0)<br>&gt;     &gt;<br>&gt;     &gt; These describe a 256x256 output slice with 1mm pixel spacing. The<br>&gt;     &gt; first<br>&gt;     &gt; pixel is at (-127.5,-127.5,0) in the "output coordinate system" of<br>&gt;     &gt; vtkImageReslice. The centre of the slice is at (0,0,0) in the<br>&gt;     "output<br>&gt;     &gt; coordinate system" of vtkImageReslice.<br>&gt;     &gt;<br>&gt;     &gt; Now, the original input volume is in the "input coordinate<br>&gt;     system" of<br>&gt;     &gt; vtkImageReslice. We can call the input coordinate system "x" and the<br>&gt; 
    &gt; output coordinate system "x'". The relationship between these<br>&gt;     &gt; coordinates is as follows:<br>&gt;     &gt;<br>&gt;     &gt; x = T*M*x' where "T" is ResliceTransform and "M" is ResliceMatrix<br>&gt;     &gt;<br>&gt;     &gt; So this tells you that, if "M" is chosen to be a pure rotation<br>&gt;     &gt; matrix,<br>&gt;     &gt; and if "T" contains the position of the tool point in input image<br>&gt;     &gt; coordinates, then the point x' = (0,0,0), which is in the centre<br>&gt;     &gt; of our<br>&gt;     &gt; output plane, will correspond to the point x = tool_point. So, we<br>&gt;     &gt; will<br>&gt;     &gt; be extracting a slice through the tool point position.<br>&gt;     &gt;<br>&gt;     &gt; I know that is probably not the best description, let me know if<br>&gt;     &gt; things<br>&gt;     &gt; aren't quite clear.<br>&gt;     &gt;<br>&gt;     &gt; - David<br>&gt;     &gt;<br>&gt;     &gt;<br>&gt;     &gt;<br>&gt;     &gt;<br>&gt;    
 &gt; Emmanouil Moschidis wrote:<br>&gt;     &gt; &gt; Hello<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt; I want to use the vtkImageReslice class for reading a series of<br>&gt;     &gt; slices<br>&gt;     &gt; &gt; and exctracting one slice based on coordinates and quaternions<br>&gt;     &gt; &gt; received from a tracking system.<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt; Is there any specific documentation and/or any working<br>&gt;     examples for<br>&gt;     &gt; &gt; this class? It is very powerful yet the only usable information<br>&gt;     &gt; I have<br>&gt;     &gt; &gt; found is the class reference webpage.<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt; Any hint about how to proceed towards the insight of it would be<br>&gt;     &gt; &gt; highly appreciated<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt; thanks<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt;<br>&gt;     &gt;<br>&gt;     ------------------------------------------------------------------------<br>&gt;    
 &gt; &gt; Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge<br>&gt;     &gt; &gt; to<br>&gt;     &gt; &gt; see what's on, when.<br>&gt;     &gt; &gt;<br>&gt;     &gt;<br>&gt;     ------------------------------------------------------------------------<br>&gt;     &gt; &gt;<br>&gt;     &gt; &gt; _______________________________________________<br>&gt;     &gt; &gt; This is the private VTK discussion list.<br>&gt;     &gt; &gt; Please keep messages on-topic. Check the FAQ at:<br>&gt;     &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt;     &gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt;     &gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt;     &gt; &gt;<br>&gt;     &gt;<br>&gt;     &gt;<br>&gt;     &gt;<br>&gt;     ------------------------------------------------------------------------<br>&gt;     &gt; Be a PS3 game guru.<br>&gt;     &gt; Get your game face on with the latest PS3 news and previews at<br>&gt;     Yahoo!<br>&gt;     &gt;
 Games.<br>&gt;<br>&gt;<br>&gt; ------------------------------------------------------------------------<br>&gt; Yahoo! oneSearch: Finally, mobile search that gives answers <br>&gt; <http: us.rd.yahoo.com="" evt="48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC">, <br>&gt; not web links. <br><br></http:></dgobbi@atamai.com></blockquote><br><p>&#32;
      <hr size=1>Luggage? GPS? Comic books? <br>
Check out fitting <a href="http://us.rd.yahoo.com/evt=48249/*http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz"> gifts for grads</a> at Yahoo! Search.