<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-flowed"
style="font-family: -moz-fixed; font-size: 12px;" lang="x-western">On
03/29/2010 10:07 PM, David Gobbi wrote:
<br>
<blockquote type="cite" style="color: rgb(0, 0, 0);">On Mon, Mar 29,
2010 at 1:33 PM, Erik Türke<a class="moz-txt-link-rfc2396E"
href="mailto:tuerke@cbs.mpg.de"><tuerke@cbs.mpg.de></a> wrote:
<br>
<blockquote type="cite" style="color: rgb(0, 0, 0);">On 03/29/2010
08:40 PM, David Gobbi wrote:
<br>
<blockquote type="cite" style="color: rgb(0, 0, 0);">On Mon, Mar
29, 2010 at 12:26 PM, Erik Türke<a class="moz-txt-link-rfc2396E"
href="mailto:tuerke@cbs.mpg.de"><tuerke@cbs.mpg.de></a>
wrote:
<br>
<br>
<br>
<blockquote type="cite" style="color: rgb(0, 0, 0);">Hi!
<br>
<br>
Well, this should be part of an adapter...so the user should get a list
<br>
of
<br>
pointers to vtkImageData objects (i return a list since the adapter
also
<br>
gets 4d data as input).
<br>
But it seems, this is not possible, so i have to return a list of
<br>
pointers
<br>
to vtkImageImport objects, what imho is a little odd for the user of
the
<br>
adapter.
<br>
<br>
</blockquote>
I don't understand what you are trying to say. Can you give more
detail?
<br>
<br>
David
<br>
<br>
</blockquote>
Hi
<br>
<br>
I want to write an adapter which takes an image object of an own type
and
<br>
returns a list of vtkImageData type pointers, like:
<br>
<br>
data::ImageList imgList = isis::data::IOFactory::load("data.nii", "");
<br>
<br>
or
<br>
<br>
isis::data::ImageList imgList = isis::data::IOFactory::load("data.v",
"");
<br>
<br>
imgList is the image object of type own, which i want to transform into
a
<br>
vtkImageData object, like
<br>
<br>
std::list<vtkImageData*> vtkList =
<br>
isis::adapter::VTKAdapter::makeVtkImageList(imgList.front());
<br>
<br>
(do not be confused of the imgList.front()...this is an object of
dimension
<br>
4, so i want to return a list of 3d vtkdata)
<br>
<br>
So, if someone for instance write an vtk image viewer which should
support
<br>
the isis image type, he/she can use the VTKAdapter to transform my own
<br>
imagetype into a vtkImageData type and use it.
<br>
<br>
But the way things are going i have to return vtkImageImport objects:
<br>
<br>
std::list<vtkImageImport*> vtkList =
<br>
isis::adapter::VTKAdapter::makeVtkImageList(imgList.front());
<br>
<br>
which actually was not my goal.
<br>
</blockquote>
<br>
Well, I am not familiar with isis, but now I have an idea of what you
<br>
are trying to do.
<br>
<br>
First, note that when using STL containers with VTK objects, you must
<br>
always use smart pointers:
<br>
<br>
std::vector<vtkSmartPointer<vtkImageData> >
imageDataVector;
<br>
<br>
Smart pointers are the only way that the VTK garbage collector can
<br>
track objects that are inside of STL containers.
<br>
<br>
<br>
As for the rest, I really don't understand why you cannot make a list
<br>
of vtkImageData objects. Why not do something like this?
<br>
<br>
For each 3D image:
<br>
<br>
1) create a vtkImageImport
<br>
2) set the vtkImageImport up for your data
<br>
3) call Update
<br>
4) use GetOutput() to get the vtkImageData
<br>
5) add the vtkImageData to a
std:list<vtkSmartPointer<vtkImageData> > container
<br>
6) call Delete on the vtkImageImport
<br>
7) repeat for the next 3D image
<br>
<br>
I have used a similar technique for importing 4D image to VTK with no
problem.
<br>
<br>
David
<br>
</blockquote>
Ahhh very thanks....i guess i was a little blockheaded <span
class="moz-smiley-s1" title=":-)"><span>:-)</span></span>
<br>
<br>
I did not see the simple vtkImage = vtkImporter->GetOutput()
command...
<br>
<br>
thanks a lot!!
<br>
<br>
cheers
<br>
</div>
</body>
</html>