From: malaterre Date: Wed, 20 Apr 2005 22:04:34 +0000 (+0000) Subject: BUG: Fix Numerical Excption on bcc55 X-Git-Tag: Version1.2.bp~767 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=27e4eedc79e0b16ee8decc2fcc94474012f15558;p=gdcm.git BUG: Fix Numerical Excption on bcc55 --- diff --git a/src/gdcmSerieHelper.cxx b/src/gdcmSerieHelper.cxx index f0dcdca3..bb7d47eb 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/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;