From 4b9ae361e990dd636e9b67b45de4680e876ec51b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:23:22 +0000 Subject: [PATCH 01/10] build(deps): bump astral-sh/setup-uv from 4 to 5 Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 4 to 5. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v4...v5) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/tox.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 9d630a49..571c9318 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -29,7 +29,7 @@ jobs: SHA: ${{ steps.test-head.outputs.SHA }} steps: - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 - name: Git settings (pacify DataLad) run: | git config --global user.name 'NiPreps Bot' @@ -87,7 +87,7 @@ jobs: submodules: recursive fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 - uses: actions/cache/restore@v4 with: path: ${{ env.TEST_DATA_HOME }} @@ -120,7 +120,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 + uses: astral-sh/setup-uv@v5 - name: Show tox config run: uvx tox c - name: Show tox config (this call) From 572df62df95823e7b83a573352a7003ad40f84e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 16:07:00 +0000 Subject: [PATCH 02/10] build(deps): bump astral-sh/setup-uv from 5 to 6 Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 6. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/tox.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 571c9318..0e9dcb48 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -29,7 +29,7 @@ jobs: SHA: ${{ steps.test-head.outputs.SHA }} steps: - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 - name: Git settings (pacify DataLad) run: | git config --global user.name 'NiPreps Bot' @@ -87,7 +87,7 @@ jobs: submodules: recursive fetch-depth: 0 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 - uses: actions/cache/restore@v4 with: path: ${{ env.TEST_DATA_HOME }} @@ -120,7 +120,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install the latest version of uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v6 - name: Show tox config run: uvx tox c - name: Show tox config (this call) From 09e9248c6fa497f44c045fcec479e5077001fe38 Mon Sep 17 00:00:00 2001 From: Cory Shain Date: Fri, 30 May 2025 23:01:24 -0700 Subject: [PATCH 03/10] Patch for crash when applying 3D transform to 4D image --- nitransforms/resampling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nitransforms/resampling.py b/nitransforms/resampling.py index 1045cde1..390825c5 100644 --- a/nitransforms/resampling.py +++ b/nitransforms/resampling.py @@ -108,7 +108,7 @@ async def _apply_serial( semaphore = asyncio.Semaphore(max_concurrent) for t in range(n_resamplings): - xfm_t = transform if n_resamplings == 1 else transform[t] + xfm_t = transform if (n_resamplings == 1 or transform.ndim < 4) else transform[t] if targets is None: targets = ImageGrid(spatialimage).index( # data should be an image @@ -270,7 +270,7 @@ def apply( # Order F ensures individual volumes are contiguous in memory # Also matches NIfTI, making final save more efficient resampled = np.zeros( - (len(ref_ndcoords), len(transform)), dtype=input_dtype, order="F" + (len(ref_ndcoords), n_resamplings), dtype=input_dtype, order="F" ) resampled = asyncio.run( From 6116491d30d4b3a880835615b924fad6ca9e4c14 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:39:36 -0400 Subject: [PATCH 04/10] doc: Update and simplify RTD config --- .readthedocs.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4cb47fff..56d55db7 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,12 +10,10 @@ build: - asdf plugin add uv - asdf install uv latest - asdf global uv latest - # Turn `python -m virtualenv` into `python -c pass` - - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py - post_create_environment: + create_environment: - uv venv $READTHEDOCS_VIRTUALENV_PATH - # Turn `python -m pip` into `python -c pass` - - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py - post_install: - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache .[niftiext] - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache -r docs/requirements.txt + install: + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache .[niftiext] -r docs/requirements.txt + +sphinx: + configuration: docs/conf.py From 9a2b333d7ad7b8251f0138cb4bcdee2d04ce0b19 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:41:26 -0400 Subject: [PATCH 05/10] sty: Remove unused global variables --- nitransforms/conftest.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/nitransforms/conftest.py b/nitransforms/conftest.py index 854cac43..70680882 100644 --- a/nitransforms/conftest.py +++ b/nitransforms/conftest.py @@ -6,8 +6,6 @@ import pytest import tempfile -_data = None -_brainmask = None _testdir = Path(os.getenv("TEST_DATA_HOME", "~/.nitransforms/testdata")).expanduser() _datadir = Path(__file__).parent / "tests" / "data" @@ -48,10 +46,6 @@ def testdata_path(): @pytest.fixture def get_testdata(): """Generate data in the requested orientation.""" - global _data - - if _data is not None: - return _data return _reorient(_testdir / "someones_anatomy.nii.gz") @@ -59,11 +53,6 @@ def get_testdata(): @pytest.fixture def get_testmask(): """Generate data in the requested orientation.""" - global _brainmask - - if _brainmask is not None: - return _brainmask - return _reorient(_testdir / "someones_anatomy_brainmask.nii.gz") From f6e870a1ee2c270e9a54af9c8713a388b2c0ed7d Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:45:24 -0400 Subject: [PATCH 06/10] doc: Update CI badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5a45349..4ae2340f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NiTransforms [![DOI](https://joss.theoj.org/papers/10.21105/joss.03459/status.svg)](https://doi.org/10.21105/joss.03459) [![ISBI2020](https://img.shields.io/badge/doi-10.31219%2Fosf.io%2F8aq7b-blue.svg)](https://doi.org/10.31219/osf.io/8aq7b) -[![Deps & CI](https://github.com/nipy/nitransforms/actions/workflows/travis.yml/badge.svg)](https://github.com/nipy/nitransforms/actions/workflows/travis.yml) +[![Deps & CI](https://github.com/nipy/nitransforms/actions/workflows/tox.yml/badge.svg)](https://github.com/nipy/nitransforms/actions/workflows/tox.yml) [![CircleCI](https://circleci.com/gh/nipy/nitransforms.svg?style=svg)](https://circleci.com/gh/nipy/nitransforms) [![codecov](https://codecov.io/gh/nipy/nitransforms/branch/master/graph/badge.svg)](https://codecov.io/gh/nipy/nitransforms) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nipy/nitransforms/master?filepath=docs%2Fnotebooks%2F) From 6d60f1a24c47d2991246222ee43e02fb6a90fbce Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:25:01 -0400 Subject: [PATCH 07/10] doc: Switch from zenodo.json to CITATION.cff, add contributors --- .zenodo.json | 50 -------------------------- CITATION.cff | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 50 deletions(-) delete mode 100644 .zenodo.json create mode 100644 CITATION.cff diff --git a/.zenodo.json b/.zenodo.json deleted file mode 100644 index 2cea96d1..00000000 --- a/.zenodo.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "title": "NiTransforms: A Python tool to read, represent, manipulate, and apply $n$-dimensional spatial transforms", - "description": "

A Python package to access a cacophony of neuroimaging file formats representing spatio-temporal, linear-and-nonlinear transformations.

", - "creators": [ - { - "affiliation": "Department of Psychology, Stanford University, Stanford, CA, USA", - "name": "Goncalves, Mathias", - "orcid": "0000-0002-7252-7771" - }, - { - "affiliation": "Department of Psychology, Stanford University, Stanford, CA, USA", - "name": "Markiewicz, Christopher J.", - "orcid": "0000-0002-6533-164X" - }, - { - "affiliation": "Basque Center on Cognition Brain and Language, San Sebastian, Spain", - "name": "Moia, Stefano", - "orcid": "0000-0002-2553-3327" - }, - { - "affiliation": "McGovern Institute for Brain Research, Massachusetts Institute of Technology (MIT), Cambridge, MA, USA; and Department of Otolaryngology, Harvard Medical School, Boston, MA, USA", - "name": "Ghosh, Satrajit", - "orcid": "0000-0002-5312-6729" - }, - { - "affiliation": "Department of Psychology, Stanford University, Stanford, CA, USA", - "name": "Poldrack, Russell A.", - "orcid": "0000-0001-6755-0259" - }, - { - "affiliation": "Lausanne University Hospital and University of Lausanne, Lausanne, Switzerland", - "name": "Esteban, Oscar", - "orcid": "0000-0001-8435-6191" - } - ], - "contributors": [ - { - "affiliation": "Charite Universitatsmedizin Berlin, Germany", - "name": "Waller, Lea", - "orcid": "0000-0002-3239-6957", - "type": "Researcher" - } - ], - "keywords": [ - "neuroimaging", - "spatial normalization" - ], - "license": "mit-license", - "upload_type": "software" -} diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..575132c1 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,100 @@ +cff-version: 1.2.0 +title: "NiTransforms: A Python tool to read, represent, manipulate, and apply N-dimensional spatial transforms" +license: MIT +type: software +url: https://github.com/nipy/nitransforms/ +version: 24.1.1 +date-released: 2024-12-18 +abstract: | + Spatial transforms formalize mappings between coordinates of objects in biomedical images. + Transforms typically are the outcome of image registration methodologies, which estimate + the alignment between two images. + Image registration is a prominent task present in nearly all standard image processing + and analysis pipelines. + The proliferation of software implementations of image registration methodologies has + resulted in a spread of data structures and file formats used to preserve and communicate + transforms. + This segregation of formats precludes the compatibility between tools and endangers the + reproducibility of results. + We propose a software tool capable of converting between formats and resampling images + to apply transforms generated by the most popular neuroimaging packages and libraries + (AFNI, FSL, FreeSurfer, ITK, and SPM). + The proposed software is subject to continuous integration tests to check the + compatibility with each supported tool after every change to the code base. + Compatibility between software tools and imaging formats is a necessary bridge + to ensure the reproducibility of results and enable the optimization and evaluation + of current image processing and analysis workflows. +keywords: + - neuroimaging + - spatial normalization + +authors: + - family-names: Goncalves + given-names: Mathias + orcid: https://orcid.org/0000-0002-7252-7771 + affiliation: "Department of Psychology, Stanford University, Stanford, CA, USA" + - family-names: Markiewicz + given-names: Christopher J. + orcid: https://orcid.org/0000-0002-6533-164X + affiliation: "Department of Psychology, Stanford University, Stanford, CA, USA" + - family-names: Moia + given-names: Stefano + orcid: https://orcid.org/0000-0002-2553-3327 + affiliation: "Basque Center on Cognition Brain and Language, San Sebastian, Spain" + - family-names: Waller + given-names: Lea + orcid: https://orcid.org/0000-0002-3239-6957 + affiliation: Charite Universitatsmedizin Berlin, Germany + - family-names: Pinsard + given-names: Basile + orcid: https://orcid.org/0000-0002-4391-3075 + affiliation: University of Montréal, Montréal, Canada + - family-names: Banús + given-names: Jaume + orcid: https://orcid.org/0000-0001-9318-6323 + - family-names: Visconti di Oleggio Castello + given-names: Matteo + orcid: https://orcid.org/0000-0001-7931-5272 + affiliation: University of California Berkeley, Berkeley, CA, USA + - family-names: Marabotto + given-names: Julien + orcid: https://orcid.org/0009-0003-7070-5217 + affiliation: Lausanne University Hospital and University of Lausanne, Lausanne, Switzerland + - family-names: Ma + given-names: Feilong + orcid: https://orcid.org/0000-0002-6838-3971 + affiliation: Dartmouth College, Hanover, NH, United States + - family-names: Nielson + given-names: Dylan + orcid: https://orcid.org/0000-0003-4613-6643 + affiliation: Machine Learning Team, National Institute of Mental Health, USA + - family-names: Cluce + given-names: Jon + orcid: https://orcid.org/0000-0001-7590-5806 + affiliation: Child Mind Institute, New York, NY, USA + - family-names: Shain + given-names: Cory + orcid: https://orcid.org/0000-0002-2704-7197 + affiliation: Stanford University, Stanford, CA, USA + ## When contributing, please copy and uncomment the following lines + # - family-names: + # given-names: + # orcid: https://orcid.org/ + # affiliation: + - family-names: Ghosh + given-names: Satrajit + orcid: https://orcid.org/0000-0002-5312-6729 + affiliation: "McGovern Institute for Brain Research, Massachusetts Institute of Technology (MIT), Cambridge, MA, USA; and Department of Otolaryngology, Harvard Medical School, Boston, MA, USA" + - family-names: Poldrack + given-names: Russell A. + orcid: https://orcid.org/0000-0001-6755-0259 + affiliation: "Department of Psychology, Stanford University, Stanford, CA, USA" + - family-names: Esteban + given-names: Oscar + orcid: https://orcid.org/0000-0001-8435-6191 + affiliation: "Lausanne University Hospital and University of Lausanne, Lausanne, Switzerland" + +identifiers: + - description: Concept DOI for the software + type: doi + value: 10.5281/zenodo.5499693 From 7ee94ba676c70641cc9425d25aeb4f6bb82dcc4f Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:25:19 -0400 Subject: [PATCH 08/10] chore: Add mailmap --- .mailmap | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..dac8efaa --- /dev/null +++ b/.mailmap @@ -0,0 +1,12 @@ +Oscar Esteban +Christopher J. Markiewicz +Christopher J. Markiewicz +Mathias Goncalves +Mathias Goncalves +Mathias Goncalves +Julien Marabotto <166002186+jmarabotto@users.noreply.github.com> +Julien Marabotto <166002186+jmarabotto@users.noreply.github.com> +Julien Marabotto <166002186+jmarabotto@users.noreply.github.com> +Stefano Moia +Basile Pinsard +Jaume Banús From a036b5869cab864c3c7bfe3c298e6f5fff6d17ba Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Sat, 31 May 2025 07:48:10 -0400 Subject: [PATCH 09/10] doc: Fix CI badge --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 4edf3198..a1bb94f8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,7 +14,7 @@ A development repo for `nipy/nibabel#656 Date: Mon, 2 Jun 2025 11:01:20 -0400 Subject: [PATCH 10/10] rel: 24.1.2 --- CHANGES.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index c0772387..31628681 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,18 @@ +24.1.2 (June 02, 2025) +====================== +New patch release that addresses a crash when applying a 3D transform to a 4D image. + +New Contributors +---------------- +* @coryshain made their first contribution in https://github.com/nipy/nitransforms/pull/236 + +CHANGES +------- +* FIX: Patch for crash when applying 3D transform to 4D image (#236) +* MNT: Switch from zenodo.json to CITATION.cff, add contributors (#237) + +**Full Changelog**: https://github.com/nipy/nitransforms/compare/24.1.1...24.1.2 + 24.1.1 (December 18, 2024) ========================== New patch release that adds ``nitransforms.resampling.apply`` as a top-level import, and removes the `pkg_resources` dependency.