Skip to content

Commit

Permalink
Updated installation process with PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeLeGoc committed Dec 19, 2024
1 parent b4fbd7f commit acb4297
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 38 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,26 @@ Check the full documentation : [https://teamncmc.github.io/cuisto](https://teamn
Steps 1-3 below need to be performed only once. If Anaconda or conda is already installed, skip steps 1-2 and use the Anaconda prompt instead.
1. Install [Miniforge](https://conda-forge.org/download/), as user, add conda to PATH and make it the default interpreter.
2. Open a terminal (PowerShell in Windows). run : `conda init` and restart the terminal.
3. Create a virtual environment named "hq" with Python 3.12:
3. Create a virtual environment named "cuisto-env" with Python 3.12 :
```bash
conda create -n cuisto-env python=3.12
```
conda create -n hq python=3.12
4. Activate the environment :
```bash
conda activate cuisto-env
```bash
5. Install `cuisto` :
```
4. Activate the environment:
```
conda activate hq
```
5. Download the latest release from [here](https://github.com/TeamNCMC/cuisto/releases/latest) (choose "Source code (zip)) and unzip it on your computer.
6. Browse to the repository from the terminal and install the `cuisto` package:
```
cd /path/to/the/unzipped/folder
pip install .
pip install cuisto
```
6. (Optional) Download the latest release from [here](https://github.com/TeamNCMC/cuisto/releases/latest) (choose "Source code (zip)) and unzip it on your computer. You can copy the `scripts/` folder to get access to the QuPath and Python scripts. You can check the notebooks in `docs/demo_notebooks` as well !
The `cuisto` will be then available in Python from anywhere as long as the `hq` conda environment is activated. You can get started by looking and using the [Jupyter notebooks](#using-notebooks).
The `cuisto` will be then available in Python from anywhere as long as the `cuisto-env` conda environment is activated. You can get started by looking and using the [Jupyter notebooks](#using-notebooks).
For more complete installation instructions, see the [documentation](https://teamncmc.github.io/cuisto/main-getting-started.html#slow-start).
## Using notebooks
Some Jupyter notebooks are available in the "docs/demo_notebooks" folder. You can open them in an IDE (such as [vscode](https://code.visualstudio.com/), select the "hq" environment as kernel in the top right) or in the Jupyter web interface (`jupyter notebook` in the terminal, with the "hq" environment activated).
Some Jupyter notebooks are available in the "docs/demo_notebooks" folder. You can open them in an IDE (such as [vscode](https://code.visualstudio.com/), select the "cuisto-env" environment as kernel in the top right) or in the Jupyter web interface (`jupyter notebook` in the terminal, with the "cuisto-env" environment activated).
## Brain structures
You can generate brain structures outlines coordinates in three projections (coronal, sagittal, top-view) with the script in scripts/atlas/generate_atlas_outline.py. They are used to overlay brain regions outlines in 2D projection density maps. It might take a while so you can also grab a copy of those files here:
Expand Down
38 changes: 13 additions & 25 deletions docs/main-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ conda create -c conda-forge -n cuisto-env python=3.12
```
conda activate cuisto-env
```
4. [Download](https://github.com/TeamNCMC/cuisto/releases/latest) the latest release .zip, unzip it and install it with pip, from inside the `cuisto-xxx` folder :
4. Install `cuisto`
```
pip install .
pip install cuisto
```
If you want to build the doc :
If you want to build the doc locally :
```
pip install .[doc]
pip install cuisto[doc]
```
5. Check the [Examples section](https://teamncmc.github.io/cuisto/main-using-notebooks.html) !

## Slow start
!!! tip
Expand Down Expand Up @@ -73,8 +74,7 @@ The following commands should be run from a terminal (PowerShell). Remember that
```
conda create -c conda-forge -n cuisto-env python=3.12
```
2. Get a copy of the `cuisto` Source code .zip package, from the [Releases](https://github.com/TeamNCMC/cuisto/releases/latest) page.
3. We need to install it *inside* the `cuisto-env` environment we just created. First, you need to *activate* the `cuisto-env` environment :
2. We need to install it *inside* the `cuisto-env` environment we just created. First, you need to *activate* the `cuisto-env` environment :
```bash
conda activate cuisto-env
```
Expand All @@ -83,27 +83,15 @@ The following commands should be run from a terminal (PowerShell). Remember that
(cuisto-env) PS C:\Users\myname>
```
This means that Python packages will now be installed in the `cuisto-env` environment and won't conflict with other toolboxes you might be using.
Then, we use `pip` to install `cuisto`. `pip` was installed with Python, and will scan the `cuisto` folder, specifically the "pyproject.toml" file that lists all the required dependencies. To do so, you can either :
+
```bash
pip install /path/to/cuisto
```
+ Change directory from the terminal :
```
cd /path/to/cuisto
```
Then install the package, "." denotes "here" :
```
pip install .
```
+ Use the file explorer to get to the `cuisto` folder, use ++shift+right-button++ to "Open PowerShell window here" and run :
```
pip install .
```
3. Then, we use `pip` to install `cuisto`. `pip` was installed with Python, and will fetch the latest release from PyPI.
```bash
pip install cuisto
```
4. Get a copy of the `cuisto` Source code .zip package, from the [Releases](https://github.com/TeamNCMC/cuisto/releases/latest) page, to have access to all the utility scripts in the `scripts/` folder.

`cuisto` is now installed inside the `cuisto-env` environment and will be available in Python from that environment !

!!! tip
You will need to perform step 3. each time you want to update the package.
You can run `pip install cuisto --upgrade` from the `cuisto-env` environment to update the package.

If you already have registered data and cells in QuPath, you can export Annotations and Detections as TSV files and head to the [Example](main-using-notebooks.md) section.
If you already have registered data and cells in QuPath, you can export Annotations and Detections as TSV files and head to the [Example](main-using-notebooks.md) section. Otherwise, check out the Guides section on the left panel.

0 comments on commit acb4297

Please sign in to comment.