How to ensure canal segmentation is correctly cropped for QC when using sct_qc?

I’m having an issue with how SCT crops the QC images for canal segmentations when using sct_qc.
– When there is no existing canal segmentation label: segmentation runs through "sct_deepseg canal…” and the QC file is cropped appropriately (I can visualize the entire canal).
– However, when QC is generated by “sct_qc”, it crops tightly to the spinal cord and cuts off the canal. I’ve tried -p sct_propseg and -p sct_deepseg_sc, and both still cut off the canal.

Please advise on how to ensure that the QC images are correctly cropped so that the canal is not cut off.

SCT version: git-master-b3df012e69294318c1621c1bee270031c0744db0
Command: sct_propseg (“sct_qc -i sub-CRHC011_T2w.nii.gz -s sub-CRHC011_T2w_label-canal_seg.nii.gz -p sct_propseg -qc /home/rdpant/nilab/Spine_Normative_Modeling/RD/BIDS/derivatives/qc -qc-subject sub-CRHC011”)

Screenshot of QC image with canal cropped off at the edges:

Dear RD,

sct_deepseg canal should have its own argument called -qc-seg that controls the cropping behavior of the built-in QC report for sct_deepseg:

> sct_deepseg canal -h

  -qc-seg <file>        Segmentation file to use for cropping the QC. This
                        option is useful when you want to QC a region that is
                        different from the output segmentation. For example, it
                        might be useful to provide a dilated cord segmentation
                        to expand the QC field of view.
                        
                        If `-qc-seg` is not provided, the default behavior will
                        depend on the value of `-qc-plane`:
                          - 'Axial': Without '-qc-seg', a sensible crop radius
                          between 15-40 vox will be automatically used,
                          depending on the resolution and segmentation type.
                          - 'Sagittal': Without '-qc-seg', the full image will
                          be displayed by default. (For very large images, this
                          may cause a crash, so using `-qc-seg` is highly
                          recommended.)

However, now that I look at sct_qc by comparison, it seems as though this -qc-seg option (as well as the default cropping behavior with the seg padding) has not been extended to the sct_qc script. I see that we have a longstanding issue to improve the QC report for sct_deepseg via sct_qc:

I will bump the priority on this issue and make a note that it is user-requested, now.

My apologies for this inconvenience, and thank you again for reporting. :hearts:

Kind regards,
Joshua

Hi Joshua,

Thank you for clarifying! Glad to hear that this issue will be bumped in priority.
Do you know any temporary work-around to adjust cropping behavior for sct_qc while we await updates?

Best,
RD

In the very short term, it is safe to modify the hard-coded radius value in SCT’s QC-generating source code to a larger value. The default radius is 15 (30x30 mosaic squares) while the default canal value is 27.

Our apologies again for the inconvenience. Thank you for your patience and understanding.

Kind regards,
Joshua