Closed yuanpengpeng closed 1 month ago
Hello @yuanpengpeng,
You can first perform rigid/affine registration, then resample the moving image using the result of that transformation. Then register the fixed image to the resampled moving image using the Demons algorithm. Finally you can resample the original moving image using the composition of the demons and rigid transformation.
Hello @yuanpengpeng,
You can first perform rigid/affine registration, then resample the moving image using the result of that transformation. Then register the fixed image to the resampled moving image using the Demons algorithm. Finally you can resample the original moving image using the composition of the demons and rigid transformation.
In fact, my steps are as follows. The two three-dimensional CT lung images are different in size and spacing. I first perform spacing to keep the items the same, and then resize them to crop or pad them into the same size. Then perform rigid registration. The result of rigid registration seems to be aligned in three-dimensional space. Then at this time, the image origin and image direction of the two images are different. This is obvious. Because the two images were rigidly registered, the diffeomorphism method of demons registration was finally used, and then the image origin and image direction of the two images were reported to be different, but I used another filter DemonsRegistrationFilter, there is no such error, which is very strange.
I reported an error when using the DiffeomorphicDemonsRegistrationFilter filter for non-rigid registration.
Traceback (most recent call last): File "K:\谷歌下载缓存内容\SimpleITK-Notebooks-master\Python\diffeomorpicDemon.py", line 230, in
smoothing_sigmas=[8, 4],
File "K:\谷歌下载缓存内容\SimpleITK-Notebooks-master\Python\diffeomorpicDemon.py", line 193, in multiscale_demons
f_image, m_image, initial_displacement_field
File "E:\anaconda\envs\python37\lib\site-packages\SimpleITK\SimpleITK.py", line 22402, in Execute
return _SimpleITK.DiffeomorphicDemonsRegistrationFilter_Execute(self, *args)
RuntimeError: Exception thrown in SimpleITK DiffeomorphicDemonsRegistrationFilter_Execute: d:\a\1\sitk-build\itk-prefix\include\itk-5.3\itkImageToImageFilter.hxx:219:
ITK ERROR: DiffeomorphicDemonsRegistrationFilter(000001443D3672E0): Inputs do not occupy the same physical space!
InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], InputImageMovingImage Origin: [-7.5815767e+00, 5.4486262e+01, -4.4952166e+00]
Tolerance: 2.5147638e-06
InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00
0.0000000e+00 1.0000000e+00 0.0000000e+00
0.0000000e+00 0.0000000e+00 1.0000000e+00
, InputImageMovingImage Direction: 9.9922094e-01 3.5710354e-02 -1.6801463e-02
-3.6092556e-02 9.9908321e-01 -2.3023120e-02
1.5963896e-02 2.3611591e-02 9.9959374e-01
Process finished with exit code 1
It seems that the image origin and image direction of the two images are inconsistent, but the two images are not aligned in the initial state, so Perform two rigid registrations. For example, the image origin and image direction of the two images are different. What should I do?