Skip to content

Registration of images which do not cover the entire brain #787

@LuRoe7

Description

@LuRoe7

Describe the bug
I want to register a DCE-MRI image into the MNI space and do not achieve a good result. The field of view (FOV) of the DCE-MRI image does not cover the entire brain. I attached a screenshot at the bottom of this post.

To reproduce

# set path to brain extracted DCE-MRI image registered to the native T1w space
patlak_img = ants.image_read('path/to/sub-IMPCSF008_ses-BL_acq-LinReg_PatlakToAnatBrain.nii.gz')

# set path to corresponding mask image
patlak_mask = ants.image_read('/path/to/sub-IMPCSF008_ses-BL_acq-LinReg_PatlakToAnatBrainMask.nii.gz')

# set path to MNI template (only brain)
mni_template = ants.image_read('/path/to/MNI152NLin6Asym_2mm_T1w_brain.nii.gz')

# set path to MNI mask
mni_mask = ants.image_read('/path/to/MNI152NLin6Asym_2mm_T1w_brain_mask.nii.gz')

# run ants registration
reg_result = ants.registration(fixed=mni_template,
moving=patlak_img,
outprefix='/path/to/test_',
type_of_transform='SyN',
mask = mni_mask,
moving_mask=patlak_mask)

# extract the registered moving image
registered_image = reg_result['warpedmovout']

# save it as a NIfTI file
ants.image_write(registered_image, '/path/to/test_out.nii.gz')

# apply transform
patlak_mask_mni = ants.apply_transforms(fixed=mni_template,
moving=patlak_img,
transformlist=['/path/to/test_out.nii.gz', '/path/to/test_0GenericAffine.mat'],
interpolator='linear',
output_dtype='float')

# write image
ants.image_write(patlak_mask_mni, '/path/to/test_Registered.nii.gz')

Screenshots
This is the resulting registration (test_Registered.nii.gz):

Image

And this is how the DCE-MRI image looks like in native T1w space:

Image

Any advice what I could optimize?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions