[Insight-users] loading 4d dicom image

Jose Ignacio Prieto joseignacio.prieto at gmail.com
Tue Jul 2 17:29:19 EDT 2013


I have been checking gdcm and dcmtk and I think the best choice would be to
override reading methods in itkDCMTKFileReader.cxx
Does anybody have a hint?
Thanks


On Mon, Jul 1, 2013 at 10:09 AM, Jose Ignacio Prieto <
joseignacio.prieto at gmail.com> wrote:

> ok, but i don't want a vector of images. I want to have a 4d matrix so I
> can do segmentation through time
>
>
> On Mon, Jul 1, 2013 at 9:59 AM, Alessandro <notinmyhead at gmail.com> wrote:
>
>> Using this iterators (seriesItr and seriesEnd), you should be able to
>> loop and set a vector of images (such as typedef std::vector < ImageType3D
>> >  4dVector) by loading one volume after another.
>>
>> In your code, you only read the first volume by setting the filenames
>> into ImageSeriesReader object...
>>
>>
>> Il giorno 01/lug/2013, alle ore 15.49, Jose Ignacio Prieto ha scritto:
>>
>> > Hi, I am trying to load a 4d image into ITK using gdcm libraries. They
>> are a 4DFlow and a M2D Dicom created with a phillips resonator. I have both
>> datasets in multiple files dicom and in enhanced dicom. I can load them as
>> a 3d image now, with time changing in Z direction (all frames together for
>> a single z position, and then the next slice in z direction again with all
>> the frames), but i want the libaries to recognize it is a 4d, not a 3d. I
>> have tried to load every volume separated by the tag 0018|1060, but it
>> would be a vector of volumes and not a 4d matrix. And I don't know how to
>> make it for enhanced dicom. What would be the best approach??
>> > Thanks!
>> >
>> > #include "itkImage.h"
>> > #include "itkImageFileReader.h"
>> > #include "itkImageFileWriter.h"
>> > #include "itkGDCMImageIO.h"
>> > #include "itkGDCMSeriesFileNames.h"
>> > #include "itkImageSeriesReader.h"
>> > #include "itkImageFileWriter.h"
>> > #include <itkImageToVTKImageFilter.h>
>> > #include <itkExtractImageFilter.h>
>> >
>> > typedef unsigned short    PixelType;
>> > typedef itk::Image< PixelType, Dimension3>         ImageType3D;
>> > typedef itk::Image< PixelType, Dimension4 >         ImageType;
>> > typedef itk::ImageSeriesReader< ImageType >        ReaderType;
>> > typedef itk::GDCMSeriesFileNames NamesGeneratorType;
>> > typedef std::vector< std::string >   FileNamesContainer;
>> > typedef itk::GDCMImageIO       ImageIOType;
>> > typedef std::vector< std::string >    SeriesIdContainer;
>> >
>> > const unsigned int      Dimension3 = 3;
>> > const unsigned int      Dimension4 = 4;
>> > ReaderType::Pointer reader = ReaderType::New();
>> > ImageIOType::Pointer dicomIO = ImageIOType::New();
>> > NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
>> > FileNamesContainer fileNames;
>> > std::string seriesIdentifier;
>> >
>> > reader->SetImageIO( dicomIO );
>> > nameGenerator->SetDirectory( argv[9]);
>> > const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();
>> > SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
>> > SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();
>> > seriesIdentifier = seriesUID.begin()->c_str();
>> > fileNames = nameGenerator->GetFileNames( seriesIdentifier );
>> > reader->SetFileNames( fileNames );
>> > reader->Update();
>> >
>> >
>> > --
>> > José Ignacio Prieto
>> > celular(nuevo): 94348182
>> > _____________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Kitware offers ITK Training Courses, for more information visit:
>> > http://www.kitware.com/products/protraining.php
>> >
>> > Please keep messages on-topic and check the ITK FAQ at:
>> > http://www.itk.org/Wiki/ITK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.itk.org/mailman/listinfo/insight-users
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>
>
>
> --
> José Ignacio Prieto
> celular(nuevo): 94348182
>



-- 
José Ignacio Prieto
celular(nuevo): 94348182
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130702/c5b462d7/attachment.htm>


More information about the Insight-users mailing list