Package org.itk.simple
Class ImageSeriesReader
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageReaderBase
org.itk.simple.ImageSeriesReader
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
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::ImageSeriesReader::ImageSeriesReader()protected
ImageSeriesReader
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
itk::simple::ImageSeriesReader::~ImageSeriesReader() overrideexecute()
Image itk::simple::ImageSeriesReader::Execute() override Set/Get The output PixelType of the image.protected void
finalize()
protected static long
getCPtr
(ImageSeriesReader obj) const std::vector<std::string>& itk::simple::ImageSeriesReader::GetFileNames() conststatic VectorString
getGDCMSeriesFileNames
(String directory) static VectorString
getGDCMSeriesFileNames
(String directory, String seriesID) static VectorString
getGDCMSeriesFileNames
(String directory, String seriesID, boolean useSeriesDetails) static VectorString
getGDCMSeriesFileNames
(String directory, String seriesID, boolean useSeriesDetails, boolean recursive) static VectorString
getGDCMSeriesFileNames
(String directory, String seriesID, boolean useSeriesDetails, boolean recursive, boolean loadSequences) static VectorString
getGDCMSeriesIDs
(String directory) static VectorString
getGDCMSeriesIDs
(String directory, boolean useSeriesDetails) 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.boolean
bool itk::simple::ImageSeriesReader::GetMetaDataDictionaryArrayUpdate()getMetaDataKeys
(long slice) std::vector<std::string> itk::simple::ImageSeriesReader::GetMetaDataKeys(unsigned int slice) const Get the meta-data dictionary keys for a slice.getName()
std::string itk::simple::ImageSeriesReader::GetName() const override return user readable name of the filterboolean
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.void
Self& itk::simple::ImageSeriesReader::MetaDataDictionaryArrayUpdateOff()void
Self& itk::simple::ImageSeriesReader::MetaDataDictionaryArrayUpdateOn() Set the value of MetaDataDictionaryArrayUpdate to true or false respectively.void
setFileNames
(VectorString fileNames) Self& itk::simple::ImageSeriesReader::SetFileNames(const std::vector< std::string > &fileNames)void
setMetaDataDictionaryArrayUpdate
(boolean metaDataDictionaryArrayUpdate) Self& itk::simple::ImageSeriesReader::SetMetaDataDictionaryArrayUpdate(bool metaDataDictionaryArrayUpdate) Set/Get whether the meta-data dictionaries for the slices should be read.protected static long
toString()
std::string itk::simple::ImageSeriesReader::ToString() const override Print ourselves to stringMethods inherited from class org.itk.simple.ImageReaderBase
getCPtr, getImageIO, getImageIOFromFileName, getLoadPrivateTags, getOutputPixelType, getRegisteredImageIOs, loadPrivateTagsOff, loadPrivateTagsOn, setImageIO, setLoadPrivateTags, setOutputPixelType, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
ImageSeriesReader
protected ImageSeriesReader(long cPtr, boolean cMemoryOwn) -
ImageSeriesReader
public ImageSeriesReader()itk::simple::ImageSeriesReader::ImageSeriesReader()
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageReaderBase
-
delete
public void delete()itk::simple::ImageSeriesReader::~ImageSeriesReader() override- Overrides:
delete
in classImageReaderBase
-
toString
std::string itk::simple::ImageSeriesReader::ToString() const override Print ourselves to string- Overrides:
toString
in classImageReaderBase
-
getName
std::string itk::simple::ImageSeriesReader::GetName() const override return user readable name of the filter- Overrides:
getName
in classProcessObject
-
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
-
getGDCMSeriesFileNames
-
getGDCMSeriesIDs
-
getGDCMSeriesIDs
-
setFileNames
Self& itk::simple::ImageSeriesReader::SetFileNames(const std::vector< std::string > &fileNames) -
getFileNames
const std::vector<std::string>& itk::simple::ImageSeriesReader::GetFileNames() const -
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 classImageReaderBase
-
getMetaDataKeys
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
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
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.
-