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() {}
101 std::string m_ImageFileName;
102 float m_SliceLocation;
113 class ITK_EXPORT IPLFileNameList
116 typedef std::vector< IPLFileSortInfo * > ListType;
117 typedef ListType::iterator IteratorType;
118 typedef size_t ListSizeType;
121 SortGlobalAscend = 0,
122 SortGlobalDescend = 1,
123 SortByNameAscend = 2,
124 SortByNameDescend = 3
138 m_SortOrder = SortGlobalAscend;
141 virtual ~IPLFileNameList()
143 IteratorType it = begin();
144 IteratorType itend = end();
146 while ( it != itend )
155 return m_List.begin();
163 IPLFileSortInfo * operator[](
unsigned int __n)
165 IteratorType it = begin();
166 IteratorType itend = end();
168 for (
unsigned int i = 0; it != itend && i != __n; it++, i++ )
177 ListSizeType NumFiles()
const
179 return m_List.size();
182 bool AddElementToList(
char const *
const filename,
183 const float sliceLocation,
189 const int imageNumber,
193 if ( m_List.empty() )
202 else if ( XDim != m_XDim || YDim != m_YDim )
206 else if(XRes != m_XRes || YRes != m_YRes)
210 else if ( Key1 != m_Key1 || Key2 != m_Key2 )
214 IteratorType it = begin();
215 IteratorType itend = end();
216 while ( it != itend )
218 if ( std::string(filename) == ( *it )->GetImageFileName() )
224 m_List.push_back(
new IPLFileSortInfo(filename,
232 void RemoveElementFromList(
const int ElementToRemove)
234 IteratorType it = m_List.begin();
235 IteratorType itend = m_List.end();
238 for ( i = 0; it != itend; i++, it++ )
240 if ( i != ElementToRemove )
252 void sortImageList();
254 void sortImageListAscend();
256 void sortImageListDescend();
258 ListSizeType GetnumImageInfoStructs()
const
260 return m_List.size();