-
Notifications
You must be signed in to change notification settings - Fork 4
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
Apply scale #8
Apply scale #8
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8 +/- ##
==========================================
- Coverage 92.06% 91.55% -0.52%
==========================================
Files 3 3
Lines 290 308 +18
==========================================
+ Hits 267 282 +15
- Misses 23 26 +3
Continue to review full report at Codecov.
|
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.
Hey Johannes @jo-mueller ,
thanks for working on this.
I'm wondering if it is possible to write a bit cleaner code. I suggest, either all functions consume layers or all functions consume nparrays. That would make it easier to maintain later.
I often see syntax like labels_data: Union[[napari.layers.Labels, napari.types.LabelsData]]
as parameter type annotation. Have you tested this from napari? If you run this function from within napari, how does the user-interface look like? I'm wondering how magicgui can guess how to build a user-interface for this type...
Thanks!
Robert
@@ -340,7 +344,10 @@ def points_to_labels(points_data:PointsData, as_large_as_image:LayerData, viewer | |||
|
|||
# labels_stack[points_data] = np.arange(len(points_data)) | |||
|
|||
labels_stack = np.zeros(as_large_as_image.shape, dtype=int) | |||
labels_stack = np.zeros(as_large_as_image.data.shape, dtype=int) |
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.
Will this work if as_large_as_image
is of type LayerData
?
if __name__ == '__main__': | ||
import napari | ||
test_something(napari.Viewer) |
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.
if __name__ == '__main__': | |
import napari | |
test_something(napari.Viewer) |
You do not need this if you run pytest -k test_curvature
from the command line.
binary = np.asarray(labels == label_id) | ||
|
||
vertices, faces, normals, values = marching_cubes(binary, 0) | ||
|
||
if isinstance(labels, Labels): |
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'm suspecting this will never be true because of lines 441/442 above
Hey @haesleinhuepf
Sorry about that. I changed the PR to draft mode for fixing it up and will notify you once it's ready for review.
In that case it would have to be layers - otherwise there's no way to access the scale parameter inside a function. |
Fixes #6