<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2>VTK documentation&nbsp;indicates that 
vtkImageReslice is derived from vtkImageAlgorithm so GetOutput will return 
vtkImageData object. Check the documentation.</FONT></DIV>
<DIV><FONT face=Arial size=2>HTH</FONT></DIV>
<DIV><FONT face=Arial size=2>Vidyadhar</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=moshman65@yahoo.com href="mailto:moshman65@yahoo.com">Emmanouil 
  Moschidis</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=dgobbi@atamai.com 
  href="mailto:dgobbi@atamai.com">David Gobbi</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=vtkusers@vtk.org 
  href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, May 23, 2007 4:04 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] vtkImageReslice 
  class</DIV>
  <DIV><BR></DIV>Can someone load the image coming from the vtkImageReslice to a 
  vtkImageData object? (is it the correct object to load an image to?)&nbsp; Is 
  there any snippet of code? <BR><BR>I want to get the image from 
  vtkImageReslice read the pixels (this seems to be also a problem - hot to get 
  the pixels from vtkImageData) and then use custom classes and viewer for 
  visualizing the result.&nbsp; &nbsp; <BR><BR><B><I>David Gobbi &lt;<A 
  href="mailto:dgobbi@atamai.com">dgobbi@atamai.com</A>&gt;</I></B> wrote:
  <BLOCKQUOTE class=replbq 
  style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">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: 
    evt="48252/*http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC" 
    us.rd.yahoo.com="">, <BR>&gt; not web links. 
    <BR><BR></HTTP:></DGOBBI@ATAMAI.COM></BLOCKQUOTE><BR>
  <P>
  <HR SIZE=1>
  <A 
  href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&amp;cmp=Yahoo&amp;ctv=AprNI&amp;s=Y&amp;s2=EM&amp;b=50">Pinpoint 
  customers </A>who are looking for what you sell. </BLOCKQUOTE></BODY></HTML>