Fibers length in multi animals¶
This example uses synthetic data to showcase how histoquant
can be used in a pipeline.
Annotations measurements should be exported from QuPath, following the required directory structure.
Alternatively, you can merge all your CSV files yourself, one per animal, adding an animal ID to each table. Those can be processed with the histoquant.process.process_animal()
function, in a loop, collecting the results at each iteration and finally concatenating the results. Finally, those can be used with display
module. See the API reference for the process
module.
In [1]:
Copied!
import cuisto
import cuisto
In [2]:
Copied!
# Full path to your configuration file, edited according to your need beforehand
config_file = "../../resources/demo_config_multi.toml"
# Full path to your configuration file, edited according to your need beforehand
config_file = "../../resources/demo_config_multi.toml"
In [3]:
Copied!
# Files
wdir = "../../resources/multi"
animals = ["mouse0", "mouse1"]
# Files
wdir = "../../resources/multi"
animals = ["mouse0", "mouse1"]
In [4]:
Copied!
# get configuration
cfg = cuisto.Config(config_file)
# get configuration
cfg = cuisto.Config(config_file)
In [5]:
Copied!
# get distributions per regions
df_regions, _, _ = cuisto.process.process_animals(
wdir, animals, cfg, compute_distributions=False
)
# have a look
display(df_regions.head(10))
# get distributions per regions
df_regions, _, _ = cuisto.process.process_animals(
wdir, animals, cfg, compute_distributions=False
)
# have a look
display(df_regions.head(10))
Processing mouse1: 100%|██████████| 2/2 [00:00<00:00, 15.66it/s]
Name | hemisphere | Area µm^2 | Area mm^2 | length µm | length mm | density µm^-1 | density mm^-1 | coverage index | relative count | relative density | channel | animal | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | ACVII | Contra. | 9099.04 | 0.009099 | 468.0381 | 0.468038 | 0.051438 | 51438.184688 | 24.07503 | 0.00064 | 0.022168 | marker3 | mouse0 |
1 | ACVII | Contra. | 9099.04 | 0.009099 | 4260.4844 | 4.260484 | 0.468234 | 468234.495068 | 1994.905762 | 0.0019 | 0.056502 | marker2 | mouse0 |
2 | ACVII | Contra. | 9099.04 | 0.009099 | 5337.7103 | 5.33771 | 0.586623 | 586623.45698 | 3131.226069 | 0.010104 | 0.242734 | marker1 | mouse0 |
3 | ACVII | Ipsi. | 4609.90 | 0.004610 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | marker3 | mouse0 |
4 | ACVII | Ipsi. | 4609.90 | 0.004610 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | marker2 | mouse0 |
5 | ACVII | Ipsi. | 4609.90 | 0.004610 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | marker1 | mouse0 |
6 | ACVII | both | 13708.94 | 0.013709 | 468.0381 | 0.468038 | 0.034141 | 34141.086036 | 15.979329 | 0.000284 | 0.011001 | marker3 | mouse0 |
7 | ACVII | both | 13708.94 | 0.013709 | 4260.4844 | 4.260484 | 0.310781 | 310781.460857 | 1324.079566 | 0.000934 | 0.030688 | marker2 | mouse0 |
8 | ACVII | both | 13708.94 | 0.013709 | 5337.7103 | 5.33771 | 0.38936 | 389359.811918 | 2078.289878 | 0.00534 | 0.142623 | marker1 | mouse0 |
9 | AMB | Contra. | 122463.80 | 0.122464 | 30482.7815 | 30.482782 | 0.248913 | 248912.588863 | 7587.548059 | 0.041712 | 0.107271 | marker3 | mouse0 |
In [6]:
Copied!
figs_regions = cuisto.display.plot_regions(df_regions, cfg)
figs_regions = cuisto.display.plot_regions(df_regions, cfg)