Open IsaacLord opened 4 years ago
After two image correction in loop i got the following error:
RuntimeError Traceback (most recent call last)
in 19 corrector.SetDebug(True) 20 ---> 21 output = corrector.Execute(inputImage,maskImage) 22 23 sitk.WriteImage( maskImage, os.path.join(baseDir, f[:3]+'_BC' +'.'+ 'nii.gz'))
C:\ProgramData\Anaconda3\lib\site-packages\SimpleITK\SimpleITK.py in Execute(self, *args) 51745 51746 """
51747 return _SimpleITK.N4BiasFieldCorrectionImageFilter_Execute(self, *args) 51748 51749 N4BiasFieldCorrectionImageFilter_swigregister = _SimpleITK.N4BiasFieldCorrectionImageFilter_swigregister
RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrectionImageFilter_Execute: d:\a\1\sitk-build\itk-prefix\include\itk-4.13\itkImageToImageFilter.hxx:241: itk::ERROR: SubtractImageFilter(000001E58DCBF500): Inputs do not occupy the same physical space! InputImage Origin: [8.0516953e+01, -1.3090556e+02, 1.4494916e+02], InputImage_1 Origin: [2.3951695e+02, -3.4590556e+02, 3.9994916e+02] Tolerance: 1.0000000e-06 InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], InputImage_1 Spacing: [2.1500000e+02, 2.5500000e+02, 1.5900000e+02] Tolerance: 1.0000000e-06
Thanks for your advice. I will change the code later.
Im trying to apply N4BiasFieldCorrection on multiple image (more than 100) i just put this code on for loop how with different methods, however i got the following errors. It run on one by one images however in loop i got the errors.
code:
Error:
51749 N4BiasFieldCorrectionImageFilter_swigregister = _SimpleITK.N4BiasFieldCorrectionImageFilter_swigregister
RuntimeError: Exception thrown in SimpleITK N4BiasFieldCorrectionImageFilter_Execute: d:\a\1\sitk-build\itk-prefix\include\itk-4.13\itkImageToImageFilter.hxx:241: itk::ERROR: SubtractImageFilter(000001E58DCBF980): Inputs do not occupy the same physical space! InputImage Origin: [8.0516953e+01, -1.3090556e+02, 1.4494916e+02], InputImage_1 Origin: [1.9875000e+01, -2.6875000e+01, 3.1875000e+01] Tolerance: 1.0000000e-06 InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], InputImage_1 Spacing: [2.6875000e+01, 3.1875000e+01, 1.9875000e+01] Tolerance: 1.0000000e-06.
implementation:
First method:
second method: