dorianps / LINDA

Lesion Identification with Neighborhood Data Analysis
Apache License 2.0
20 stars 4 forks source link

Applying transformation generated by LINDA #32

Open yqliu9240 opened 2 years ago

yqliu9240 commented 2 years ago

Hello LINDA developers,

I have performed registration between the patient's T1 and template brain, and I now want to transform some ROIs from template brain to the patient's T1, applying transformation matrices generated by LINDA. The problem is that the patient had lesion in the right hemisphere and I flipped the L-R dimension for running LINDA. This would result in the ROI mapped to the anatomically opposite hemisphere on T1, e.g., a left-hemisphere ROI in ch2 would be mapped to the "left"-hemisphere in T1, which is actually the right hemisphere. Is there a way to change the transformation matrix from LINDA to flip back the L-R transformation?

Thank you, Yuqi

dorianps commented 2 years ago

Hi Yuqi,

You can use the transformations to bring the ROIs in the flipped T1 space, then apply a L-R flip to bring them in the original T1 space (same way you flipped the T1 the first time). You have only to be careful about the interpolation method. At minimum ROIs need nearest neighbor so that ROI values are retained, but there is a mode for multilabel interpolation which retain better the ROI boundaries. Interpolation is relevant when you apply the warps, while the LR flip should not affect them I think.

yqliu9240 commented 2 years ago

Thank you for the reply! What is confusing me is that the label of the ROIs would change. Let's say I have two ROIs, left M1 and right M1, and they are not symmetrical in standard space. After transformation, the leftM1 ROI would end up being rightM1 for the patient, but it doesn't match the location of rightM1 in the standard space. Wouldn't that be a problem?

What seems to make more sense is I flip the ROI in the standard space, assuming the standard space is symmetrical. Then apply transformation so that the ROI is back to the correct hemisphere. Does that sound sensible?

And I see that there is a Multilabel option to interpolation method in antsApplyTransforms, is that what you meant? It also includes several other arguments: MultiLabel[,], how should I specify sigma and alpha?

Thank you! Yuqi

dorianps commented 2 years ago

Ah, I see what you mean. Yes, the ROIs can be asymmetric in template space. I am not sure of the exact scenario you see with your data. I thought that ROI asymmetries come because a specific gyrus/sulcus is bigger or smaller in one of the hemispheres. If that gyrus is mapped in template space and the ROIs are brought back and flipped, it should still label correctly the area. But, again, I am only trying to imagine what would happen. If you have a specific example, please post pictures.

A workaround to your problem is very simply this: Now that you have the lesion mask for the subject, flip everything back to normal: i.e., both lesion and T1 are correctly on the right side. Then install LESYMAP and run registerLesionToTemplate(). This will register directly your T1 onto a template of your choice (or the default which is mni_icbm152_t1_tal_nlin_sym_09c.nii.gz). If you choose a different template, it may be better to have all the masks accepted as arguments by the function because it would do a better registration after brain extraction.

yqliu9240 commented 2 years ago

I'm attaching a picture showing the senario. The LaIPS in the final image derives from RaIPS on the standard space, causing a mismatch between the patient's ROI and the standard ROI. ROIsideexample

And the LESYMAP method makes sense, thank you!

Yuqi

dorianps commented 2 years ago

I see that the template may not look like the image after the final flip, but that doesn't mean the ROI is in the wrong place. Anyway, you can give a try to lesymap to see if direct registration addresses your concern.