Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge imio in as image_io submodule #33

Merged
merged 89 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
e014c7b
Initial commit
crousseau Oct 1, 2021
4a20910
bump
adamltyson Jul 15, 2020
c74a57e
bump
adamltyson Jul 15, 2020
4e76714
bump
adamltyson Jul 15, 2020
1a386cf
add bump2version
adamltyson Jul 16, 2020
09d0378
Bump version: 0.0.2 → 0.0.3
adamltyson Jul 16, 2020
8c2c522
add pre commit hooks
adamltyson Jul 16, 2020
6de2eed
update testing
adamltyson Jul 16, 2020
4a6d038
reorder ci
adamltyson Jul 16, 2020
8e6ae65
fix non-istropic loading error
adamltyson Nov 5, 2020
9a77dcd
Bump version: 0.0.3 → 0.0.4
adamltyson Nov 5, 2020
9722889
Gh actions (#3)
adamltyson Nov 25, 2020
2848622
transfer to brainglobe
adamltyson Dec 16, 2020
b820e00
run tests on PR
adamltyson Jun 21, 2021
091a5cc
update coverage
adamltyson Jun 21, 2021
5c72f6f
support python 3.9
adamltyson Jun 21, 2021
a569cce
Bump version: 0.0.5 → 0.0.6
adamltyson Jun 21, 2021
e3eb0ec
update bump2version
adamltyson Jun 21, 2021
3a91bbe
Bump version: 0.0.6 → 0.1.0-rc0
adamltyson Jun 21, 2021
1fde218
Bump version: 0.1.0-rc0 → 0.1.0
adamltyson Jun 21, 2021
6db5636
Update setup.py
adamltyson Oct 7, 2021
9c8ee28
add missing import
adamltyson Oct 7, 2021
8e615b2
Update README.md
adamltyson Oct 7, 2021
d5ff00f
fix linting
adamltyson Oct 7, 2021
951411e
Exclude tests from packaged distributions (#6)
jaimergp Feb 4, 2022
c005053
Update pre commit
adamltyson Feb 4, 2022
125c9b5
reformat
adamltyson Feb 4, 2022
70361c1
Python 3.10 compatibility
adamltyson Feb 4, 2022
5f9f551
Bump version: 0.1.0 → 0.2.0-rc0
adamltyson Feb 4, 2022
b191105
update GH actions
adamltyson Feb 4, 2022
cd54391
Bump version: 0.2.0-rc0 → 0.2.0-rc1
adamltyson Feb 4, 2022
0b4e34e
Bump version: 0.2.0-rc1 → 0.2.0
adamltyson Feb 4, 2022
9c295de
Revert older changes
adamltyson Feb 14, 2022
1d8bfe1
Fix deprecation of tifffile.imsave replaced by tifffile.imwrite. (#8)
JulesScholler Apr 29, 2022
4308b9b
Bump version: 0.2.1 → 0.2.2-rc0
adamltyson Apr 29, 2022
466049b
Bump version: 0.2.2-rc0 → 0.2.2
adamltyson Apr 29, 2022
d7cc875
Add link to contributing guide
adamltyson May 31, 2022
a36b87b
Add tox and use brainglobe/actions (#10)
adamltyson Jun 6, 2022
3dac57e
Update tox.ini
adamltyson Jun 9, 2022
22c85b7
Bump version: 0.2.2 → 0.2.3-rc0
adamltyson Jul 26, 2022
5a8c607
Bump version: 0.2.3-rc0 → 0.2.3
adamltyson Jul 26, 2022
6b685cf
Long description (#11)
adamltyson Jul 26, 2022
2292cb1
Bump version: 0.2.4-rc0 → 0.2.4
adamltyson Jul 26, 2022
5cbc6a3
Change coverage badge to codecov.
adamltyson Jul 27, 2022
b2dc8dd
Test on recent python versions (#13)
dstansby Jan 31, 2023
e93fc18
Replace brainglobe > NI actions (#14)
dstansby Feb 3, 2023
8f5dc7e
Use standard pre-commit config (#15)
dstansby Feb 13, 2023
4f0ffe7
Use pyproject.toml (#16)
dstansby Feb 24, 2023
4091d87
Filter warnings in pytest (#17)
dstansby Feb 28, 2023
61fb3b8
Add all-contributors
adamltyson Mar 30, 2023
9f499da
Update README.md
adamltyson Mar 30, 2023
927ee81
Merge pull request #18 from brainglobe/contributors
dstansby Mar 30, 2023
63c09bc
docs: add crousseau as a contributor for code, ideas, and test (#25)
allcontributors[bot] Mar 30, 2023
6661f2d
Don't skip CI for all-contrbutors-bot
adamltyson Mar 30, 2023
9f9fb01
Update .all-contributorsrc
adamltyson Mar 30, 2023
b6b1b67
docs: add jaimergp as a contributor for code (#23)
allcontributors[bot] Mar 30, 2023
937ac89
docs: add JulesScholler as a contributor for code (#22)
allcontributors[bot] Mar 30, 2023
31823bb
docs: add dstansby as a contributor for test, code, and 3 more (#21)
allcontributors[bot] Mar 30, 2023
b504386
docs: add adamltyson as a contributor for code, infra, and 2 more (#24)
allcontributors[bot] Mar 30, 2023
ef57ad3
Update doc links (#27)
adamltyson Jun 19, 2023
a14934a
[pre-commit.ci] pre-commit autoupdate (#28)
pre-commit-ci[bot] Jun 20, 2023
7c7f8d1
Update dependency (imlib -> brainglobe-utils) (#29)
adamltyson Jun 26, 2023
18ce4e2
[pre-commit.ci] pre-commit autoupdate (#31)
pre-commit-ci[bot] Jun 27, 2023
bdebb78
remove all contributors (#32)
adamltyson Jun 28, 2023
7d9b38e
[pre-commit.ci] pre-commit autoupdate (#33)
pre-commit-ci[bot] Jul 4, 2023
b7b3198
[pre-commit.ci] pre-commit autoupdate (#34)
pre-commit-ci[bot] Jul 11, 2023
e0e5f34
Update CI workflow to use NIU actions (#35)
willGraham01 Jul 18, 2023
0f86998
[pre-commit.ci] pre-commit autoupdate (#36)
pre-commit-ci[bot] Jul 18, 2023
a629b28
[pre-commit.ci] pre-commit autoupdate (#37)
pre-commit-ci[bot] Jul 25, 2023
6c28c9c
[pre-commit.ci] pre-commit autoupdate (#38)
pre-commit-ci[bot] Aug 1, 2023
cebc28e
[pre-commit.ci] pre-commit autoupdate (#39)
pre-commit-ci[bot] Aug 8, 2023
15d9aeb
[pre-commit.ci] pre-commit autoupdate (#40)
pre-commit-ci[bot] Aug 17, 2023
b848990
[pre-commit.ci] pre-commit autoupdate (#41)
pre-commit-ci[bot] Aug 22, 2023
c94cad2
[pre-commit.ci] pre-commit autoupdate (#42)
pre-commit-ci[bot] Aug 29, 2023
43a71ca
Set pre-commit autoupdate frequency to monthly (#43)
adamltyson Aug 29, 2023
bed58d4
[pre-commit.ci] pre-commit autoupdate (#44)
pre-commit-ci[bot] Sep 5, 2023
7a763f0
[pre-commit.ci] pre-commit autoupdate (#45)
pre-commit-ci[bot] Oct 3, 2023
877d979
[pre-commit.ci] pre-commit autoupdate (#48)
pre-commit-ci[bot] Nov 7, 2023
d87e52a
[pre-commit.ci] pre-commit autoupdate (#49)
pre-commit-ci[bot] Dec 5, 2023
bfe2a0d
[pre-commit.ci] pre-commit autoupdate (#50)
pre-commit-ci[bot] Jan 2, 2024
176e871
Update GH actions badge (#51)
adamltyson Jan 10, 2024
d1c806b
Update test_and_deploy.yml (#52)
alessandrofelder Feb 5, 2024
712fc00
Add manifest (#54)
willGraham01 Feb 6, 2024
b9615ba
[pre-commit.ci] pre-commit autoupdate (#53)
pre-commit-ci[bot] Feb 6, 2024
d8dc67b
Merge remote-tracking branch 'imio/main' into merge-imio-in
willGraham01 Feb 9, 2024
f699d8a
refactor image_io as submodule
willGraham01 Feb 9, 2024
a4586a4
Deprecated alias warning is still present
willGraham01 Feb 9, 2024
ada6b01
Fix an actual circular import because of wildcard import
willGraham01 Feb 9, 2024
2328e0b
Fix buggy html logo - wrong escape backslash
willGraham01 Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: tests
on:
push:
branches:
- 'main'
- "main"
tags:
- 'v*'
- "v**"
pull_request:
workflow_dispatch:

jobs:
linting:
name: Check Linting
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/lint@v2
Expand Down Expand Up @@ -60,7 +61,6 @@ jobs:
steps:
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2


upload_all:
name: Publish build distributions
needs: [build_sdist_wheels]
Expand Down
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ repos:
hooks:
- id: mypy
args: [--config-file, pyproject.toml]
additional_dependencies: [numpy]
additional_dependencies:
- numpy
- types-setuptools
- types-requests
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# brainglobe-utils

Shared general purpose tools for the BrainGlobe project

## Installation

```bash
pip install brainglobe-utils
```

To also include the dependencies required for `napari`, use:

```bash
pip install brainglobe-utils[napari]
```

For development, clone this repository and install the dependencies with one of the following commands:

```bash
pip install -e .[dev]
pip install -e .[dev,napari]
Expand Down
13 changes: 7 additions & 6 deletions brainglobe_utils/brainreg/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import os
from typing import List, Optional, Tuple

import bg_space as bgs
import imio
import brainglobe_space as bgs
import numpy as np
import pandas as pd
import tifffile
from bg_atlasapi import BrainGlobeAtlas

from brainglobe_utils.image_io import get_size_image_from_file_paths


def transform_points_from_downsampled_to_atlas_space(
downsampled_points: np.ndarray,
Expand Down Expand Up @@ -91,7 +92,7 @@ def get_anatomical_space_from_image_planes(
image_plane : np.ndarray
A numpy-like array representing a single image plane from a 3D image.
orientation : str
The orientation of the image following the bg-space
The orientation of the image following the brainglobe-space
three-letter convention (e.g., 'asr', 'psl').
voxel_sizes : List[float]
A list of floats representing the voxel sizes (e.g., [5, 2, 2]).
Expand All @@ -103,7 +104,7 @@ def get_anatomical_space_from_image_planes(

"""

shape = tuple(imio.get_size_image_from_file_paths(image_plane).values())
shape = tuple(get_size_image_from_file_paths(image_plane).values())

space = bgs.AnatomicalSpace(
orientation,
Expand Down Expand Up @@ -132,7 +133,7 @@ def transform_points_from_raw_to_downsampled_space(
source_image_plane : np.ndarray
A numpy-like array representing a single image.
orientation : str
The orientation of the image following the bg-space
The orientation of the image following the brainglobe-space
three letter convention (e.g. 'asr', 'psl')
voxel_sizes : List[float]
A list of floats representing the voxel sizes (e.g. [5, 2, 2])
Expand Down Expand Up @@ -182,7 +183,7 @@ def transform_points_to_atlas_space(
source_image_plane : np.ndarray
A numpy-like array representing a single image.
orientation : str
The orientation of the image following the bg-space
The orientation of the image following the brainglobe-space
three letter convention (e.g. 'asr', 'psl')
voxel_sizes : List[float]
A list of floats representing the voxel sizes (e.g. [5, 2, 2])
Expand Down
4 changes: 2 additions & 2 deletions brainglobe_utils/image/heatmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path
from typing import Tuple, Union

import imio
import numpy as np
from scipy.ndimage import zoom
from skimage.filters import gaussian
Expand All @@ -10,6 +9,7 @@
from brainglobe_utils.image.binning import get_bins
from brainglobe_utils.image.masking import mask_image_threshold
from brainglobe_utils.image.scale import scale_and_convert_to_16_bits
from brainglobe_utils.image_io import to_tiff


def rescale_array(source_array, target_array, order=1):
Expand Down Expand Up @@ -104,6 +104,6 @@ def heatmap_from_points(

if output_filename is not None:
ensure_directory_exists(Path(output_filename).parent)
imio.to_tiff(heatmap_array, output_filename)
to_tiff(heatmap_array, output_filename)

return heatmap_array
6 changes: 6 additions & 0 deletions brainglobe_utils/image_io/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__author__ = "Charly Rousseau, Adam Tyson"
__version__ = "0.2.4"

from brainglobe_utils.image_io.load import *
from brainglobe_utils.image_io.save import *
from brainglobe_utils.image_io.utils import *
Loading
Loading