]> Creatis software - clitk.git/commitdiff
Force gdcm to find spacing
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 19 Jan 2017 14:47:37 +0000 (15:47 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 19 Jan 2017 14:47:37 +0000 (15:47 +0100)
Used with preclinical CT image to find the z-spacing

common/vvImageReader.cxx

index 0e4c22ba05b468522dace0bf3b08ee2412652d08..5e7d90364dc6ee28e067cfd18c7aa0a8169a07a4 100644 (file)
@@ -19,6 +19,7 @@
 #define VVIMAGEREADER_CXX
 
 #include <itkImageFileReader.h>
+#include "gdcmImageHelper.h"
 #include "vvImageReader.h"
 #include "vvImageReader.txx"
 #include "clitkTransformUtilities.h"
@@ -57,6 +58,7 @@ void vvImageReader::Update(LoadedImageType type)
     mLastError="Unable to read file.";
   } else {
     reader->SetFileName(mInputFilenames[0]);
+    gdcm::ImageHelper::SetForcePixelSpacing(true);
     reader->ReadImageInformation();
     if (mInputFilenames.size() > 1)
       Update(reader->GetNumberOfDimensions()+1,reader->GetComponentTypeAsString(reader->GetComponentType()),type);