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