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 wrong disc labeling and other minor improvements #1814

Merged
merged 10 commits into from
Jun 6, 2018

Conversation

jcohenadad
Copy link
Member

Fixes #1812, Fixes #1810

@jcohenadad jcohenadad requested a review from zougloub June 4, 2018 05:41
@jcohenadad jcohenadad added this to the 3.2.1 milestone Jun 4, 2018
@jcohenadad jcohenadad added bug category: fixes an error in the code sct_label_vertebrae context: labels Jun 4, 2018
@jcohenadad jcohenadad self-assigned this Jun 4, 2018
Copy link
Contributor

@zougloub zougloub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions if you don't mind answering them :)

for iz in range(nz):
# get 2d slice
slice = im_seg_labeled.data[:, :, iz]
# check if at least one voxel is non-zero
if np.any(slice):
slice_one = np.copy(slice)
# set all non-zero values to 1
# set all non-zero values to 1 (to compute center of mass)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why not use center of mass with the original slice?

Copy link
Member Author

@jcohenadad jcohenadad Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if one slice includes part of vertebral level i and i+1, the center of mass will be shifted towards the i+1 level. We don't want that here (i.e. the goal is to be at the center of the cord). Comments added: c7b4b1e

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

vertebral_level_previous = np.max(im_seg_labeled.data)
# loop across z
vertebral_level_previous = np.max(im_seg_labeled.data) # initialize with the max label value
# loop across z in the superior direction (i.e. starts with the bottom slice)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments added: c7b4b1e

@jcohenadad jcohenadad merged commit d3df727 into master Jun 6, 2018
@jcohenadad jcohenadad deleted the jca_issue1812 branch June 6, 2018 11:58
jcohenadad added a commit that referenced this pull request Dec 18, 2019
* Fixed wrong disc labeling values (#1812)

* Change colormap for fsleyes syntax (#1810)

* forgot to complete #1810

* added comments


Former-commit-id: d3df727
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_label_vertebrae context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants