Open RivettiLuciano opened 2 years ago
I had some problems to get the displacement field of a registration. The registration work well but when I use TransformixImageFilter to get the displacement field I get an error. Below the code I'm using:
CT = sitk.ReadImage('',sitk.sitkFloat32) CBCT = sitk.ReadImage('',sitk.sitkFloat32) elastixImageFilter = sitk.ElastixImageFilter() elastixImageFilter.LogToFileOff() elastixImageFilter.LogToConsoleOff() elastixImageFilter.SetOutputDirectory(ElastixOutputFile) elastixImageFilter.SetFixedImage(CBCT) parametermap = elastixImageFilter.ReadParameterFile(Parameter_File) elastixImageFilter.SetParameterMap(parametermap) elastixImageFilter.SetMovingImage(CT) elastixImageFilter.Execute() transformixImageFilter = sitk.TransformixImageFilter() transformixImageFilter.SetTransformParameterMap(elastixImageFilter.GetTransformParameterMap()) transformixImageFilter.ComputeDeformationFieldOn() transformixImageFilter.Execute()
The Parameter_File I used can be found here
Error:
RuntimeError: Exception thrown in SimpleITK TransformixImageFilter_Execute: /mnt/Luco/Modules/Elastix/SimpleElastix/Code/Elastix/src/sitkTransformixImageFilterImpl.cxx:116: sitk::ERROR: itk::ExceptionObject (0x564e638b7190) Location: "unknown" File: /mnt/Luco/Modules/Elastix/Build/ITK-prefix/include/ITK-5.1/itkImageBase.hxx Line: 184 Description: itk::ERROR: Image(0x564e63aa0300): Bad direction, determinant is 0. Direction is 1 0 0 0
I had some problems to get the displacement field of a registration. The registration work well but when I use TransformixImageFilter to get the displacement field I get an error. Below the code I'm using:
The Parameter_File I used can be found here
Error:
RuntimeError: Exception thrown in SimpleITK TransformixImageFilter_Execute: /mnt/Luco/Modules/Elastix/SimpleElastix/Code/Elastix/src/sitkTransformixImageFilterImpl.cxx:116: sitk::ERROR: itk::ExceptionObject (0x564e638b7190) Location: "unknown" File: /mnt/Luco/Modules/Elastix/Build/ITK-prefix/include/ITK-5.1/itkImageBase.hxx Line: 184 Description: itk::ERROR: Image(0x564e63aa0300): Bad direction, determinant is 0. Direction is 1 0 0 0