18 #ifndef __itkDICOMSeriesFileNames_h
19 #define __itkDICOMSeriesFileNames_h
20 #if !defined( ITK_LEGACY_REMOVE )
28 #include "DICOMParser.h"
29 #include "DICOMAppHelper.h"
46 class ITK_EXPORT DICOMSeriesFileNames:
public Object
50 typedef DICOMSeriesFileNames Self;
51 typedef Object Superclass;
52 typedef SmartPointer< Self > Pointer;
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 void PrintSelf(std::ostream & os, Indent indent)
const;
156 DICOMSeriesFileNames(
const Self &);
157 void operator=(
const Self &);
159 int CanReadFile(
const char *fname);
161 void RecurseDirectory(std::string directory, FileNamesArrayType & filenames);
163 itkdicomparser::DICOMParser m_Parser;
164 itkdicomparser::DICOMAppHelper m_AppHelper;
167 std::string m_Directory;
168 FileNamesArrayType m_FileNames;
169 FileNamesArrayType m_SeriesUIDs;
170 FileNamesArrayType m_SeriesDescriptions;
171 FileNamesArrayType m_BodyParts;
172 FileNamesArrayType m_ScanOptions;
174 FileNameSortingOrderType m_FileNameSortingOrder;
176 TimeStamp m_DirectorySetTime;
177 TimeStamp m_DirectoryScanTime;
181 #endif //#if !defined( ITK_LEGACY_REMOVE )
182 #endif // __itkDICOMSeriesFileNames_h