From 8eed4a06e372d143c648d9e89b3661141bd9c262 Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 30 Oct 2007 14:51:00 +0000 Subject: [PATCH] Initializing DropDuplicatePositions to false should help! --- src/gdcmSerieHelper.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index 28e4218e..eb6dd6a0 100644 --- a/src/gdcmSerieHelper.cxx +++ b/src/gdcmSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2007/10/30 11:11:04 $ - Version: $Revision: 1.63 $ + Date: $Date: 2007/10/30 14:51:00 $ + Version: $Revision: 1.64 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -43,7 +43,7 @@ SerieHelper::SerieHelper() ClearAll(); UserLessThanFunction = 0; DirectOrder = true; - + DropDuplicatePositions = false; } /** @@ -648,6 +648,8 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList ) bool first = true; ZSpacing = -1.0; // will be updated if process doesn't fail + gdcmDebugMacro("============================================DropDuplicatePositions : " << DropDuplicatePositions ); + std::multimap distmultimap; // Use a multimap to sort the distances from 0,0,0 for ( FileList::const_iterator @@ -720,6 +722,8 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList ) } } + gdcmDebugMacro("After parsing vector, nb of elements : " << fileList->size() ); + // Find out if min/max are coherent if ( min == max ) { @@ -735,6 +739,9 @@ bool SerieHelper::ImagePositionPatientOrdering( FileList *fileList ) it2 != distmultimap.end(); ++it2) { + + gdcmDebugMacro("Check if image shares a common position : " << (*it2).second->GetFileName() ); + if (distmultimap.count((*it2).first) != 1) { gdcmWarningMacro("File: [" -- 2.45.1