X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHelper.cxx;h=60de9c019f6bf4afc38dab443a772636c50a3763;hb=6c5eca9df49cc2ecbb9b343ec286a91df3998cbf;hp=f025fd036130b2cbf8e5f0561d4def573330adec;hpb=12efe160c7bc15c54a9dd6e1940314205cae919a;p=gdcm.git diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index f025fd03..60de9c01 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 12:40:03 $ - Version: $Revision: 1.29 $ + Date: $Date: 2005/10/27 09:14:15 $ + Version: $Revision: 1.33 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -68,7 +68,7 @@ void SerieHelper::ClearAll() it != l->end(); ++it) { - delete *it; // remove each entry + (*it)->Delete(); // remove each entry } l->clear(); delete l; // remove the container @@ -88,7 +88,7 @@ void SerieHelper::ClearAll() void SerieHelper::AddFileName(std::string const &filename) { // Create a DICOM file - File *header = new File (); + File *header = File::New(); header->SetLoadMode(LoadMode); header->SetFileName( filename ); header->Load(); @@ -139,13 +139,13 @@ void SerieHelper::AddFileName(std::string const &filename) else { // at least one rule was unmatched we need to deallocate the file: - delete header; + header->Delete(); } } else { gdcmWarningMacro("Could not read file: " << filename ); - delete header; + header->Delete(); } } @@ -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 << "]");