diff --git a/batch_processing.sh b/batch_processing.sh index f71d554ca8..279c9f26b3 100755 --- a/batch_processing.sh +++ b/batch_processing.sh @@ -128,7 +128,7 @@ cd .. # =========================================================================================== cd t1 # Segment spinal cord -sct_deepseg_sc -i t1.nii.gz -c t1 +sct_deepseg_sc -i t1.nii.gz -c t1 -qc "$SCT_BP_QC_FOLDER" # Smooth spinal cord along superior-inferior axis sct_smooth_spinalcord -i t1.nii.gz -s t1_seg.nii.gz # Flatten cord in the right-left direction (to make nice figure) diff --git a/spinalcordtoolbox/deepseg_sc/core.py b/spinalcordtoolbox/deepseg_sc/core.py index a24c77b9a1..f2fcb32c24 100644 --- a/spinalcordtoolbox/deepseg_sc/core.py +++ b/spinalcordtoolbox/deepseg_sc/core.py @@ -25,7 +25,7 @@ # Thresholds to apply to binarize segmentations from the output of the 2D CNN. These thresholds were obtained by # minimizing the standard deviation of cross-sectional area across contrasts. For more details, see: # https://github.com/sct-pipeline/deepseg-threshold -THR_DEEPSEG = {'t1': 0.74353448, 't2': 0.34353448, 't2s': 0.89008621, 'dwi': 0.01422414} +THR_DEEPSEG = {'t1': 0.15, 't2': 0.7, 't2s': 0.89, 'dwi': 0.01} logger = logging.getLogger(__name__) @@ -548,7 +548,7 @@ def deep_segmentation_spinalcord(im_image, contrast_type, ctr_algo='cnn', ctr_fi # Binarize the resampled image (except for soft segmentation, defined by threshold_seg=-1) if threshold_seg >= 0: logger.info("Binarizing the resampled segmentation...") - im_seg_r.data = im_seg_r.data.astype(np.uint8) + im_seg_r.data = (im_seg_r.data > 0.5).astype(np.uint8) # post processing step to z_regularized im_seg_r_postproc = post_processing_volume_wise(im_seg_r)