SimpleElastix icon indicating copy to clipboard operation
SimpleElastix copied to clipboard

How can I get a intuitive Mean result image?

Open ZhenhongDu opened this issue 4 years ago • 2 comments

Hello, I am a freshman to SimpleElastix,how can I get a intuitive Mean result image like this ?⬇ image

The code I used is as follows:

import SimpleITK as sitk

elastixImageFilter = sitk.ElastixImageFilter()
elastixImageFilter.SetFixedImage(sitk.ReadImage("fixedImage.nii")
elastixImageFilter.SetMovingImage(sitk.ReadImage("movingImage.nii")
elastixImageFilter.SetParameterMap(sitk.GetDefaultParameterMap("affine"))
elastixImageFilter.Execute()
res_img = elastixImageFilter.GetResultImage()

And I plot 'res_img' with matplotlib ,the result is just a single image after registration image I notice that we can use cimg = sitk.Compose(simg1, simg2, simg1 // 2. + simg2 // 2.) to achieve a simliar effect in SimpleITK, However ,I do not have the the image which is the movingImage after registration in SimpleElastix ,and I only get the res_img. Is 'res_img' equal to moving image after transforming?

ZhenhongDu avatar Oct 17 '20 04:10 ZhenhongDu

Hi @ddddg929 yes, the result image is the transformed moving image. And the intuitive mean image is indeed created using sitk.Compose().

kaspermarstal avatar Oct 27 '20 21:10 kaspermarstal

Thank you very much for your kind response!

ZhenhongDu avatar Nov 03 '20 03:11 ZhenhongDu