Register MRI and histology

Dear Slicer community,

I would like to register MRI to histology data to compare tumor volumes retrieved from MRI-segmentation with groundtruth.
I have an isotropic T2w 3D (Image dimensions 100 200 120, Image spacing 0.1 0.1 0.1) and an image stack from lightsheet microscopy in nrrd format (image dimensions 2160 2560 472, Image spacing 1 1 1).
As the dimensions are very different, automatic registration does not work (as expected). I tried to resample the images with various modules, but am unable to find a way to bring the two datasets to similar dimensions and spacing.

  • I installed the IASEM extension and am able to reduce the image dimensions of the histology image to match those of the T2w, but with that image spacing increases.
  • Using ResampleScalarVolume, I can bring the image spacing of the T2w to match that of the bin shrinked histology, but obviously the result is of not much use. It does not work the other way round either (i.e. bring the image spacing of the histology to match that of the T2w), as the resampling fails with an error (“can’t allocate enough memory”).

Is there a way to downsample the histology images so that I can register my T2w to it?

The main issue is that the image spacing of the microscopy image looks incorrect (2160 pixels x 1mm/pixel = 2.16 meters). You can type the correct spacing value in Volumes module’s Volume information section. After this, you can resample the image to approximately match the MRI image resolution (about 0.1mm, or maybe a bit smaller spacing, such as 0.05 or or 0.03, but as small as 0.01).

After this, registration could work, but MRI/histology registration is usually a hard problem. I would recommend to start registration with manually defined landmarks (for example, using Fiducial registration wizard module of SlicerIGT extension). It is always guaranteed to work, but it requires time and expertise, and it is limited in how many landmarks you can find and how accurately you can specify their position. So, you may want to use it as an initialization step and then refine it using automated methods.

We may give more specific advice if you post a few screenshots of your data set.

Thank you for the reply.
The image spacing information of the microscopy image are indeed wrong. It should be 3.25 x 3.25 x 5 µm and I changed it in the Volumes module manually. I then resampled the image using ResampleScalar Volumes module to match the MRI image resolution as you suggested. This worked nicely.
As the image dimensions of T2w and the microscopy image were then of course different, I followed the instructions in the User FAQ and used ResampleScalarVolumeDWIVolume module to resample the microscopy image again to match the T2w dimensions. This also worked nicely.
Before I start with a fiducial based registration, I have a remaining question:
If I put T2w in the Background and the resampled microscopy image in the foreground and put the fader to 0.5, the microscopy image is much smaller than the T2w. I think I’m missing something, but shouldn’t they appear roughly the same as dimensions and spacing now match?

Moreover, I’m not sure if the repeated resampling is a good idea. Is there a better way of doing it?

In case it helps to understand the issue, these are the volume information of my images:
T2w:
image dimensions: 100 x 200 x 120
image spacing: 0.1 x 0.1 x 0.1 mm

microscopy:
image dimensions: 2160 x 2560 x 472
image spacing: 0.00325 x 0.00325 x 0.005 mm

microscopy after 1st resampling in ResampleScalarVolumes module:
image dimensions: 70 x 83 x 24
image spacing: 0.1 x 0.1 x 0.1 mm

microscopy after 2nd resampling in ResampleScalarVolumeDWIVolume module>
image dimensions: 100 x 200 x 120
image spacing: 0.1 x 0.1 x 0.1 mm

What is in your image? Prostate, breast,…? It may be normal that the extent of the histology image is much smaller than the MRI, because the resected tissue may be just a small piece of tissue relative to the whole imaged body part. Can you post a screenshot so that we can see what do you find suspicious?

Repeated resampling should be avoided (for example by just concatenating transforms and resample with the final composite transform), but first I would just focus on getting a full registration done and then optimize the workflow.

Sorry, I forgot to mention that I’m working on mouse brain images. It’s a 3D T2w covering the whole brain on the MRI side. For histology, brains were first cleared and then scanned with a lightsheet microscope to acquire Z-stacks with 5 µm step size and coverage of up to 2000 µm (not the whole brain, but a large part of it). LSM images were initially exported as .tif and converted to .nrrd in FIJI. The brain shrinks about 40% during the clearing procedure, but the general anatomy remains intact.
The volume information of T2w and resampled microscopy image displayed in the Volumes module are exactly the same now. Therefore, I thought they should have the same size when displayed together in the viewer.
Perhaps I misunderstand the logic behind the resampling procedure. Do the microscopy data need to be resampled in a way to account for the 40% shrinkage during clearing?
If so, what would be the best way of doing it?
Or isn’t this size differences a problem at all and would disappear with fiducial based-registration?

Attached is a screenshot showing T2w in the background and the double-resampled microscopy image in the foreground.
(The cropped border on the left (i.e. right in radiological view) of the histology image occured during LSM-scanning and is present on the original image as well. It’s not a result of resampling.)

Why not input this tif files using slicer directly through “data”, and then you can modify the parameters in “volume” after “VectorToScalar”

If the tissue shrinks that much then you need to use similarity or affine transform, which computes scale factor from the input points. Since there could be also significant non-linear warping, you may get better results by choosing warping transform.

The main challenge is how to find corresponding points between the images. There are a lot of papers about MRI/histology image registration, describing various techniques for getting point correspondences (using surgical dye, embedded fiducial markers, etc).

1 Like

Thank you for your advice!

I now used the Fiducial Registration Wizard of the IGT Extension and obtained a good result with the warping transform option!

1 Like