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

#include <itkGDCMSeriesFileNames.h>

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

Detailed Description

Generate a sequence of filenames from a DICOM series.

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

  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 'Image 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:
IO/DicomSeriesReadGaussianImageWrite.cxx, IO/DicomSeriesReadImageWrite2.cxx, IO/DicomSeriesReadPrintTags.cxx, and IO/DicomSeriesReadSeriesWrite.cxx.

Definition at line 53 of file itkGDCMSeriesFileNames.h.

Public Types

typedef SmartPointer< SelfPointer
 
typedef GDCMSeriesFileNames Self
 
typedef ProcessObject Superclass
 
- Public Types inherited from itk::ProcessObject
typedef SmartPointer< const SelfConstPointer
 
typedef
DataObject::DataObjectIdentifierType 
DataObjectIdentifierType
 
typedef DataObject::Pointer DataObjectPointer
 
typedef std::vector
< DataObjectPointer
DataObjectPointerArray
 
typedef
DataObjectPointerArray::size_type 
DataObjectPointerArraySizeType
 
typedef std::vector
< DataObjectIdentifierType
NameArray
 
typedef SmartPointer< SelfPointer
 
typedef ProcessObject Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

void AddSeriesRestriction (const std::string &tag)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
const FilenamesContainerGetFileNames (const std::string serie)
 
const FilenamesContainerGetInputFileNames ()
 
virtual const char * GetNameOfClass () const
 
const FilenamesContainerGetOutputFileNames ()
 
gdcm::SerieHelper * GetSeriesHelper (void)
 
const SerieUIDContainerGetSeriesUIDs ()
 
bool GetUseSeriesDetails (void)
 
void SetDirectory (std::string const &name)
 
void SetInputDirectory (const char *name)
 
void SetInputDirectory (std::string const &name)
 
void SetUseSeriesDetails (bool useSeriesDetails)
 
void SetOutputDirectory (std::string const &name)
 
virtual void SetRecursive (bool _arg)
 
virtual bool GetRecursive () const
 
virtual void RecursiveOn ()
 
virtual void RecursiveOff ()
 
virtual void SetLoadSequences (bool _arg)
 
virtual bool GetLoadSequences () const
 
virtual void LoadSequencesOn ()
 
virtual void LoadSequencesOff ()
 
virtual void SetLoadPrivateTags (bool _arg)
 
virtual bool GetLoadPrivateTags () const
 
virtual void LoadPrivateTagsOn ()
 
virtual void LoadPrivateTagsOff ()
 
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
 
virtual void AbortGenerateDataOn ()
 
virtual void EnlargeOutputRequestedRegion (DataObject *)
 
virtual const bool & GetAbortGenerateData () const
 
NameArray GetInputNames () const
 
MultiThreader * GetMultiThreader () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
 
DataObjectPointerArraySizeType GetNumberOfInputs () const
 
DataObjectPointerArraySizeType GetNumberOfOutputs () const
 
virtual
DataObjectPointerArraySizeType 
GetNumberOfValidRequiredInputs () const
 
NameArray GetOutputNames () const
 
virtual const float & GetProgress () const
 
NameArray GetRequiredInputNames () const
 
bool HasInput (const DataObjectIdentifierType &key) const
 
bool HasOutput (const DataObjectIdentifierType &key) const
 
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx)
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
 
virtual void PrepareOutputs ()
 
virtual void PropagateRequestedRegion (DataObject *output)
 
virtual void ResetPipeline ()
 
virtual void SetAbortGenerateData (bool _arg)
 
virtual void Update ()
 
virtual void UpdateLargestPossibleRegion ()
 
virtual void UpdateOutputData (DataObject *output)
 
virtual void UpdateOutputInformation ()
 
void UpdateProgress (float progress)
 
DataObjectPointerArray GetInputs ()
 
DataObjectPointerArray GetOutputs ()
 
DataObjectPointerArray GetIndexedInputs ()
 
DataObjectPointerArray GetIndexedOutputs ()
 
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
 
void SetProgress (float progress)
 
virtual void SetReleaseDataFlag (bool flag)
 
virtual bool GetReleaseDataFlag () const
 
void ReleaseDataFlagOn ()
 
