You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This follows discussion with @chris-allan in particular; #208 is related.
There are many different ways we could implement downsampling in Z, but a few goals to simplify the scope:
limit the addition of new dependencies, and use existing dependencies where possible
limit the number and complexity of new command line options (also keeping NGFF-Converter in mind)
consider the approaches used by existing tools, and try to adapt one to our use case
In terms of dependencies, we currently use OpenCV. Using something like VTK or nd4j is theoretically an option, but adds substantial complexity. Most of the existing tools considered (e.g. webknossos) are written in Python, and so can make use of scipy/numpy.
In terms of command line options, we already have a --downsample-type option that is used to configure whether "simple" XY downsampling (choose the upper-left corner of a 2x2 tile) is used, or OpenCV.
One proposed path forward:
Add a new boolean --downsample-z option which is false by default.
Keep the behavior of --downsample-type as-is.
If --downsample-z is set to true, downsample first in the XZ plane, then in the XY plane. The value of --downsample-type determines how this is performed. This means OpenCV can be used for both operations. Test code suggests this is fairly straightforward.
This also leaves open the possibility of adding new enum values to --downsample-type which are more 3D-aware, if we decide to add a new dependency or implementation of IImageScaler in the future.
Rejected options:
Create a 3D matrix in OpenCV and downsample it all at once
This looks possible at first glance, but previous threads and test code indicate this just doesn't work.
Simply drop every other Z plane (or equivalently, choose the corner of a 2x2x2 tile) with no other options. This was discussed in the context of how to downsample isotropically #208 and deemed to be inappropriate for the volume EM case at least.
This follows discussion with @chris-allan in particular; #208 is related.
There are many different ways we could implement downsampling in Z, but a few goals to simplify the scope:
In terms of dependencies, we currently use OpenCV. Using something like VTK or nd4j is theoretically an option, but adds substantial complexity. Most of the existing tools considered (e.g. webknossos) are written in Python, and so can make use of scipy/numpy.
In terms of command line options, we already have a
--downsample-type
option that is used to configure whether "simple" XY downsampling (choose the upper-left corner of a 2x2 tile) is used, or OpenCV.One proposed path forward:
--downsample-z
option which isfalse
by default.--downsample-type
as-is.--downsample-z
is set totrue
, downsample first in the XZ plane, then in the XY plane. The value of--downsample-type
determines how this is performed. This means OpenCV can be used for both operations. Test code suggests this is fairly straightforward.--downsample-type
which are more 3D-aware, if we decide to add a new dependency or implementation of IImageScaler in the future.Rejected options:
/cc @erindiel, @emilroz
The text was updated successfully, but these errors were encountered: