Class ImageSeriesReader


public class ImageSeriesReader extends ImageReaderBase
Read series of image files into a SimpleITK image. For some image formats such as DICOM, images also contain associated meta-data (e.g. imaging modality, patient name etc.). By default the reader does not load this information (saves time). To load the meta- data you will need to explicitly configure the reader, MetaDataDictionaryArrayUpdateOn, and possibly specify that you also want to load the private meta-data LoadPrivateTagsOn. Once the image series is read the meta-data is directly accessible from the reader. If the pixel type for the returned image is not specified it is deduced from the first image in the series. This approach is computationally efficient and assumes that all images in a series have the same pixel type. In rare situations this is not the case, not all images have the same pixel type. If this leads to a narrowing conversion (e.g. first image pixel type is unsigned int and others are float) the returned image does not represent the data correctly. To resolve such situations, explicitly specify the expected pixel type via the SetOutputPixelType method before reading the series. See: itk::simple::ReadImage for the procedural interface C++ includes: sitkImageSeriesReader.h
  • Constructor Details

    • ImageSeriesReader

      protected ImageSeriesReader(long cPtr, boolean cMemoryOwn)
    • ImageSeriesReader

      public ImageSeriesReader()
      itk::simple::ImageSeriesReader::ImageSeriesReader()
  • Method Details

    • getCPtr

      protected static long getCPtr(ImageSeriesReader obj)
    • swigRelease

      protected static long swigRelease(ImageSeriesReader obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageReaderBase
    • delete

      public void delete()
      itk::simple::ImageSeriesReader::~ImageSeriesReader() override
      Overrides:
      delete in class ImageReaderBase
    • toString

      public String toString()
      std::string itk::simple::ImageSeriesReader::ToString() const override Print ourselves to string
      Overrides:
      toString in class ImageReaderBase
    • getName

      public String getName()
      std::string itk::simple::ImageSeriesReader::GetName() const override return user readable name of the filter
      Overrides:
      getName in class ProcessObject
    • setMetaDataDictionaryArrayUpdate

      public void setMetaDataDictionaryArrayUpdate(boolean metaDataDictionaryArrayUpdate)
      Self& itk::simple::ImageSeriesReader::SetMetaDataDictionaryArrayUpdate(bool metaDataDictionaryArrayUpdate) Set/Get whether the meta-data dictionaries for the slices should be read. Default value is false, because of the additional computation time.
    • getMetaDataDictionaryArrayUpdate

      public boolean getMetaDataDictionaryArrayUpdate()
      bool itk::simple::ImageSeriesReader::GetMetaDataDictionaryArrayUpdate()
    • metaDataDictionaryArrayUpdateOn

      public void metaDataDictionaryArrayUpdateOn()
      Self& itk::simple::ImageSeriesReader::MetaDataDictionaryArrayUpdateOn() Set the value of MetaDataDictionaryArrayUpdate to true or false respectively.
    • metaDataDictionaryArrayUpdateOff

      public void metaDataDictionaryArrayUpdateOff()
      Self& itk::simple::ImageSeriesReader::MetaDataDictionaryArrayUpdateOff()
    • getGDCMSeriesFileNames

      public static VectorString getGDCMSeriesFileNames(String directory, String seriesID, boolean useSeriesDetails, boolean recursive, boolean loadSequences)
    • getGDCMSeriesFileNames

      public static VectorString getGDCMSeriesFileNames(String directory, String seriesID, boolean useSeriesDetails, boolean recursive)
    • getGDCMSeriesFileNames

      public static VectorString getGDCMSeriesFileNames(String directory, String seriesID, boolean useSeriesDetails)
    • getGDCMSeriesFileNames

      public static VectorString getGDCMSeriesFileNames(String directory, String seriesID)
    • getGDCMSeriesFileNames

      public static VectorString getGDCMSeriesFileNames(String directory)
    • getGDCMSeriesIDs

      public static VectorString getGDCMSeriesIDs(String directory, boolean useSeriesDetails)
    • getGDCMSeriesIDs

      public static VectorString getGDCMSeriesIDs(String directory)
    • setFileNames

      public void setFileNames(VectorString fileNames)
      Self& itk::simple::ImageSeriesReader::SetFileNames(const std::vector< std::string > &fileNames)
    • getFileNames

      public VectorString getFileNames()
      const std::vector<std::string>& itk::simple::ImageSeriesReader::GetFileNames() const
    • execute

      public Image execute()
      Image itk::simple::ImageSeriesReader::Execute() override Set/Get The output PixelType of the image. By default the value is sitkUnknown, which enable the output pixel type to be same as the file. If the pixel type is specified then the itk::ConvertPixelBuffer will be used to convert the pixels.
      Overrides:
      execute in class ImageReaderBase
    • getMetaDataKeys

      public VectorString getMetaDataKeys(long slice)
      std::vector<std::string> itk::simple::ImageSeriesReader::GetMetaDataKeys(unsigned int slice) const Get the meta-data dictionary keys for a slice. This is only valid after successful execution of this filter and when MetaDataDictionaryArrayUpdate is true. Each element in the array corresponds to a "slice" or filename read during execution. If the slice index is out of range, an exception will be thrown. Returns a vector of keys to the key/value entries in the file's meta- data dictionary. Iterate through with these keys to get the values.
    • hasMetaDataKey

      public boolean hasMetaDataKey(long slice, String key)
      bool itk::simple::ImageSeriesReader::HasMetaDataKey(unsigned int slice, const std::string &key) const Query a meta-data dictionary for the existence of a key.
    • getMetaData

      public String getMetaData(long slice, String key)
      std::string itk::simple::ImageSeriesReader::GetMetaData(unsigned int slice, const std::string &key) const Get the value of a meta-data dictionary entry as a string. If the key is not in the dictionary then an exception is thrown. string types in the dictionary are returned as their native string. Other types are printed to string before returning.