inter-patient Registration

Dear All,

I have two CT scans, one is truncated it has only part of the abdomen and the thorax, the other one is of the whole body.
Whenever I try to do the registration the resulting image is a truncated image whether I do it using SimpleITK or 3D Slicer. I would like to keep the whole body and see the truncated CT registered on it.

What would you suggest to overcome this problem?

Thanks in advance.

Hello @Michel_Atieh,

You are combining two operations into one and that is what is confusing you:

  1. Registration - computing the transformation between the two coordinate systems.
  2. Use of the transformation - can take many forms, but usually just resample the moving image onto the fixed image grid.

In your case, try the following workflow:

1. tx = register(fixed_image=truncated_image, moving_image=full_ct).
2. truncated_resampled_onto_full = sitk.Resample(truncated_image, full_ct, tx.GetInverse(), background_value = -1000)

Default background value is zero, and you are working with CT, so possibly you want it to be HU value of air.

1 Like

Dear Mr. Ziv,

Thank you for your response.
Can you please explain more in details what is it that I am doing wrong, I mean how should I organize the work step by step so I have the ideas clearer.

Can you also precise what image registration method should I choose from the SimpleITK site to do the registration in this case, a written code will make it easier for me to visualize the methodology.

Thank you for the help I really appreciate it, and sorry for bothering as I am still a beginner in the field of medical imaging.

Hello @Michel_Atieh ,

It is great that you are starting your education in medical imaging.

Unfortunately, you will have to gain some experience on your own or in the classroom. This forum is intended for helping users of the ITK/SimpleITK tools. Before using these tools you need to master the theory underlying them, or at least be familiar enough with it.

Possibly invest time in learning how to use a program such as 3D slicer? They have really good tutorials and there are known workflows to achieve certain goals without requiring significant understanding of the underlying algorithms.

1 Like

Dear Mr. Ziv,

Thank you for your advice. I will invest more time in learning how to use 3D Slicer to get more familiar with image registration in general and afterwards if I need any advice in using SimpleITK I will ask on this forum.

Dear Mr. Ziv,

I was able to do the image registration of the two CT scans, however, I am not knowing how will I be able to keep the whole body phantom without it being truncated whenever I do the the registration.

Second question, how can I get the background of the image black as you can see there are grey stripes on the borders of the image.

Last question, I tried doing a deformable registration, but it takes like more than an hour, is there any particular solution to overcome this problem?

Please find below a part of my code, and the resulting images for your review.

fixed_series_ID = ds_pat.SeriesInstanceUID
moving_series_ID = ds_pht.SeriesInstanceUID

fixed_series_filenames = sitk.ImageSeriesReader_GetGDCMSeriesFileNames(data_directory_Patient, fixed_series_ID)
moving_series_filenames = sitk.ImageSeriesReader_GetGDCMSeriesFileNames(data_directory_Phantom, moving_series_ID)

fixed_image = sitk.ReadImage(fixed_series_filenames, sitk.sitkFloat32)
moving_image = sitk.ReadImage(moving_series_filenames, sitk.sitkFloat32)

##Registration
registration_method = sitk.ImageRegistrationMethod()

# Similarity metric settings.
registration_method.SetMetricAsMattesMutualInformation(numberOfHistogramBins=50)
registration_method.SetMetricSamplingStrategy(registration_method.RANDOM)
registration_method.SetMetricSamplingPercentage(0.1)

registration_method.SetInterpolator(sitk.sitkLinear)

# Optimizer settings.
registration_method.SetOptimizerAsGradientDescent(learningRate= 0.01, numberOfIterations=10000, convergenceMinimumValue=1e-25, convergenceWindowSize=100)
registration_method.SetOptimizerScalesFromPhysicalShift()

# Setup for the multi-resolution framework.
registration_method.SetShrinkFactorsPerLevel(shrinkFactors = [4,2,1])
registration_method.SetSmoothingSigmasPerLevel(smoothingSigmas=[2,1,0])
registration_method.SmoothingSigmasAreSpecifiedInPhysicalUnitsOn()

# Don't optimize in-place, we would possibly like to run this cell multiple times.
registration_method.SetInitialTransform(initial_transform, inPlace=False)

final_transform = registration_method.Execute(sitk.Cast(fixed_image, sitk.sitkFloat32), sitk.Cast(moving_image, sitk.sitkFloat32))

Thanks a lot for the help you offer us.