-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update feature tables as per table specifications, in napari-workflows-wrapper task #593
Comments
I realized that it's not so easy to comply with our table specs V1 for feature tables created with the napari-workflows task. In the specs, we require this kind of attibutes: "type": "feature_table",
"region": { "path": "../labels/label_DAPI" },
"instance_key": "label", where A concrete exampleAs an example we may have this workflow !!python/object:napari_workflows._workflow.Workflow
_tasks:
regionprops_DAPI: !!python/tuple
- !!python/name:napari_skimage_regionprops._regionprops.regionprops_table ''
- dapi_img
- dapi_label_img
- true
- true
- false
- false
- false
- false combined with the following arguments of the fractal task # Prepare parameters for second napari-workflows task (measurement)
workflow_file = str(testdata_path / "napari_workflows/wf_4.yaml")
input_specs = {
"dapi_img": {"type": "image", "channel": {"wavelength_id": "A01_C01"}}, # type: ignore # noqa
"dapi_label_img": {"type": "label", "label_name": "label_DAPI"}, # type: ignore # noqa
}
output_specs = {
"regionprops_DAPI": { # type: ignore # noqa
"type": "dataframe",
"table_name": "regionprops_DAPI",
},
} Extract expected value of
|
This gets even more complicated for the napari workflow case, because the workflow itself may be creating the label image that measurements are made on. To be pragmatic, I'd say we go with Option A for the moment and include help text for the That just gets added to the metadata, so we create example OME-Zarrs that are compliant with our spec with our example workflows. Just for the record, some inference would be possible:
Our inputs & outputs have types, so we could try some inference on "type": "label" in the input & output specs. But there is the risk that e.g. the workflow loads a label image, modifies it and then makes measurements. Or that a label image is created by the workflow, but not stored as an output (I'd not recommend either, but it's possible in this flexible workflow setup). There are some fancier scenarios we could consider: we can optionally ask the user to add a For me, the main question is how much time we want to invest into our napari workflow wrapper. Given some uncertainty over the stability and continued investment into napari workflows, I'd limit it for the time being => just go with Option A
I still think the spec is an overall good idea. And it should get used by the scmultiplex measurements, which are much more straightforward: Based on a label image, create measurements and save them to a table. Those are what I currently use as a default measurement task and we can make them spec compliant. Plus, this spec will enable interesting downstream functionality in napari plugins to automatically associate measurements to the correct label layer, which would be very useful. |
Any preference between the following two options?
I'd rather go with 2, because it offers an intuitive way of setting that parameter in the most common cases:
Examples (within option 2): # Label already exists
input_specs = {
"dapi_img": {
"type": "image",
"channel": {
"wavelength_id": "A01_C01"
}
},
"dapi_label_img": {
"type": "label",
"label_name": "label_DAPI"
},
}
output_specs = {
"regionprops_DAPI": {
"type": "dataframe",
"table_name": "regionprops_DAPI",
"label_name": "label_DAPI",
},
}
# Label is computed within the same workflow (warning: I did not test this)
input_specs = {
"input": {
"type": "image",
"channel": {
"wavelength_id": "A01_C01"
}
}
}
output_specs = {
"Result of Expand labels (scikit-image, nsbatwm)": {
"type": "label",
"label_name": "label_DAPI",
},
"regionprops_DAPI": {
"type": "dataframe",
"table_name": "regionprops_DAPI",
"label_name": "label_DAPI",
},
} |
…`region/path` table attribute (ref #593)
Option 2 is currently implemented through 7043d64. The relevant bit of the task looks like this |
|
When producing feature tables from the napari-workflows-wrapper task, we are currently not complying with our own feature-table specifications, which are being defined as part of #582.
We currently write a measurement table into a Zarr group as:
without including any
table_attrs
. We should start to also use the attributes that were proposed in ome/ngff#64 (e.g.type
,region
,instance_key
).The text was updated successfully, but these errors were encountered: