[Insight-users] ITK Dicom imagedata to VTK imagedata
Sercani
sercanimailgroups at gmail.com
Wed Jul 30 02:08:43 EDT 2008
Isn't there any other way to convert directly
itk::ImageSeriesReader->getOutput() to vtkImageData? I've seen some filters
for this process but I'm not sure about how to use them...
-----Original Message-----
From: Mathieu Malaterre [mailto:mathieu.malaterre at gmail.com]
Sent: Thursday, July 24, 2008 12:32 PM
To: Sercani
Subject: Re: [Insight-users] ITK Dicom imagedata to VTK imagedata
You could also used directlry:
vtkGDCMImageReader.
See:
http://www.reviewingit.com/index.php/content/view/62/2/
HTH
On Thu, Jul 24, 2008 at 11:01 AM, Sercani <sercanimailgroups at gmail.com>
wrote:
> 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();
>
> }
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--
Success is getting what you want. Happiness is wanting what you get.
More information about the Insight-users
mailing list