From f20f0de1b77ae95ed4a1183ba39e51e35aa4db51 Mon Sep 17 00:00:00 2001 From: malaterre Date: Tue, 22 Nov 2005 20:28:33 +0000 Subject: [PATCH] ENH: I cannot remember what was the bug but since noone cares just committing --- src/gdcmFile.cxx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 3afec3bc..57b1ba6a 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.cxx,v $ Language: C++ - Date: $Date: 2005/11/21 16:28:06 $ - Version: $Revision: 1.305 $ + Date: $Date: 2005/11/22 20:28:33 $ + Version: $Revision: 1.306 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -600,7 +600,6 @@ float File::GetZSpacing() // if no 'Spacing Between Slices' is found, // we assume slices join together // (no overlapping, no interslice gap) - // if they don't, we're fucked up entry = GetDataEntry(0x0018,0x0050); if( entry ) { @@ -613,6 +612,21 @@ float File::GetZSpacing() else gdcmWarningMacro("Unfound Slice Thickness (0018,0050)"); + // if no 'Spacing Between Slices' is found, + // we assume slices join together + // (no overlapping, no interslice gap) + entry = GetDataEntry(0x3004,0x000c); + if( entry ) + { + float z1 = (float)entry->GetValue(0); + float z2 = (float)entry->GetValue(1); + zspacing = z2 - z1; // can be negative... + + if ( zspacing == 0.0 ) + zspacing = 1.0; + return zspacing; + } + return zspacing; } -- 2.48.1