28 #ifndef __itkIPLFileNameList_h
29 #define __itkIPLFileNameList_h
38 #define IPLSetMacro(name, type) \
39 virtual void Set##name (const type _arg) \
41 if ( this->m_##name != _arg ) \
43 this->m_##name = _arg; \
49 #define IPLGetMacro(name, type) \
50 virtual type Get##name () \
52 return this->m_##name; \
74 IPLFileSortInfo(
const char *
const filename,
float sliceLocation,
75 int sliceOffset,
int echoNumber,
int imageNumber,
78 m_ImageFileName = filename;
79 m_SliceLocation = sliceLocation;
80 m_SliceOffset = sliceOffset;
81 m_EchoNumber = echoNumber;
82 m_ImageNumber = imageNumber;
86 virtual ~IPLFileSortInfo() {}
102 std::string m_ImageFileName;
103 float m_SliceLocation;
114 class ITK_EXPORT IPLFileNameList
117 typedef std::vector< IPLFileSortInfo * > ListType;
118 typedef ListType::iterator IteratorType;
119 typedef size_t ListSizeType;
122 SortGlobalAscend = 0,
123 SortGlobalDescend = 1,
124 SortByNameAscend = 2,
125 SortByNameDescend = 3
139 m_SortOrder = SortGlobalAscend;
142 virtual ~IPLFileNameList()
144 IteratorType it = begin();
145 IteratorType itend = end();
147 while ( it != itend )
156 return m_List.begin();
164 IPLFileSortInfo * operator[](
unsigned int __n)
166 IteratorType it = begin();
167 IteratorType itend = end();
169 for (
unsigned int i = 0; it != itend && i != __n; it++, i++ )
178 ListSizeType NumFiles()
const
180 return m_List.size();
183 bool AddElementToList(
char const *
const filename,
184 const float sliceLocation,
190 const int imageNumber,
194 if ( m_List.empty() )
203 else if ( XDim != m_XDim || YDim != m_YDim )
207 else if(XRes != m_XRes || YRes != m_YRes)
211 else if ( Key1 != m_Key1 || Key2 != m_Key2 )
215 IteratorType it = begin();
216 IteratorType itend = end();
217 while ( it != itend )
219 if ( std::string(filename) == ( *it )->GetImageFileName() )
225 m_List.push_back(
new IPLFileSortInfo(filename,
233 void RemoveElementFromList(
const int ElementToRemove)
235 IteratorType it = m_List.begin();
236 IteratorType itend = m_List.end();
239 for ( i = 0; it != itend; i++, it++ )
241 if ( i != ElementToRemove )
253 void sortImageList();
255 void sortImageListAscend();
257 void sortImageListDescend();
259 ListSizeType GetnumImageInfoStructs()
const
261 return m_List.size();