-
Notifications
You must be signed in to change notification settings - Fork 37
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
Minor fixes to segmentation #195
Conversation
if pixel_array.shape[1:3] != (self.Rows, self.Columns): | ||
raise ValueError( | ||
'Pixel array representing segments has the wrong number of ' | ||
'rows and columns.' | ||
) |
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.
This is true by construction of the self.Rows and self.Columns, so the check is pointless
if pixel_array.ndim == 2: | ||
pixel_array = pixel_array[np.newaxis, ...] |
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.
This is duplicated from above
if pixel_array.ndim not in [3, 4]: | ||
raise ValueError('Pixel array must be a 2D, 3D, or 4D array.') |
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.
Moving this earlier simplifies things a bit
As I was reviewing #184 I noticed some minor errors in the implementation of segmentation. Just some checks that are redundant and make the code more confusing to follow as well as the typo you found in the examples. I thought I might as well push these now
@hackermd