ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
itk::GDCMSeriesFileNames Class Reference

#include <itkGDCMSeriesFileNames.h>

Detailed Description

Generate a sequence of filenames from a DICOM series.

This class generates a sequence of files whose filenames point to a DICOM file. The ordering is based on the following strategy: Read all images in the directory (assuming there is only one study/series)

  1. Extract Image Orientation & Image Position from DICOM images, and then calculate the ordering based on the 3D coordinate of the slice.
  2. If for some reason this information is not found or failed, another strategy is used: the ordering is based on 'Instance Number'.
  3. If this strategy also failed, then the filenames are ordered by lexicographical order.

If multiple volumes are being grouped as a single series for your DICOM objects, you may want to try calling SetUseSeriesDetails(true) prior to calling SetDirectory().

Examples
Examples/IO/DicomSeriesReadGaussianImageWrite.cxx, Examples/IO/DicomSeriesReadImageWrite2.cxx, Examples/IO/DicomSeriesReadPrintTags.cxx, Examples/IO/DicomSeriesReadSeriesWrite.cxx, SphinxExamples/src/IO/GDCM/ReadAndPrintDICOMTags/Code.cxx, SphinxExamples/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/Code.cxx, and SphinxExamples/src/IO/GDCM/ResampleDICOMSeries/Code.cxx.

Definition at line 63 of file itkGDCMSeriesFileNames.h.

+ Inheritance diagram for itk::GDCMSeriesFileNames:
+ Collaboration diagram for itk::GDCMSeriesFileNames:

Public Types

using FileNamesContainerType = FilenamesContainer
 
using Pointer = SmartPointer< Self >
 
using Self = GDCMSeriesFileNames
 
using SeriesUIDContainerType = SerieUIDContainer
 
using Superclass = ProcessObject
 
- Public Types inherited from itk::ProcessObject
using ConstPointer = SmartPointer< const Self >
 
using DataObjectIdentifierType = DataObject::DataObjectIdentifierType
 
using DataObjectPointer = DataObject::Pointer
 
using DataObjectPointerArray = std::vector< DataObjectPointer >
 
using DataObjectPointerArraySizeType = DataObjectPointerArray::size_type
 
using MultiThreaderType = MultiThreaderBase
 
using NameArray = std::vector< DataObjectIdentifierType >
 
using Pointer = SmartPointer< Self >
 
using Self = ProcessObject
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

void AddSeriesRestriction (const std::string &tag)
 
const FileNamesContainerTypeGetFileNames (const std::string serie)
 
const FileNamesContainerTypeGetInputFileNames ()
 
const char * GetNameOfClass () const override
 
const FileNamesContainerTypeGetOutputFileNames ()
 
const SeriesUIDContainerTypeGetSeriesUIDs ()
 
bool GetUseSeriesDetails () const
 
void SetDirectory (const std::string &name)
 
void SetInputDirectory (const char *name)
 
void SetInputDirectory (const std::string &name)
 
void SetUseSeriesDetails (bool useSeriesDetails)
 
void SetOutputDirectory (const std::string &name)
 
virtual void SetRecursive (bool _arg)
 
virtual bool GetRecursive () const
 
virtual void RecursiveOn ()
 
virtual void SetLoadSequences (bool _arg)
 
virtual bool GetLoadSequences () const
 
virtual void LoadSequencesOn ()
 
virtual void SetLoadPrivateTags (bool _arg)
 
virtual bool GetLoadPrivateTags () const
 
virtual void LoadPrivateTagsOn ()
 
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOn ()
 
virtual void EnlargeOutputRequestedRegion (DataObject *)
 
virtual const bool & GetAbortGenerateData () const
 
DataObjectPointerArray GetIndexedInputs ()
 
DataObjectPointerArray GetIndexedOutputs ()
 
NameArray GetInputNames () const
 
DataObjectPointerArray GetInputs ()
 
MultiThreaderTypeGetMultiThreader () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
 
DataObjectPointerArraySizeType GetNumberOfInputs () const
 
DataObjectPointerArraySizeType GetNumberOfOutputs () const
 
virtual DataObjectPointerArraySizeType GetNumberOfValidRequiredInputs () const
 
NameArray GetOutputNames () const
 
DataObjectPointerArray GetOutputs ()
 
virtual float GetProgress () const
 
NameArray GetRequiredInputNames () const
 
bool HasInput (const DataObjectIdentifierType &key) const
 
bool HasOutput (const DataObjectIdentifierType &key) const
 
void IncrementProgress (float increment)
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
 
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx)
 
