Home

Awesome

LSD NM experiments tutorial

General notes


Getting started

git clone https://github.com/funkelab/lsd_nm_experiments.git
conda create -n test_env python=3.8
conda activate test_env

If you just need boto3 for fetching containers:

pip install boto3

If you also want to view data with neuroglancer:

pip install boto3 neuroglancer h5py zarr

Downloading container(s)

python download_imgs.py

Or building legacy container from source:

./setup.sh

Fetching data

python fetch_data.py

Creating masks

python create_masks.py
singularity exec --nv ../lsd:v0.8.img python create_masks.py

Viewing the data

Example fib25 training data:


Downloading network checkpoints

python fetch_checkpoint.py

Training a network

singularity exec --nv ../../../lsd:v0.8.img python mknet.py
.
├── checkpoint
├── config.json
├── config.meta
├── mknet.py
├── predict.py
├── predict_scan.py
├── train_net_checkpoint_400000.data-00000-of-00001
├── train_net_checkpoint_400000.index
├── train_net_checkpoint_400000.meta
├── train_net.json
├── train_net.meta
├── train.py
└── view_batch.py
singularity exec --nv ../../../lsd:v0.8.img python train.py 1

if trained_until >= max_iteration:
     return
singularity exec --nv ../../../lsd:v0.8.img python train.py 400001
python -i view_batch.py -f snapshots/batch_400001.hdf


Running Inference

singularity exec --nv ../../../lsd:v0.8.img python predict_scan.py


Multitask (MTLSD)

void main() {
    emitRGB(
        vec3(
            toNormalized(getDataValue(3)),
            toNormalized(getDataValue(4)),
            toNormalized(getDataValue(5)))
        );
}
void main() {
    float v = toNormalized(getDataValue(6));
    vec4 rgba = vec4(0,0,0,0);
    if (v != 0.0) {
        rgba = vec4(colormapJet(v), 1.0);
    }
    emitRGBA(rgba);
}

Autocontext (ACLSD and ACRLSD)


Todos: add consolidated fib25/hemi nets to tutorial