Skip to main content

Reconstruct birefringence, slow axis, bright-field, and degree of polarization from polarization-resolved images.

Project description

ReconstructOrder

Reconstruct birefringence, slow axis, bright-field, and degree of polarization from polarization-resolved images. The core algorithm employs Stokes representation for reconstruction and background correction. The repository also provides utilities for batch analysis of multi-dimensional datasets acquired with Micro-Manager (https://micro-manager.org/) and OpenPolScope acquisition plugin (https://openpolscope.org/).

Installation

Create a new conda environment (optional, but recommended)

Install conda package management system by installing anaconda or miniconda (https://conda.io/). 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>

All code blocks below assume you are in the above environment

Option 1: install released version via pip

ReconstructOrder is available on pip. Running pip install will also install dependencies. From your environment created above, type:

pip install ReconstructOrder

Option 2: install developer version via git

Install the git version control system git : https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Use git to clone this repository to your current directory:

git clone https://github.com/czbiohub/ReconstructOrder.git
  • install dependencies

You have two options to install dependencies: via pip (python index package) or via docker

  • install dependencies via pip

    If you are running ReconstructOrder on your own machine, navigate to the cloned repository and install python library dependencies:

    pip install -r requirements.txt
    
  • install dependencies via docker

    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

Usage

To run reconstruction, you will need to create a configuration file. The configuration file is a .yml file and specifies parameters for:

  • 'dataset'
  • 'processing'
  • 'plotting'

Examples can be found https://github.com/czbiohub/ReconstructOrder under "examples/example_configs" folder

See /ReconstructOrder/config/config_example.yml for an example config file with detailed explanation of parameters.

Before running, you should modify the dataset:data_dir and dataset:processed_dir paths to point to source data path and output path, respectively. Example data is located at examples/example_data

There are two ways to run reconstruction:

  • from command line

    If you pip installed the library, from any folder, simply type:

    runReconstruction --config path-and-name-to-your-config.yml
    

    If you cloned the developer repo, navigate to the repo and call the script:

    (C:\ReconstructOrder\) python runReconstruction.py --config path-and-name-to-your-config.yml
    
  • from IPython

    If you are writing your own code and want to use the ReconstructOrder library, you can reconstruct as follows:
    import ReconstructOrder.workflow as wf
    wf.reconstructBatch('path-and-name-to-your-config.yml')
    

License

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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. 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.

  3. 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 ip@czbiohub.org 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ReconstructOrder-0.0.1.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

ReconstructOrder-0.0.1-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file ReconstructOrder-0.0.1.tar.gz.

File metadata

  • Download URL: ReconstructOrder-0.0.1.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ReconstructOrder-0.0.1.tar.gz
Algorithm Hash digest
SHA256 13c2610eeadc7c0341e128955212d17cfebeb7846cd611ab8858671c7abbdabb
MD5 977d8ca52895d96cd4714803bcae777b
BLAKE2b-256 38fd759d882bca491da0a571b1707fd698b99ddca405424a55f2beeb018af69f

See more details on using hashes here.

File details

Details for the file ReconstructOrder-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ReconstructOrder-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for ReconstructOrder-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8187b3df5272b96f75860dcfbe8a9c1f8432ffa7c542c11fe313cdab87d6be
MD5 fe80ec77ab29b27b2ee52da2f77d9270
BLAKE2b-256 bd4a2cfbb74bcef9d544d77b23df0431416579a3968f361b10380e1ca4336fed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page