1 /*=========================================================================
4 Module: $RCSfile: vtkGdcm4DSplitter.h,v $
6 Date: $Date: 2011/04/13 13:30:58 $
7 Version: $Revision: 1.9 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef _VTKGDCM4DSPLITTER_H_
20 #define _VTKGDCM4DSPLITTER_H_
23 #include <vtkImageData.h>
24 #include "gdcmDirList.h"
26 #include "gdcmSerieHelper.h"
28 typedef bool (*FoncComp)(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2);
30 #define CALL_MEMBER_FONC(object, ptrToFoncMember) ((object).*(ptrToFoncMember))
36 GDCM_NAME_SPACE::File *file;
40 //namespace GDCM_NAME_SPACE
42 class vtkGdcm4DSplitter {
44 //-----------------------------------------------------------------------------
49 // Locate Data to process
50 // ======================
51 void setRecursive(bool recursive);
52 bool setDirName (std::string &dirName);
53 bool setVectDirName (std::vector<std::string> &vectDirName);
54 bool setVectFileName(std::vector<std::string> &vectFileName);
56 bool setVectGdcmFile(std::vector<GDCM_NAME_SPACE::File *> *vectGdcmFile);
60 void setSplitOnPosition();
61 void setSplitOnOrientation();
62 void setSplitOnTag(unsigned short int splitGroup, unsigned short int splitElem);
64 void setSplitConvertToFloat(bool conv);
66 void setSplitOnly(bool s);
70 void setSortOnPosition();
71 // use setSortOnUserFunction, instead!
72 // void setSortOnTag(unsigned short int sortGroup, unsigned short int sortElem)
73 // {SortOnPosition=false; SortOnOrientation=false; SortOnTag=true; SortOnFileName=false; SortOnUserFunction=false;
74 // SortGroup=sortGroup; SortElem=sortElem;}
76 void setSortOnUserFunction (FoncComp f);
78 //void setSortConvertToFloat(bool conv);
80 void setSortOnFileName();
82 // SortOnOrientation : not yet made; IOP sorter missing!
83 //inline void setSortOnOrientation(){SortOnPosition=false; SortOnOrientation=true; SortOnTag=false; SortOnFileName=false; SortOnUserFunction=false;}
85 std::vector<vtkImageData*> *GetImageDataVector();
86 vtkImageData *GetImageData();
88 std::vector< GDCM_NAME_SPACE::FileList *> *GetVectGdcmFileLists();
94 bool CompareOnSortTag (GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2);
95 bool CompareOnSortTagConvertToFloat(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2);
96 void reorgXCoherentFileSetmap (GDCM_NAME_SPACE::XCoherentFileSetmap &xcm);
97 bool sortVectElem(std::vector<ELEM> *le);
105 std::vector<std::string> VectDirName;
106 std::vector<std::string> VectFileName;
108 bool SplitOnPosition;
109 bool SplitOnOrientation;
112 unsigned short int SplitGroup;
113 unsigned short int SplitElem;
114 bool SplitConvertToFloat;
118 bool SortOnOrientation;
121 bool SortOnUserFunction;
123 FoncComp UserCompareFunction;
125 unsigned short int SortGroup;
126 unsigned short int SortElem;
127 bool SortConvertToFloat;
133 std::vector<vtkImageData*> *ImageDataVector;
134 vtkImageData *ImageData;
135 //std::vector<GDCM_NAME_SPACE::File *> VectGdcmFile;
136 GDCM_NAME_SPACE::FileList *VectGdcmFile;
137 GDCM_NAME_SPACE::XCoherentFileSetmap xcm;
138 //std::vector<std::vector<GDCM_NAME_SPACE::File *> > VectGdcmFileLists;
139 std::vector<GDCM_NAME_SPACE::FileList *> VectGdcmFileLists;
142 //} // end namespace gdcm
144 //-----------------------------------------------------------------------------