]> Creatis software - clitk.git/blobdiff - common/vvImageReader.cxx
Add define to avoid vtk warning on mac
[clitk.git] / common / vvImageReader.cxx
index f4f1a907214912b61b4bbe295a1c2652c6359c8e..ddc4ad3833ae2e60050fee3debd5c58e106ee4c7 100644 (file)
@@ -161,7 +161,15 @@ void vvImageReader::ReadMatImageTransform()
   if(f.is_open()) {
     f.close();
 
-    itk::Matrix<double, 4, 4> itkMat = clitk::ReadMatrix3D(filename);
+    itk::Matrix<double, 4, 4> itkMat;
+    itkMat.SetIdentity();
+    try {
+      itkMat = clitk::ReadMatrix3D(filename);
+    }
+    catch (itk::ExceptionObject & err) {
+      itkWarningMacro(<< "Found " << filename
+                      << " but this is not a 4x4 matrix so it is ignored.");
+    }
 
     vtkSmartPointer<vtkMatrix4x4> matrix = vtkSmartPointer<vtkMatrix4x4>::New();
     matrix->Identity();