Skip to content

[napari-workflows] Access parameters within napari-workflow? #158

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

Closed
tcompa opened this issue Oct 27, 2022 · 3 comments
Closed

[napari-workflows] Access parameters within napari-workflow? #158

tcompa opened this issue Oct 27, 2022 · 3 comments

Comments

@tcompa
Copy link
Collaborator

tcompa commented Oct 27, 2022

placeholder, I'll update later (e.g. True,True,True,True, in measurement for 3D)

@jluethi
Copy link
Collaborator

jluethi commented Oct 27, 2022

If this is about #152, I think that's mostly out-of-scope for Fractal. The user should provide pipelines with correct settings for the resolution levels they want to run things at. We can't know which parameters would need to be scaled when.

If it's about changing other parameters, I'm happy to have the discussion whether those should be modified within Fractal or whether that should be done outside of Fractal :)

@tcompa
Copy link
Collaborator Author

tcompa commented Oct 27, 2022

TL;DR
This issue was not specially relevant, and can be closed right away. I thought we'd have to validate some inputs (the perimeter=True/False one) to avoid unsafe execution, but actually the napari-workflow function (a wrapper of scikit-image itself) already does that for us.
If access to workflow parameters comes up somewhere else we can open a new issue. I guess the typical answer will be "user is in charge".


The regionprops function that we use as part of workflows has these arguments:

def regionprops(
  image_layer : napari.layers.Layer,
  labels_layer: napari.layers.Labels,
  size : bool = True,
  intensity : bool = True,
  perimeter : bool = False,
  shape : bool = False,
  position : bool = False,
  moments : bool = False,
  napari_viewer : Viewer = None):

On one example (I don't have a reproducible script at hand, but I can recreate it if is useful) running on 3D data and with all arguments set to True led to a memory error (asking for >50G of memory allocation, for the tiny dataset). This seemed weird and I switched to True, True, False, False, False, False, which was sufficient to avoid the error.

At first (and this is the reason for the current issue) I thought that the problem was that perimeter measurement is not allowed for 3D images. Then I realized that the napari-workflows function linked above actually raises a warning about that, and then skips this property. Therefore the large memory usage should have come from some other property (shape, position or moments). I did not dig further to identify it.

@tcompa tcompa closed this as completed Oct 27, 2022
Repository owner moved this from TODO to Done in Fractal Project Management Oct 27, 2022
@jluethi
Copy link
Collaborator

jluethi commented Oct 27, 2022

Ok, makes sense, thanks for the context! :) They work well on 2D examples, but some may not make sense for 3D measurements :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants