From Ohm

Dicom Series Loader with ITK

To load a dicom series from multiple files and not only a single one, we have to do a little more work:

The directory, in which the images reside, is assumed to be available as “series”:

#include "itkImage.h"
#include "itkGDCMImageIO.h"
#include "itkGDCMSeriesFileNames.h"
#include "itkImageSeriesReader.h"

// create name generator
typedef itk::GDCMSeriesFileNames NamesGeneratorType;
NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();

// create dicom series reader
typedef itk::ImageSeriesReader<Image3DType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
typedef itk::GDCMImageIO ImageIOType;
ImageIOType::Pointer dicomIO = ImageIOType::New();

// get series IDs
typedef std::vector<std::string> SeriesIdContainer;
const SeriesIdContainer &seriesUID = nameGenerator->GetSeriesUIDs();

// get dicom series
typedef std::vector<std::string> FileNamesContainer;
FileNamesContainer fileNames;

// pull reader

Retrieved from

Page last modified on November 16, 2020, at 11:36 PM