virtual void PrepareOutputs ()
 
virtual void PropagateRequestedRegion (DataObject *output)
 
virtual void ResetPipeline ()
 
virtual void SetAbortGenerateData (bool _arg)
 
void SetMultiThreader (MultiThreaderType *threader)
 
virtual void Update ()
 
virtual void UpdateLargestPossibleRegion ()
 
virtual void UpdateOutputData (DataObject *output)
 
virtual void UpdateOutputInformation ()
 
void UpdateProgress (float progress)
 
virtual void SetReleaseDataFlag (bool val)
 
virtual bool GetReleaseDataFlag () const
 
void ReleaseDataFlagOn ()
 
void ReleaseDataFlagOff ()
 
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
 
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
 
virtual void ReleaseDataBeforeUpdateFlagOn ()
 
virtual void SetNumberOfWorkUnits (ThreadIdType _arg)
 
virtual const ThreadIdTypeGetNumberOfWorkUnits () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 GDCMSeriesFileNames ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~GDCMSeriesFileNames () override
 
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
 
void AddOptionalInputName (const DataObjectIdentifierType &)
 
void AddOptionalInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
virtual void AddOutput (DataObject *output)
 
bool AddRequiredInputName (const DataObjectIdentifierType &)
 
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
virtual void CacheInputReleaseDataFlags ()
 
virtual void GenerateData ()
 
virtual void GenerateInputRequestedRegion ()
 
virtual void GenerateOutputInformation ()
 
virtual void GenerateOutputRequestedRegion (DataObject *output)
 
DataObjectGetInput (const DataObjectIdentifierType &key)
 
const DataObjectGetInput (const DataObjectIdentifierType &key) const
 
virtual const DataObjectPointerArraySizeTypeGetNumberOfRequiredInputs () const
 
virtual const DataObjectPointerArraySizeTypeGetNumberOfRequiredOutputs () const
 
bool IsIndexedInputName (const DataObjectIdentifierType &) const
 
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
 
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
 
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
 
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
 
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
 
virtual void PopBackInput ()
 
virtual void PopFrontInput ()
 
 ProcessObject ()
 
virtual void PropagateResetPipeline ()
 
virtual void PushBackInput (const DataObject *input)
 
virtual void PushFrontInput (const DataObject *input)
 
virtual void ReleaseInputs ()
 
virtual void RemoveInput (const DataObjectIdentifierType &key)
 
virtual void RemoveInput (DataObjectPointerArraySizeType)
 
virtual void RemoveOutput (const DataObjectIdentifierType &key)
 
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
 
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
 
virtual void RestoreInputReleaseDataFlags ()
 
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
 
virtual void SetNthInput (DataObjectPointerArraySizeType idx, DataObject *input)
 
virtual void SetNthOutput (DataObjectPointerArraySizeType idx, DataObject *output)
 
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
 
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
 
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
 
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
 
virtual void SetOutput (const DataObjectIdentifierType &name, DataObject *output)
 
virtual void SetPrimaryInput (DataObject *object)
 
virtual void SetPrimaryOutput (DataObject *object)
 
void SetRequiredInputNames (const NameArray &)
 
virtual void VerifyInputInformation () const
 
virtual void VerifyPreconditions () const
 
 ~ProcessObject () override
 
DataObjectGetInput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryInput ()
 
const DataObjectGetPrimaryInput () const
 
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryInputName () const
 
DataObjectGetOutput (const DataObjectIdentifierType &key)
 
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
 
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryOutputName () const
 
DataObjectGetOutput (DataObjectPointerArraySizeType i)
 
const DataObjectGetOutput (DataObjectPointerArraySizeType i) const
 
DataObjectGetPrimaryOutput ()
 
const DataObjectGetPrimaryOutput () const
 
virtual bool GetThreaderUpdateProgress () const
 
virtual void ThreaderUpdateProgressOn ()
 
virtual void SetThreaderUpdateProgress (bool arg)
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

std::string m_InputDirectory = ""
 
FileNamesContainerType m_InputFileNames {}
 
bool m_LoadPrivateTags = false
 
bool m_LoadSequences = false
 
std::string m_OutputDirectory = ""
 
FileNamesContainerType m_OutputFileNames {}
 
bool m_Recursive = false
 
std::unique_ptr< gdcm::SerieHelper > m_SerieHelper
 
SeriesUIDContainerType m_SeriesUIDs {}
 
bool m_UseSeriesDetails = true
 

Additional Inherited Members