void ReleaseDataFlagOff ()
 
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
 
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
 
virtual void ReleaseDataBeforeUpdateFlagOn ()
 
virtual void ReleaseDataBeforeUpdateFlagOff ()
 
virtual void SetNumberOfThreads (ThreadIdType _arg)
 
virtual const ThreadIdTypeGetNumberOfThreads () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) 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
 
virtual void Register () const ITK_OVERRIDE
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) ITK_OVERRIDE
 
virtual void UnRegister () const ITK_OVERRIDE
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
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 flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 GDCMSeriesFileNames ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const ITK_OVERRIDE
 
 ~GDCMSeriesFileNames ()
 
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
 
virtual void AddOutput (DataObject *output)
 
virtual void CacheInputReleaseDataFlags ()
 
virtual void GenerateData ()
 
virtual void GenerateInputRequestedRegion ()
 
virtual void GenerateOutputInformation ()
 
virtual void GenerateOutputRequestedRegion (DataObject *output)
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredOutputs () const
 
bool IsIndexedInputName (const DataObjectIdentifierType &) const
 
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
 
 itkLegacyMacro (virtual void RemoveOutput(DataObject *output))
 
 itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num))
 
 itkLegacyMacro (virtual void RemoveInput(DataObject *input))
 
 itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num))
 
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
 
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
 
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
 
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
 
 ProcessObject ()
 
virtual void PropagateResetPipeline ()
 
virtual void ReleaseInputs ()
 
virtual void RemoveInput (const DataObjectIdentifierType &key)
 
virtual void RemoveInput (DataObjectPointerArraySizeType)
 
virtual void RemoveOutput (const DataObjectIdentifierType &key)
 
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
 
virtual void RestoreInputReleaseDataFlags ()
 
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
 
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
 
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
 
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
 
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
 
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
 
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
 
virtual void SetPrimaryInput (DataObject *input)
 
virtual void SetPrimaryOutput (DataObject *output)
 
virtual void VerifyInputInformation ()
 
virtual void VerifyPreconditions ()
 
 ~ProcessObject ()
 
DataObjectGetInput (const DataObjectIdentifierType &key)
 
const DataObjectGetInput (const DataObjectIdentifierType &key) const
 
DataObjectGetInput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
 
virtual void PushBackInput (const DataObject *input)
 
virtual void PopBackInput ()
 
virtual void PushFrontInput (const DataObject *input)
 
virtual void PopFrontInput ()
 
DataObjectGetPrimaryInput ()
 
const DataObjectGetPrimaryInput () const
 
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryInputName (void) const
 
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredInputs () const
 
bool AddRequiredInputName (const DataObjectIdentifierType &)
 
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
 
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 
void SetRequiredInputNames (const NameArray &)
 
DataObjectGetOutput (const DataObjectIdentifierType &key)
 
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
 
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
 
virtual const char * GetPrimaryOutputName (void) const
 
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryOutput ()
 
const DataObjectGetPrimaryOutput () const
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- 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 Member Functions

 GDCMSeriesFileNames (const Self &)
 
void operator= (const Self &)
 

Private Attributes

std::string m_InputDirectory
 
FilenamesContainer m_InputFileNames
 
bool m_LoadPrivateTags
 
bool m_LoadSequences
 
std::string m_OutputDirectory
 
FilenamesContainer m_OutputFileNames
 
bool m_Recursive
 
gdcm::SerieHelper * m_SerieHelper
 
SerieUIDContainer m_SeriesUIDs
 
bool m_UseSeriesDetails
 

Additional Inherited Members

- Protected Types inherited from itk::LightObject
typedef int InternalReferenceCountType
 
- Protected Attributes inherited from itk::ProcessObject
TimeStamp m_OutputInformationMTime
 
bool m_Updating
 
- Protected Attributes inherited from itk::LightObject
InternalReferenceCountType m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 

Member Typedef Documentation

Definition at line 59 of file itkGDCMSeriesFileNames.h.

Standard class typedefs.

Definition at line 57 of file itkGDCMSeriesFileNames.h.

Definition at line 58 of file itkGDCMSeriesFileNames.h.

Constructor & Destructor Documentation

