Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lumbar rootlets - images and labels have different resolution and dimensions #46

Closed
valosekj opened this issue May 23, 2024 · 6 comments

Comments

@valosekj
Copy link
Member

valosekj commented May 23, 2024

Raphaëlle Schlienger manually segmented T12 to S3 dorsal rootlets on 6 healthy participants on T2_ZOOMit images. 🎉
During the procedure, she resampled the T2_ZOOMit images to 0.6x0.6x2mm resolution, as tracking rootlets at 0.3x0.3x0.5mm would have taken even longer:

Generate empty rootlets image in 0.6x0.6x2mm resolution (do this directly in FSLeyes with the Resample Image option),

This resampling caused not only the resolution to be different but also the dimensions. The borders of the label image containing rootlets exceed the T2_ZOOMit image (shown in orange; by setting min to -1):

image
dim and pixdim2
valosek@macbook-pro:~/data/experiments/lumbar_rootlets$ fin sub-CTS04_ses-SPpre_acq-zoomit_T2w.nii.gz
data_type	INT16
dim1		1024
dim2		372
dim3		192
dim4		1
datatype	4
pixdim1		0.292969
pixdim2		0.292969
pixdim3		0.500000
pixdim4		3.080000
cal_max		0.000000
cal_min		0.000000
file_type	NIFTI-1+                                                                                                                                                                                         /0.1s
valosek@macbook-pro:~/data/experiments/lumbar_rootlets$ fin sub-CTS04_ses-SPpre_T2w_rootlets_resampled.nii.gz
data_type	FLOAT32
dim1		85
dim2		417
dim3		125
dim4		1
datatype	16
pixdim1		0.600000
pixdim2		0.600000
pixdim3		2.000000
pixdim4		1.000000
cal_max		0.000000
cal_min		0.000000
file_type	NIFTI-1+
@valosekj
Copy link
Member Author

valosekj commented May 23, 2024

Trying sct_resample -ref:

sct_resample -i sub-CTS04_ses-SPpre_acq-zoomit_T2w.nii.gz -ref sub-CTS04_ses-SPpre_T2w_rootlets_resampled.nii.gz -x linear -o sub-CTS04_ses-SPpre_acq-zoomit_T2w_resampled.nii.gz

However, due to the different dimensions, the output looks:
(but, at least, the FSLeyes warning about different orientations/FOV disappeared)

image

@valosekj
Copy link
Member Author

Trying sct_resample -mm 0.6x0.6x2.0 followed by sct_crop_image -ref

# Resample T2_ZOOMit image to the rootlets resolution 
sct_resample -i sub-CTS04_ses-SPpre_acq-zoomit_T2w.nii.gz -mm 0.6x0.6x2.0 -x linear -o sub-CTS04_ses-SPpre_acq-zoomit_T2w_resampled2.nii.gz
# Crop the rootlets around the resampled T2_ZOOMit image
sct_crop_image -i sub-CTS04_ses-SPpre_T2w_rootlets_resampled.nii.gz -ref sub-CTS04_ses-SPpre_acq-zoomit_T2w_resampled2.nii.gz -o sub-CTS04_ses-SPpre_T2w_rootlets_resampled_crop.nii.gz

The rootlets label image (in orange) is rotated relative to the resampled T2_ZOOMit image:

image

@RaphaSchl
Copy link

Hi Jan,
It seems that using FLIRT with nearest neighbour interpolation to resample rootlets back into ZOOMit resolution works !

flirt -in sub-CTS04_ses-SPpre_T2w_rootlets_resampled.nii.gz -ref sub-CTS04_ses-SPpre_acq-zoomit_T2w.nii.gz -applyxfm -usesqform -out sub-CTS04_ses-SPpre_T2w_rootlets_resampled_inzoomit.nii.gz -interp nearestneighbour

The output orange rootlets are back in ZOOMit resolution :
rootlets_inzoomitres

@valosekj
Copy link
Member Author

Indeed! FLIRT works! Thank you! 🚀

@jcohenadad
Copy link
Member

i'm curious as to why FLIRT worked, but not SCT. We should investigate (not a priority, but I don't want this to fall into a cracks) @joshuacwnewton

@RaphaSchl
Copy link

RaphaSchl commented May 27, 2024

SCT works too ☺️ I get exactly the same results as with the FLIRT command when I run :

sct_resample -i sub-CTS04_ses-SPpre_T2w_rootlets_resampled.nii.gz -ref sub-CTS04_ses-SPpre_acq-zoomit_T2w.nii.gz -x nn -o sub-CTS04_ses-SPpre_T2w_rootlets_resampled_inzoomitsct.nii.gz

I think the issue might have been the interpolation used !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants