Cropping on volume intersection

Hello everyone,

I am currently working on CT/MRI registration using Elastix in a script. Since I want to automate as much of the workflow as possible, I want to automate the cropping of CT and MRI volumes and launch Elastix from there.

For now, my workflow is as follows :

  • Pre-alignement of MRI (moving) on CT (fixed) with 3 points fiducial registration
  • Cloning the CT and cropping using an ROI fitted to the MRI volume
  • Registration of Cloned cropped CT (fixed) and MRI (moving) using elastix (preset Generic (all))
  • Delete the cloned CT

This workflow seems to work fairly well, however, I get problems when the MRI is not fully included in the CT, since after cropping, the MRI have more information than the CT (since I only crop the CT based on the MRI bounding box). To correct that, I made a few tests by manually cropping both CT and MRI at their intersection, so that both resulting cropped volumes have the same bounding box. This seems to produce better results.

My question is : is there a way to fit the ROI directly on the intersection of volumes?

Thank you in advance !