+ SplitOnPosition=false;
+ SplitOnOrientation=false;
+ SplitOnTag=true;
+ SplitGroup=splitGroup;
+ SplitElem=splitElem;
+ }
+
+/**
+ * \brief asks for converting to 'float' the tag values used as a splitting criteria (lexicographic order may not be suitable)
+ */
+ void vtkGdcm4DSplitter::setSplitConvertToFloat(bool conv) {SplitConvertToFloat=conv;}
+
+/**
+ * \brief asks for splitting Filesets according to what was asked for (no sorting, no reading data)
+ */
+ void vtkGdcm4DSplitter::setSplitOnly(bool s)
+ {
+ SplitOnly = s;
+ }
+
+ // Sort criterion
+ // ==============
+ //
+
+/**
+ * \brief asks for IPP sorting each XCoherent gdcm::FILE set
+ */
+ void vtkGdcm4DSplitter::setSortOnPosition()
+ {
+ SortOnPosition=true;
+ SortOnOrientation=false;
+ //SortOnTag=false;
+ SortOnFileName=false;
+ SortOnUserFunction=false;
+ SortOnPosition=true;
+ }
+
+ // use setSortOnUserFunction, instead!
+ // void setSortOnTag(unsigned short int sortGroup, unsigned short int sortElem)
+ // {
+ // SortOnPosition=false;
+ // SortOnOrientation=false;
+ // SortOnTag=true;
+ // SortOnFileName=false;
+ // SortOnUserFunction=false;
+ // SortGroup=sortGroup; SortElem=sortElem;
+ // }
+
+
+/**
+ * \brief sets a user supplied function (comparison)
+ * @param f comparison function
+ */
+ void vtkGdcm4DSplitter::setSortOnUserFunction (FoncComp f)
+ {
+ UserCompareFunction=f;
+ SortOnPosition=false;
+ SortOnOrientation=false;
+ //SortOnTag=false;
+ SortOnFileName=false;
+ SortOnUserFunction=true;
+ }
+
+ // void setSortConvertToFloat(bool conv)
+ // {
+ // SortConvertToFloat=conv;
+ // }
+
+/**
+ * \brief asks for sorting each XCoherent gdcm::FILE set, according to the File names
+ */
+ void vtkGdcm4DSplitter::setSortOnFileName()
+ {
+ SortOnPosition=false;
+ SortOnOrientation=false;
+ //SortOnTag=false;
+ SortOnFileName=true;
+ SortOnUserFunction=false;
+ }
+
+/**
+ * \brief returns a std::vector of gdcm::FileList* (gdcm::FileList : actually, a std::vector of gdcm::File*)
+ */
+ std::vector<GDCM_NAME_SPACE::FileList *> *vtkGdcm4DSplitter::GetVectGdcmFileLists()
+ {
+ if (SplitOnly)
+ return &VectGdcmFileLists;
+
+ GDCM_NAME_SPACE::XCoherentFileSetmap::iterator it;
+ for ( it = xcm.begin();
+ it != xcm.end();
+ ++it)
+ {
+ VectGdcmFileLists.push_back((*it).second);
+ }
+ return &VectGdcmFileLists;
+ }
+
+/**
+ * \brief returns a std::vector of [2D/3D, depending on what was passed] vtkImageData*
+ */
+ std::vector<vtkImageData*> * vtkGdcm4DSplitter::GetImageDataVector()
+ {
+ if (SplitOnly)
+ return NULL;
+ return ImageDataVector;
+ }
+
+/**
+ * \brief when user _knows_ only _one_ vtkImageData* is returned he may be interested in not getting a vector...
+ */
+ vtkImageData *vtkGdcm4DSplitter::GetImageData()
+ {
+ if (SplitOnly)
+ return NULL;
+ return (*ImageDataVector)[0];
+ }
+
+
+// bool vtkGdcm4DSplitter::CompareOnSortTagConvertToFloat(GDCM_NAME_SPACE::File *file1, GDCM_NAME_SPACE::File *file2)
+// {
+// return atof(file1->GetEntryString(vtkGdcm4DSplitter::SortGroup,vtkGdcm4DSplitter::SortElem).c_str()) < atof(file2->GetEntryString(vtkGdcm4DSplitter::SortGroup,vtkGdcm4DSplitter::SortElem).c_str());
+// return atof(file1->GetEntryString(SortGroup,SortElem).c_str()) < atof(file2->GetEntryString(SortGroup,SortElem).c_str());
+// }