-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Fixed unassigned variable in case -z or -vert is not used #1354
Conversation
scripts/sct_extract_metric.py
Outdated
@@ -369,6 +369,8 @@ def main(fname_data, path_label, method, slices_of_interest, vertebral_levels, f | |||
normalizing_label[0], slices_list = remove_slices(normalizing_label[0], slices_of_interest) | |||
if fname_mask_weight: # if the flag -mask-weighted was specified, | |||
im_weight.data, slices_list = remove_slices(im_weight.data, slices_of_interest) | |||
else: | |||
slices_list = range(0, nz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using np.zeros(nz)
, because range
is an iterable in python3 which would cause break the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.zeros(nz) doesn't produce the same thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it is the function np.arange(nz)
I was thinking of.
Description of the Change
Default assignment is a list with all slices.
Steps and Constraints
data on /Volumes/folder_shared/sct_issues/20170608_issue1241
command:
Applicable Issues
Fixes #1241