scalableminds / webknossos-libs

Python API and CLI tools for working with WEBKNOSSOS datasets, annotations and server interactions. Includes converter to OME-Zarr.
https://docs.webknossos.org/webknossos-py/index.html
22 stars 9 forks source link

Support other units than nm for dataset voxel size #1076

Open fm3 opened 1 month ago

fm3 commented 1 month ago

WEBKNOSSOS now supports unit-aware voxel sizes as of https://github.com/scalableminds/webknossos/pull/7783

hotzenklotz commented 3 weeks ago

What happens when uploading a new dataset through the WK web UI when I specify a voxel size in, e.g. cm? Is this info passed to the worker as centimeters or converted to be backward compatible?

fm3 commented 3 weeks ago

@MichaelBuessemeyer maybe you could have a look at this? I believe the frontend sets the parameters for the conversion job? Should be converted to nm for the moment I guess.

MichaelBuessemeyer commented 2 weeks ago

The frontend passed the voxel size to the convert backend route, but currently the backend route ignores this parameter. https://github.com/scalableminds/webknossos/pull/7783/files#diff-66a6ddc071c75a4168f82e78673cb7a6a84e64debcdfd553ebb5995acc1a2540

I think, the backend would need to pass this to the worker so in case the conversion is successful, the worker can register the new dataset at wk with the passed down voxel size (factor and unit).

Should we open up a worker pr to add the new unit as a parameter for the conversion job?

fm3 commented 2 weeks ago

Thanks for investigating. I’ll add an adapter to the backend code so that it will convert the unit to nanometer for now, before passing it to the worker job parameters.

Adapting the worker to actually use the unit requires this libs issue to be solved first, which will probably take a bit of time.

fm3 commented 2 weeks ago

Done that in https://github.com/scalableminds/webknossos/pull/7783/commits/d3410be3ebad5affaf5d6911c4130c7914a5f286 :) Good catch!