vtkImageData, python and dicom

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

vtkImageData, python and dicom

abhishek
Hello Group,

I have started to use VTK with Python2.5.

I want to populate vtkImageData with DICOM Pixel data. Please suggest, how can i do this?

Regards
Abhishek.
Reply | Threaded
Open this post in threaded view
|

Re: vtkImageData, python and dicom

timb
Hi,

Don't know if this is any help but this is how I did it in C++ reading pixel data from a RT Dose DICOM file:
(I used vtkGDCMImageReader to read the pixel data from the DICOM file)

--------------------------------------------------------------------------------
std::string filename = "DicomFile.dcm";    // Put in your file name here

vtkGDCMImageReader *DoseReader = vtkGDCMImageReader::New();
DoseReader->SetFileName( filename.c_str() );
DoseReader->Update();

vtkImageDate *DoseImageData = DoseReader->GetOutput();
---------------------------------------------------------------------------------

You can then use something like DoseImageData->GetScalarComponentAsDouble(x, y, z, 0) to cycle through and get the pixel values.

Hope this helps
Cheers
Tim
Reply | Threaded
Open this post in threaded view
|

Re: vtkImageData, python and dicom

kingvsk
In reply to this post by abhishek
Try the following example which is in c++ but not much difficult to convert.

http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOM

--
Sathish

On Thursday 27 September 2012 10:56 AM, abhishek wrote:
Hello Group, 

I have started to use VTK with Python2.5. 

I want to populate vtkImageData with DICOM Pixel data. Please suggest, how
can i do this? 

Regards 
Abhishek.



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkImageData-python-and-dicom-tp5716322.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Sathish