Skip to content

Commit

Permalink
Merge pull request #101 from PolarizedLightFieldMicroscopy/structure
Browse files Browse the repository at this point in the history
Structure
  • Loading branch information
gschlafly authored Jun 5, 2024
2 parents 0eb713f + 6bb7cc7 commit ac9075d
Show file tree
Hide file tree
Showing 173 changed files with 7,814 additions and 7,046 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pytest-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,8 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -r requirements.txt
pip install -e .[test]
- name: Test with pytest
run: |
pytest
pytest -m "not slow"
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
*/__pycache__/*
.ipynb_checkpoints/*
reconstructions/*
forward_images/*
playground/*
phantoms/*
xylem_mid_outputs/*
intensity_images_shape_17/*
intensity_images_shape_85/*
forward_images_noise/*
data/*
*.pkl
src/bir_tomo.egg-info/*
2 changes: 1 addition & 1 deletion .streamlit/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ runOnSave = true
# textColor = "#DCDCDC"
# font = "sans serif"

# type the following to see all the settings: streamlit config show
# type the following to see all the settings: streamlit config show
63 changes: 34 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,40 @@
![python version](https://img.shields.io/badge/python-3.11-blue)
![python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
[![Run Pytest](https://github.com/PolarizedLightFieldMicroscopy/forward-model/actions/workflows/pytest-action.yml/badge.svg)](https://github.com/PolarizedLightFieldMicroscopy/forward-model/actions/workflows/pytest-action.yml)
# GeoBirT
Polarized light field microscopy forward model and inverse model using geometrical optics and Jones Calculus.

## How to use
## Installation
Run the following code to create a virtual environment will all the necessary and relevant packages:
```
conda create --name bir-tomo python=3.11 --yes
conda activate bir-tomo
pip install -e .
```
If you have a CUDA on your computer, or having issues with pytorch, try following the instructions [here](https://pytorch.org/get-started/locally/) for installing pytorch.

To download an editable installation in developer mode:
```
pip install -e .[dev]
```

### Requirements
See `pyproject.toml` for the dependencies.

Necessary packages:
- matplotlib (numpy is included)
- tqdm
- torch
- h5py (for reading and saving volumes)
- tifffile (for reading and saving images)
- plotly (for visualizing volumes)
- ipykernel (for using jupyter notebooks)
- streamlit (for running the streamlit page locally)
- pytest (for testing code during development)
- scikit-image (for analyzing images)

## Birefringence tomography
*To be updated soon...*

For the forward model, the main script is `run_simulations.py`. The workflow within that script is the following:

1. Create a birefringent raytracer.
Expand Down Expand Up @@ -32,32 +63,6 @@ streamlit run User_Interface.py

You can also use our streamlit app that runs on the streamlit cloud and uses the code in the *stream* branch: https://polarizedlightfieldmicroscopy-forward-mo-user-interface-dc1r85.streamlit.app/

## Requirements
<!-- See environment.txt and environment.yml files. -->

Necessary packages:
- matplotlib (numpy is included)
- tqdm
- torch
- h5py (for reading and saves volumes)
- plotly (for visualizing volumes)
- ipykernel (for using jupyter notebooks)
- os (for saving images)
- streamlit (for running the streamlit page locally)
- pytest (for testing code during development)

Run the following code to create a virtual environment will all the necessary and relevant packages:
```
conda create --name model python=3.11 tqdm matplotlib h5py --yes
conda activate model
conda install -c conda-forge pytorch ipykernel tifffile --yes
conda install -c plotly plotly --yes
pip install streamlit
conda install -c anaconda pytest --yes
```

If you have a CUDA on your computer, or having issues with pytorch, try following the instructions [here](https://pytorch.org/get-started/locally/) for installing pytorch.

## Testing
- Run ```pytest``` in the terminal to check that all the tests pass.
- An example of running a particular test is ```pytest -v test_jones.py::test_polscope```.
- An example of running a particular test is ```pytest -v tests/test_jones.py::test_polscope```.
16 changes: 0 additions & 16 deletions VolumeRaytraceLFM/birefringence_base.py

This file was deleted.

Loading

0 comments on commit ac9075d

Please sign in to comment.