spinal-cord-7t / coil-qc-code

7T Spinal Cord Coil QC Analysis Code
0 stars 0 forks source link

Co-register in-vivo and phantom B1+ and SNR maps for visualisation purposes #64

Open evaalonsoortiz opened 1 month ago

evaalonsoortiz commented 1 month ago

Both phantom and in-vivo B1+ and SNR maps would be easier to compare visually if they were co-registered. In the figure below we see an example of in-vivo SNR maps that are not co-registered, making visual comparison across subjects less elegant.

Screenshot 2024-05-31 at 1 09 53 PM
evaalonsoortiz commented 3 weeks ago

Here are the co-registration results for the phantom data (see https://github.com/spinal-cord-7t/coil-qc-code/commit/1b86cedf28392e02fb10a1b31a4393aafc8a52d8):

co-registered TFL vs not co-registered

Screenshot 2024-06-11 at 11 57 14 AM Screenshot 2024-06-11 at 11 58 46 AM

co-registered DREAM vs not co-registered

Screenshot 2024-06-11 at 11 59 17 AM Screenshot 2024-06-11 at 11 59 32 AM

co-registered SNR vs. not co-registered

Screenshot 2024-06-11 at 11 59 57 AM Screenshot 2024-06-11 at 12 00 14 PM

Before I invest time in coregistering the spinal cord ROI that was created in the TFL to the DREAM and SNR scans and computing average signals in that ROI instead of a straight line, I'd like for us to approve/agree on this strategy.

@jcohenadad Do you like the co-registered visualization better than the non-coregistered? I myself am not convinced. I don't like the dead space around the coregistered images.

jcohenadad commented 3 weeks ago

I also don't like the dead space around the coreg images. I suggest cropping to a space that is visible across all scans. Which also makes sense because the purpose of these figures is to compare across acquisitions (and if one site shows regions that are not covered by another site, it defeats the purpose of the comparison)

evaalonsoortiz commented 3 weeks ago

Of course, why didn't I think of that!

evaalonsoortiz commented 3 weeks ago

Progress report:

Co-registered phantom visualization is now looking good. I've decided to use the phantom "spinal cord" mask to measure B1+ and SNR signals and plot them alongside the tiled images (as opposed to plotting signal along a vertical line like before). As you can see in the image below, the tiled images now have the spinal cord ROI superimposed.

Problem: for some reason the TFL spinal cord mask does not show up. @jcohenadad do you mind helping me debug this? See https://github.com/spinal-cord-7t/coil-qc-code/commit/090d99f705d66e634016c1247e9c5e0d5627e011

Screenshot 2024-06-13 at 9 56 41 PM Screenshot 2024-06-13 at 9 56 55 PM Screenshot 2024-06-13 at 9 57 10 PM
evaalonsoortiz commented 2 weeks ago

Progress report:

Co-registered phantom visualization is now looking good. I've decided to use the phantom "spinal cord" mask to measure B1+ and SNR signals and plot them alongside the tiled images (as opposed to plotting signal along a vertical line like before). As you can see in the image below, the tiled images now have the spinal cord ROI superimposed.

Problem: for some reason the TFL spinal cord mask does not show up. @jcohenadad do you mind helping me debug this? See 090d99f

Screenshot 2024-06-13 at 9 56 41 PM Screenshot 2024-06-13 at 9 56 55 PM Screenshot 2024-06-13 at 9 57 10 PM

mask display issue fixed here: https://github.com/spinal-cord-7t/coil-qc-code/commit/c663840592f42fcfb2185f79c1fe8a147fa4ed59

evaalonsoortiz commented 2 weeks ago

Progress report:

Here are the co-registered in-vivo maps:

Screenshot 2024-06-19 at 5 20 34 PM Screenshot 2024-06-19 at 5 20 53 PM Screenshot 2024-06-19 at 5 21 09 PM

It may not look like it from these cropped images, but the co-registration is pretty bad. I'm using the following:

sct_register_multimodal -i sub-{site}{subject_id}_{file_name}.nii.gz -iseg sub-{site}{subject_id}_{file_name}_seg.nii.gz -d ../../sub-{site_ref}{subject_id}/fmap/sub-{site_ref}{subject_id}_{file_name}.nii.gz -dseg ../../sub-{site_ref}{subject_id}/fmap/sub-{site_ref}{subject_id}_{file_name}_seg.nii.gz -param step=1,type=seg,algo=centermassrot,metric=MeanSquares

I have a spinal cord segmentation mask for each image type (TFL B1+ map, DREAM B1+ map, and SNR map) that is generated elsewhere in the code. Using that segmentation, I applied the parameter options that seemed to be recommended in sct_register_multimodal -h for this type of use case. @jcohenadad are there different options that you think would work better?

Latest commit:https://github.com/spinal-cord-7t/coil-qc-code/commit/f3287f9b9fe35c6443b8d0192e4e15d53d1f1c46

jcohenadad commented 2 weeks ago

It may not look like it from these cropped images, but the co-registration is pretty bad.

Yes, I can see that from the vertebral levels.

In this case I would recommend to use a label-based registration using the disc labels (automatically generated). I can help with that.

We also need to watch out for the interpolation used-- by default, it is linear, which we might not want for quantitative maps (nn might be more appropriate-- to check)