X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vtk%2FvtkGdcm4DSplitter.h;h=482f509c915aee1218925ecba624c976817c2610;hb=76ac46b16fd92d0fb444f786d4946424d9029315;hp=105f2894f6a6714f83307041631731c8b7177129;hpb=68fe377d4e6396c109849870190bb73e27f4043d;p=gdcm.git diff --git a/vtk/vtkGdcm4DSplitter.h b/vtk/vtkGdcm4DSplitter.h index 105f2894..482f509c 100644 --- a/vtk/vtkGdcm4DSplitter.h +++ b/vtk/vtkGdcm4DSplitter.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcm4DSplitter.h,v $ Language: C++ - Date: $Date: 2011/04/08 00:11:36 $ - Version: $Revision: 1.7 $ + Date: $Date: 2011/04/20 15:03:54 $ + Version: $Revision: 1.12 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,68 +23,91 @@ #include #include "gdcmDirList.h" #include "gdcmFile.h" +#include "gdcmSerieHelper.h" typedef bool (*FoncComp)(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2); #define CALL_MEMBER_FONC(object, ptrToFoncMember) ((object).*(ptrToFoncMember)) - + + typedef struct + { + std::string strIPP; + double dist; + GDCM_NAME_SPACE::File *file; + } ELEM; + + //namespace GDCM_NAME_SPACE //{ class vtkGdcm4DSplitter { public: +//----------------------------------------------------------------------------- vtkGdcm4DSplitter(); - ~vtkGdcm4DSplitter(){}; - bool setDirName(std::string &dirName); - bool setVectDirName(std::vector &vectDirName); + ~vtkGdcm4DSplitter(); + + // Locate Data to process + // ====================== + void setRecursive(bool recursive); + bool setDirName (std::string &dirName); + bool setVectDirName (std::vector &vectDirName); bool setVectFileName(std::vector &vectFileName); + + bool setVectGdcmFile(std::vector *vectGdcmFile); + + void setFlipY(bool f) { FlipY = f; } // Split // ===== - inline void setSplitOnPosition() {SplitOnPosition=true; SplitOnOrientation=false; SplitOnTag=false;} - inline void setSplitOnOrientation(){SplitOnPosition=false; SplitOnOrientation=true; SplitOnTag=false;} - inline void setSplitOnTag(unsigned short int splitGroup, unsigned short int splitElem) - {SplitOnPosition=false; SplitOnOrientation=false; SplitOnTag=true; - SplitGroup=splitGroup; SplitElem=splitElem;} - inline void setSplitConvertToFloat(bool conv) {SplitConvertToFloat=conv;} + void setSplitOnPosition(); + void setSplitOnOrientation(); + void setSplitOnTag(unsigned short int splitGroup, unsigned short int splitElem); + + void setSplitConvertToFloat(bool conv); + void setSplitOnly(bool s); + // Sort // ==== - inline void setSortOnPosition() {SortOnPosition=true; SortOnOrientation=false; SortOnTag=false; SortOnFileName=false; SortOnUserFunction=false; - SortOnPosition=true;} + void setSortOnPosition(); // use setSortOnUserFunction, instead! - // inline void setSortOnTag(unsigned short int sortGroup, unsigned short int sortElem) + // void setSortOnTag(unsigned short int sortGroup, unsigned short int sortElem) // {SortOnPosition=false; SortOnOrientation=false; SortOnTag=true; SortOnFileName=false; SortOnUserFunction=false; // SortGroup=sortGroup; SortElem=sortElem;} - inline void setSortOnUserFunction (FoncComp f) - { UserCompareFunction=f; - SortOnPosition=false; SortOnOrientation=false; SortOnTag=false; SortOnFileName=false; SortOnUserFunction=true;} - - inline void setSortConvertToFloat(bool conv) {SortConvertToFloat=conv;} + void setSortOnUserFunction (FoncComp f); - inline void setSortOnFileName() {SortOnPosition=false; SortOnOrientation=false; SortOnTag=false; SortOnFileName=true; SortOnUserFunction=false;} + //void setSortConvertToFloat(bool conv); - inline void setRecursive(bool recursive) { Recursive=recursive;} + void setSortOnFileName(); - // SortOnOrientation : not yet made + // SortOnOrientation : not yet made; IOP sorter missing! //inline void setSortOnOrientation(){SortOnPosition=false; SortOnOrientation=true; SortOnTag=false; SortOnFileName=false; SortOnUserFunction=false;} std::vector *GetImageDataVector(); vtkImageData *GetImageData(); + std::vector< GDCM_NAME_SPACE::FileList *> *GetVectGdcmFileLists(); + bool Go(); protected: private: bool CompareOnSortTag (GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2); bool CompareOnSortTagConvertToFloat(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2); - + void reorgXCoherentFileSetmap (GDCM_NAME_SPACE::XCoherentFileSetmap &xcm); + bool sortVectElem(std::vector *le); + GDCM_NAME_SPACE::FileList * getGdcmFileList(); + // Data // ---- public: protected: private: + + // + // Set by user + // std::string DirName; std::vector VectDirName; std::vector VectFileName; @@ -96,25 +119,37 @@ typedef bool (*FoncComp)(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *f unsigned short int SplitGroup; unsigned short int SplitElem; bool SplitConvertToFloat; - + bool SplitOnly; + bool SortOnPosition; bool SortOnOrientation; - bool SortOnTag; + //bool SortOnTag; bool SortOnFileName; bool SortOnUserFunction; FoncComp UserCompareFunction; - unsigned short int SortGroup; - unsigned short int SortElem; - bool SortConvertToFloat; + //unsigned short int SortGroup; + //unsigned short int SortElem; + //bool SortConvertToFloat; bool Recursive; - int TypeDir; - int TypeResult; + bool FlipY; bool verbose; + + // + // needed, to work + // + int TypeDir; + GDCM_NAME_SPACE::XCoherentFileSetmap xcm; + + // + // may be got by user + // std::vector *ImageDataVector; - vtkImageData *ImageData; + GDCM_NAME_SPACE::FileList *VectGdcmFile; // std::vector of gdcm::File* + + std::vector VectGdcmFileLists; // result of the splitting operation }; //} // end namespace gdcm