itk::GDCMSeriesFileNames::GDCMSeriesFileNames ( )
protected
itk::GDCMSeriesFileNames::~GDCMSeriesFileNames ( )
protected
itk::GDCMSeriesFileNames::GDCMSeriesFileNames ( const Self )
private

Member Function Documentation

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

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

Warning
User need to set SetUseSeriesDetails(true)

Definition at line 154 of file itkGDCMSeriesFileNames.h.

References m_SerieHelper.

virtual::itk::LightObject::Pointer itk::GDCMSeriesFileNames::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

const FilenamesContainer& 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.

const FilenamesContainer& 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

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.

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.

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

Run-time type information (and related methods).

Reimplemented from itk::ProcessObject.

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

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

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

Recursively parse the input directory

gdcm::SerieHelper* itk::GDCMSeriesFileNames::GetSeriesHelper ( void  )
inline

Returns a pointer to the SeriesHelper class. This access allows the files as gdcm dicom objects in a series to be queried for dicom tag values prior to reading the series. Such querying is useful to determine which series should be read - e.g., to determine which is the T2 scan, etc.

Definition at line 143 of file itkGDCMSeriesFileNames.h.

References m_SerieHelper.

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

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

bool itk::GDCMSeriesFileNames::GetUseSeriesDetails ( void  )
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 132 of file itkGDCMSeriesFileNames.h.

References m_UseSeriesDetails.

virtual void itk::GDCMSeriesFileNames::LoadPrivateTagsOff ( )
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.

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.

virtual void itk::GDCMSeriesFileNames::LoadSequencesOff ( )
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.

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.

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

Method for creation through the object factory.

void itk::GDCMSeriesFileNames::operator= ( const Self )
private
virtual void itk::GDCMSeriesFileNames::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

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.

virtual void itk::GDCMSeriesFileNames::RecursiveOff ( )
virtual

Recursively parse the input directory

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

Recursively parse the input directory

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

Set the directory that contains the DICOM series.

Definition at line 76 of file itkGDCMSeriesFileNames.h.

References SetInputDirectory().

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

Set the directory that contains the DICOM series.

Referenced by SetDirectory().

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

Set the directory that contains the DICOM series.

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.

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.

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

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

Definition at line 87 of file itkGDCMSeriesFileNames.h.

References m_OutputDirectory, and itk::Object::Modified().

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

Recursively parse the input directory

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

std::string itk::GDCMSeriesFileNames::m_InputDirectory
private

Contains the input directory where the DICOM serie is found

Definition at line 187 of file itkGDCMSeriesFileNames.h.

FilenamesContainer itk::GDCMSeriesFileNames::m_InputFileNames
private

Internal structure to keep the list of input/output filenames

Definition at line 193 of file itkGDCMSeriesFileNames.h.

bool itk::GDCMSeriesFileNames::m_LoadPrivateTags
private

Definition at line 205 of file itkGDCMSeriesFileNames.h.

bool itk::GDCMSeriesFileNames::m_LoadSequences
private

Definition at line 204 of file itkGDCMSeriesFileNames.h.

std::string itk::GDCMSeriesFileNames::m_OutputDirectory
private

Contains the output directory where the DICOM serie should be written

Definition at line 190 of file itkGDCMSeriesFileNames.h.

Referenced by SetOutputDirectory().

FilenamesContainer itk::GDCMSeriesFileNames::m_OutputFileNames
private

Definition at line 194 of file itkGDCMSeriesFileNames.h.

bool itk::GDCMSeriesFileNames::m_Recursive
private

Definition at line 203 of file itkGDCMSeriesFileNames.h.

gdcm::SerieHelper* itk::GDCMSeriesFileNames::m_SerieHelper
private

Internal structure to order serie from one directory

Definition at line 197 of file itkGDCMSeriesFileNames.h.

Referenced by AddSeriesRestriction(), and GetSeriesHelper().

SerieUIDContainer itk::GDCMSeriesFileNames::m_SeriesUIDs
private

Internal structure to keep the list of series UIDs

Definition at line 200 of file itkGDCMSeriesFileNames.h.

bool itk::GDCMSeriesFileNames::m_UseSeriesDetails
private

Definition at line 202 of file itkGDCMSeriesFileNames.h.

Referenced by GetUseSeriesDetails().


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