Sign inSign up

seunglab/chunkflow

By seunglab

•Updated about 5 years ago

convnet inference using difference backends

Image
1

10K+

seunglab/chunkflow repository overview

alt text

Documentation Status Build Status PyPI version Coverage Status License Docker Hub Twitter URL

⁠Features

  • Composable operators. The chunk operators could be composed in commandline for flexible usage.
  • Hybrid Cloud Distributed computation in both local and cloud computers. The task scheduling frontend and computationally heavy backend are decoupled using AWS Simple Queue Service. The backend could be any computer with internet connection and cloud authentication.
  • Petabyte scale. We have used chunkflow to output over eighteen petabyte images and scaled up to 3600 nodes with NVIDIA GPUs across three regions in Google Cloud⁠, and chunkflow is still reliable.
  • Operators work with 3D image volumes.
  • You can plugin your own code as an operator.

Check out the Documentation⁠ for installation⁠ and usage⁠. Try it out by following the tutorial⁠.

⁠Image Segmentation Example

Perform Convolutional net inference to segment 3D image volume with one single command!

#!/bin/bash

chunkflow \
    read-tif --file-name path/of/image.tif -o image \
    inference --convnet-model path/of/model.py --convnet-weight-path path/of/weight.pt \
        --input-patch-size 20 256 256 --output-patch-overlap 4 64 64 --num-output-channels 3 \
        -f pytorch --batch-size 12 --mask-output-chunk -i image -o affs \
    plugin -f agglomerate --threshold 0.7 --aff-threshold-low 0.001 --aff-threshold-high 0.9999 -i affs -o seg \
    neuroglancer -i image,affs,seg -p 33333 -v 30 6 6

you can see your 3D image and segmentation directly in Neuroglancer⁠!

Image_Segmentation

⁠Operators

After installation, You can simply type chunkflow and it will list all the operators with help message. We keep adding new operators and will keep it update here. For the detailed usage, please checkout our Documentation⁠.

Operator NameFunction
aggregate-skeleton-fragmentsMerge skeleton fragments from chunks
channel-votingVote across channels of semantic map
cloud-watchRealtime speedometer in AWS CloudWatch
connected-componentsThreshold the boundary map to get a segmentation
copy-varCopy a variable to a new name
create-chunkCreate a fake chunk for easy test
create-infoCreate info file of Neuroglancer Precomputed volume
crop-marginCrop the margin of a chunk
delete-chunkDelete chunk in task to reduce RAM requirement
delete-task-in-queueDelete the task in AWS SQS queue
downsample-uploadDownsample the chunk hierarchically and upload to volume
evaluate-segmentationCompare segmentation chunks
fetch-task-from-fileFetch task from a file
fetch-task-from-sqsFetch task from AWS SQS queue one by one
generate-tasksGenerate tasks one by one
gaussian-filter2D Gaussian blurring operated in-place
inferenceConvolutional net inference
log-summarySummary of logs
maskBlack out the chunk based on another mask chunk
mask-out-objectsMask out selected or small objects
meshBuild 3D meshes from segmentation chunk
mesh-manifestCollect mesh fragments for object
neuroglancerVisualize chunks using neuroglancer
normalize-contrast-nkemNormalize image contrast using histograms
normalize-intensityNormalize image intensity to -1:1
normalize-section-shangNormalization algorithm created by Shang
pluginImport local code as a customized operator.
quantizeQuantize the affinity map
read-h5Read HDF5 files
read-pngsRead png files
read-precomputedCutout chunk from a local/cloud storage volume
read-tifRead TIFF files
read-nrrdRead NRRD files
remap-segmentationRenumber a serials of segmentation chunks
setup-envPrepare storage infor files and produce tasks
skeletonizeCreate centerlines of objects in a segmentation chunk
skip-taskIf a result file already exists, skip this task
skip-all-zeroIf a chunk has all zero, skip this task
thresholdUse a threshold to segment the probability map
viewAnother chunk viewer in browser using CloudVolume
write-h5Write chunk as HDF5 file
write-pngsSave chunk as a serials of png files
write-precomputedSave chunk to local/cloud storage volume
write-tifWrite chunk as TIFF file
write-nrrdWrite chunk as NRRD file

⁠Reference

We have a paper⁠ for this repo:


@article{wu_chunkflow_2021,
	title = {Chunkflow: hybrid cloud processing of large {3D} images by convolutional nets},
	issn = {1548-7105},
	shorttitle = {Chunkflow},
	url = {https://www.nature.com/articles/s41592-021-01088-5},
	doi = {10.1038/s41592-021-01088-5},
	journal = {Nature Methods},
	author = {Wu, Jingpeng and Silversmith, William M. and Lee, Kisuk and Seung, H. Sebastian},
	year = {2021},
	pages = {1--2}
}

Tag summary

Content type

Image

Digest

Size

2.5 GB

Last updated

over 5 years ago

docker pull seunglab/chunkflow