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,
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 using ListType = std::vector< IPLFileSortInfo * >;
129 using IteratorType = ListType::iterator;
130 using ListSizeType = size_t;
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)
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 )
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 auto it = m_List.begin();
238 auto 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)