webknossos-libs icon indicating copy to clipboard operation
webknossos-libs copied to clipboard

Restructure wkcuber commands / Build new CLI

Open normanrz opened this issue 3 years ago • 1 comments

The commands in wkcuber have grown over time. I think it would be time to clean that up a bit. I think we should use sub commands instead of individual modules:

# Auto-detection and converting image stacks, czi, nifti, zarr etc. 
wkcuber convert --scale 11.24,11.24,25 data/source data/target

# Specialized converting
wkcuber convert tiles --layer_name color data/source data/target
wkcuber convert zarr --layer_name color data/source/mag1 data/target
wkcuber convert knossos --layer_name color data/source/mag1 data/target
wkcuber convert raw  --layer_name color --scale 10,10,30 --input_dtype uint8 --shape 2048,2048,1024 data/source/raw_file.raw data/target
wkcuber convert nifti  --layer_name color --scale 10,10,30 data/source/nifti_file data/target

# Downsampling, upsampling, compression
wkcuber downsample --layer_name color --interpolation_mode mode --to 256 data/target 
wkcuber upsample --layer_name color --from 2 --to 1 data/target 
wkcuber compress --layer_name segmentation data/target

# Recubing
wkcuber recubing --layer_name color --dtype uint8 --chunks_per_shard 64,64,64 data/source/wkw data/target

# Exporting
wkcuber export tiff data/source data/target
wkcuber export nifti data/source data/target

# Check equality
wkcuber check_equality data/source data/target

Perhaps typer could be used to restructure this, but maybe our arguments/subcommand structure is too complicated for typer.

normanrz avatar Apr 04 '22 16:04 normanrz

This would be great! I'd even consider integrating it into the webknossos package. I would love to give this a shot!

jstriebel avatar Apr 06 '22 14:04 jstriebel

# Auto-detection and converting image stacks, czi, nifti, zarr etc. 
wkcuber convert --scale 11.24,11.24,25 data/source data/target

Should be implemented using the new Dataset.from_images API.

normanrz avatar Apr 25 '23 07:04 normanrz