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

qc report to display manual segmentation #4488

Closed
maxradx opened this issue May 20, 2024 · 6 comments
Closed

qc report to display manual segmentation #4488

maxradx opened this issue May 20, 2024 · 6 comments

Comments

@maxradx
Copy link

maxradx commented May 20, 2024

Hi,

Feature justification: Is your feature request related to a problem? Please describe.
I want to use the sct_qc function to generate a qc report that displays manual segmentations after completing manual segmentation tasks.

Describe the solution you'd like*
If it does not already exist, I think it would be great to have a function like sct_qc -i source_image.nii.gz -mask mask.nii.gz (where source_image.nii.gz is the source image from a dataset and mask.nii.gz the mask that has been obtained with manual segmentation) that generate a qc report making able to navigate through the images for quick assessment of the accuracy of manual segmentations.

Describe alternatives you've considered
How can we easily qc manual segmentation images? (instead of using manual correction script and iterate through cases, for example....)

Additional context
N/A.

Thanks.

@valosekj
Copy link
Member

valosekj commented May 20, 2024

You can use sct_qc with the following syntax:

sct_qc -i ${file}.nii.gz -s ${file_seg}.nii.gz -d ${file_lesion}.nii.gz -p sct_deepseg_lesion -plane sagittal -qc ${PATH_QC} -qc-subject ${SUBJECT}
  • -i - background image, e.g., T2w
  • -s - spinal cord segmentation used to crop the QC around the spinal cord (because there is no need to show slices outside of the spinal cord)
  • -d - manual binary lesion segmentation

Example: https://github.com/ivadomed/model_seg_sci/blob/392a88ab3dc1cbc2f2f5ef1fe5ba7217a216a825/create_manual_sc_seg/generate_qc.sh#L88C1-L88C187

@maxradx
Copy link
Author

maxradx commented May 20, 2024

Ok thanks!

1- But is there a way to generate the sct qc report from manual segmentation that is not on spinal cord images (I really like the interface and think from a more general perspective e.g. manual segmentation of brain tumors)?

2- Also, in this command line, I must have processed the images using sct (sct_deepseg_lesion) : is there a way to generate the qc report without image processing in sct? (e.g. just to overlay the manual segmentation mask with the image?)

@valosekj
Copy link
Member

1- But is there a way to generate the sct qc report from manual segmentation that is not on spinal cord images (I really like the interface and think from a more general perspective e.g. manual segmentation of brain tumors)?

The spinal cord mask (provided by the arg -s) is used to include all the slices within the spinal cord. If you didn't use the SC mask, then you would plot only slices containing the annotated lesion mask. You could thus miss false negative slices, i.e., a slice contains a lesion, but the lesion was not annotated.
I guess the current QC is tailored to the SC. But theoretically, you can try to provide brain images instead of the SC images. Instead of SC seg, you can provide brain mask.

2- Also, in this command line, I must have processed the images using sct (sct_deepseg_lesion)

No, you can directly provide manual lesion segmentation for arg -d.
-p sct_deepseg_lesion within the sct_qc command is only used to tell the QC framework that you want to generate lesion QC.

@maxradx
Copy link
Author

maxradx commented May 20, 2024

Ok great! It works (to display manual segmentation). Thanks!
Other question:
If I want to include all slices of the study (not just the ones with the SC), how may I proceed? (script provides the error below when I try to not use the argument -s : TypeError: Image constructor takes at least one argument.
image

@valosekj
Copy link
Member

If I want to include all slices of the study (not just the ones with the SC), how may I proceed?

Hmm, good question. Maybe you can try to dilate (sct_maths -dilate) the SC mask to cover also slices outside of the SC.

(script provides the error below when I try to not use the argument -s : TypeError: Image constructor takes at least one argument.

Yes, this is expected because sct_qc -p sct_deepseg_lesion requires both -s and -d arguments.

You can try to check this issue and this PR and try to do some experiments with sct_qc to achieve the QC you need.

@joshuacwnewton
Copy link
Member

Given that the scope of this issue is covered by:

I think we can close this issue?

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

No branches or pull requests

3 participants