[vtkusers] about vtkImageData

Lic. José M. Rodriguez Bacallao jmrbcu at gmail.com
Tue Jun 30 11:40:34 EDT 2009


as I said before, until now, I have been using vtkGDCMImageReader but
now I wan't to use pydicom, this is how I read the image with pydicom:

import dicom
dataset = dicom.read_file('./path/to/file.dcm')
pixel_array = ds.pixel_array #numpy array
pixel_data = ds.PixelData #string of bytes

question is: How do I visualize any of these with vtk to see a dicom image?

On 6/30/09, Mathieu Malaterre <mathieu.malaterre at gmail.com> wrote:
> On Tue, Jun 30, 2009 at 3:07 PM, Lic. José M. Rodriguez
> Bacallao<jmrbcu at gmail.com> wrote:
>> how to populate a vtkImageData with pixel data from a dicom image
>> (pydicom, I 'm using python), pixel data could be a numpy array or a
>> string of bytes, until now, I've been using vtkGDCMImageReader but I
>> am exploring new horizons!!!
>
> If you have installed gdcm (vtkGDCMImageReader) there are a couple of
> lower level functionality for passing the byte buffer from a
> gdcm.ImageReader to Numpy.
>
> I do not understand why you would do that: gdcm.ImageReader -> Numpy
> -> vtkImageData instead of the direct vtkGDCMImageReader, since you
> basically would have to duplicate the logic from vtkGDCMImageReader...
>
> --
> Mathieu
>


-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------



More information about the vtkusers mailing list