Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aimed at fixing some ValueError or IndexError errors that have been reported to occur when using
sct_deepseg_sc
orsct_deepseg_lesion
.#2016
To reproduce the error:
Error:
It should be noted that this error did not occur when using
-centerline svm
. Also, this is not related to the fact that the input image is a single axial slice, since recent improvements (see PR_2012) allow to handle this kind of input.For instance, the below command works:
Proposed solution:
The reported error occurs when the spinal cord was not detected (here on the single axial slice). There is no much that we can do about it. Consequently, I proposed in the PR to invite the user to use another
-centerline
method, such assvm
orviewer
:#2015 & #1921
To reproduce:
Error:
It raised an IndexError when an empty slice segmentation is encountered by the function
post_processing_slice_wise
.Proposed solution:
Use the center of mass of the neighbour slices to perform the slice wise post processing. If the neighbours are also empty (ie all the slices of a 3D patches are not segmented), then no post-processing is performed.
--> Tested on the example_data and it fixes the present error without impacting the output segmentation.
#2001
This issue suggests to correct the Usage of
sct_deepseg_lesion
since-c t2_ax
is not a type of contrast but a contrast_orientation.Proposed solution:
Clarify the usage:
#2057
svm
is now the-centerline
default value for all contrasts , as indicated in the Usage.#1825
To reproduce:
Error:
Duplication of output_folder in the
display_syntax_viewer
:This is now fixed: