Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[FIX] Fix circular import with DTIBasedMeasure enumeration #1373

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions clinica/pipelines/dwi/dti/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""This module contains utilities used by the DWIDTI pipeline."""

from enum import Enum
from pathlib import Path
from typing import Dict, List, Tuple

from clinica.utils.dwi import DTIBasedMeasure

__all__ = [
"DTIBasedMeasure",
"compute_statistics_on_atlases",
"get_caps_filenames",
"rename_into_caps",
Expand All @@ -15,15 +15,6 @@
]


class DTIBasedMeasure(str, Enum):
"""Possible DTI measures."""

FRACTIONAL_ANISOTROPY = "FA"
MEAN_DIFFUSIVITY = "MD"
AXIAL_DIFFUSIVITY = "AD"
RADIAL_DIFFUSIVITY = "RD"


def compute_statistics_on_atlases(
registered_map: Path, name_map: str, dwi_preprocessed_file: Path
) -> List[Path]:
Expand Down
12 changes: 12 additions & 0 deletions clinica/utils/dwi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from enum import Enum

__all__ = ["DTIBasedMeasure"]


class DTIBasedMeasure(str, Enum):
"""Possible DTI measures."""

FRACTIONAL_ANISOTROPY = "FA"
MEAN_DIFFUSIVITY = "MD"
AXIAL_DIFFUSIVITY = "AD"
RADIAL_DIFFUSIVITY = "RD"
2 changes: 1 addition & 1 deletion clinica/utils/input_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections.abc import Iterable
from typing import Optional, Union

from clinica.pipelines.dwi.dti.utils import DTIBasedMeasure
from clinica.utils.dwi import DTIBasedMeasure
from clinica.utils.pet import ReconstructionMethod, SUVRReferenceRegion, Tracer

# BIDS
Expand Down
2 changes: 1 addition & 1 deletion test/nonregression/pipelines/dwi/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def run_dwi_dti(
input_dir: Path, output_dir: Path, ref_dir: Path, working_dir: Path
) -> None:
from clinica.pipelines.dwi.dti.pipeline import DwiDti
from clinica.pipelines.dwi.dti.utils import DTIBasedMeasure
from clinica.utils.bids import BIDSFileName
from clinica.utils.dwi import DTIBasedMeasure

caps_dir = output_dir / "caps"

Expand Down
2 changes: 1 addition & 1 deletion test/unittests/utils/test_input_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from clinica.pipelines.dwi.dti.utils import DTIBasedMeasure
from clinica.utils.dwi import DTIBasedMeasure
from clinica.utils.pet import ReconstructionMethod, Tracer


Expand Down
2 changes: 1 addition & 1 deletion test/unittests/utils/test_utils_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def test_clinica_file_reader_dwi_dti_error(tmp_path):


def test_clinica_file_reader_dwi_dti(tmp_path):
from clinica.pipelines.dwi.dti.utils import DTIBasedMeasure
from clinica.utils.dwi import DTIBasedMeasure
from clinica.utils.input_files import dwi_dti
from clinica.utils.inputs import clinica_file_reader, clinica_list_of_files_reader

Expand Down
Loading