28 #ifndef itkIPLFileNameList_h
29 #define itkIPLFileNameList_h
30 #include "ITKIOIPLExport.h"
40 #define IPLSetMacroDeclaration(name, type) \
41 virtual void Set##name (const type _arg);
44 #define IPLSetMacroDefinition(class, name, type) \
45 void class::Set##name (const type _arg) \
48 CLANG_SUPPRESS_Wfloat_equal \
49 if ( this->m_##name != _arg ) \
52 this->m_##name = _arg; \
57 #define IPLGetMacroDeclaration(name, type) \
58 virtual type Get##name ();
61 #define IPLGetMacroDefinition(class, name, type) \
62 type class::Get##name () \
64 return this->m_##name; \
85 IPLFileSortInfo(
const char *
const filename,
float sliceLocation,
86 int sliceOffset,
int echoNumber,
int imageNumber,
87 void *data = ITK_NULLPTR)
89 m_ImageFileName = filename;
90 m_SliceLocation = sliceLocation;
91 m_SliceOffset = sliceOffset;
92 m_EchoNumber = echoNumber;
93 m_ImageNumber = imageNumber;
97 virtual ~IPLFileSortInfo();
113 std::string m_ImageFileName;
114 float m_SliceLocation;
125 class ITKIOIPL_EXPORT IPLFileNameList
128 typedef std::vector< IPLFileSortInfo * > ListType;
129 typedef ListType::iterator IteratorType;
130 typedef size_t ListSizeType;
133 SortGlobalAscend = 0,
134 SortGlobalDescend = 1,
135 SortByNameAscend = 2,
136 SortByNameDescend = 3
150 m_SortOrder = SortGlobalAscend;
153 virtual ~IPLFileNameList();
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 )
213 else if ( Key1 != m_Key1 || Key2 != m_Key2 )
217 IteratorType it = begin();
218 IteratorType itend = end();
219 while ( it != itend )
221 if ( std::string(filename) == ( *it )->GetImageFileName() )
227 m_List.push_back(
new IPLFileSortInfo(filename,
235 void RemoveElementFromList(
const int ElementToRemove)
237 IteratorType it = m_List.begin();
238 IteratorType itend = m_List.end();
241 for ( i = 0; it != itend; i++, it++ )
243 if ( i != ElementToRemove )
255 void sortImageList();
257 void sortImageListAscend();
259 void sortImageListDescend();
261 ListSizeType GetnumImageInfoStructs()
const
263 return m_List.size();
#define IPLSetMacroDeclaration(name, type)
#define IPLGetMacroDeclaration(name, type)
bool NotAlmostEquals(T1 x1, T2 x2)