[vtkusers] vtkImageData, python and dicom

timb tim.butler at ulh.nhs.uk
Thu Sep 27 04:42:55 EDT 2012


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



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



More information about the vtkusers mailing list