Analyze density (bright-field, phase), anisotropy (birefringence, slow axis), and degree of polarization of specimens from polarization-resolved and depth-resolved images. The acquisition, calibration, background correction, and reconstruction algorithms are described in the following preprint and paper:
Guo, S.-M., Yeh, L.-H., Folkesson, J.,..., Mehta, S. B. (2019). [Revealing architectural order with quantitative label-free imaging and deep learning.](https://doi.org/10.1101/631101) BioRxiv 631101.
Syuan-Ming Guo, Li-Hao Yeh, Jenny Folkesson, Ivan E Ivanov, Anitha P Krishnan, Matthew G Keefe, Ezzat Hashemi, David Shin, Bryant B Chhun, Nathan H Cho, Manuel D Leonetti, May H Han, Tomasz J Nowakowski, Shalin B Mehta, "Revealing architectural order with quantitative label-free imaging and deep learning," eLife 2020;9:e55502 DOI: 10.7554/eLife.55502 (2020).
We have now added support for Micro-Manager 2.0 and developed a napari plugin for QLIPP. The corresponding GitHub repository is recOrder. reconstruct-order
is no longer maintained.
As an illustration, following figure shows inputs and outputs of the ReconstructOrder for polarization-resolved data acquired at 21 consecutive focal planes with 2D phase reconstruction algorithm.
ReconstructOrder currently supports data format acquired using Micro-Manager 1.4.22 multi-dimension acquisition (link) and OpenPolScope acquisition plugin (link). We will add support for Micro-Manager 2.0 format in the next release.
Install conda package management system by installing anaconda or miniconda (link). Creating a conda environment dedicated to ReconstructOrder will avoid version conflicts among packages required by ReconstructOrder and packages required by other python software.
conda create -n <your-environment-name> python=3.7 conda activate <your-environment-name>
ReconstructOrder is available on pip. Running pip install will also install dependencies. From your environment created above, type:
pip install ReconstructOrder
Install the git version control system git : link
Use git to clone this repository to your current directory:
git clone https://github.com/mehta-lab/reconstruct-order.git
You cab install dependencies via pip (python index package) or run ReconstructOrder inside a docker container with the dependencies pre-installed
If you are running ReconstructOrder on your own machine,
a) navigate to the cloned repository:
cd reconstruct-order
b) install python library dependencies:pip install -r requirements.txt
c) Create a symbolic library link with setup.py:python setup.py develop
If you are running ReconstructOrder on a compute node (e.g., fry2@czbiohub), it is recommended to run it in a Docker container. Docker is the virtual environment with all the required libraries pre-installed so you can run your copy of ReconstructOrder without recreating the environment. The docker image for ReconstructOrder has been built on fry2@czbiohub. If you are running ReconstructOrder on other servers, you can build the docker image after cloning the repository by doing :
docker build -t reconstruct_order:py37 -f Dockerfile.ReconstructOrder .
Now, to start a docker container, do
docker run -it -v /data/<your data dir>/:<data dir name inside docker>/ -v ~/ReconstructOrder:/ReconstructOrder reconstruct_order:py37 bash
ReconstructOrder supports NVIDIA GPU computation through cupy package, please follow here for installation (check cupy is properly installed by import cupy
). To enable gpu processing, set processing: use_gpu: True
in the configuration file.
The reconstruction parameters are specified in the configuration file.
Configuration file template(config_example.yml
) can be found here underexamples
folder, which incluides detailed explanation of parameters for running ReconstructOrder in different modesTo use the configuration file template for your data, you need to at least modify
dataset: data_dir
anddataset: processed_dir
to point to source data path and output path. See the template docstrings for the usage of other parameters.
If you pip installed the library, from any folder, simply type:
runReconstruction --config path-and-name-to-your-config.yml
or
python runReconstruction.py --config path-and-name-to-your-config.yml
if you the symlink wasn't set up.
- To call ReconstructOrder as a library in your own script to run reconstruction:
import ReconstructOrder.workflow as wf wf.reconstruct_batch('path-and-name-to-your-config.yml')
In the following, we demonstrate how to download our example dataset (hosted here) and run ReconstructOrder on it to get birefringence and phase images. This instruction should work for installation from both Option 1 and 2.
a) In the terminal, switch to the environment with ReconstructOrder installed
conda activate <your-environment-name>
b) Navigate to the repository folder:
cd reconstruct-order
c) Download example dataset:
python DownloadExample.py
The example datasets will be downloaded and upzipped in the data_downloaded
folder, together with the configuration files.
d) Run ReconstructOrder on the downloaded dataset, e.g. MouseBrain dataset:
python runReconstruction.py --config ./data_downloaded/MouseBrain/config.yml
e) The reconstructed images will be saved the data_downloaded
folder. You can reconstruct other downloaded datasets following the above steps, or change the parameters in the configuration file and observe the changes in the output images.
Chan Zuckerberg Biohub Software License
This software license is the 2-clause BSD license plus clause a third clause that prohibits redistribution and use for commercial purposes without further permission.
Copyright © 2019. Chan Zuckerberg Biohub. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Redistributions and use for commercial purposes are not permitted without the Chan Zuckerberg Biohub's written permission. For purposes of this license, commercial purposes are the incorporation of the Chan Zuckerberg Biohub's software into anything for which you will charge fees or other compensation or use of the software to perform a commercial service for a third party. Contact [email protected] for commercial licensing opportunities.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.