Skip to content

Commit

Permalink
Merge pull request #1 from TeamNCMC/rename-to-cuisto
Browse files Browse the repository at this point in the history
Rename package to cuisto
  • Loading branch information
GuillaumeLeGoc authored Dec 19, 2024
2 parents 0c8c987 + c8d6067 commit d90246e
Show file tree
Hide file tree
Showing 48 changed files with 170 additions and 169 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
This file might no be up to date nor complete. Please check the Releases page for more information on versions.

## Version 2024.12.19
- Renamed the package to cuisto (because histoquant is already the name of a commercial software).

## Version 2024.12.10
- Fixed offset writing geojson file in segmentation module.
- Added original_pixelsize parameters to rescale coordinates to match final image size. This allows the use of QuPath pixel classifier trained on resized image, eg. with a lower Resolution parameter (higher pixel size).
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# histoquant
# cuisto

Python package for histological quantification of objects in reference atlas regions.

`histoquant` uses data exported from [QuPath](https://qupath.github.io) used with [ABBA](https://abba-documentation.readthedocs.io/en/latest/) to pool data and derive, average and display metrics.
`cuisto` uses data exported from [QuPath](https://qupath.github.io) used with [ABBA](https://abba-documentation.readthedocs.io/en/latest/) to pool data and derive, average and display metrics.

Check the full documentation : [https://teamncmc.github.io/histoquant](https://teamncmc.github.io/histoquant)
Check the full documentation : [https://teamncmc.github.io/cuisto](https://teamncmc.github.io/cuisto)

## Install
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.
Expand All @@ -18,16 +18,16 @@ Steps 1-3 below need to be performed only once. If Anaconda or conda is already
```
conda activate hq
```
5. Download the latest release from [here](https://github.com/TeamNCMC/histoquant/releases/latest) (choose "Source code (zip)) and unzip it on your computer.
6. Browse to the repository from the terminal and install the `histoquant` package:
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 .
```
The `histoquant` 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 `hq` 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/histoquant/main-getting-started.html#slow-start).
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).
Expand All @@ -51,4 +51,4 @@ Head to [http://localhost:8000/](http://localhost:8000/) from a web browser.
The documentation is built with [MkDocs](https://www.mkdocs.org/) using the [Material theme](https://squidfunk.github.io/mkdocs-material/). [KaTeX](https://katex.org/) CSS and fonts are embedded instead of using a CDN, and are under a [MIT license](https://opensource.org/license/MIT).

## Credits
`histoquant` has been primarly developed by [Guillaume Le Goc](https://legoc.fr) in [Julien Bouvier's lab](https://www.bouvier-lab.com/) at [NeuroPSI](https://neuropsi.cnrs.fr/).
`cuisto` has been primarly developed by [Guillaume Le Goc](https://legoc.fr) in [Julien Bouvier's lab](https://www.bouvier-lab.com/) at [NeuroPSI](https://neuropsi.cnrs.fr/). The clever name was found by Aurélie Bodeau.
4 changes: 2 additions & 2 deletions configs/config_template.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
########################################################################################
# Configuration file for histoquant package
# Configuration file for cuisto package
# -----------------------------------------
# This is a TOML file. It maps a key to a value : `key = value`.
# Each key must exist and be filled. The keys' names can't be modified, except:
Expand All @@ -11,7 +11,7 @@
# - the TOML specification : https://toml.io/en/
# - matplotlib colors : https://matplotlib.org/stable/gallery/color/color_demo.html
#
# Configuration file part of the python histoquant package.
# Configuration file part of the python cuisto package.
# version : 2.1
########################################################################################

Expand Down
2 changes: 1 addition & 1 deletion histoquant/__init__.py → cuisto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""histoquant package.
"""cuisto package.
Perform quantification of objects in registered and segmented histological slices.
"""

Expand Down
4 changes: 2 additions & 2 deletions histoquant/compute.py → cuisto/compute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""compute module, part of histoquant.
"""compute module, part of cuisto.
Contains actual computation functions.
Expand All @@ -7,7 +7,7 @@
import numpy as np
import pandas as pd

from histoquant.utils import get_starter_cells, select_hemisphere_channel
from cuisto.utils import get_starter_cells, select_hemisphere_channel


def get_regions_metrics(
Expand Down
6 changes: 3 additions & 3 deletions histoquant/config.py → cuisto/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""config module, part of histoquant.
"""config module, part of cuisto.
Contains the Config class.
Expand All @@ -8,7 +8,7 @@
import warnings

from brainglobe_atlasapi import BrainGlobeAtlas
from histoquant import utils
from cuisto import utils


class Config:
Expand Down Expand Up @@ -42,7 +42,7 @@ def __init__(self, config_file):
self.get_leaves_list()

def get_blacklist(self):
"""Wraps histoquant.utils.get_blacklist."""
"""Wraps cuisto.utils.get_blacklist."""

self.atlas["blacklist"] = utils.get_blacklist(
self.files["blacklist"], self.bg_atlas
Expand Down
4 changes: 2 additions & 2 deletions histoquant/display.py → cuisto/display.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""display module, part of histoquant.
"""display module, part of cuisto.
Contains display functions, essentially wrapping matplotlib and seaborn functions.
Expand All @@ -12,7 +12,7 @@
import seaborn as sns
from matplotlib import patches

from histoquant import utils
from cuisto import utils


def add_injection_patch(X: list, ax: plt.Axes, **kwargs) -> plt.Axes:
Expand Down
6 changes: 3 additions & 3 deletions histoquant/io.py → cuisto/io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""io module, part of histoquant.
"""io module, part of cuisto.
Contains loading and saving functions.
Expand All @@ -7,7 +7,7 @@
import os

from brainglobe_atlasapi import BrainGlobeAtlas
from histoquant import utils
from cuisto import utils
import orjson
import pandas as pd

Expand Down Expand Up @@ -282,7 +282,7 @@ def load_dfs(
File(s) format.
identifiers : list of str, optional
List of identifiers to load from files. Defaults to the ones saved in
histoquant.process.process_animals().
cuisto.process.process_animals().
Returns
-------
Expand Down
8 changes: 4 additions & 4 deletions histoquant/process.py → cuisto/process.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""process module, part of histoquant.
"""process module, part of cuisto.
Wraps other functions for a click&play behaviour. Relies on the configuration file.
Expand All @@ -9,7 +9,7 @@
import pandas as pd
from tqdm import tqdm

from histoquant import compute, io, utils
from cuisto import compute, io, utils


def process_animal(
Expand All @@ -31,7 +31,7 @@ def process_animal(
Animal ID.
df_annotations, df_detections : pd.DataFrame
DataFrames of QuPath Annotations and Detections.
cfg : histoquant.Config
cfg : cuisto.Config
The configuration loaded from TOML configuration file.
compute_distributions : bool, optional
If False, do not compute the 1D distributions and return an empty list.Default
Expand Down Expand Up @@ -185,7 +185,7 @@ def process_animals(
Base working directory, containing `animals` folders.
animals : list-like of str
List of animals ID.
cfg: histoquant.Config
cfg: cuisto.Config
Configuration object.
out_fmt : {None, "h5", "csv", "tsv", "xslx", "pickle"}
Output file(s) format, if None, nothing is saved (default).
Expand Down
2 changes: 1 addition & 1 deletion histoquant/seg.py → cuisto/seg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""seg module, part of histoquant.
"""seg module, part of cuisto.
Functions for segmentating probability map stored as an image.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion histoquant/utils.py → cuisto/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""utils module, part of histoquant.
"""utils module, part of cuisto.
Contains utilities functions.
Expand Down
2 changes: 1 addition & 1 deletion docs/api-compute.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.compute
:::cuisto.compute
2 changes: 1 addition & 1 deletion docs/api-config-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
`normalize_starter_cells` : normalize non-relative metrics by the number of starter cells

<h4>metrics</h4>
*Names of metrics. The keys are used internally in histoquant as is so should NOT be modified. The values will only chang etheir names in the ouput file*
*Names of metrics. The keys are used internally in cuisto as is so should NOT be modified. The values will only chang etheir names in the ouput file*

`"density µm^-2"` : relevant name
`"density mm^-2"` : relevant name
Expand Down
2 changes: 1 addition & 1 deletion docs/api-config.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.config
:::cuisto.config
2 changes: 1 addition & 1 deletion docs/api-display.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.display
:::cuisto.display
2 changes: 1 addition & 1 deletion docs/api-io.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.io
:::cuisto.io
2 changes: 1 addition & 1 deletion docs/api-process.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.process
:::cuisto.process
2 changes: 1 addition & 1 deletion docs/api-seg.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.seg
:::cuisto.seg
2 changes: 1 addition & 1 deletion docs/api-utils.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:::histoquant.utils
:::cuisto.utils
16 changes: 8 additions & 8 deletions docs/demo_notebooks/cells_distributions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"This notebook shows how to load data exported from QuPath, compute metrics and display them, according to the configuration file. This is meant for a single-animal.\n",
"\n",
"There are some conventions that need to be met in the QuPath project so that the measurements are usable with `histoquant`:\n",
"There are some conventions that need to be met in the QuPath project so that the measurements are usable with `cuisto`:\n",
"+ Objects' classifications must be derived, eg. be in the form \"something: else\". The primary classification (\"something\") will be refered to \"object_type\" and the secondary classification (\"else\") to \"channel\" in the configuration file.\n",
"+ Only one \"object_type\" can be processed at once, but supports any numbers of channels.\n",
"+ Annotations (brain regions) must have properly formatted measurements. For punctual objects, it would be the count. Run the \"add_regions_count.groovy\" script to add them. The measurements names must be in the form \"something: else name\", for instance, \"something: else Count\". \"name\" is refered to \"base_measurement\" in the configuration file.\n",
Expand All @@ -24,7 +24,7 @@
"source": [
"import pandas as pd\n",
"\n",
"import histoquant as hq"
"import cuisto"
]
},
{
Expand Down Expand Up @@ -59,7 +59,7 @@
"outputs": [],
"source": [
"# get configuration\n",
"cfg = hq.config.Config(config_file)"
"cfg = cuisto.config.Config(config_file)"
]
},
{
Expand Down Expand Up @@ -812,7 +812,7 @@
],
"source": [
"# get distributions per regions, spatial distributions and coordinates\n",
"df_regions, dfs_distributions, df_coordinates = hq.process.process_animal(\n",
"df_regions, dfs_distributions, df_coordinates = cuisto.process.process_animal(\n",
" animal, df_annotations, df_detections, cfg, compute_distributions=True\n",
")\n",
"\n",
Expand Down Expand Up @@ -849,9 +849,9 @@
],
"source": [
"# plot distributions per regions\n",
"figs_regions = hq.display.plot_regions(df_regions, cfg)\n",
"figs_regions = cuisto.display.plot_regions(df_regions, cfg)\n",
"# specify which regions to plot\n",
"# figs_regions = hq.display.plot_regions(df_regions, cfg, names_list=[\"GRN\", \"IRN\", \"MDRNv\"])\n",
"# figs_regions = cuisto.display.plot_regions(df_regions, cfg, names_list=[\"GRN\", \"IRN\", \"MDRNv\"])\n",
"\n",
"# save as svg\n",
"# figs_regions[0].savefig(r\"C:\\Users\\glegoc\\Downloads\\regions_count.svg\")\n",
Expand All @@ -876,7 +876,7 @@
],
"source": [
"# plot 1D distributions\n",
"fig_distrib = hq.display.plot_1D_distributions(\n",
"fig_distrib = cuisto.display.plot_1D_distributions(\n",
" dfs_distributions, cfg, df_coordinates=df_coordinates\n",
")"
]
Expand Down Expand Up @@ -906,7 +906,7 @@
],
"source": [
"# plot heatmap (all types of cells pooled)\n",
"fig_heatmap = hq.display.plot_2D_distributions(df_coordinates, cfg)"
"fig_heatmap = cuisto.display.plot_2D_distributions(df_coordinates, cfg)"
]
}
],
Expand Down
Loading

0 comments on commit d90246e

Please sign in to comment.