28 #ifndef itkIPLFileNameList_h
29 #define itkIPLFileNameList_h
30 #include "ITKIOIPLExport.h"
40 #define IPLSetMacroDeclaration(name, type) virtual void Set##name(const type _arg)
42 #define IPLSetMacroDefinition(class, name, type) \
43 void class ::Set##name(const type _arg) \
46 ITK_GCC_SUPPRESS_Wfloat_equal \
47 if (this->m_##name != _arg) \
49 this->m_##name = _arg; \
53 ITK_MACROEND_NOOP_STATEMENT
56 #define IPLGetMacroDeclaration(name, type) virtual type Get##name()
58 #define IPLGetMacroDefinition(class, name, type) \
59 type class ::Get##name() { return this->m_##name; } \
60 ITK_MACROEND_NOOP_STATEMENT
80 IPLFileSortInfo(
const char *
const filename,
85 void * data =
nullptr)
87 m_ImageFileName = filename;
88 m_SliceLocation = sliceLocation;
89 m_SliceOffset = sliceOffset;
90 m_EchoNumber = echoNumber;
91 m_ImageNumber = imageNumber;
95 virtual ~IPLFileSortInfo();
111 std::string m_ImageFileName{};
112 float m_SliceLocation{};
116 const void * m_Data{};
124 class ITKIOIPL_EXPORT IPLFileNameList
127 using ListType = std::vector<IPLFileSortInfo *>;
128 using IteratorType = ListType::iterator;
129 using ListSizeType = size_t;
133 SortGlobalAscend = 0,
134 SortGlobalDescend = 1,
135 SortByNameAscend = 2,
136 SortByNameDescend = 3
150 m_SortOrder = SortGlobalAscend;
153 virtual ~IPLFileNameList();
158 return m_List.begin();
167 IPLFileSortInfo * operator[](
unsigned int __n)
172 for (
unsigned int i = 0; it != itend && i != __n; it++, i++)
185 return m_List.size();
189 AddElementToList(
char const *
const filename,
190 const float sliceLocation,
196 const int imageNumber,
209 else if (XDim != m_XDim || YDim != m_YDim)
217 else if (Key1 != m_Key1 || Key2 != m_Key2)
225 if (std::string(filename) == (*it)->GetImageFileName())
231 m_List.push_back(
new IPLFileSortInfo(filename,
240 RemoveElementFromList(
const int ElementToRemove)
242 auto it = m_List.begin();
243 auto itend = m_List.end();
246 for (i = 0; it != itend; i++, it++)
248 if (i != ElementToRemove)
264 sortImageListAscend();
267 sortImageListDescend();
270 GetnumImageInfoStructs()
const
272 return m_List.size();