Skip to content

Commit

Permalink
install and astra tomopy venv instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
gianthk committed Nov 22, 2023
1 parent a354dda commit a4c7311
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 17 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ git clone https://github.com/gianthk/alrecon.git
2. Navigate to the repository and create a virtual environment with all necessary dependencies:
```commandline
cd alrecon
conda env create --file alrecon.yml
conda activate alrecon
conda env create --file envs/alrecon-base.yml
conda activate alrecon-base
```
> [!NOTE]
> If you already have a destination virtual environment for alrecon, you can install manually the requirements listed in file [alrecon.yml](alrecon.yml).
> If you already have a destination virtual environment for alrecon, you can install manually the requirements listed in file [alrecon.yml](envs/alrecon-base.yml).
> [!NOTE]
> To use TomoPy with CUDA features, install TomoPy from conda following [these instructions](https://tomopy.readthedocs.io/en/stable/install.html).
3. Build the `alrecon` app:
```commandline
cd alrecon
pip install -e .
```

Expand Down Expand Up @@ -64,10 +66,17 @@ You can take a look at [solara's documnetation](https://solara.dev/api) for more
## Integration with Google Sheets
- `Alrecon` allows you to keep a consistent log of all reconstruction jobs on an online master Google spreadsheet.
- The integration uses [gspread](https://docs.gspread.org/en/v5.12.0/), a Python API for Google Sheets.
- You will need to setup your Google account, enable Google Sheets API, and create a Secret Key for accessing your online master. Follow [these instructions](https://www.youtube.com/watch?v=hyUw-koO2DA) to setup the integration with Google Sheets.
- You will need to setup your Google Cloud account, enable [Google Sheets API](https://developers.google.com/sheets/api/guides/concepts), and create a Secret Key with read/write permission to your online master Google sheet. Follow [these instructions](https://www.youtube.com/watch?v=hyUw-koO2DA) to setup the integration with Google Sheets API.

## Use with [napari](https://napari.org/stable/)
napari is a pure Python powerfull viewer for multi-dimensional images. Until now, alrecon supports napari only when [running the app through Jupyter](#run-al-recon-within-jupyter).
[napari](https://napari.org/stable/) is a pure Python powerfull viewer for multi-dimensional images. Until now, alrecon supports napari only when [running the app through Jupyter](#run-al-recon-within-jupyter).

## Setup [ImageJ](https://imagej.net/software/fiji/) launcher
To launch [ImageJ](https://imagej.net/software/fiji/) from the alrecon web app follow these steps:
1. Modify the path to your ImageJ executable in the alrecon general settings
![alrecon imagej executable path setting](docs/pictures/alrecon_imagej.png)

2. Copy the [FolderOpener_virtual.ijm](/imagej_macros/FolderOpener_virtual.ijm) ImageJ macro contained in `/alrecon/imagej_macros/` to the plugin folder of your ImageJ installation. On Linux this is something like `/opt/Fiji.app/macros/`.

## Acknowledgements
This work was performed within the [BEATS](https://beats-sesame.eu/) project and has received funding from the EU’s H2020 framework programme for research and innovation under grant agreement n° [822535](https://cordis.europa.eu/project/id/822535).
2 changes: 1 addition & 1 deletion alrecon/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Al-recon. Everyone can reconstruct"""
__title__ = "Al-recon"
__version__ = "0.3.1"
__version__ = "0.3.2"
__description__ = "Computed Tomography reconstruction web applicatoin. Built with solara."
Binary file added docs/pictures/alrecon_imagej.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions envs/alrecon-astra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: alrecon
channels:
- conda-forge
dependencies:
- python=3.8
- astra-toolbox::astra-toolbox
- tomopy
- plotly::plotly
- dxchange
- pandas
- tifffile
- pip
- pip:
- pypng
- matplotlib
- gspread
- gspread-dataframe
- oauth2client
- solara
- napari
3 changes: 0 additions & 3 deletions alrecon.yml → envs/alrecon-base.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: alrecon
channels:
- conda-forge
- defaults
dependencies:
- python>=3.8
- tomopy
- dxchange
- pip
- pip:
- numpy
- pandas
- tifffile
- pypng
- plotly
- matplotlib
- numexpr
- gspread
- gspread-dataframe
- oauth2client
Expand Down
51 changes: 51 additions & 0 deletions envs/install_alrecon_in_tomopy_dev_env.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## the following commands were used to create a virtual environment for alrecon with full GPU functionalities using astra-toolbox and tomopy
```commandline
conda create --name tomopy python=3.8
conda activate tomopy
conda install -c astra-toolbox astra-toolbox
conda install -c conda-forge tomopy
conda install dxchange pandas tifffile
conda install -c conda-forge dxchange pandas tifffile
pip install pypng matplotlib gspread gspread-dataframe oauth2client
pip install solara
```

---
## the following is an attempt to install tomopy and alrecon in development mode in a virtual environment with the astra-toolbox

### 1. clone the TomoPy GitHub repository
### 2. create virtual env
```commandline
conda env create -f /tomopy/envs/linux-cuda.yml --name alrecon python=3.8
conda activate alrecon
```

### 3. install astra-toolbox
```commandline
conda install -c astra-toolbox astra-toolbox
```

### 4. build TomoPy
```commandline
cd tomopy/
pip install . --no-deps
mkdir build
cd build
cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_INSTALL_LIBDIR=lib
cmake --build .
cmake --install .
```

### 5. Clone the alrecon GitHub repository
### 6. Install the alrecon dependencies
```commandline
cd alrecon/
conda install -c plotly plotly
conda install pandas tifffile
pip install pypng matplotlib gspread gspread-dataframe oauth2client
pip install solara
```
### 7. Build alrecon
```commandline
pip install -e .
```
5 changes: 5 additions & 0 deletions imagej_macros/FolderOpener_virtual.ijm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filelist = getArgument()
print("Importing .TIFF sequence:")
print(filelist)
run("Image Sequence...", "open=" + filelist + " sort use");
print("Done.")
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,17 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
"Topic :: Utilities",
]
requires-python = ">=3.8"
dynamic = ["version", "description"]
dependencies = [
"tomopy",
"pathlib",
# "logging",
# "random",
# "time",
# "math",
"numpy",
"solara",
"plotly",
"dxchange",
"tomopy",
"pyyaml",
"numpy",
"tifffile",
Expand All @@ -50,6 +44,8 @@ dependencies = [

[project.optional-dependencies]
all = [
"pandas",
"astra-toolbox::astra-toolbox",
"gspread",
"gspread_dataframe",
"oauth2client",
Expand Down

0 comments on commit a4c7311

Please sign in to comment.