[Insight-users] ITK Dicom imagedata to VTK imagedata

Sercani sercanimailgroups at gmail.com
Thu Jul 24 05:01:20 EDT 2008


Hi everyone;

I am writing a MPR and VRT application for DICOM datasets in C++. Firstly I
was using vtkDicomImageReader for reading DICOM series, I created MPR
section and it works great, but VTK doesn't support to parse all of the
DICOM headers. So I decided to use ITK and GDCM to read DICOM header . Now
my application reads the same DICOM set twice (with VTK and GDCM) so I want
to manage all reading process with ITK and GDCM. I've parsed the header as
illustrated in Insight\Examples\IO\DicomSeriesReadPrintTags.cxx . How can I
convert reader->GetOutput() to vtkImageData ?

Thanks already;

 

            typedef signed short PixelType;

            const unsigned int Dimension = 3;

            typedef itk::Image< PixelType, Dimension > ImageType;

            typedef itk::ImageSeriesReader< ImageType > ReaderType;

            ReaderType::Pointer reader = ReaderType::New();

            typedef itk::GDCMImageIO ImageIOType;

            ImageIOType::Pointer dicomIO = ImageIOType::New();

            reader->SetImageIO( dicomIO );

            typedef itk::GDCMSeriesFileNames NamesGeneratorType;

            NamesGeneratorType::Pointer nameGenerator =
NamesGeneratorType::New();

            nameGenerator->SetInputDirectory( dir.c_str() );

            typedef std::vector<std::string> FileNamesContainer;

            FileNamesContainer fileNames =
nameGenerator->GetInputFileNames();

            reader->SetFileNames( fileNames );

            try

            {

                  reader->Update();

            }

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080724/23b10a82/attachment.htm>


More information about the Insight-users mailing list