X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHelper.cxx;h=23e60112f8a1c034b658593be36d4c05d34d7194;hb=1f4b804082d56e199031a5380165eff84750f8a8;hp=c205856fcfe747e2f522b4ced5fee425ad68d203;hpb=6b51b22366f878e1050c75a6ebb755bd2ff365c7;p=gdcm.git diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index c205856f..23e60112 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/25 14:52:35 $ - Version: $Revision: 1.30 $ + Date: $Date: 2005/11/08 16:31:21 $ + Version: $Revision: 1.34 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -218,12 +218,12 @@ void SerieHelper::AddGdcmFile(File *header) * @param value value to be checked to exclude File * @param op operator we want to use to check */ -void SerieHelper::AddRestriction(uint16_t group, uint16_t elem, +void SerieHelper::AddRestriction(TagKey const &key, std::string const &value, int op) { ExRule r; - r.group = group; - r.elem = elem; + r.group = key[0]; + r.elem = key[1]; r.value = value; r.op = op; ExRestrictions.push_back( r ); @@ -296,10 +296,10 @@ bool SerieHelper::IsCoherent(FileList *fileSet) FileList::const_iterator it = fileSet->begin(); - int nX = (*it)->GetXSize(); - int nY = (*it)->GetYSize(); - int pixelSize = (*it)->GetPixelSize(); - + int nX = (*it)->GetXSize(); + int nY = (*it)->GetYSize(); + int pixelSize = (*it)->GetPixelSize(); + bool signedPixelData = (*it)->IsSignedPixelData(); it ++; for ( ; it != fileSet->end(); @@ -311,7 +311,9 @@ bool SerieHelper::IsCoherent(FileList *fileSet) return false; if ( (*it)->GetPixelSize() != pixelSize ) return false; - // probabely more is to be checked (?) + if ( (*it)->IsSignedPixelData() != signedPixelData ) + return false; + // probabely more is to be checked (?) } return true; } @@ -425,7 +427,7 @@ XCoherentFileSetmap SerieHelper::SplitOnOrientation(FileList *fileSet) strOrient = ossOrient.str(); ossOrient.str(""); // FIXME : is it a 'cleaner' way to initialize an ostringstream? - + if ( CoherentFileSet.count(strOrient) == 0 ) { gdcmDebugMacro(" New Orientation :[" << strOrient << "]"); @@ -434,7 +436,7 @@ XCoherentFileSetmap SerieHelper::SplitOnOrientation(FileList *fileSet) } // Current Orientation and DICOM header match; add the file: CoherentFileSet[strOrient]->push_back( (*it) ); - } + } return CoherentFileSet; } @@ -497,7 +499,8 @@ XCoherentFileSetmap SerieHelper::SplitOnPosition(FileList *fileSet) ossPosition << pos[i]; } strPosition = ossPosition.str(); - + ossPosition.str(""); + if ( CoherentFileSet.count(strPosition) == 0 ) { gdcmDebugMacro(" New Position :[" << strPosition << "]");