X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHelper.cxx;h=d16d52635b5c573f5d25f34233d97f99736d9f00;hb=76bb7282f2aee8ff167483c0ccf3397769b21326;hp=a2610d05dd3686d6217e295c577f6aff64bc7474;hpb=40652dbd656d93e590c21217849493f4db0c80eb;p=gdcm.git diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index a2610d05..d16d5263 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2006/03/30 16:41:22 $ - Version: $Revision: 1.48 $ + Date: $Date: 2006/05/30 08:10:19 $ + Version: $Revision: 1.53 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,7 +19,7 @@ #include "gdcmSerieHelper.h" #include "gdcmDirList.h" #include "gdcmFile.h" -#include "gdcmDictEntry.h" // for TranslateToKey +//#include "gdcmDictEntry.h" // for TranslateToKey : no more ! #include "gdcmDebug.h" #include "gdcmUtil.h" @@ -163,7 +163,7 @@ bool SerieHelper::AddFile(File *header) if ( SingleSerieUIDFileSetHT.count(id) == 0 ) { - gdcmDebugMacro(" New Serie UID :[" << id << "]"); + gdcmDebugMacro(" New/gdcmSerieHelper.cxx Serie UID :[" << id << "]"); // create a std::list in 'id' position SingleSerieUIDFileSetHT[id] = new FileList; } @@ -209,7 +209,7 @@ void SerieHelper::AddRestriction(TagKey const &key) ExRefine.push_back( r ); } -#ifndef GDCM_LEGACY_REMOVE +//#ifndef GDCM_LEGACY_REMOVE /** * \brief add a rule for restricting a DICOM file to be in the serie we are * trying to find. For example you can select only the DICOM files from a @@ -223,13 +223,15 @@ void SerieHelper::AddRestriction(TagKey const &key) * @deprecated use : AddRestriction(TagKey const &key, * std::string const &value, int op); */ + void SerieHelper::AddRestriction(uint16_t group, uint16_t elem, std::string const &value, int op) { TagKey t(group, elem); AddRestriction(t, value, op); } -#endif + +//#endif /** * \brief add an extra 'SerieDetail' for building a 'Serie Identifier' @@ -274,7 +276,10 @@ void SerieHelper::SetDirectory(std::string const &dir, bool recursive) */ void SerieHelper::OrderFileList(FileList *fileSet) { - + // Only computed during ImagePositionPatientOrdering + // (need to sort the FileList using IPP and IOP !) + ZSpacing = -1.0; + if ( SerieHelper::UserLessThanFunction ) { UserOrdering( fileSet ); @@ -327,12 +332,13 @@ bool SerieHelper::IsCoherent(FileList *fileSet) return true; } -#ifndef GDCM_LEGACY_REMOVE +//#ifndef GDCM_LEGACY_REMOVE /** * \brief accessor (DEPRECATED : use GetFirstSingleSerieUIDFileSet ) * Warning : 'coherent' means here they have the same Serie UID * @return The first FileList if found, otherwhise NULL */ + /* FileList *SerieHelper::GetFirstCoherentFileList() { ItFileSetHt = SingleSerieUIDFileSetHT.begin(); @@ -340,13 +346,14 @@ FileList *SerieHelper::GetFirstCoherentFileList() return ItFileSetHt->second; return NULL; } - +*/ /** * \brief accessor (DEPRECATED : use GetNextSingleSerieUIDFileSet ) * Warning : 'coherent' means here they have the same Serie UID * \note : meaningfull only if GetFirstCoherentFileList() already called * @return The next FileList if found, otherwhise NULL */ + /* FileList *SerieHelper::GetNextCoherentFileList() { gdcmAssertMacro (ItFileSetHt != SingleSerieUIDFileSetHT.end()); @@ -356,6 +363,7 @@ FileList *SerieHelper::GetNextCoherentFileList() return ItFileSetHt->second; return NULL; } +*/ /** * \brief accessor (DEPRECATED : use GetSingleSerieUIDFileSet ) @@ -363,13 +371,15 @@ FileList *SerieHelper::GetNextCoherentFileList() * @param SerieUID SerieUID * \return pointer to the FileList if found, otherwhise NULL */ + /* FileList *SerieHelper::GetCoherentFileList(std::string SerieUID) { if ( SingleSerieUIDFileSetHT.count(SerieUID) == 0 ) return 0; return SingleSerieUIDFileSetHT[SerieUID]; } -#endif +*/ +//#endif /** @@ -539,7 +549,7 @@ XCoherentFileSetmap SerieHelper::SplitOnPosition(FileList *fileSet) * value of a given Tag * @param fileSet File Set to be splitted * @param group group number of the target Element - * @param elem element number of the target Element + * @param element element number of the target Element * \return std::map of 'Xcoherent' File sets */ @@ -599,8 +609,6 @@ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet, bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList ) //based on Jolinda Smith's algorithm { -gdcmDebugMacro( "In ImagePositionPatientOrdering()" << std::endl ); -std::cout << "In ImagePositionPatientOrdering()" << std::endl; //Tags always use the same coordinate system, where "x" is left //to right, "y" is posterior to anterior, and "z" is foot to head (RAH). @@ -1031,5 +1039,14 @@ void SerieHelper::Sort(FileList *fileList, bool (*pt2Func)( File *file1, File *f std::sort(fileList->begin(), fileList->end(), pt2Func ); } +/* +#ifndef GDCM_LEGACY_REMOVE +bool SerieHelper::AddGdcmFile(File* header) +{ + return AddFile(header); +} +#endif +*/ + //----------------------------------------------------------------------------- } // end namespace gdcm