[vtkusers] vtkMetaImageReader Python

Cory Quammen cquammen at cs.unc.edu
Tue Sep 25 07:42:53 EDT 2007


Hi Anne-Laure,

The vtkMetaImageReader class is basically an algorithm for reading in
files. By itself, it does not represent an image. Instead, it handles
the details of loading in an image.

To get image data from this class, call Update() on the
vtkMetaImageReader after you have specified the file name, and use the
GetOutput() method. For example:

imageReader = vtkMetaImageReader()
imageReader.SetFileName("myfile.mhd")
imageReader.Update()

image = imageReader.GetOutput()
# List the dimensions of the image, for example
print image.GetDimensions()

Regards,
Cory

On 9/25/07, annelaure <al_didier at yahoo.fr> wrote:
>
> Hi,
> I'm a beginner in vtk and I'm lost. To begin, I just want to read a .mhd
> file and to put it in a variable called "image". I write :
> image = vtkMetaImageReader()
> image.SetFileName ("myfile.mhd")
>
> But, It seems that "image" doesn't contain any informations. I certainly
> miss something...
>
> Thank you so much for your help,
>
> Best regards,
>
> Anne-Laure
>
> --
> View this message in context: http://www.nabble.com/vtkMetaImageReader-Python-tf4514321.html#a12875855
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>


-- 
Cory Quammen
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen



More information about the vtkusers mailing list