28 #ifndef __itkIPLFileNameList_h
29 #define __itkIPLFileNameList_h
30 #include "ITKIOIPLExport.h"
39 #define IPLSetMacro(name, type) \
40 virtual void Set##name (const type _arg) \
42 if ( this->m_##name != _arg ) \
44 this->m_##name = _arg; \
50 #define IPLGetMacro(name, type) \
51 virtual type Get##name () \
53 return this->m_##name; \
75 IPLFileSortInfo(
const char *
const filename,
float sliceLocation,
76 int sliceOffset,
int echoNumber,
int imageNumber,
77 void *data = ITK_NULLPTR)
79 m_ImageFileName = filename;
80 m_SliceLocation = sliceLocation;
81 m_SliceOffset = sliceOffset;
82 m_EchoNumber = echoNumber;
83 m_ImageNumber = imageNumber;
87 virtual ~IPLFileSortInfo() {}
103 std::string m_ImageFileName;
104 float m_SliceLocation;
115 class ITKIOIPL_EXPORT IPLFileNameList
118 typedef std::vector< IPLFileSortInfo * > ListType;
119 typedef ListType::iterator IteratorType;
120 typedef size_t ListSizeType;
123 SortGlobalAscend = 0,
124 SortGlobalDescend = 1,
125 SortByNameAscend = 2,
126 SortByNameDescend = 3
140 m_SortOrder = SortGlobalAscend;
143 virtual ~IPLFileNameList()
145 IteratorType it = begin();
146 IteratorType itend = end();
148 while ( it != itend )
157 return m_List.begin();
165 IPLFileSortInfo * operator[](
unsigned int __n)
167 IteratorType it = begin();
168 IteratorType itend = end();
170 for (
unsigned int i = 0; it != itend && i != __n; it++, i++ )
179 ListSizeType NumFiles()
const
181 return m_List.size();
184 bool AddElementToList(
char const *
const filename,
185 const float sliceLocation,
191 const int imageNumber,
195 if ( m_List.empty() )
204 else if ( XDim != m_XDim || YDim != m_YDim )
208 else if(XRes != m_XRes || YRes != m_YRes)
212 else if ( Key1 != m_Key1 || Key2 != m_Key2 )
216 IteratorType it = begin();
217 IteratorType itend = end();
218 while ( it != itend )
220 if ( std::string(filename) == ( *it )->GetImageFileName() )
226 m_List.push_back(
new IPLFileSortInfo(filename,
234 void RemoveElementFromList(
const int ElementToRemove)
236 IteratorType it = m_List.begin();
237 IteratorType itend = m_List.end();
240 for ( i = 0; it != itend; i++, it++ )
242 if ( i != ElementToRemove )
254 void sortImageList();
256 void sortImageListAscend();
258 void sortImageListDescend();
260 ListSizeType GetnumImageInfoStructs()
const
262 return m_List.size();
#define IPLGetMacro(name, type)
#define IPLSetMacro(name, type)