hammerlab / cytokit

Microscopy Image Cytometry Toolkit
Apache License 2.0
115 stars 18 forks source link

Initial codex processor CLI implementation #2

Closed eric-czech closed 6 years ago

eric-czech commented 6 years ago

Hey @nsamusik ,

I put some installation details and usage in the README where the idea was to have a CLI that would let you do this:

# Enable use of the file naming convention you mentioned before
> export CODEX_FILE_FORMAT_VERSION='v0.2' 
> codex-processor \
    --gpus=[0,1]                      # Can be a scalar or list of GPUs to use
    --input-dir=path/to/raw/stacks \  # Contains "Cyc*_reg*" folders
    --config-dir=path/to/configs \    # Defaults to data dir
    --output-dir=path/to/output 

As far as file naming conventions go, I added environment variables like CODEX_FILE_FORMAT_VERSION and CODEX_CONFIG_VERSION to control changes in configuration schemas and file naming versions, where the file naming schemas are declared like this.

I think the version 0.2 file naming formats there would take care of what you were asking about though I'm unclear on how to write output files normally like reg1_X01_Y01.tif in a format like C###_Z###_T###.tif so right now it's R###_X###_Y###.tif instead. Was the intention really to do away with X/Y coordinates in the resulting files? Let me know what I'm missing.

I tested it so far on Windows, Mac and Linux (via nvidia-docker) with little issue so far except that on Windows you also have to set an environment variable like set CODEX_CPU_ONLY_OPS=CodexFocalPlaneSelector,TranslationApplier since those operations in my code currently use TensorFlow ops with unsupported CUDA functions on Windows.


Also @armish , I know this is a tough commit to review since I rebased a lot into it (I'll keep them shorter if we get a back and forth going) but here are some key parts:

Or suggestions on anything else would be great too!