18 #ifndef itkDICOMSeriesFileNames_h
19 #define itkDICOMSeriesFileNames_h
20 #if !defined( ITK_LEGACY_REMOVE )
28 #include "DICOMParser.h"
29 #include "DICOMAppHelper.h"
46 class DICOMSeriesFileNames:
public Object
50 typedef DICOMSeriesFileNames Self;
51 typedef Object Superclass;
58 itkTypeMacro(DICOMSeriesFileNames, Object);
71 void SetDirectory(
const std::string & dir)
73 if ( m_Directory != dir )
90 m_DirectorySetTime.Modified();
94 itkGetStringMacro(Directory);
98 itkSetMacro(Ascending,
bool);
99 itkGetConstMacro(Ascending,
bool);
100 itkBooleanMacro(Ascending);
104 typedef std::vector< std::string > FileNamesArrayType;
109 const FileNamesArrayType & GetSeriesUIDs(
bool recursive =
false);
113 const FileNamesArrayType & GetSeriesDescriptions(){
return m_SeriesDescriptions; }
114 const FileNamesArrayType & GetSeriesBodyParts(){
return m_BodyParts; }
115 const FileNamesArrayType & GetSeriesScanOptions(){
return m_ScanOptions; }
121 const FileNamesArrayType & GetFileNames(
bool recursive =
false);
127 const FileNamesArrayType & GetFileNames(
const std::string & seriesUID,
128 bool recursive =
false);
134 typedef enum { SortByImageNumber, SortBySliceLocation, SortByImagePositionPatient } FileNameSortingOrderType;
135 itkSetEnumMacro(FileNameSortingOrder, FileNameSortingOrderType);
136 itkGetEnumMacro(FileNameSortingOrder, FileNameSortingOrderType);
137 void SetFileNameSortingOrderToSortByImageNumber()
138 { this->SetFileNameSortingOrder(SortByImageNumber); }
139 void SetFileNameSortingOrderToSortBySliceLocation()
140 { this->SetFileNameSortingOrder(SortBySliceLocation); }
141 void SetFileNameSortingOrderToSortByImagePositionPatient()
142 { this->SetFileNameSortingOrder(SortByImagePositionPatient); }
148 std::string GetFileName(
const std::string & instanceUID);
151 DICOMSeriesFileNames();
152 ~DICOMSeriesFileNames() {}
153 virtual void PrintSelf(std::ostream & os, Indent indent)
const ITK_OVERRIDE;
156 ITK_DISALLOW_COPY_AND_ASSIGN(DICOMSeriesFileNames);
158 int CanReadFile(
const char *fname);
160 void RecurseDirectory(std::string directory, FileNamesArrayType & filenames);
162 itkdicomparser::DICOMParser m_Parser;
163 itkdicomparser::DICOMAppHelper m_AppHelper;
166 std::string m_Directory;
167 FileNamesArrayType m_FileNames;
168 FileNamesArrayType m_SeriesUIDs;
169 FileNamesArrayType m_SeriesDescriptions;
170 FileNamesArrayType m_BodyParts;
171 FileNamesArrayType m_ScanOptions;
173 FileNameSortingOrderType m_FileNameSortingOrder;
175 TimeStamp m_DirectorySetTime;
176 TimeStamp m_DirectoryScanTime;
180 #endif //#if !defined( ITK_LEGACY_REMOVE )
181 #endif // itkDICOMSeriesFileNames_h