Skip to content

Commit

Permalink
Drop old stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Oct 12, 2024
1 parent a7b0f84 commit 6fbb1cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion sdcflows/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def doctest_fixture(doctest_namespace, request):
dsA_dir=data_dir / "dsA",
dsB_dir=data_dir / "dsB",
dsC_dir=data_dir / "dsC",
dsD_dir=data_dir / "dsD",
)
doctest_namespace.update((key, Path(val.root)) for key, val in layouts.items())

Expand Down
7 changes: 5 additions & 2 deletions sdcflows/interfaces/fmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _PhaseMap2radsOutputSpec(TraitedSpec):


class PhaseMap2rads(SimpleInterface):
"""Convert a phase map given in a.u. (e.g., 0-4096) to radians."""
"""Convert a phase map given in a.u. (e.g., 0-4096) to radians (0 to 2pi)."""

input_spec = _PhaseMap2radsInputSpec
output_spec = _PhaseMap2radsOutputSpec
Expand All @@ -73,7 +73,10 @@ class _PhaseMap2rads2OutputSpec(TraitedSpec):


class PhaseMap2rads2(SimpleInterface):
"""Convert a phase map given in a.u. (e.g., 0-4096) to radians."""
"""Convert a phase map given in a.u. (e.g., 0-4096) to radians (-pi to pi).
This differs from PhaseMap2rads, which scales the phase to [0, 2*pi].
"""

input_spec = _PhaseMap2rads2InputSpec
output_spec = _PhaseMap2rads2OutputSpec
Expand Down
8 changes: 6 additions & 2 deletions sdcflows/utils/phasemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


def au2rads(in_file, newpath=None):
"""Convert the input phase map in arbitrary units (a.u.) to rads."""
"""Convert the input phase map in arbitrary units (a.u.) to rads (0 to 2pi)."""
import numpy as np
import nibabel as nb
from nipype.utils.filemanip import fname_presuffix
Expand All @@ -47,7 +47,10 @@ def au2rads(in_file, newpath=None):


def au2rads2(in_file, newpath=None):
"""Convert the input phase map in arbitrary units (a.u.) to rads (-pi to pi)."""
"""Convert the input phase map in arbitrary units (a.u.) to rads (-pi to pi).
This differs from au2rads, which scales the phase to [0, 2*pi].
"""
import numpy as np
import nibabel as nb
from nipype.utils.filemanip import fname_presuffix
Expand All @@ -58,6 +61,7 @@ def au2rads2(in_file, newpath=None):

# Rescale to [0, 2*pi]
data = (data - data.min()) * (2 * np.pi / (data.max() - data.min()))
# Rescale to [-pi, pi]
data = data - np.pi

# Round to float32 and clip
Expand Down
9 changes: 0 additions & 9 deletions sdcflows/utils/wrangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,6 @@ def find_estimators(
FieldmapEstimation(sources=<2 files>, method=<EstimatorType.ANAT: 5>,
bids_id='auto_...')]
It should find MEDIC-style files too:
>>> find_estimators(
... layout=layouts['dsD'],
... subject="01",
... ) # doctest: +ELLIPSIS
[FieldmapEstimation(sources=<10 files>, method=<EstimatorType.MEDIC: 10>,
bids_id='medic')]
"""
from .misc import create_logger
from bids.layout import Query
Expand Down

0 comments on commit 6fbb1cb

Please sign in to comment.