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

Fixed unassigned variable in case -z or -vert is not used #1354

Merged
merged 4 commits into from
Jun 15, 2017

Conversation

jcohenadad
Copy link
Member

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:

sct_extract_metric -i Dh_reg.nii -f atlas/ -method map -overwrite 1 -output-map test.nii.gz

Applicable Issues

Fixes #1241

@jcohenadad jcohenadad added bug category: fixes an error in the code fix:major sct_extract_metric context: labels Jun 12, 2017
@jcohenadad jcohenadad self-assigned this Jun 12, 2017
@jcohenadad jcohenadad added this to the Release v3.0.5 milestone Jun 12, 2017
@peristeri peristeri modified the milestones: v3.0.6, Release v3.0.5 Jun 12, 2017
@@ -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)
Copy link
Contributor

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.

Copy link
Member Author

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

Copy link
Contributor

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.

@peristeri peristeri merged commit dd1a873 into master Jun 15, 2017
@peristeri peristeri deleted the jca_issue1241 branch June 15, 2017 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: fixes an error in the code sct_extract_metric context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants