From 6608cb99d72eb762ca92eaede5c6168a2d823f1c Mon Sep 17 00:00:00 2001 From: nipreps-bot Date: Thu, 19 Dec 2024 11:20:49 +0100 Subject: [PATCH] enh: rename all instances of ``"eddymotion"`` ``` git ls-files -z | xargs -0 sed -i 's/eddymotion/nifreeze/g' git mv src/eddymotion src/nifreeze ``` --- .dockerignore | 4 +- .github/workflows/pythonpackage.yml | 12 +-- .github/workflows/test.yml | 8 +- .gitignore | 4 +- .zenodo.json | 2 +- CHANGES.rst | 2 +- CONTRIBUTING.md | 4 +- NOTICE | 2 +- README.rst | 22 +++--- docs/Makefile | 8 +- docs/conf.py | 8 +- docs/developers.rst | 32 ++++---- docs/index.rst | 4 +- docs/installation.rst | 10 +-- docs/notebooks/bold_realignment.ipynb | 76 +++++++++---------- docs/notebooks/dmri_covariance.ipynb | 6 +- docs/notebooks/dwi_gp_estimation.ipynb | 4 +- docs/running.rst | 6 +- docs/usage.rst | 6 +- pyproject.toml | 24 +++--- scripts/dwi_gp_estimation_error_analysis.py | 8 +- .../dwi_gp_estimation_error_analysis_plot.py | 2 +- scripts/dwi_gp_estimation_signal_plot.py | 2 +- scripts/dwi_gp_estimation_simulated_signal.py | 4 +- scripts/optimize_registration.py | 8 +- src/nifreeze/__init__.py | 8 +- src/nifreeze/cli/run.py | 6 +- src/nifreeze/conftest.py | 2 +- src/nifreeze/data/splitting.py | 2 +- src/nifreeze/estimator.py | 16 ++-- src/nifreeze/math/tests/test_utils.py | 2 +- src/nifreeze/model/__init__.py | 6 +- src/nifreeze/model/_dipy.py | 4 +- src/nifreeze/model/base.py | 6 +- src/nifreeze/model/dmri.py | 12 +-- src/nifreeze/model/gpr.py | 2 +- src/nifreeze/model/pet.py | 4 +- src/nifreeze/registration/ants.py | 6 +- test/conftest.py | 2 +- test/test_data_utils.py | 2 +- test/test_dmri.py | 4 +- test/test_gpr.py | 2 +- test/test_integration.py | 6 +- test/test_main.py | 8 +- test/test_model.py | 14 ++-- test/test_parser.py | 2 +- test/test_registration.py | 6 +- test/test_splitting.py | 4 +- test/test_version.py | 8 +- tox.ini | 2 +- 50 files changed, 202 insertions(+), 202 deletions(-) diff --git a/.dockerignore b/.dockerignore index c1e659c..4900fc1 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,8 +8,8 @@ build/**/* build dist/**/* dist -src/eddymotion.egg-info/**/* -src/eddymotion.egg-info +src/nifreeze.egg-info/**/* +src/nifreeze.egg-info .eggs/**/* .eggs diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 35ca69d..2876f8d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -41,7 +41,7 @@ jobs: pip install -U build hatch pip twine python -m build -s -w - python -m twine check dist/eddymotion-* + python -m twine check dist/nifreeze-* mv dist /tmp/package @@ -60,7 +60,7 @@ jobs: source /tmp/pip/bin/activate pip install -U pip python -m pip install . - INSTALLED_VERSION=$(python -c 'import eddymotion as em; print(em.__version__, end="")') + INSTALLED_VERSION=$(python -c 'import nifreeze as em; print(em.__version__, end="")') echo "VERSION: \"${THISVERSION}\"" echo "INSTALLED: \"${INSTALLED_VERSION}\"" test "${INSTALLED_VERSION}" = "${THISVERSION}" @@ -70,8 +70,8 @@ jobs: python -m venv /tmp/install_sdist source /tmp/install_sdist/bin/activate pip install -U pip - python -m pip install /tmp/package/eddymotion*.tar.gz - INSTALLED_VERSION=$(python -c 'import eddymotion as em; print(em.__version__, end="")') + python -m pip install /tmp/package/nifreeze*.tar.gz + INSTALLED_VERSION=$(python -c 'import nifreeze as em; print(em.__version__, end="")') echo "VERSION: \"${THISVERSION}\"" echo "INSTALLED: \"${INSTALLED_VERSION}\"" test "${INSTALLED_VERSION}" = "${THISVERSION}" @@ -81,7 +81,7 @@ jobs: python -m venv /tmp/install_wheel source /tmp/install_wheel/bin/activate pip install -U pip - python -m pip install /tmp/package/eddymotion*.whl - INSTALLED_VERSION=$(python -c 'import eddymotion as em; print(em.__version__, end="")') + python -m pip install /tmp/package/nifreeze*.whl + INSTALLED_VERSION=$(python -c 'import nifreeze as em; print(em.__version__, end="")') echo "INSTALLED: \"${INSTALLED_VERSION}\"" test "${INSTALLED_VERSION}" = "${THISVERSION}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 213ed5b..0293c50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ defaults: # Force tox and pytest to use color env: FORCE_COLOR: true - TEST_DATA_HOME: /home/runner/eddymotion-tests/ + TEST_DATA_HOME: /home/runner/nifreeze-tests/ ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 4 ANTSPATH: /usr/share/miniconda/bin/ @@ -54,12 +54,12 @@ jobs: datalad wtf - uses: actions/cache/restore@v4 with: - path: /home/runner/eddymotion-tests/ + path: /home/runner/nifreeze-tests/ key: data-v0 - name: Get test data with DataLad run: | if [[ ! -d "${TEST_DATA_HOME}" ]]; then - datalad install -rg --source=https://gin.g-node.org/nipreps-data/tests-eddymotion.git ${TEST_DATA_HOME} + datalad install -rg --source=https://gin.g-node.org/nipreps-data/tests-nifreeze.git ${TEST_DATA_HOME} else cd ${TEST_DATA_HOME} datalad update --merge -r . @@ -67,7 +67,7 @@ jobs: fi - uses: actions/cache/save@v4 with: - path: /home/runner/eddymotion-tests/ + path: /home/runner/nifreeze-tests/ key: data-v0 - name: Install tox run: | diff --git a/.gitignore b/.gitignore index f14da92..2bdf48d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # setuptools-scm -eddymotion/_version.py +nifreeze/_version.py # Byte-compiled / optimized / DLL files __pycache__/ @@ -115,4 +115,4 @@ ENV/ kubernetes/jobs/ # Version files -src/eddymotion/_version.py \ No newline at end of file +src/nifreeze/_version.py \ No newline at end of file diff --git a/.zenodo.json b/.zenodo.json index dcf7868..d747b31 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -20,7 +20,7 @@ "scheme": "doi" } ], - "title": "eddymotion: model-based estimation of head-motion and eddy-current distortions", + "title": "nifreeze: model-based estimation of head-motion and eddy-current distortions", "upload_type": "software", "creators": [ { diff --git a/CHANGES.rst b/CHANGES.rst index c274261..097c46c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -23,7 +23,7 @@ A new minor release with fixes such as setting random seeds and enhancing parall * ENH: Drop support for Python 3.8 and 3.9 (#158) * ENH: Remove unused `tmp_path` parameter from test (#162) * ENH: Outsource leave-one-out splitter so it can be used across data types (#98) - * ENH: Simplify `eddymotion.estimator.EddyMotionEstimator.fit` (#149) + * ENH: Simplify `nifreeze.estimator.EddyMotionEstimator.fit` (#149) * ENH: Refactor code linter and formatter dependencies (#144) * ENH: Use NumPy's `Generator` class as a replacement for `RandomState` (#141) * ENH: Define instance attributes in ``__init__`` method (#133) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 971bdc8..fdfbf89 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ -# Contributing to *eddymotion* +# Contributing to *nifreeze* -*eddymotion* is a project of the [*NiPreps* Community, which specifies the contributing guidelines](https://www.nipreps.org/community/). \ No newline at end of file +*nifreeze* is a project of the [*NiPreps* Community, which specifies the contributing guidelines](https://www.nipreps.org/community/). \ No newline at end of file diff --git a/NOTICE b/NOTICE index c1f37ee..c0433d0 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ -eddymotion +nifreeze Copyright 2021 The NiPreps Developers. This product includes software developed by diff --git a/README.rst b/README.rst index 56aad44..bf60009 100644 --- a/README.rst +++ b/README.rst @@ -7,23 +7,23 @@ Estimating head-motion and deformations derived from eddy-currents in diffusion :alt: DOI .. image:: https://img.shields.io/badge/License-Apache_2.0-blue.svg - :target: https://github.com/nipreps/eddymotion/blob/main/LICENSE + :target: https://github.com/nipreps/nifreeze/blob/main/LICENSE :alt: License -.. image:: https://img.shields.io/pypi/v/eddymotion.svg - :target: https://pypi.python.org/pypi/eddymotion/ +.. image:: https://img.shields.io/pypi/v/nifreeze.svg + :target: https://pypi.python.org/pypi/nifreeze/ :alt: Latest Version -.. image:: https://github.com/nipreps/eddymotion/actions/workflows/test.yml/badge.svg - :target: https://github.com/nipreps/eddymotion/actions/workflows/test.yml +.. image:: https://github.com/nipreps/nifreeze/actions/workflows/test.yml/badge.svg + :target: https://github.com/nipreps/nifreeze/actions/workflows/test.yml :alt: Testing -.. image:: https://github.com/nipreps/eddymotion/actions/workflows/pages/pages-build-deployment/badge.svg - :target: https://www.nipreps.org/eddymotion/main/index.html +.. image:: https://github.com/nipreps/nifreeze/actions/workflows/pages/pages-build-deployment/badge.svg + :target: https://www.nipreps.org/nifreeze/main/index.html :alt: Documentation -.. image:: https://github.com/nipreps/eddymotion/actions/workflows/pythonpackage.yml/badge.svg - :target: https://github.com/nipreps/eddymotion/actions/workflows/pythonpackage.yml +.. image:: https://github.com/nipreps/nifreeze/actions/workflows/pythonpackage.yml/badge.svg + :target: https://github.com/nipreps/nifreeze/actions/workflows/pythonpackage.yml :alt: Python package Retrospective estimation of head-motion between diffusion-weighted images (DWI) acquired within @@ -49,8 +49,8 @@ the work of ``eddy`` and *SHORELine*, while generalizing these methods to multip .. BEGIN FLOWCHART -.. image:: https://raw.githubusercontent.com/nipreps/eddymotion/507fc9bab86696d5330fd6a86c3870968243aea8/docs/_static/eddymotion-flowchart.svg - :alt: The eddymotion flowchart +.. image:: https://raw.githubusercontent.com/nipreps/nifreeze/507fc9bab86696d5330fd6a86c3870968243aea8/docs/_static/nifreeze-flowchart.svg + :alt: The nifreeze flowchart .. END FLOWCHART diff --git a/docs/Makefile b/docs/Makefile index caf887d..5a951a6 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -97,17 +97,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/eddymotion.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/nifreeze.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/eddymotion.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/nifreeze.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/eddymotion" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/eddymotion" + @echo "# mkdir -p $$HOME/.local/share/devhelp/nifreeze" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/nifreeze" @echo "# devhelp" epub: diff --git a/docs/conf.py b/docs/conf.py index 1ad6269..e17d34b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,7 +9,7 @@ from packaging.version import Version -from eddymotion import __copyright__, __packagename__, __version__ +from nifreeze import __copyright__, __packagename__, __version__ # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, @@ -104,7 +104,7 @@ "_build", "Thumbs.db", ".DS_Store", - "api/eddymotion.rst", + "api/nifreeze.rst", ] # The name of the Pygments (syntax highlighting) style to use. @@ -149,7 +149,7 @@ # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = "eddymotiondoc" +htmlhelp_basename = "nifreezedoc" # -- Options for LaTeX output ------------------------------------------------ @@ -228,7 +228,7 @@ # -- Extension configuration ------------------------------------------------- -apidoc_module_dir = "../src/eddymotion" +apidoc_module_dir = "../src/nifreeze" apidoc_output_dir = "api" apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "config/*"] apidoc_separate_modules = True diff --git a/docs/developers.rst b/docs/developers.rst index 400cbf5..50dc52d 100644 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -7,18 +7,18 @@ Before delving into the code, please make sure you have read all the guidelines Documentation ------------- -Documentation sources are found under the ``docs/`` folder, and builds are archived in the `gh-pages `__ branch of the repository. -With GitHub Pages, the documentation is posted under https://www.nipreps.org/eddymotion. +Documentation sources are found under the ``docs/`` folder, and builds are archived in the `gh-pages `__ branch of the repository. +With GitHub Pages, the documentation is posted under https://www.nipreps.org/nifreeze. We maintain versioned documentation, by storing git tags under ``./`` folders, i.e., we do not archive every patch release, but only every minor release. In other words, folder ``0.1/`` of the documentation tree contains the documents for the latest release within the *0.1.x* series. With every commit (or merge commit) to ``main``, the *development* version of the documentation under the folder ``main/`` is updated too. -The ``gh-pages`` branch is automatically maintained with `a GitHub Action `__. +The ``gh-pages`` branch is automatically maintained with `a GitHub Action `__. Please, do not commit manually to ``gh-pages``. To build the documentation locally, you first need to make sure that ``setuptools_scm[toml] >= 6.2`` is installed in your environment and then:: - $ cd / - $ python -m setuptools_scm # This will generate ``src/eddymotion/_version.py`` + $ cd / + $ python -m setuptools_scm # This will generate ``src/nifreeze/_version.py`` $ make -C docs/ html Library API (application program interface) @@ -28,14 +28,14 @@ Information on specific functions, classes, and methods. .. toctree:: :glob: - api/eddymotion.cli - api/eddymotion.data - api/eddymotion.data.dmri - api/eddymotion.estimator - api/eddymotion.exceptions - api/eddymotion.math - api/eddymotion.model - api/eddymotion.registration - api/eddymotion.testing - api/eddymotion.utils - api/eddymotion.viz + api/nifreeze.cli + api/nifreeze.data + api/nifreeze.data.dmri + api/nifreeze.estimator + api/nifreeze.exceptions + api/nifreeze.math + api/nifreeze.model + api/nifreeze.registration + api/nifreeze.testing + api/nifreeze.utils + api/nifreeze.viz diff --git a/docs/index.rst b/docs/index.rst index 0467a8e..a56d826 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,8 +4,8 @@ .. include:: ../README.rst :start-after: END FLOWCHART -.. image:: _static/eddymotion-flowchart.svg - :alt: The eddymotion flowchart +.. image:: _static/nifreeze-flowchart.svg + :alt: The nifreeze flowchart Contents -------- diff --git a/docs/installation.rst b/docs/installation.rst index 02fccc5..ba3463e 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,18 +3,18 @@ Installation ============ -Make sure all of *eddymotion*' `External Dependencies`_ are installed. +Make sure all of *nifreeze*' `External Dependencies`_ are installed. On a functional Python 3.10 (or above) environment with ``pip`` installed, -*eddymotion* can be installed using the habitual command :: +*nifreeze* can be installed using the habitual command :: - $ python -m pip install eddymotion + $ python -m pip install nifreeze Check your installation with the following command line :: - $ python -c "from eddymotion import __version__; print(__version__)" + $ python -c "from nifreeze import __version__; print(__version__)" External Dependencies --------------------- -*eddymotion* requires DIPY_, and ANTs_. +*nifreeze* requires DIPY_, and ANTs_. diff --git a/docs/notebooks/bold_realignment.ipynb b/docs/notebooks/bold_realignment.ipynb index 1cb8548..92ad306 100644 --- a/docs/notebooks/bold_realignment.ipynb +++ b/docs/notebooks/bold_realignment.ipynb @@ -19,7 +19,7 @@ "from scipy.ndimage import binary_dilation\n", "from skimage.morphology import ball\n", "\n", - "from eddymotion.registration import ants as erants\n", + "from nifreeze.registration import ants as erants\n", "\n", "nest_asyncio.apply()" ] @@ -31,10 +31,10 @@ "outputs": [], "source": [ "DATA_PATH = Path(\"/data/datasets/\")\n", - "WORKDIR = Path.home() / \"tmp\" / \"eddymotiondev\" / \"ismrm25\"\n", + "WORKDIR = Path.home() / \"tmp\" / \"nifreezedev\" / \"ismrm25\"\n", "WORKDIR.mkdir(parents=True, exist_ok=True)\n", "\n", - "OUTPUT_DIR = Path(\"/data/derivatives\") / \"eddymotion-ismrm25-exp2\"\n", + "OUTPUT_DIR = Path(\"/data/derivatives\") / \"nifreeze-ismrm25-exp2\"\n", "OUTPUT_DIR.mkdir(exist_ok=True, parents=True)" ] }, @@ -129,26 +129,26 @@ { "data": { "text/plain": [ - "[PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000005/sub-01/func/sub-01_task-mixedgamblestask_run-03_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000005/sub-02/func/sub-02_task-mixedgamblestask_run-01_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000005/sub-06/func/sub-06_task-mixedgamblestask_run-02_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000005/sub-15/func/sub-15_task-mixedgamblestask_run-03_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000005/sub-14/func/sub-14_task-mixedgamblestask_run-01_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000030/sub-10570/func/sub-10570_task-bht_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000030/sub-10460/func/sub-10460_task-scap_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000030/sub-10304/func/sub-10304_task-bart_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000030/sub-10376/func/sub-10376_task-taskswitch_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000030/sub-11097/func/sub-11097_task-stopsignal_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000210/sub-28/func/sub-28_task-cuedSGT_run-02_echo-1_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000210/sub-16/func/sub-16_task-cuedSGT_run-02_echo-1_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000210/sub-24/func/sub-24_task-cuedSGT_run-03_echo-1_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000210/sub-18/func/sub-18_task-cuedSGT_run-04_echo-1_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds000210/sub-09/func/sub-09_task-cuedSGT_run-03_echo-1_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds002785/sub-0202/func/sub-0202_task-workingmemory_acq-seq_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds002785/sub-0214/func/sub-0214_task-anticipation_acq-seq_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds002785/sub-0139/func/sub-0139_task-restingstate_acq-mb3_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds002785/sub-0178/func/sub-0178_task-workingmemory_acq-seq_desc-realigned_bold.nii.gz'),\n", - " PosixPath('/data/derivatives/eddymotion-ismrm25-exp2/ds002785/sub-0016/func/sub-0016_task-emomatching_acq-seq_desc-realigned_bold.nii.gz')]" + "[PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000005/sub-01/func/sub-01_task-mixedgamblestask_run-03_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000005/sub-02/func/sub-02_task-mixedgamblestask_run-01_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000005/sub-06/func/sub-06_task-mixedgamblestask_run-02_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000005/sub-15/func/sub-15_task-mixedgamblestask_run-03_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000005/sub-14/func/sub-14_task-mixedgamblestask_run-01_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000030/sub-10570/func/sub-10570_task-bht_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000030/sub-10460/func/sub-10460_task-scap_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000030/sub-10304/func/sub-10304_task-bart_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000030/sub-10376/func/sub-10376_task-taskswitch_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000030/sub-11097/func/sub-11097_task-stopsignal_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000210/sub-28/func/sub-28_task-cuedSGT_run-02_echo-1_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000210/sub-16/func/sub-16_task-cuedSGT_run-02_echo-1_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000210/sub-24/func/sub-24_task-cuedSGT_run-03_echo-1_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000210/sub-18/func/sub-18_task-cuedSGT_run-04_echo-1_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds000210/sub-09/func/sub-09_task-cuedSGT_run-03_echo-1_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds002785/sub-0202/func/sub-0202_task-workingmemory_acq-seq_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds002785/sub-0214/func/sub-0214_task-anticipation_acq-seq_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds002785/sub-0139/func/sub-0139_task-restingstate_acq-mb3_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds002785/sub-0178/func/sub-0178_task-workingmemory_acq-seq_desc-realigned_bold.nii.gz'),\n", + " PosixPath('/data/derivatives/nifreeze-ismrm25-exp2/ds002785/sub-0016/func/sub-0016_task-emomatching_acq-seq_desc-realigned_bold.nii.gz')]" ] }, "execution_count": 5, @@ -244,7 +244,7 @@ "\n", "\n", "def plot_combined_profile(\n", - " images, afni_fd, eddymotion_fd, indexing=None, figsize=(15, 1.7), cmap=\"gray\", labels=None\n", + " images, afni_fd, nifreeze_fd, indexing=None, figsize=(15, 1.7), cmap=\"gray\", labels=None\n", "):\n", " # Calculate the number of profile plots\n", " n_images = len(images)\n", @@ -258,9 +258,9 @@ "\n", " # Plot the framewise displacement on the first axis\n", " fd_axis = axes[0]\n", - " timepoints = np.arange(len(afni_fd)) # Assuming afni_fd and eddymotion_fd have the same length\n", + " timepoints = np.arange(len(afni_fd)) # Assuming afni_fd and nifreeze_fd have the same length\n", " fd_axis.plot(timepoints, afni_fd, label=\"AFNI 3dVolreg FD\", color=\"blue\")\n", - " fd_axis.plot(timepoints, eddymotion_fd, label=\"eddymotion FD\", color=\"orange\")\n", + " fd_axis.plot(timepoints, nifreeze_fd, label=\"nifreeze FD\", color=\"orange\")\n", " fd_axis.set_ylabel(\"FD (mm)\")\n", " fd_axis.legend(loc=\"upper right\")\n", " fd_axis.set_xticks([]) # Hide x-ticks to keep x-axis clean\n", @@ -337,8 +337,8 @@ "metadata": {}, "outputs": [], "source": [ - "from eddymotion.model.base import AverageModel\n", - "from eddymotion.utils import random_iterator" + "from nifreeze.model.base import AverageModel\n", + "from nifreeze.utils import random_iterator" ] }, { @@ -428,14 +428,14 @@ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mCancelledError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[29], line 26\u001b[0m\n\u001b[1;32m 23\u001b[0m tasks\u001b[38;5;241m.\u001b[39mappend(task)\n\u001b[1;32m 25\u001b[0m \u001b[38;5;66;03m# Await all tasks\u001b[39;00m\n\u001b[0;32m---> 26\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m asyncio\u001b[38;5;241m.\u001b[39mgather(\u001b[38;5;241m*\u001b[39mtasks, return_exceptions\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/tasks.py:349\u001b[0m, in \u001b[0;36mTask.__wakeup\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__wakeup\u001b[39m(\u001b[38;5;28mself\u001b[39m, future):\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 349\u001b[0m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 350\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 351\u001b[0m \u001b[38;5;66;03m# This may also be a cancellation.\u001b[39;00m\n\u001b[1;32m 352\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__step(exc)\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/tasks.py:279\u001b[0m, in \u001b[0;36mTask.__step\u001b[0;34m(***failed resolving arguments***)\u001b[0m\n\u001b[1;32m 277\u001b[0m result \u001b[38;5;241m=\u001b[39m coro\u001b[38;5;241m.\u001b[39msend(\u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m 278\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 279\u001b[0m result \u001b[38;5;241m=\u001b[39m coro\u001b[38;5;241m.\u001b[39mthrow(exc)\n\u001b[1;32m 280\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 281\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_must_cancel:\n\u001b[1;32m 282\u001b[0m \u001b[38;5;66;03m# Task is cancelled right before coro stops.\u001b[39;00m\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/tasks.py:349\u001b[0m, in \u001b[0;36mTask.__wakeup\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__wakeup\u001b[39m(\u001b[38;5;28mself\u001b[39m, future):\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 349\u001b[0m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 350\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 351\u001b[0m \u001b[38;5;66;03m# This may also be a cancellation.\u001b[39;00m\n\u001b[1;32m 352\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__step(exc)\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/tasks.py:279\u001b[0m, in \u001b[0;36mTask.__step\u001b[0;34m(***failed resolving arguments***)\u001b[0m\n\u001b[1;32m 277\u001b[0m result \u001b[38;5;241m=\u001b[39m coro\u001b[38;5;241m.\u001b[39msend(\u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[1;32m 278\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 279\u001b[0m result \u001b[38;5;241m=\u001b[39m coro\u001b[38;5;241m.\u001b[39mthrow(exc)\n\u001b[1;32m 280\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 281\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_must_cancel:\n\u001b[1;32m 282\u001b[0m \u001b[38;5;66;03m# Task is cancelled right before coro stops.\u001b[39;00m\n", "Cell \u001b[0;32mIn[12], line 2\u001b[0m, in \u001b[0;36mants\u001b[0;34m(t, data, hdr, nii, brainmask_path, semaphore, workdir)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mants\u001b[39m(t, data, hdr, nii, brainmask_path, semaphore, workdir):\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mwith\u001b[39;00m semaphore:\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m# Set up paths\u001b[39;00m\n\u001b[1;32m 4\u001b[0m fixed_path \u001b[38;5;241m=\u001b[39m workdir \u001b[38;5;241m/\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfixedimage_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mt\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m04d\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.nii.gz\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 5\u001b[0m moving_path \u001b[38;5;241m=\u001b[39m workdir \u001b[38;5;241m/\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmovingimage_\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mt\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m04d\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m.nii.gz\u001b[39m\u001b[38;5;124m\"\u001b[39m\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/locks.py:15\u001b[0m, in \u001b[0;36m_ContextManagerMixin.__aenter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__aenter__\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39macquire()\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m# We have no use for the \"as ...\" clause in the with\u001b[39;00m\n\u001b[1;32m 17\u001b[0m \u001b[38;5;66;03m# statement for locks.\u001b[39;00m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/locks.py:387\u001b[0m, in \u001b[0;36mSemaphore.acquire\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 386\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 387\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m fut\n\u001b[1;32m 388\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 389\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_waiters\u001b[38;5;241m.\u001b[39mremove(fut)\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/futures.py:287\u001b[0m, in \u001b[0;36mFuture.__await__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 285\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdone():\n\u001b[1;32m 286\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_asyncio_future_blocking \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m--> 287\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m \u001b[38;5;28mself\u001b[39m \u001b[38;5;66;03m# This tells Task to wait for completion.\u001b[39;00m\n\u001b[1;32m 288\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdone():\n\u001b[1;32m 289\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mawait wasn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt used with future\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/tasks.py:349\u001b[0m, in \u001b[0;36mTask.__wakeup\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__wakeup\u001b[39m(\u001b[38;5;28mself\u001b[39m, future):\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 349\u001b[0m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 350\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 351\u001b[0m \u001b[38;5;66;03m# This may also be a cancellation.\u001b[39;00m\n\u001b[1;32m 352\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__step(exc)\n", - "File \u001b[0;32m~/.miniconda/envs/eddymotion/lib/python3.11/asyncio/futures.py:198\u001b[0m, in \u001b[0;36mFuture.result\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 196\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m _CANCELLED:\n\u001b[1;32m 197\u001b[0m exc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_cancelled_error()\n\u001b[0;32m--> 198\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 199\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m!=\u001b[39m _FINISHED:\n\u001b[1;32m 200\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions\u001b[38;5;241m.\u001b[39mInvalidStateError(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mResult is not ready.\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/locks.py:15\u001b[0m, in \u001b[0;36m_ContextManagerMixin.__aenter__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__aenter__\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39macquire()\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m# We have no use for the \"as ...\" clause in the with\u001b[39;00m\n\u001b[1;32m 17\u001b[0m \u001b[38;5;66;03m# statement for locks.\u001b[39;00m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/locks.py:387\u001b[0m, in \u001b[0;36mSemaphore.acquire\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 385\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 386\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 387\u001b[0m \u001b[38;5;28;01mawait\u001b[39;00m fut\n\u001b[1;32m 388\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 389\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_waiters\u001b[38;5;241m.\u001b[39mremove(fut)\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/futures.py:287\u001b[0m, in \u001b[0;36mFuture.__await__\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 285\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdone():\n\u001b[1;32m 286\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_asyncio_future_blocking \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m--> 287\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m \u001b[38;5;28mself\u001b[39m \u001b[38;5;66;03m# This tells Task to wait for completion.\u001b[39;00m\n\u001b[1;32m 288\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdone():\n\u001b[1;32m 289\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mawait wasn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt used with future\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/tasks.py:349\u001b[0m, in \u001b[0;36mTask.__wakeup\u001b[0;34m(self, future)\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__wakeup\u001b[39m(\u001b[38;5;28mself\u001b[39m, future):\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 349\u001b[0m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 350\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m exc:\n\u001b[1;32m 351\u001b[0m \u001b[38;5;66;03m# This may also be a cancellation.\u001b[39;00m\n\u001b[1;32m 352\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__step(exc)\n", + "File \u001b[0;32m~/.miniconda/envs/nifreeze/lib/python3.11/asyncio/futures.py:198\u001b[0m, in \u001b[0;36mFuture.result\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 196\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m _CANCELLED:\n\u001b[1;32m 197\u001b[0m exc \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_cancelled_error()\n\u001b[0;32m--> 198\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 199\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m!=\u001b[39m _FINISHED:\n\u001b[1;32m 200\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions\u001b[38;5;241m.\u001b[39mInvalidStateError(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mResult is not ready.\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", "\u001b[0;31mCancelledError\u001b[0m: " ] } @@ -479,7 +479,7 @@ "source": [ "from nitransforms.resampling import apply\n", "\n", - "from eddymotion.registration.utils import displacement_framewise\n", + "from nifreeze.registration.utils import displacement_framewise\n", "\n", "afni_fd = {}\n", "nitransforms_fd = {}\n", @@ -1730,7 +1730,7 @@ " (afni, original, nitransforms),\n", " afni_fd[str(bold_run)],\n", " nitransforms_fd[str(bold_run)],\n", - " labels=(\"3dVolreg\", str(bold_run), \"eddymotion\"),\n", + " labels=(\"3dVolreg\", str(bold_run), \"nifreeze\"),\n", " indexing=(None, (slice(None), 3 * datashape[1] // 4, datashape[2] // 2, slice(None))),\n", " )\n", "\n", @@ -1755,7 +1755,7 @@ ], "metadata": { "kernelspec": { - "display_name": "eddymotion", + "display_name": "nifreeze", "language": "python", "name": "python3" }, diff --git a/docs/notebooks/dmri_covariance.ipynb b/docs/notebooks/dmri_covariance.ipynb index e27ceff..20c99b8 100644 --- a/docs/notebooks/dmri_covariance.ipynb +++ b/docs/notebooks/dmri_covariance.ipynb @@ -24,7 +24,7 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", - "from eddymotion.model.gpr import (\n", + "from nifreeze.model.gpr import (\n", " compute_pairwise_angles,\n", " exponential_covariance,\n", " spherical_covariance,\n", @@ -229,7 +229,7 @@ "metadata": {}, "outputs": [], "source": [ - "from eddymotion.testing.simulations import simulate_voxels\n", + "from nifreeze.testing.simulations import simulate_voxels\n", "\n", "NUM_VOXELS = 3000\n", "BVAL_SHELL = 3000\n", @@ -345,7 +345,7 @@ } ], "source": [ - "from eddymotion.model.gpr import EddyMotionGPR, SphericalKriging\n", + "from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging\n", "\n", "K = SphericalKriging(beta_a=PARAMETER_SPHERICAL_a, beta_l=PARAMETER_lambda)(X_real)\n", "K -= K.min()\n", diff --git a/docs/notebooks/dwi_gp_estimation.ipynb b/docs/notebooks/dwi_gp_estimation.ipynb index 4ef57d3..a4389f1 100644 --- a/docs/notebooks/dwi_gp_estimation.ipynb +++ b/docs/notebooks/dwi_gp_estimation.ipynb @@ -5,7 +5,7 @@ "id": "d11e5969ed6af8a5", "metadata": {}, "source": [ - "Estimate a DWI signal using the eddymotion Gaussian Process (GP) regressor estimator." + "Estimate a DWI signal using the nifreeze Gaussian Process (GP) regressor estimator." ] }, { @@ -143,7 +143,7 @@ "metadata": {}, "outputs": [], "source": [ - "from eddymotion.model.gpr import EddyMotionGPR, SphericalKriging\n", + "from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging\n", "\n", "beta_a = 1.38\n", "beta_l = 1 / 2.1\n", diff --git a/docs/running.rst b/docs/running.rst index 010250e..83e307a 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -1,11 +1,11 @@ -.. _running_eddymotion: +.. _running_nifreeze: Running *Eddymotion* ******************** Command line interface ---------------------- .. argparse:: - :ref: eddymotion.cli.parser._build_parser - :prog: eddymotion + :ref: nifreeze.cli.parser._build_parser + :prog: nifreeze :nodefault: :nodefaultconst: \ No newline at end of file diff --git a/docs/usage.rst b/docs/usage.rst index a02fbe9..89cd1e7 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -11,8 +11,8 @@ To utilize Eddymotion functionalities within your Python module or script, follo .. code-block:: python # Import required components from the Eddymotion package - from eddymotion.data import dmri - from eddymotion.estimator import EddyMotionEstimator + from nifreeze.data import dmri + from nifreeze.estimator import EddyMotionEstimator 2. **Load DWI Data**: Load diffusion MRI (dMRI) data into a `DWI` object using the `load` function. Ensure the gradient table is provided. It should have one row per diffusion-weighted image. The first three columns represent the gradient directions, and the last column indicates the timing and strength of the gradients in units of s/mm² [ R A S+ b ]. If your data are in NIfTI file format, include a file containing the gradient information with the argument "gradients_file": @@ -59,7 +59,7 @@ To utilize Eddymotion functionalities within your Python module or script, follo - `dwi_data`: The target DWI dataset, represented by this tool's internal type. - `align_kwargs`: Parameters to configure the image registration process. - - `models`: list of diffusion models used to generate the registration target for each gradient map. For a list of available models, see :doc:`api/eddymotion.model`. + - `models`: list of diffusion models used to generate the registration target for each gradient map. For a list of available models, see :doc:`api/nifreeze.model`. - `omp_nthreads`: Maximum number of threads an individual process may use. - `n_jobs`: Number of parallel jobs. - `seed`: Seed for the random number generator (necessary for deterministic estimation). diff --git a/pyproject.toml b/pyproject.toml index 463dd29..7cefdca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] -name = "eddymotion" +name = "nifreeze" description = "Pure python eddy-current and head-motion correction for dMRI, an extension of QSIprep's SHOREline algorithm (Cieslak, 2020) to multiple diffusion models." readme = "README.rst" authors = [{name = "The NiPreps Developers", email = "nipreps@gmail.com"}] @@ -34,8 +34,8 @@ dependencies = [ dynamic = ["version"] [project.urls] -Documentation = "https://www.nipreps.org/eddymotion" -Home = "https://github.com/nipreps/eddymotion" +Documentation = "https://www.nipreps.org/nifreeze" +Home = "https://github.com/nipreps/nifreeze" NiPreps = "https://www.nipreps.org/" [project.optional-dependencies] @@ -82,12 +82,12 @@ antsopt = [ ] # Aliases -docs = ["eddymotion[doc]"] -tests = ["eddymotion[test]"] -all = ["eddymotion[doc,test,dev,plotting,resmon,antsopt]"] +docs = ["nifreeze[doc]"] +tests = ["nifreeze[test]"] +all = ["nifreeze[doc,test,dev,plotting,resmon,antsopt]"] [project.scripts] -eddymotion = "eddymotion.cli.run:main" +nifreeze = "nifreeze.cli.run:main" # # Hatch configurations @@ -100,9 +100,9 @@ allow-direct-references = true exclude = [".git_archival.txt"] # No longer needed in sdist [tool.hatch.build.targets.wheel] -packages = ["src/eddymotion"] +packages = ["src/nifreeze"] # exclude = [ -# "eddymotion/tests/data", # Large test data directory +# "nifreeze/tests/data", # Large test data directory # ] @@ -116,7 +116,7 @@ local_scheme = "no-local-version" [tool.hatch.build.hooks.vcs] -version-file = "src/eddymotion/_version.py" +version-file = "src/nifreeze/_version.py" # # Developer tool configurations @@ -163,7 +163,7 @@ inline-quotes = "double" quote-style = "double" [tool.ruff.lint.isort] -known-first-party=["eddymotion"] +known-first-party=["nifreeze"] [tool.pytest.ini_options] pythonpath = "src/ test/" @@ -183,7 +183,7 @@ omit = [ '*/viz/*', '*/__init__.py', '*/conftest.py', - 'src/eddymotion/_version.py' + 'src/nifreeze/_version.py' ] [tool.coverage.report] diff --git a/scripts/dwi_gp_estimation_error_analysis.py b/scripts/dwi_gp_estimation_error_analysis.py index 2591f58..c9aebbb 100644 --- a/scripts/dwi_gp_estimation_error_analysis.py +++ b/scripts/dwi_gp_estimation_error_analysis.py @@ -36,11 +36,11 @@ import pandas as pd from sklearn.model_selection import KFold, RepeatedKFold, cross_val_predict, cross_val_score -from eddymotion.model.gpr import ( +from nifreeze.model.gpr import ( EddyMotionGPR, SphericalKriging, ) -from eddymotion.testing import simulations as testsims +from nifreeze.testing import simulations as testsims def cross_validate( @@ -63,8 +63,8 @@ def cross_validate( Number of folds. n_repeats : :obj:`int` Number of times the cross-validator needs to be repeated. - gpr : obj:`~eddymotion.model.gpr.EddyMotionGPR` - The eddymotion Gaussian process regressor object. + gpr : obj:`~nifreeze.model.gpr.EddyMotionGPR` + The nifreeze Gaussian process regressor object. Returns ------- diff --git a/scripts/dwi_gp_estimation_error_analysis_plot.py b/scripts/dwi_gp_estimation_error_analysis_plot.py index 176e56f..1656f6b 100644 --- a/scripts/dwi_gp_estimation_error_analysis_plot.py +++ b/scripts/dwi_gp_estimation_error_analysis_plot.py @@ -35,7 +35,7 @@ import numpy as np import pandas as pd -from eddymotion.viz.signals import plot_error +from nifreeze.viz.signals import plot_error def _build_arg_parser() -> argparse.ArgumentParser: diff --git a/scripts/dwi_gp_estimation_signal_plot.py b/scripts/dwi_gp_estimation_signal_plot.py index 9148947..819ffc7 100644 --- a/scripts/dwi_gp_estimation_signal_plot.py +++ b/scripts/dwi_gp_estimation_signal_plot.py @@ -35,7 +35,7 @@ from dipy.core.gradients import gradient_table from dipy.io import read_bvals_bvecs -from eddymotion.viz.signals import plot_prediction_surface +from nifreeze.viz.signals import plot_prediction_surface def _build_arg_parser() -> argparse.ArgumentParser: diff --git a/scripts/dwi_gp_estimation_simulated_signal.py b/scripts/dwi_gp_estimation_simulated_signal.py index ade883f..c3e9771 100644 --- a/scripts/dwi_gp_estimation_simulated_signal.py +++ b/scripts/dwi_gp_estimation_simulated_signal.py @@ -33,8 +33,8 @@ import numpy as np from dipy.core.sphere import Sphere -from eddymotion.model.gpr import EddyMotionGPR, SphericalKriging -from eddymotion.testing import simulations as testsims +from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging +from nifreeze.testing import simulations as testsims SAMPLING_DIRECTIONS = 200 diff --git a/scripts/optimize_registration.py b/scripts/optimize_registration.py index 33c990e..3412368 100644 --- a/scripts/optimize_registration.py +++ b/scripts/optimize_registration.py @@ -35,8 +35,8 @@ from smac import HyperparameterOptimizationFacade, Scenario from smac.utils.configspace import get_config_hash -from eddymotion.registration import ants as erants -from eddymotion.registration import utils +from nifreeze.registration import ants as erants +from nifreeze.registration import utils logger = logging.getLogger("ants-optimization") @@ -75,9 +75,9 @@ async def ants(cmd, cwd, stdout, stderr, semaphore): return returncode -DATASET_PATH = Path(getenv("TEST_DATA_HOME", f"{getenv('HOME')}/.cache/eddymotion-tests")) +DATASET_PATH = Path(getenv("TEST_DATA_HOME", f"{getenv('HOME')}/.cache/nifreeze-tests")) -WORKDIR = Path.home() / "tmp" / "eddymotiondev" +WORKDIR = Path.home() / "tmp" / "nifreezedev" WORKDIR.mkdir(parents=True, exist_ok=True) EXPERIMENTDIR = WORKDIR / "smac" diff --git a/src/nifreeze/__init__.py b/src/nifreeze/__init__.py index 412aab1..8c0014d 100644 --- a/src/nifreeze/__init__.py +++ b/src/nifreeze/__init__.py @@ -20,12 +20,12 @@ # # https://www.nipreps.org/community/licensing/ # -"""Top-level package for eddymotion.""" +"""Top-level package for nifreeze.""" -from eddymotion._version import __version__ +from nifreeze._version import __version__ -__packagename__ = "eddymotion" -__copyright__ = "Copyright 2021, The eddymotion developers" +__packagename__ = "nifreeze" +__copyright__ = "Copyright 2021, The nifreeze developers" __url__ = "https://github.com/nipreps/EddyMotionCorrection" DOWNLOAD_URL = f"https://github.com/nipreps/{__packagename__}/archive/{__version__}.tar.gz" diff --git a/src/nifreeze/cli/run.py b/src/nifreeze/cli/run.py index b68e83b..edf1a79 100644 --- a/src/nifreeze/cli/run.py +++ b/src/nifreeze/cli/run.py @@ -24,9 +24,9 @@ from pathlib import Path -from eddymotion.cli.parser import parse_args -from eddymotion.data.dmri import DWI -from eddymotion.estimator import EddyMotionEstimator +from nifreeze.cli.parser import parse_args +from nifreeze.data.dmri import DWI +from nifreeze.estimator import EddyMotionEstimator def main(argv=None) -> None: diff --git a/src/nifreeze/conftest.py b/src/nifreeze/conftest.py index a867fef..f9a4cfa 100644 --- a/src/nifreeze/conftest.py +++ b/src/nifreeze/conftest.py @@ -29,7 +29,7 @@ import numpy import pytest -test_data_env = os.getenv("TEST_DATA_HOME", str(Path.home() / "eddymotion-tests")) +test_data_env = os.getenv("TEST_DATA_HOME", str(Path.home() / "nifreeze-tests")) test_output_dir = os.getenv("TEST_OUTPUT_DIR") test_workdir = os.getenv("TEST_WORK_DIR") diff --git a/src/nifreeze/data/splitting.py b/src/nifreeze/data/splitting.py index 66c0369..fca0f7b 100644 --- a/src/nifreeze/data/splitting.py +++ b/src/nifreeze/data/splitting.py @@ -34,7 +34,7 @@ def lovo_split(dataset, index, with_b0=False): Parameters ---------- - dataset : :obj:`eddymotion.data.dmri.DWI` + dataset : :obj:`nifreeze.data.dmri.DWI` DWI object index : :obj:`int` Index of the DWI orientation to be left out in this fold. diff --git a/src/nifreeze/estimator.py b/src/nifreeze/estimator.py index 2ca4a18..723594b 100644 --- a/src/nifreeze/estimator.py +++ b/src/nifreeze/estimator.py @@ -28,10 +28,10 @@ import nibabel as nb from tqdm import tqdm -from eddymotion import utils as eutils -from eddymotion.data.splitting import lovo_split -from eddymotion.model.base import ModelFactory -from eddymotion.registration.ants import _prepare_registration_data, _run_registration +from nifreeze import utils as eutils +from nifreeze.data.splitting import lovo_split +from nifreeze.model.base import ModelFactory +from nifreeze.registration.ants import _prepare_registration_data, _run_registration class EddyMotionEstimator: @@ -53,7 +53,7 @@ def estimate( Parameters ---------- - data : :obj:`~eddymotion.dmri.DWI` + data : :obj:`~nifreeze.dmri.DWI` The target DWI dataset, represented by this tool's internal type. The object is used in-place, and will contain the estimated parameters in its ``em_affines`` property, as well as the rotated @@ -67,7 +67,7 @@ def estimate( models : :obj:`list` Selects the diffusion model that will generate the registration target corresponding to each gradient map. - See :obj:`~eddymotion.model.ModelFactory` for allowed models (and corresponding + See :obj:`~nifreeze.model.ModelFactory` for allowed models (and corresponding keywords). omp_nthreads : :obj:`int` Maximum number of threads an individual process may use. @@ -228,12 +228,12 @@ def _prepare_kwargs(data, kwargs): Parameters ---------- - data : :class:`eddymotion.data.dmri.DWI` + data : :class:`nifreeze.data.dmri.DWI` DWI data object. kwargs : :obj:`dict` Keyword arguments. """ - from eddymotion.data.filtering import advanced_clip as _advanced_clip + from nifreeze.data.filtering import advanced_clip as _advanced_clip if data.brainmask is not None: kwargs["mask"] = data.brainmask diff --git a/src/nifreeze/math/tests/test_utils.py b/src/nifreeze/math/tests/test_utils.py index 4970233..8461810 100644 --- a/src/nifreeze/math/tests/test_utils.py +++ b/src/nifreeze/math/tests/test_utils.py @@ -23,7 +23,7 @@ import numpy as np import pytest -from eddymotion.math.utils import compute_angle, is_positive_definite +from nifreeze.math.utils import compute_angle, is_positive_definite def test_is_positive_definite(): diff --git a/src/nifreeze/model/__init__.py b/src/nifreeze/model/__init__.py index 149a71e..886b698 100644 --- a/src/nifreeze/model/__init__.py +++ b/src/nifreeze/model/__init__.py @@ -22,18 +22,18 @@ # """Data models.""" -from eddymotion.model.base import ( +from nifreeze.model.base import ( AverageModel, ModelFactory, TrivialModel, ) -from eddymotion.model.dmri import ( +from nifreeze.model.dmri import ( AverageDWModel, DKIModel, DTIModel, GPModel, ) -from eddymotion.model.pet import PETModel +from nifreeze.model.pet import PETModel __all__ = ( "ModelFactory", diff --git a/src/nifreeze/model/_dipy.py b/src/nifreeze/model/_dipy.py index d7eb177..5025421 100644 --- a/src/nifreeze/model/_dipy.py +++ b/src/nifreeze/model/_dipy.py @@ -31,7 +31,7 @@ from dipy.reconst.base import ReconstModel from sklearn.gaussian_process import GaussianProcessRegressor -from eddymotion.model.gpr import ( +from nifreeze.model.gpr import ( EddyMotionGPR, ExponentialKriging, SphericalKriging, @@ -157,7 +157,7 @@ def fit( Returns ------- - :obj:`~eddymotion.model.dipy.GPFit` + :obj:`~nifreeze.model.dipy.GPFit` A model fit container object. """ diff --git a/src/nifreeze/model/base.py b/src/nifreeze/model/base.py index 1bf8f01..1759164 100644 --- a/src/nifreeze/model/base.py +++ b/src/nifreeze/model/base.py @@ -20,11 +20,11 @@ # # https://www.nipreps.org/community/licensing/ # -"""Base infrastructure for eddymotion's models.""" +"""Base infrastructure for nifreeze's models.""" import numpy as np -from eddymotion.exceptions import ModelNotFittedError +from nifreeze.exceptions import ModelNotFittedError class ModelFactory: @@ -51,7 +51,7 @@ def init(model="DTI", **kwargs): return TrivialModel(predicted=kwargs.pop("S0"), gtab=kwargs.pop("gtab")) if model.lower() in ("avgdwi", "averagedwi", "meandwi"): - from eddymotion.model.dmri import AverageDWModel + from nifreeze.model.dmri import AverageDWModel return AverageDWModel(**kwargs) diff --git a/src/nifreeze/model/dmri.py b/src/nifreeze/model/dmri.py index 6241fab..82e5993 100644 --- a/src/nifreeze/model/dmri.py +++ b/src/nifreeze/model/dmri.py @@ -24,9 +24,9 @@ import numpy as np from joblib import Parallel, delayed -from eddymotion.exceptions import ModelNotFittedError -from eddymotion.model._dipy import _rasb2dipy -from eddymotion.model.base import BaseModel +from nifreeze.exceptions import ModelNotFittedError +from nifreeze.model._dipy import _rasb2dipy +from nifreeze.model.base import BaseModel def _exec_fit(model, data, chunk=None): @@ -238,7 +238,7 @@ def __init__(self, **kwargs): bias : :obj:`bool` Whether the overall distribution of each diffusion weighted image will be standardized and centered around the - :data:`src.eddymotion.model.base.DEFAULT_CLIP_PERCENTILE` percentile. + :data:`src.nifreeze.model.base.DEFAULT_CLIP_PERCENTILE` percentile. stat : :obj:`str` Whether the summary statistic to apply is ``"mean"`` or ``"median"``. @@ -310,10 +310,10 @@ class DKIModel(BaseDWIModel): class GPModel(BaseDWIModel): - """A wrapper of :obj:`~eddymotion.model.dipy.GaussianProcessModel`.""" + """A wrapper of :obj:`~nifreeze.model.dipy.GaussianProcessModel`.""" _modelargs = ("kernel_model",) - _model_class = "eddymotion.model._dipy.GaussianProcessModel" + _model_class = "nifreeze.model._dipy.GaussianProcessModel" def find_shelling_scheme( diff --git a/src/nifreeze/model/gpr.py b/src/nifreeze/model/gpr.py index f23705d..06f2f8b 100644 --- a/src/nifreeze/model/gpr.py +++ b/src/nifreeze/model/gpr.py @@ -64,7 +64,7 @@ class EddyMotionGPR(GaussianProcessRegressor): r""" - A Gaussian process (GP) regressor specialized for eddymotion. + A Gaussian process (GP) regressor specialized for nifreeze. This specialization of the default GP regressor is created to allow the following extended behaviors: diff --git a/src/nifreeze/model/pet.py b/src/nifreeze/model/pet.py index f6e1299..1773367 100644 --- a/src/nifreeze/model/pet.py +++ b/src/nifreeze/model/pet.py @@ -25,8 +25,8 @@ import numpy as np from joblib import Parallel, delayed -from eddymotion.exceptions import ModelNotFittedError -from eddymotion.model.base import BaseModel +from nifreeze.exceptions import ModelNotFittedError +from nifreeze.model.base import BaseModel DEFAULT_TIMEFRAME_MIDPOINT_TOL = 1e-2 """Time frame tolerance in seconds.""" diff --git a/src/nifreeze/registration/ants.py b/src/nifreeze/registration/ants.py index 2f1c949..f01978d 100644 --- a/src/nifreeze/registration/ants.py +++ b/src/nifreeze/registration/ants.py @@ -78,7 +78,7 @@ def _to_nifti( """ data = np.squeeze(data) if clip: - from eddymotion.data.filtering import advanced_clip + from nifreeze.data.filtering import advanced_clip data = advanced_clip(data) nii = nb.Nifti1Image( @@ -162,7 +162,7 @@ def _get_ants_settings(settings: str = "b0-to-b0_level0") -> Path: """ return Path( pkg_fn( - "eddymotion.registration", + "nifreeze.registration", f"config/{settings}.json", ) ) @@ -461,7 +461,7 @@ def _run_registration( registration = Registration( terminal_output="file", from_file=pkg_fn( - "eddymotion.registration", + "nifreeze.registration", f"config/{reg_target_type[0]}-to-{reg_target_type[1]}_level{i_iter}.json", ), fixed_image=str(fixed.absolute()), diff --git a/test/conftest.py b/test/conftest.py index 9d8812d..b74b114 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -29,7 +29,7 @@ import numpy import pytest -test_data_env = os.getenv("TEST_DATA_HOME", str(Path.home() / "eddymotion-tests")) +test_data_env = os.getenv("TEST_DATA_HOME", str(Path.home() / "nifreeze-tests")) test_output_dir = os.getenv("TEST_OUTPUT_DIR") test_workdir = os.getenv("TEST_WORK_DIR") diff --git a/test/test_data_utils.py b/test/test_data_utils.py index 658e79b..79fa16b 100644 --- a/test/test_data_utils.py +++ b/test/test_data_utils.py @@ -2,7 +2,7 @@ import numpy as np import numpy.testing as npt -from eddymotion.data.utils import apply_affines +from nifreeze.data.utils import apply_affines def test_apply_affines(): diff --git a/test/test_dmri.py b/test/test_dmri.py index 98c89f2..74c5cad 100644 --- a/test/test_dmri.py +++ b/test/test_dmri.py @@ -26,8 +26,8 @@ import numpy as np import pytest -from eddymotion.data.dmri import load -from eddymotion.model.dmri import ( +from nifreeze.data.dmri import load +from nifreeze.model.dmri import ( find_shelling_scheme, ) diff --git a/test/test_gpr.py b/test/test_gpr.py index efc42b2..8d19974 100644 --- a/test/test_gpr.py +++ b/test/test_gpr.py @@ -26,7 +26,7 @@ import pytest from dipy.io import read_bvals_bvecs -from eddymotion.model import gpr +from nifreeze.model import gpr GradientTablePatch = namedtuple("gtab", ["bvals", "bvecs"]) diff --git a/test/test_integration.py b/test/test_integration.py index 1b1ba85..b30f7d5 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -28,9 +28,9 @@ import nitransforms as nt import numpy as np -from eddymotion.data.dmri import DWI -from eddymotion.estimator import EddyMotionEstimator -from eddymotion.registration.utils import displacements_within_mask +from nifreeze.data.dmri import DWI +from nifreeze.estimator import EddyMotionEstimator +from nifreeze.registration.utils import displacements_within_mask def test_proximity_estimator_trivial_model(datadir, tmp_path): diff --git a/test/test_main.py b/test/test_main.py index 6b322e7..7d38620 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -25,13 +25,13 @@ import pytest -from eddymotion.__main__ import main +from nifreeze.__main__ import main @pytest.fixture(autouse=True) def set_command(monkeypatch): with monkeypatch.context() as m: - m.setattr(sys, "argv", ["eddymotion"]) + m.setattr(sys, "argv", ["nifreeze"]) yield @@ -39,7 +39,7 @@ def test_help(capsys): with pytest.raises(SystemExit): main(["--help"]) captured = capsys.readouterr() - assert captured.out.startswith("usage: eddymotion [-h]") + assert captured.out.startswith("usage: nifreeze [-h]") def test_main(tmp_path, datadir): @@ -66,4 +66,4 @@ def test_main(tmp_path, datadir): ) # assert Path(output_dir).joinpath("dwi.h5").exists() # Empty - # Also, call python -m eddymotion or eddymotion from GHA ?? + # Also, call python -m nifreeze or nifreeze from GHA ?? diff --git a/test/test_model.py b/test/test_model.py index 2f50e6f..dd901bb 100644 --- a/test/test_model.py +++ b/test/test_model.py @@ -26,13 +26,13 @@ import pytest from dipy.sims.voxel import single_tensor -from eddymotion import model -from eddymotion.data.dmri import DWI -from eddymotion.data.splitting import lovo_split -from eddymotion.exceptions import ModelNotFittedError -from eddymotion.model._dipy import GaussianProcessModel -from eddymotion.model.dmri import DEFAULT_MAX_S0, DEFAULT_MIN_S0 -from eddymotion.testing import simulations as _sim +from nifreeze import model +from nifreeze.data.dmri import DWI +from nifreeze.data.splitting import lovo_split +from nifreeze.exceptions import ModelNotFittedError +from nifreeze.model._dipy import GaussianProcessModel +from nifreeze.model.dmri import DEFAULT_MAX_S0, DEFAULT_MIN_S0 +from nifreeze.testing import simulations as _sim def test_trivial_model(): diff --git a/test/test_parser.py b/test/test_parser.py index 27276e8..397daa8 100644 --- a/test/test_parser.py +++ b/test/test_parser.py @@ -25,7 +25,7 @@ import pytest -from eddymotion.cli.parser import _build_parser +from nifreeze.cli.parser import _build_parser MIN_ARGS = ["data/dwi.h5"] diff --git a/test/test_registration.py b/test/test_registration.py index 4f19391..45ff787 100644 --- a/test/test_registration.py +++ b/test/test_registration.py @@ -33,8 +33,8 @@ from nipype.interfaces.ants.registration import Registration from pkg_resources import resource_filename as pkg_fn -from eddymotion.registration.ants import _massage_mask_path -from eddymotion.registration.utils import displacements_within_mask +from nifreeze.registration.ants import _massage_mask_path +from nifreeze.registration.utils import displacements_within_mask @pytest.mark.parametrize("r_x", [0.0, 0.1, 0.3]) @@ -62,7 +62,7 @@ def test_ANTs_config_b0(datadir, tmp_path, dataset, r_x, r_y, r_z, t_x, t_y, t_z registration = Registration( terminal_output="file", from_file=pkg_fn( - "eddymotion.registration", + "nifreeze.registration", "config/b0-to-b0_level0.json", ), fixed_image=str(fixed.absolute()), diff --git a/test/test_splitting.py b/test/test_splitting.py index 99beb4d..7d4d25a 100644 --- a/test/test_splitting.py +++ b/test/test_splitting.py @@ -24,8 +24,8 @@ import numpy as np -from eddymotion.data.dmri import DWI -from eddymotion.data.splitting import lovo_split +from nifreeze.data.dmri import DWI +from nifreeze.data.splitting import lovo_split def test_lovo_split(datadir): diff --git a/test/test_version.py b/test/test_version.py index e73e2e8..66e4092 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -25,7 +25,7 @@ import sys from importlib import reload -import eddymotion +import nifreeze def test_version_scm0(monkeypatch): @@ -34,6 +34,6 @@ def test_version_scm0(monkeypatch): class _version: __version__ = "10.0.0" - monkeypatch.setitem(sys.modules, "eddymotion._version", _version) - reload(eddymotion) - assert eddymotion.__version__ == "10.0.0" + monkeypatch.setitem(sys.modules, "nifreeze._version", _version) + reload(nifreeze) + assert nifreeze.__version__ == "10.0.0" diff --git a/tox.ini b/tox.ini index 76398f3..77371e1 100644 --- a/tox.ini +++ b/tox.ini @@ -35,7 +35,7 @@ pass_env = PATH extras = test commands = - pytest --doctest-modules --cov eddymotion -n auto --cov-report xml \ + pytest --doctest-modules --cov nifreeze -n auto --cov-report xml \ --junitxml=test-results.xml -v src test {posargs} [testenv:docs]