]> Creatis software - gdcm.git/commitdiff
BUG: Fix Numerical Excption on bcc55
authormalaterre <malaterre>
Wed, 20 Apr 2005 22:04:34 +0000 (22:04 +0000)
committermalaterre <malaterre>
Wed, 20 Apr 2005 22:04:34 +0000 (22:04 +0000)
src/gdcmSerieHelper.cxx

index f0dcdca3366dad1813b5ed90a56903ad257ceb7a..bb7d47ebb264c6e738f4e8ad234a2cee1c7da593 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHelper.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/05 01:37:09 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/04/20 22:04:34 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -285,6 +285,13 @@ bool SerieHelper::ImagePositionPatientOrdering( GdcmFileList *fileList )
    CoherentGdcmFileVector.resize( n );
    // gdcmAssertMacro( CoherentGdcmFileVector.capacity() >= n );
 
+   // Find out if min/max are coherent
+   if( min == max )
+     {
+     gdcmWarningMacro( "Looks like all images have the exact same image position...");
+     return false;
+     }
+
    float step = (max - min)/(n - 1);
    int pos;
    n = 0;