diff --git a/Modules/IO/TransformBase/include/itkTransformFileReader.hxx b/Modules/IO/TransformBase/include/itkTransformFileReader.hxx index aed80096528..35da14f3c5f 100644 --- a/Modules/IO/TransformBase/include/itkTransformFileReader.hxx +++ b/Modules/IO/TransformBase/include/itkTransformFileReader.hxx @@ -139,6 +139,14 @@ void TransformFileReaderTemplate m_TransformIO->SetFileName(m_FileName); m_TransformIO->Read(); + if (ioTransformList.empty()) + { + std::ostringstream msg; + msg << "Transform IO: " << m_TransformIO->GetNameOfClass() << std::endl + << " failed to read file: " << this->GetFileName() << std::endl; + itkExceptionMacro( << msg.str() ); + } + // Clear old results. this->m_TransformList.clear(); // If the transform is derived from itk::KernelTransform, the internal matrices