Code Monkey home page Code Monkey logo

biostitch's Introduction

Image stitcher for Opera Phenix HCS System

This program uses microscope coordinates from Index.idx.xml to stitch images. There is also adaptive mode that improves stitching quality by using phase correlation based image registration. Current version allows to process image datasets that are bigger than memory by writing stitched images to the file every channel or every plane. You can stitch dataset of any size as long as you have enough physical memory and amount of RAM at least the size of a single stitched plane.

Command line arguments:

Required

--img_dir path to the directory with images.

--out_dir path to output directory.

--mode stack: output image is z-stack; maxz: output image is max intensity projections across z-stack.

--scan specify type of microscope scanning used (manual or auto)

Optional

-h, --help will print help.

--xml path to the xml file with microscope metadata, typically ../Images/Index.idx.xml.

--reference_channel select channel that will be used for estimating stitching parameters. Default is to use first channel.

--stitch_channels specify space separated channel names to stitch (e.g. "DAPI" "ALEXA 657"). Default is to use all channels.

--correct_illumination_in_channels specify space separated channel names that require correction of bad illumination (e.g. "DAPI"), RNA spot channels usually do not need correction. Default is none. Use all to apply correction to all channels.

--adaptive flag that enables estimation of stitching parameters using Fourier transformation based registration. If you are enabling this parameter you have to specify expected overlap between images.

--make_preview will generate z-max projection of specified channel in the out_dir.

--save_param will save parameters estimated during stitching into 3 csv files (image_ids, x_sizes, y_sizes)

--load_param specify folder that contains the following csv files: image_ids.csv, x_size.csv, y_sizes.csv, that contain previously estimated parameters

--output_name specify name of the output image. Default ot use name from Index.idx.xml

--fovs specify a comma separated, without spaces, subset of fields of view you want to use for stitching

--extra_meta, JSON formatted extra metadata ("channel_names")

Example usage

cd biostitch
conda activate biostitch
python -m biostitch --img_dir "/path/to/dataset/Images/" --out_dir "/path/to/out/directory/" --scan "manual" --mode "maxz" --adaptive --make_preview --stitch_channels "DAPI" "ALEXA 568" --correct_illumination_in_channels "DAPI" --extra_meta "{ \"channel_names\": { \"DAPI\": \"nuclei\", \"Alexa 488\": \"some gene\" } }"

Dependencies

numpy, pandas, imagecodecs-lite, tifffile, opencv-contrib-python, dask

This program developed and tested in the conda environment and some packages may fail to install correctly without it. If you want to install dask with pip, use command pip install "dask[complete]".

Installation example for conda

conda create -n biostich python=3.7 numpy pandas dask

source activate biostitch

pip install imagecodecs-lite tifffile opencv-contrib-python

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.