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

Expand centerline QC report to add sagittal/coronal views #4011

Open
jcohenadad opened this issue Jan 24, 2023 · 6 comments
Open

Expand centerline QC report to add sagittal/coronal views #4011

jcohenadad opened this issue Jan 24, 2023 · 6 comments
Labels
feature category: new functionality sct_qc context:

Comments

@jcohenadad
Copy link
Member

jcohenadad commented Jan 24, 2023

When validating output centerlines, it would be convenient to have a QC. One possibility is to use multiple axial views, as done for the SC segmentation QC. However, given that we are not after accuracy here, there might be a more rapid way to QC centerlines: by looking at the sagittal and coronal views. However, if only showing the medial sagittal plane, we might 'miss' the spinal cord. hence, an idea would be to average the 1/3 central chunk of the FOV and display that for the sagittal view. And for the coronal, average the entirety of the A-P axis. See related discussion: neuropoly/idea-projects#15 (comment)

Also, to make sure the centerline is visible, we would need to do a 'repmat' (ie: find the 'one' along the array, and replace all zeroes by one) along the RL and AP axes, respectively for the sagittal and coronal views.

Related to neuropoly/idea-projects#15 (comment)

@joshuacwnewton
Copy link
Member

When validating output centerlines, it would be convenient to have a QC. One possibility is to use multiple axial views, as done for the SC segmentation QC.

I might be missing something here, but don't we have an axial slicewise QC report for sct_get_centerline already?

Screenshot (sct_example_data/t2/t2.nii.gz)

image

optional.add_argument(
"-qc",
metavar=Metavar.folder,
action=ActionCreateFolder,
help="The path where the quality control generated content will be saved."
)

It's present in sct_qc as well:

parser.add_argument('-p',
help='SCT function associated with the QC report to generate',
choices=('sct_propseg', 'sct_deepseg_sc', 'sct_deepseg_gm', 'sct_register_multimodal',
'sct_register_to_template', 'sct_warp_template', 'sct_label_vertebrae',
'sct_detect_pmj', 'sct_label_utils', 'sct_get_centerline', 'sct_fmri_moco',
'sct_dmri_moco'),

So, is the idea here to augment the existing axial QC with saggital and/or medial views?

@joshuacwnewton
Copy link
Member

@jcohenadad
Copy link
Member Author

I might be missing something here, but don't we have an axial slicewise QC report for sct_get_centerline already?

oh! I was the one missing something 😅 I completely forgot we already had this QC. That being said, it would be convenient to have the sag/coronal view (esp. for images with thick sagittal slices), if not toooo complicated to implement.

@valosekj
Copy link
Member

valosekj commented Jan 24, 2023

See related discussion: neuropoly/idea-projects#15 (comment)

Just for the full context. Here is how the images in neuropoly/idea-projects#15 (comment) were obtained:

# Sagittal image
# Crop around the middle of the FOV. Here we specified the slice range manually, but it could probably be obtained automatically as well.
sct_crop_image -i sub-cal056_ses-M0_T2w.nii.gz -xmin 20 -xmax 35 -o sub-cal056_ses-M0_T2w_crop.nii.gz
# Do average
sct_maths -i sub-cal056_ses-M0_T2w_crop.nii.gz -mean x -o sub-cal056_ses-M0_T2w_crop_mean.nii.gz

# Do the same for the centerline
sct_crop_image -i sub-cal056_ses-M0_T2w_seg_centerline.nii.gz -xmin 20 -xmax 35 -o sub-cal056_ses-M0_T2w_seg_centerline_crop.nii.gz
# Do average
sct_maths -i sub-cal056_ses-M0_T2w_seg_centerline_crop.nii.gz  -mean x -o sub-cal056_ses-M0_T2w_seg_centerline_crop_mean.nii.gz

# Coronal image
# For coronal image, we did only averaging (because it is not easy to specify the slices for cropping)
sct_maths -i sub-cal056_ses-M0_T2w.nii.gz -mean y -o sub-cal056_ses-M0_T2w_mean_y.nii.gz
sct_maths -i sub-cal056_ses-M0_T2w_seg_centerline.nii.gz -mean y -o sub-cal056_ses-M0_T2w_seg_centerline_mean_y.nii.gz

@valosekj
Copy link
Member

I have just found out that we can already get sagittal centerline QC using this small hack (passing -p sct_label_vertebrae instead of -p sct_get_centerline):

sct_qc -i sub-cal056_ses-M0_T2w.nii.gz -s sub-cal056_ses-M0_T2w_seg_centerline.nii.gz -p sct_label_vertebrae -qc qc -qc-subject sub-cal056

image

For the sake of clarity, -p sct_get_centerline provides axial QC:

sct_qc -i sub-cal056_ses-M0_T2w.nii.gz -s sub-cal056_ses-M0_T2w_seg_centerline.nii.gz -p sct_get_centerline -qc qc -qc-subject sub-cal056

image

@joshuacwnewton joshuacwnewton changed the title QC report for centerline Expand centerline QC report to add sagittal/coronal views Jan 30, 2023
@valosekj
Copy link
Member

Just for the record, sct_qc -p sct_label_vertebrae also works well for getting a rough idea of SC seg in the sagittal plane:

Kapture 2023-05-24 at 14 19 27

Command:

sct_qc -i sub-zh01/ses-01/anat/sub-zh01_ses-01_acq-sag_T2w.nii.gz -s derivatives/labels/sub-zh01/ses-01/anat/sub-zh01_ses-01_acq-sag_T2w_seg-manual.nii.gz -p sct_label_vertebrae -qc qc -qc-subject sub-zh01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature category: new functionality sct_qc context:
Projects
None yet
Development

No branches or pull requests

3 participants