28 #ifndef itkIPLFileNameList_h
29 #define itkIPLFileNameList_h
30 #include "ITKIOIPLExport.h"
39 #define IPLSetMacroDeclaration(name, type) \
40 virtual void Set##name (const type _arg);
43 #define IPLSetMacroDefinition(class, name, type) \
44 void class::Set##name (const type _arg) \
46 if ( this->m_##name != _arg ) \
48 this->m_##name = _arg; \
53 #define IPLGetMacroDeclaration(name, type) \
54 virtual type Get##name ();
57 #define IPLGetMacroDefinition(class, name, type) \
58 type class::Get##name () \
60 return this->m_##name; \
81 IPLFileSortInfo(
const char *
const filename,
float sliceLocation,
82 int sliceOffset,
int echoNumber,
int imageNumber,
83 void *data = ITK_NULLPTR)
85 m_ImageFileName = filename;
86 m_SliceLocation = sliceLocation;
87 m_SliceOffset = sliceOffset;
88 m_EchoNumber = echoNumber;
89 m_ImageNumber = imageNumber;
93 virtual ~IPLFileSortInfo();
109 std::string m_ImageFileName;
110 float m_SliceLocation;
121 class ITKIOIPL_EXPORT IPLFileNameList
124 typedef std::vector< IPLFileSortInfo * > ListType;
125 typedef ListType::iterator IteratorType;
126 typedef size_t ListSizeType;
129 SortGlobalAscend = 0,
130 SortGlobalDescend = 1,
131 SortByNameAscend = 2,
132 SortByNameDescend = 3
146 m_SortOrder = SortGlobalAscend;
149 virtual ~IPLFileNameList();
153 return m_List.begin();
161 IPLFileSortInfo * operator[](
unsigned int __n)
163 IteratorType it = begin();
164 IteratorType itend = end();
166 for (
unsigned int i = 0; it != itend && i != __n; it++, i++ )
175 ListSizeType NumFiles()
const
177 return m_List.size();
180 bool AddElementToList(
char const *
const filename,
181 const float sliceLocation,
187 const int imageNumber,
191 if ( m_List.empty() )
200 else if ( XDim != m_XDim || YDim != m_YDim )
204 else if(XRes != m_XRes || YRes != m_YRes)
208 else if ( Key1 != m_Key1 || Key2 != m_Key2 )
212 IteratorType it = begin();
213 IteratorType itend = end();
214 while ( it != itend )
216 if ( std::string(filename) == ( *it )->GetImageFileName() )
222 m_List.push_back(
new IPLFileSortInfo(filename,
230 void RemoveElementFromList(
const int ElementToRemove)
232 IteratorType it = m_List.begin();
233 IteratorType itend = m_List.end();
236 for ( i = 0; it != itend; i++, it++ )
238 if ( i != ElementToRemove )
250 void sortImageList();
252 void sortImageListAscend();
254 void sortImageListDescend();
256 ListSizeType GetnumImageInfoStructs()
const
258 return m_List.size();
#define IPLSetMacroDeclaration(name, type)
#define IPLGetMacroDeclaration(name, type)