- Static Protected Member Functions inherited from itk::ProcessObject
template<typename TSourceObject >
static void MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs)
 
static constexpr float progressFixedToFloat (uint32_t fixed)
 
static uint32_t progressFloatToFixed (float f)
 
- Protected Attributes inherited from itk::ProcessObject
TimeStamp m_OutputInformationMTime {}
 
bool m_Updating {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ FileNamesContainerType

Type of the container that holds the file names in the series.

Definition at line 74 of file itkGDCMSeriesFileNames.h.

◆ Pointer

Definition at line 71 of file itkGDCMSeriesFileNames.h.

◆ Self

Standard class type aliases.

Definition at line 69 of file itkGDCMSeriesFileNames.h.

◆ SeriesUIDContainerType

Type of the container that holds the UID's for the series.

Definition at line 77 of file itkGDCMSeriesFileNames.h.

◆ Superclass

Definition at line 70 of file itkGDCMSeriesFileNames.h.

Constructor & Destructor Documentation

◆ GDCMSeriesFileNames()

itk::GDCMSeriesFileNames::GDCMSeriesFileNames ( )
protected

◆ ~GDCMSeriesFileNames()

itk::GDCMSeriesFileNames::~GDCMSeriesFileNames ( )
overrideprotected

Member Function Documentation

◆ AddSeriesRestriction()

void itk::GDCMSeriesFileNames::AddSeriesRestriction ( const std::string &  tag)

Add more restriction on the selection of a Series. This follows the same approach as SetUseSeriesDetails, but allows a user to add even more DICOM tags to take into account for subrefining a set of DICOM files into multiple series. The tag format is "group|element" of a DICOM tag.

Warning
UseSeriesDetails needs to be set to true.

◆ GetFileNames()

const FileNamesContainerType& itk::GDCMSeriesFileNames::GetFileNames ( const std::string  serie)

Returns a vector containing the series' file names. The file names are ordered by the strategy define in header. All DICOM files have the same exact UID equal to the one user's specified. An extended UID may be returned/used if SetUseSeriesDetails(true) has been called.

◆ GetInputFileNames()

const FileNamesContainerType& itk::GDCMSeriesFileNames::GetInputFileNames ( )

Returns a vector containing the series' file names. The file names are ordered by the strategy define in header. No sorting is done based on UID

◆ GetLoadPrivateTags()

virtual bool itk::GDCMSeriesFileNames::GetLoadPrivateTags ( ) const
virtual

Parse any private tags in the DICOM file. Defaults to false to skip private tags. This makes loading DICOM files faster when private tags are not needed.

◆ GetLoadSequences()

virtual bool itk::GDCMSeriesFileNames::GetLoadSequences ( ) const
virtual

Parse any sequences in the DICOM file. Defaults to false to skip sequences. This makes loading DICOM files faster when sequences are not needed.

◆ GetNameOfClass()

const char* itk::GDCMSeriesFileNames::GetNameOfClass ( ) const
overridevirtual

◆ GetOutputFileNames()

const FileNamesContainerType& itk::GDCMSeriesFileNames::GetOutputFileNames ( )

Returns a vector containing the series' file names. The file names are ordered in the same exact order as the input one. This could be dangerous if the writing has changed 3rd position or some other DICOM tag in the header

◆ GetRecursive()

virtual bool itk::GDCMSeriesFileNames::GetRecursive ( ) const
virtual

Recursively parse the input directory. Must be set before the call to SetInputDirectory().

◆ GetSeriesUIDs()

const SeriesUIDContainerType& itk::GDCMSeriesFileNames::GetSeriesUIDs ( )

Returns a vector containing all the UIDs found when parsing the directory specified via SetDirectory. If no directory is specified return an empty vector. An extended UID may be returned/used if SetUseSeriesDetails(true) has been called.

◆ GetUseSeriesDetails()

bool itk::GDCMSeriesFileNames::GetUseSeriesDetails ( ) const
inline

Returns true if using additional series information such as ProtocolName and SeriesName to identify when a single SeriesUID contains multiple 3D volumes - as can occur with perfusion and DTI imaging

Definition at line 161 of file itkGDCMSeriesFileNames.h.

◆ LoadPrivateTagsOn()

virtual void itk::GDCMSeriesFileNames::LoadPrivateTagsOn ( )
virtual

Parse any private tags in the DICOM file. Defaults to false to skip private tags. This makes loading DICOM files faster when private tags are not needed.

◆ LoadSequencesOn()

virtual void itk::GDCMSeriesFileNames::LoadSequencesOn ( )
virtual

Parse any sequences in the DICOM file. Defaults to false to skip sequences. This makes loading DICOM files faster when sequences are not needed.

◆ New()

static Pointer itk::GDCMSeriesFileNames::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

void itk::GDCMSeriesFileNames::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::ProcessObject.

◆ RecursiveOn()

virtual void itk::GDCMSeriesFileNames::RecursiveOn ( )
virtual

Recursively parse the input directory. Must be set before the call to SetInputDirectory().

◆ SetDirectory()

void itk::GDCMSeriesFileNames::SetDirectory ( const std::string &  name)
inline

Set the directory that contains the DICOM series.

Definition at line 97 of file itkGDCMSeriesFileNames.h.

◆ SetInputDirectory() [1/2]

void itk::GDCMSeriesFileNames::SetInputDirectory ( const char *  name)

Set the directory that contains the DICOM series.

◆ SetInputDirectory() [2/2]

void itk::GDCMSeriesFileNames::SetInputDirectory ( const std::string &  name)

Set the directory that contains the DICOM series.

◆ SetLoadPrivateTags()

virtual void itk::GDCMSeriesFileNames::SetLoadPrivateTags ( bool  _arg)
virtual

Parse any private tags in the DICOM file. Defaults to false to skip private tags. This makes loading DICOM files faster when private tags are not needed.

◆ SetLoadSequences()

virtual void itk::GDCMSeriesFileNames::SetLoadSequences ( bool  _arg)
virtual

Parse any sequences in the DICOM file. Defaults to false to skip sequences. This makes loading DICOM files faster when sequences are not needed.

◆ SetOutputDirectory()

void itk::GDCMSeriesFileNames::SetOutputDirectory ( const std::string &  name)
inline

Set the directory where the output DICOM series should be written.

Definition at line 110 of file itkGDCMSeriesFileNames.h.

◆ SetRecursive()

virtual void itk::GDCMSeriesFileNames::SetRecursive ( bool  _arg)
virtual

Recursively parse the input directory. Must be set before the call to SetInputDirectory().

◆ SetUseSeriesDetails()

void itk::GDCMSeriesFileNames::SetUseSeriesDetails ( bool  useSeriesDetails)

Use additional series information such as ProtocolName and SeriesName to identify when a single SeriesUID contains multiple 3D volumes - as can occur with perfusion and DTI imaging

Member Data Documentation

◆ m_InputDirectory

std::string itk::GDCMSeriesFileNames::m_InputDirectory = ""
private

Contains the input directory where the DICOM series is found

Definition at line 201 of file itkGDCMSeriesFileNames.h.

◆ m_InputFileNames

FileNamesContainerType itk::GDCMSeriesFileNames::m_InputFileNames {}
private

Internal structure to keep the list of input/output filenames

Definition at line 207 of file itkGDCMSeriesFileNames.h.

◆ m_LoadPrivateTags

bool itk::GDCMSeriesFileNames::m_LoadPrivateTags = false
private

Definition at line 219 of file itkGDCMSeriesFileNames.h.

◆ m_LoadSequences

bool itk::GDCMSeriesFileNames::m_LoadSequences = false
private

Definition at line 218 of file itkGDCMSeriesFileNames.h.

◆ m_OutputDirectory

std::string itk::GDCMSeriesFileNames::m_OutputDirectory = ""
private

Contains the output directory where the DICOM series should be written

Definition at line 204 of file itkGDCMSeriesFileNames.h.

◆ m_OutputFileNames

FileNamesContainerType itk::GDCMSeriesFileNames::m_OutputFileNames {}
private

Definition at line 208 of file itkGDCMSeriesFileNames.h.

◆ m_Recursive

bool itk::GDCMSeriesFileNames::m_Recursive = false
private

Definition at line 217 of file itkGDCMSeriesFileNames.h.

◆ m_SerieHelper

std::unique_ptr<gdcm::SerieHelper> itk::GDCMSeriesFileNames::m_SerieHelper
private

Internal structure to order series from one directory

Definition at line 211 of file itkGDCMSeriesFileNames.h.

◆ m_SeriesUIDs

SeriesUIDContainerType itk::GDCMSeriesFileNames::m_SeriesUIDs {}
private

Internal structure to keep the list of series UIDs

Definition at line 214 of file itkGDCMSeriesFileNames.h.

◆ m_UseSeriesDetails

bool itk::GDCMSeriesFileNames::m_UseSeriesDetails = true
private

Definition at line 216 of file itkGDCMSeriesFileNames.h.


The documentation for this class was generated from the following file: