X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHelper.cxx;h=08916637ed24de986f955a625e35d3b1e61806f9;hb=9f370e10404b477add75840ccfee5d575ca21e16;hp=984298943cdbe53344797d776563e58c7ee02fae;hpb=a327799cbf00b337c8ae66223b4554fd83633ff9;p=gdcm.git diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index 98429894..08916637 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2005/10/17 15:05:44 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/10/23 15:04:26 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -54,8 +54,8 @@ SerieHelper::~SerieHelper() } /** - * \brief - Preventively, clear everything at constructor time. - * - use it at destructor time. + * \brief Preventively, clear everything at constructor time. + * ( use it at destructor time.) */ void SerieHelper::ClearAll() { @@ -106,10 +106,11 @@ void SerieHelper::AddFileName(std::string const &filename) ++it2) { const ExRule &r = *it2; - s = header->GetEntryValue( r.group, r.elem ); + s = header->GetEntryString( r.group, r.elem ); if ( !Util::CompareDicomString(s, r.value.c_str(), r.op) ) { // Argh ! This rule is unmatched; let's just quit + allrules = 0; break; } @@ -121,10 +122,11 @@ void SerieHelper::AddFileName(std::string const &filename) // Let's add it! // 0020 000e UI REL Series Instance UID - const std::string &uid = header->GetEntryValue (0x0020, 0x000e); + const std::string &uid = header->GetEntryString(0x0020, 0x000e); // if uid == GDCM_UNFOUND then consistently we should find GDCM_UNFOUND // no need here to do anything special + if ( SingleSerieUIDFileSetHT.count(uid) == 0 ) { gdcmDebugMacro(" New Serie UID :[" << uid << "]"); @@ -152,7 +154,7 @@ void SerieHelper::AddFileName(std::string const &filename) * of the gdcm::SerieHelper. * \warning : this method should be used by aware users only! * Passing a gdcm::File* has the same effect than passing a file name! - * \TODO : decide which one is wrong (the method, or the commentary)! + * \todo : decide which one is wrong (the method, or the commentary)! * the following comment doesn't match the method :-( * User is supposed to know the files he want to deal with * and consider them they belong to the same Serie @@ -228,18 +230,6 @@ void SerieHelper::AddRestriction(uint16_t group, uint16_t elem, } #ifndef GDCM_LEGACY_REMOVE -/** - * \brief add a rules for restricting a DICOM file to be in the serie we are - * trying to find. For example you can select only the DICOM file from a - * directory which would have a particular EchoTime==4.0. - * This method is a user level, value is not required to be formatted as a DICOM - * string - * @param group Group number of the target tag. - * @param elem Element number of the target tag. - * @param value value to be checked to exclude File - * @deprecated use : AddRestriction(uint16_t group, uint16_t elem, - * std::string const &value, int op); - */ void SerieHelper::AddRestriction(TagKey const &key, std::string const &value) { Rule r; @@ -327,11 +317,7 @@ bool SerieHelper::IsCoherent(FileList *fileSet) } #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,12 +326,7 @@ FileList *SerieHelper::GetFirstCoherentFileList() 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,12 +337,7 @@ FileList *SerieHelper::GetNextCoherentFileList() return NULL; } -/** - * \brief accessor (DEPRECATED : use GetSingleSerieUIDFileSet ) - * Warning : 'coherent' means here they have the same Serie UID - * @param SerieUID SerieUID - * \return pointer to the FileList if found, otherwhise NULL - */ + FileList *SerieHelper::GetCoherentFileList(std::string SerieUID) { if ( SingleSerieUIDFileSetHT.count(SerieUID) == 0 ) @@ -486,11 +462,11 @@ XCoherentFileSetmap SerieHelper::SplitOnPosition(FileList *fileSet) // 0020,0032 : Image Position Patient // 0020,0030 : Image Position (RET) - std::string strImPos = (*it)->GetEntryValue(0x0020,0x0032); + strImPos = (*it)->GetEntryString(0x0020,0x0032); if ( strImPos == GDCM_UNFOUND) { gdcmWarningMacro( "Unfound Image Position Patient (0020,0032)"); - strImPos = (*it)->GetEntryValue(0x0020,0x0030); // For ACR-NEMA images + strImPos = (*it)->GetEntryString(0x0020,0x0030); // For ACR-NEMA images if ( strImPos == GDCM_UNFOUND ) { gdcmWarningMacro( "Unfound Image Position (RET) (0020,0030)"); @@ -535,11 +511,13 @@ XCoherentFileSetmap SerieHelper::SplitOnPosition(FileList *fileSet) * \brief Splits a SingleSerieUID File set Coherent according to the * 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 * \return std::map of 'Xcoherent' File sets */ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet, - uint16_t group, uint16_t element) + uint16_t group, uint16_t elem) { XCoherentFileSetmap CoherentFileSet; @@ -559,7 +537,7 @@ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet, // 0020,0032 : Image Position Patient // 0020,0030 : Image Position (RET) - std::string strTagValue = (*it)->GetEntryValue(group,element); + strTagValue = (*it)->GetEntryString(group,elem); if ( CoherentFileSet.count(strTagValue) == 0 ) { @@ -569,7 +547,7 @@ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet, } // Current Tag value and DICOM header match; add the file: CoherentFileSet[strTagValue]->push_back( (*it) ); - } + } return CoherentFileSet; } @@ -583,8 +561,9 @@ XCoherentFileSetmap SerieHelper::SplitOnTagValue(FileList *fileSet, * We may order, considering : * -# Image Position Patient * -# Image Number + * -# File Name * -# More to come :-) - * WARNING : FileList = std::vector + * \note : FileList = std::vector * @param fileList Coherent File list (same Serie UID) to sort * @return false only if the header is bugged ! */