Skip to content

Commit

Permalink
maint: address some remaining "eddymotion" mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
nipreps-bot authored and oesteban committed Dec 20, 2024
1 parent 2f9f8d0 commit 7a48118
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3
- name: Lint EddyMotion
- name: Lint NiFreeze
run: pipx run ruff check --diff
- name: Format EddyMotion
- name: Format NiFreeze
run: pipx run ruff format --diff
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
latex_documents = [
(
master_doc,
"smriprep.tex",
"Eddymotion Documentation",
"nifreeze.tex",
"NiFreeze Documentation",
"The NiPreps Developers",
"manual",
),
Expand All @@ -187,7 +187,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "smriprep", "Eddymotion Documentation", [author], 1)]
man_pages = [(master_doc, "nifreeze", "NiFreeze Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -198,10 +198,10 @@
texinfo_documents = [
(
master_doc,
"smriprep",
"Eddymotion Documentation",
"nifreeze",
"NiFreeze Documentation",
author,
"Eddymotion",
"NiFreeze",
"One line description of project.",
"Miscellaneous",
),
Expand Down
2 changes: 1 addition & 1 deletion docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ For developers
==============
Contributing
------------
*Eddymotion* is a project of the *NiPreps Community*, `which specifies the contributing guidelines <https://www.nipreps.org/community/>`__.
*NiFreeze* is a project of the *NiPreps Community*, `which specifies the contributing guidelines <https://www.nipreps.org/community/>`__.
Before delving into the code, please make sure you have read all the guidelines offered online.

Documentation
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/dmri_covariance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
}
],
"source": [
"from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging\n",
"from nifreeze.model.gpr import DiffusionGPR, SphericalKriging\n",
"\n",
"K = SphericalKriging(beta_a=PARAMETER_SPHERICAL_a, beta_l=PARAMETER_lambda)(X_real)\n",
"K -= K.min()\n",
Expand Down Expand Up @@ -382,7 +382,7 @@
"metadata": {},
"outputs": [],
"source": [
"gpm = EddyMotionGPR(\n",
"gpm = DiffusionGPR(\n",
" kernel=SphericalKriging(beta_a=PARAMETER_SPHERICAL_a, beta_l=PARAMETER_lambda),\n",
" alpha=0.1,\n",
" disp=True,\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/notebooks/dwi_gp_estimation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"id": "9dcab811fe667617",
"metadata": {},
"source": [
"Define the EddyMotionGPR instance."
"Define the DiffusionGPR instance."
]
},
{
Expand All @@ -143,7 +143,7 @@
"metadata": {},
"outputs": [],
"source": [
"from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging\n",
"from nifreeze.model.gpr import DiffusionGPR, SphericalKriging\n",
"\n",
"beta_a = 1.38\n",
"beta_l = 1 / 2.1\n",
Expand All @@ -152,7 +152,7 @@
"alpha = 0.1\n",
"disp = True\n",
"optimizer = None\n",
"gpr = EddyMotionGPR(kernel=kernel, alpha=alpha, disp=disp, optimizer=optimizer)"
"gpr = DiffusionGPR(kernel=kernel, alpha=alpha, disp=disp, optimizer=optimizer)"
]
},
{
Expand Down Expand Up @@ -302,7 +302,7 @@
}
],
"source": [
"gpr = EddyMotionGPR(kernel=kernel, alpha=alpha, disp=disp, optimizer=\"fmin_l_bfgs_b\", ftol=0.1)\n",
"gpr = DiffusionGPR(kernel=kernel, alpha=alpha, disp=disp, optimizer=\"fmin_l_bfgs_b\", ftol=0.1)\n",
"gpr = gpr.fit(bvecs_shell, y.T)"
]
},
Expand Down Expand Up @@ -351,7 +351,7 @@
"metadata": {},
"outputs": [],
"source": [
"gpr = EddyMotionGPR(kernel=gpr.kernel_, alpha=alpha, disp=disp, optimizer=None)\n",
"gpr = DiffusionGPR(kernel=gpr.kernel_, alpha=alpha, disp=disp, optimizer=None)\n",
"gpr = gpr.fit(X_train, y_train.T)\n",
"y_sim2 = np.squeeze(gpr.predict(X_test))\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/running.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _running_nifreeze:

Running *Eddymotion*
********************
Running *NiFreeze*
******************
Command line interface
----------------------
.. argparse::
Expand Down
20 changes: 10 additions & 10 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

How to Use
==========
Incorporating Eddymotion into a Python module or script
-------------------------------------------------------
To utilize Eddymotion functionalities within your Python module or script, follow these steps:
Incorporating NiFreeze into a Python module or script
-----------------------------------------------------
To utilize NiFreeze functionalities within your Python module or script, follow these steps:

1. **Import Eddymotion Components**: Start by importing necessary components from the Eddymotion package:
1. **Import NiFreeze Components**: Start by importing necessary components from the NiFreeze package:

.. code-block:: python
# Import required components from the Eddymotion package
# Import required components from the nifreeze package
from nifreeze.data import dmri
from nifreeze.estimator import EddyMotionEstimator
from nifreeze.estimator import Estimator
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":

Expand All @@ -32,16 +32,16 @@ To utilize Eddymotion functionalities within your Python module or script, follo
dwi_data = dmri.DWI.from_filename('/path/to/downloaded/dwi_full.h5')
3. **Instantiate an Eddymotion Estimator Object**: Create an instance of the `EddyMotionEstimator` class, which encapsulates tools for estimating rigid-body head motion and distortions due to eddy currents.
3. **Instantiate an NiFreeze Estimator Object**: Create an instance of the `Estimator` class, which encapsulates tools for estimating rigid-body head motion and distortions due to eddy currents.

.. code-block:: python
# Create an instance of the EddyMotionEstimator class
estimator = EddyMotionEstimator()
# Create an instance of the Estimator class
estimator = Estimator()
4. **Fit the Models to Estimate the Affine Transformation**:

Use the `estimate` method of the `EddyMotionEstimator` object to estimate the affine transformation parameters:
Use the `estimate` method of the `Estimator` object to estimate the affine transformation parameters:

.. code-block:: python
Expand Down
8 changes: 4 additions & 4 deletions scripts/dwi_gp_estimation_error_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from sklearn.model_selection import KFold, RepeatedKFold, cross_val_predict, cross_val_score

from nifreeze.model.gpr import (
EddyMotionGPR,
DiffusionGPR,
SphericalKriging,
)
from nifreeze.testing import simulations as testsims
Expand All @@ -48,7 +48,7 @@ def cross_validate(
y: np.ndarray,
cv: int,
n_repeats: int,
gpr: EddyMotionGPR,
gpr: DiffusionGPR,
) -> dict[int, list[tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]]]:
"""
Perform the experiment by estimating the dMRI signal using a Gaussian process model.
Expand All @@ -63,7 +63,7 @@ def cross_validate(
Number of folds.
n_repeats : :obj:`int`
Number of times the cross-validator needs to be repeated.
gpr : obj:`~nifreeze.model.gpr.EddyMotionGPR`
gpr : obj:`~nifreeze.model.gpr.DiffusionGPR`
The nifreeze Gaussian process regressor object.
Returns
Expand Down Expand Up @@ -192,7 +192,7 @@ def main() -> None:
a = 1.15
lambda_s = 120
alpha = 1
gpr = EddyMotionGPR(
gpr = DiffusionGPR(
kernel=SphericalKriging(beta_a=a, beta_l=lambda_s),
alpha=alpha,
optimizer=None,
Expand Down
4 changes: 2 additions & 2 deletions scripts/dwi_gp_estimation_simulated_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import numpy as np
from dipy.core.sphere import Sphere

from nifreeze.model.gpr import EddyMotionGPR, SphericalKriging
from nifreeze.model.gpr import DiffusionGPR, SphericalKriging
from nifreeze.testing import simulations as testsims

SAMPLING_DIRECTIONS = 200
Expand Down Expand Up @@ -135,7 +135,7 @@ def main() -> None:
a = 1.15
lambda_s = 120
alpha = 100
gpr = EddyMotionGPR(
gpr = DiffusionGPR(
kernel=SphericalKriging(a=a, lambda_s=lambda_s),
alpha=alpha,
optimizer=None,
Expand Down
6 changes: 3 additions & 3 deletions src/nifreeze/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2022 The NiPreps Developers <[email protected]>
# Copyright The NiPreps Developers <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
from nifreeze._version import __version__

__packagename__ = "nifreeze"
__copyright__ = "Copyright 2021, The nifreeze developers"
__url__ = "https://github.com/nipreps/EddyMotionCorrection"
__copyright__ = "Copyright 2024, The NiFreeze developers"
__url__ = "https://github.com/nipreps/nifreeze"

DOWNLOAD_URL = f"https://github.com/nipreps/{__packagename__}/archive/{__version__}.tar.gz"
2 changes: 1 addition & 1 deletion src/nifreeze/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# https://www.nipreps.org/community/licensing/
#
"""Entry point for Eddymotion."""
"""Entry point for NiFreeze."""

import sys

Expand Down
6 changes: 3 additions & 3 deletions src/nifreeze/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#
# https://www.nipreps.org/community/licensing/
#
"""Eddymotion runner."""
"""NiFreeze runner."""

from pathlib import Path

from nifreeze.cli.parser import parse_args
from nifreeze.data.dmri import DWI
from nifreeze.estimator import EddyMotionEstimator
from nifreeze.estimator import Estimator


def main(argv=None) -> None:
Expand All @@ -42,7 +42,7 @@ def main(argv=None) -> None:
# Open the data with the given file path
dwi_dataset: DWI = DWI.from_filename(args.input_file)

estimator: EddyMotionEstimator = EddyMotionEstimator()
estimator: Estimator = Estimator()

_ = estimator.estimate(
dwi_dataset,
Expand Down
2 changes: 1 addition & 1 deletion src/nifreeze/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from nifreeze.registration.ants import _prepare_registration_data, _run_registration


class EddyMotionEstimator:
class Estimator:
"""Estimates rigid-body head-motion and distortions derived from eddy-currents."""

@staticmethod
Expand Down
4 changes: 2 additions & 2 deletions src/nifreeze/model/_dipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from sklearn.gaussian_process import GaussianProcessRegressor

from nifreeze.model.gpr import (
EddyMotionGPR,
DiffusionGPR,
ExponentialKriging,
SphericalKriging,
)
Expand Down Expand Up @@ -180,7 +180,7 @@ def fit(
f"and gradient table ({grad_dirs})."
)

gpr = EddyMotionGPR(
gpr = DiffusionGPR(
kernel=self.kernel,
random_state=random_state,
n_targets=y.shape[1],
Expand Down
2 changes: 1 addition & 1 deletion src/nifreeze/model/gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"""A set of supported optimizers (automatically created)."""


class EddyMotionGPR(GaussianProcessRegressor):
class DiffusionGPR(GaussianProcessRegressor):
r"""
A Gaussian process (GP) regressor specialized for nifreeze.
Expand Down
4 changes: 2 additions & 2 deletions test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import numpy as np

from nifreeze.data.dmri import DWI
from nifreeze.estimator import EddyMotionEstimator
from nifreeze.estimator import Estimator
from nifreeze.registration.utils import displacements_within_mask


Expand Down Expand Up @@ -70,7 +70,7 @@ def test_proximity_estimator_trivial_model(datadir, tmp_path):
brainmask=dwdata.brainmask,
)

estimator = EddyMotionEstimator()
estimator = Estimator()
em_affines = estimator.estimate(
data=dwi_motion,
models=("b0",),
Expand Down

0 comments on commit 7a48118

Please sign in to comment.