Hello, I have a presumably elementary registration task at hand. I am familiar with Python and have just learned the basics of the registration concept from some online resources. I intend to tackle the job using SimpleITK, which I have just started to learn about within the past couple of days. Here is the task description:
For a single patient, I have two sets of MRI “masked” images as follows: Set # 1:
– Acquired at 3.0 Tesla
– The data set contains six folders named Point 1, Point 2, …, Point 6 each of which containing 32 Dicom images.
– The 3D image in each of the six folders has dimensions of 512x512x32 and voxel sizes of (0.7813 mm x 0.7813 mm, 4 mm)
– For any given folder, for example, Point 1, all 2D-slice images are essentially blank with intensity values of zero everywhere except for one slice (e.g. slice # 26 out of 32) wherein a small anatomical 2D patch with an irregular shape has been drawn with the intensity value of 255 for all the points within the patch. The slice number with the patch is different in other folders. For example, in Point 2, slice # 32 out of 32 has the non-zero-value patch.
Set # 2:
– Acquired at 1.5 Tesla
– The data set contains six folders named Point 1, Point 2, …, Point 6 each of which containing 24 Dicom images.
– The 3D image in each of the six folders has dimensions of 512x512x24 and voxel sizes of (0.7813 mm x 0.7813 mm, 4 mm)
– The Point 1 folder in this set refers to the same anatomical region as that in Set # 1. However, the non-zero-value patch is embedded in a different slice, and the patch appears to be slightly different in shape and location compared to its counterpart in Set # 1; for example, in Point 1 folder in this Set, slice # 11 out of 24 contains the patch.
Now the job is to register 6 patches in Set # 1 to those in Set # 2 and see how patches in two sets align. Being new to the medical image registration and simpleITK, I’d highly appreciate it if the seasoned folks could give me some step by step guidance as to how to tackle this job.
I suggest you to check elastix (https://elastix.lumc.nl/, manual: https://elastix.lumc.nl/download/elastix-5.0.0-manual.pdf, examples of parameters files: http://elastix.bigr.nl/wiki/index.php/Parameter_file_database). They also have an extension based on SimpleITK (http://simpleelastix.github.io/). Your registration task gets much simpler as you may just need to define your fixed image (the 3T I guess), your moving image, and the correct parameters. The only thing I find weird is that you mention that your images only have a binary mask on one slice (only zeros and values with 255). It feels to me that you have masks that someone draw in images with more intensity values. If that is the case, you may need first to get those original images. Those are the ones you will be registering, and then you can apply the transformation between the moving image and the fixed image to these masks that you have. There’s plenty documentation regarding these registration steps that you may find on internet. You can also check the ITK Software Guide or ANTs documentation.
The database on Elastix is certainly helpful. Actually, my first software choice was SimpleElastix but I got serious issues in building and installation for which I decided to go with SimpleITK.
These masked images are the ones handed to me to examine some initial registration ideas. Eventually, I think the actual images with anatomical features will be the next step.
This said, I am thinking of some preprocessing of the Dicoms to arrive at two 3D Nifti images one for each magnetic field strength before I deliver them to any registration pipeline. Here are the steps:
For a given patient and field strength, after loading the Dicoms into a proper software, preferably something Python based, I am going to add up the data matrices of all the points (Point1 , Point2, etc.) to arrive at one 3D matrix and then convert this total matrix into a 3D Nifti image in which some slices have those non-zero-value patches.
This done for subject # 1 for example, I will have two Nifti images with dimensions 512x512x32 (for 3T) and another one at 512x512x24 knowing that both images have the same voxel sizes. The next is to resample one image for both to be at 512x512x24 to be inputs of the registration pipeline.
Please let me know:
– If the steps above seem reasonable to you.
– If positive, do you know of a way of doing step one above purely using Python, perhaps using PyDicom? I have no experience with PyDicom. I know how to resample using Nibabel or NiLearn.