junifer 0.0.6.dev227__py3-none-any.whl → 0.0.6.dev252__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- junifer/_version.py +2 -2
- junifer/api/decorators.py +1 -2
- junifer/api/functions.py +18 -18
- junifer/api/queue_context/gnu_parallel_local_adapter.py +4 -4
- junifer/api/queue_context/htcondor_adapter.py +4 -4
- junifer/api/queue_context/tests/test_gnu_parallel_local_adapter.py +3 -3
- junifer/api/queue_context/tests/test_htcondor_adapter.py +3 -3
- junifer/api/tests/test_functions.py +32 -32
- junifer/cli/cli.py +3 -3
- junifer/cli/parser.py +4 -4
- junifer/cli/tests/test_cli.py +5 -5
- junifer/cli/utils.py +5 -6
- junifer/configs/juseless/datagrabbers/ixi_vbm.py +2 -2
- junifer/configs/juseless/datagrabbers/tests/test_ucla.py +2 -2
- junifer/configs/juseless/datagrabbers/ucla.py +4 -4
- junifer/data/_dispatch.py +11 -14
- junifer/data/coordinates/_ants_coordinates_warper.py +6 -8
- junifer/data/coordinates/_coordinates.py +34 -21
- junifer/data/coordinates/_fsl_coordinates_warper.py +6 -8
- junifer/data/masks/_ants_mask_warper.py +18 -11
- junifer/data/masks/_fsl_mask_warper.py +6 -8
- junifer/data/masks/_masks.py +27 -34
- junifer/data/masks/tests/test_masks.py +4 -4
- junifer/data/parcellations/_ants_parcellation_warper.py +18 -11
- junifer/data/parcellations/_fsl_parcellation_warper.py +6 -8
- junifer/data/parcellations/_parcellations.py +39 -43
- junifer/data/parcellations/tests/test_parcellations.py +1 -2
- junifer/data/pipeline_data_registry_base.py +3 -2
- junifer/data/template_spaces.py +3 -3
- junifer/data/tests/test_data_utils.py +1 -2
- junifer/data/utils.py +69 -4
- junifer/datagrabber/aomic/id1000.py +24 -11
- junifer/datagrabber/aomic/piop1.py +27 -14
- junifer/datagrabber/aomic/piop2.py +27 -14
- junifer/datagrabber/aomic/tests/test_id1000.py +3 -3
- junifer/datagrabber/aomic/tests/test_piop1.py +4 -4
- junifer/datagrabber/aomic/tests/test_piop2.py +4 -4
- junifer/datagrabber/base.py +18 -12
- junifer/datagrabber/datalad_base.py +18 -11
- junifer/datagrabber/dmcc13_benchmark.py +31 -18
- junifer/datagrabber/hcp1200/datalad_hcp1200.py +3 -3
- junifer/datagrabber/hcp1200/hcp1200.py +26 -15
- junifer/datagrabber/hcp1200/tests/test_hcp1200.py +2 -1
- junifer/datagrabber/multiple.py +7 -7
- junifer/datagrabber/pattern.py +75 -45
- junifer/datagrabber/pattern_validation_mixin.py +204 -94
- junifer/datagrabber/tests/test_datalad_base.py +7 -8
- junifer/datagrabber/tests/test_dmcc13_benchmark.py +28 -11
- junifer/datagrabber/tests/test_pattern_validation_mixin.py +6 -6
- junifer/datareader/default.py +6 -6
- junifer/external/nilearn/junifer_connectivity_measure.py +2 -2
- junifer/external/nilearn/junifer_nifti_spheres_masker.py +4 -4
- junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +15 -15
- junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py +2 -3
- junifer/markers/base.py +8 -8
- junifer/markers/brainprint.py +7 -9
- junifer/markers/complexity/complexity_base.py +6 -8
- junifer/markers/complexity/hurst_exponent.py +5 -5
- junifer/markers/complexity/multiscale_entropy_auc.py +5 -5
- junifer/markers/complexity/perm_entropy.py +5 -5
- junifer/markers/complexity/range_entropy.py +5 -5
- junifer/markers/complexity/range_entropy_auc.py +5 -5
- junifer/markers/complexity/sample_entropy.py +5 -5
- junifer/markers/complexity/weighted_perm_entropy.py +5 -5
- junifer/markers/ets_rss.py +7 -7
- junifer/markers/falff/_afni_falff.py +1 -2
- junifer/markers/falff/_junifer_falff.py +1 -2
- junifer/markers/falff/falff_base.py +2 -4
- junifer/markers/falff/falff_parcels.py +7 -7
- junifer/markers/falff/falff_spheres.py +6 -6
- junifer/markers/functional_connectivity/crossparcellation_functional_connectivity.py +6 -6
- junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +7 -7
- junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +6 -6
- junifer/markers/functional_connectivity/functional_connectivity_base.py +10 -10
- junifer/markers/functional_connectivity/functional_connectivity_parcels.py +7 -7
- junifer/markers/functional_connectivity/functional_connectivity_spheres.py +6 -6
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +1 -2
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +1 -2
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +3 -3
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +3 -3
- junifer/markers/parcel_aggregation.py +8 -8
- junifer/markers/reho/_afni_reho.py +1 -2
- junifer/markers/reho/_junifer_reho.py +1 -2
- junifer/markers/reho/reho_base.py +2 -4
- junifer/markers/reho/reho_parcels.py +8 -8
- junifer/markers/reho/reho_spheres.py +7 -7
- junifer/markers/sphere_aggregation.py +8 -8
- junifer/markers/temporal_snr/temporal_snr_base.py +8 -8
- junifer/markers/temporal_snr/temporal_snr_parcels.py +6 -6
- junifer/markers/temporal_snr/temporal_snr_spheres.py +5 -5
- junifer/markers/utils.py +3 -3
- junifer/onthefly/_brainprint.py +2 -2
- junifer/onthefly/read_transform.py +3 -3
- junifer/pipeline/marker_collection.py +4 -4
- junifer/pipeline/pipeline_component_registry.py +5 -4
- junifer/pipeline/pipeline_step_mixin.py +15 -11
- junifer/pipeline/tests/test_pipeline_component_registry.py +2 -3
- junifer/pipeline/tests/test_pipeline_step_mixin.py +19 -19
- junifer/pipeline/tests/test_update_meta_mixin.py +4 -4
- junifer/pipeline/update_meta_mixin.py +21 -17
- junifer/pipeline/utils.py +5 -5
- junifer/preprocess/base.py +10 -10
- junifer/preprocess/confounds/fmriprep_confound_remover.py +11 -14
- junifer/preprocess/confounds/tests/test_fmriprep_confound_remover.py +1 -2
- junifer/preprocess/smoothing/smoothing.py +7 -7
- junifer/preprocess/warping/_ants_warper.py +26 -6
- junifer/preprocess/warping/_fsl_warper.py +22 -7
- junifer/preprocess/warping/space_warper.py +37 -10
- junifer/preprocess/warping/tests/test_space_warper.py +3 -4
- junifer/stats.py +4 -4
- junifer/storage/base.py +14 -13
- junifer/storage/hdf5.py +21 -20
- junifer/storage/pandas_base.py +12 -11
- junifer/storage/sqlite.py +11 -11
- junifer/storage/tests/test_hdf5.py +1 -2
- junifer/storage/tests/test_sqlite.py +2 -2
- junifer/storage/tests/test_utils.py +8 -7
- junifer/storage/utils.py +7 -7
- junifer/testing/datagrabbers.py +9 -10
- junifer/tests/test_stats.py +2 -2
- junifer/typing/_typing.py +6 -9
- junifer/utils/helpers.py +2 -3
- junifer/utils/logging.py +5 -5
- junifer/utils/singleton.py +3 -3
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/METADATA +2 -2
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/RECORD +131 -131
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/WHEEL +1 -1
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/AUTHORS.rst +0 -0
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/LICENSE.md +0 -0
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/entry_points.txt +0 -0
- {junifer-0.0.6.dev227.dist-info → junifer-0.0.6.dev252.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@
|
|
4
4
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
5
5
|
# License: AGPL
|
6
6
|
|
7
|
-
from typing import Any,
|
7
|
+
from typing import Any, Optional, Union
|
8
8
|
|
9
9
|
from ...api.decorators import register_marker
|
10
10
|
from ..parcel_aggregation import ParcelAggregation
|
@@ -61,12 +61,12 @@ class EdgeCentricFCParcels(FunctionalConnectivityBase):
|
|
61
61
|
|
62
62
|
def __init__(
|
63
63
|
self,
|
64
|
-
parcellation: Union[str,
|
64
|
+
parcellation: Union[str, list[str]],
|
65
65
|
agg_method: str = "mean",
|
66
|
-
agg_method_params: Optional[
|
66
|
+
agg_method_params: Optional[dict] = None,
|
67
67
|
conn_method: str = "correlation",
|
68
|
-
conn_method_params: Optional[
|
69
|
-
masks: Union[str,
|
68
|
+
conn_method_params: Optional[dict] = None,
|
69
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
70
70
|
name: Optional[str] = None,
|
71
71
|
) -> None:
|
72
72
|
self.parcellation = parcellation
|
@@ -80,8 +80,8 @@ class EdgeCentricFCParcels(FunctionalConnectivityBase):
|
|
80
80
|
)
|
81
81
|
|
82
82
|
def aggregate(
|
83
|
-
self, input:
|
84
|
-
) ->
|
83
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
84
|
+
) -> dict:
|
85
85
|
"""Perform parcel aggregation and ETS computation.
|
86
86
|
|
87
87
|
Parameters
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
5
5
|
# License: AGPL
|
6
6
|
|
7
|
-
from typing import Any,
|
7
|
+
from typing import Any, Optional, Union
|
8
8
|
|
9
9
|
from ...api.decorators import register_marker
|
10
10
|
from ..sphere_aggregation import SphereAggregation
|
@@ -73,10 +73,10 @@ class EdgeCentricFCSpheres(FunctionalConnectivityBase):
|
|
73
73
|
radius: Optional[float] = None,
|
74
74
|
allow_overlap: bool = False,
|
75
75
|
agg_method: str = "mean",
|
76
|
-
agg_method_params: Optional[
|
76
|
+
agg_method_params: Optional[dict] = None,
|
77
77
|
conn_method: str = "correlation",
|
78
|
-
conn_method_params: Optional[
|
79
|
-
masks: Union[str,
|
78
|
+
conn_method_params: Optional[dict] = None,
|
79
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
80
80
|
name: Optional[str] = None,
|
81
81
|
) -> None:
|
82
82
|
self.coords = coords
|
@@ -94,8 +94,8 @@ class EdgeCentricFCSpheres(FunctionalConnectivityBase):
|
|
94
94
|
)
|
95
95
|
|
96
96
|
def aggregate(
|
97
|
-
self, input:
|
98
|
-
) ->
|
97
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
98
|
+
) -> dict:
|
99
99
|
"""Perform sphere aggregation and ETS computation.
|
100
100
|
|
101
101
|
Parameters
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
from abc import abstractmethod
|
8
|
-
from typing import Any, ClassVar,
|
8
|
+
from typing import Any, ClassVar, Optional, Union
|
9
9
|
|
10
10
|
from sklearn.covariance import EmpiricalCovariance, LedoitWolf
|
11
11
|
|
@@ -63,10 +63,10 @@ class FunctionalConnectivityBase(BaseMarker):
|
|
63
63
|
def __init__(
|
64
64
|
self,
|
65
65
|
agg_method: str = "mean",
|
66
|
-
agg_method_params: Optional[
|
66
|
+
agg_method_params: Optional[dict] = None,
|
67
67
|
conn_method: str = "correlation",
|
68
|
-
conn_method_params: Optional[
|
69
|
-
masks: Union[str,
|
68
|
+
conn_method_params: Optional[dict] = None,
|
69
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
70
70
|
name: Optional[str] = None,
|
71
71
|
) -> None:
|
72
72
|
self.agg_method = agg_method
|
@@ -83,9 +83,9 @@ class FunctionalConnectivityBase(BaseMarker):
|
|
83
83
|
@abstractmethod
|
84
84
|
def aggregate(
|
85
85
|
self,
|
86
|
-
input:
|
87
|
-
extra_input: Optional[
|
88
|
-
) ->
|
86
|
+
input: dict[str, Any],
|
87
|
+
extra_input: Optional[dict[str, Any]] = None,
|
88
|
+
) -> dict[str, Any]:
|
89
89
|
"""Perform aggregation."""
|
90
90
|
raise_error(
|
91
91
|
msg="Concrete classes need to implement aggregate().",
|
@@ -94,9 +94,9 @@ class FunctionalConnectivityBase(BaseMarker):
|
|
94
94
|
|
95
95
|
def compute(
|
96
96
|
self,
|
97
|
-
input:
|
98
|
-
extra_input: Optional[
|
99
|
-
) ->
|
97
|
+
input: dict[str, Any],
|
98
|
+
extra_input: Optional[dict] = None,
|
99
|
+
) -> dict:
|
100
100
|
"""Compute.
|
101
101
|
|
102
102
|
Parameters
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
6
6
|
# License: AGPL
|
7
7
|
|
8
|
-
from typing import Any,
|
8
|
+
from typing import Any, Optional, Union
|
9
9
|
|
10
10
|
from ...api.decorators import register_marker
|
11
11
|
from ..parcel_aggregation import ParcelAggregation
|
@@ -55,12 +55,12 @@ class FunctionalConnectivityParcels(FunctionalConnectivityBase):
|
|
55
55
|
|
56
56
|
def __init__(
|
57
57
|
self,
|
58
|
-
parcellation: Union[str,
|
58
|
+
parcellation: Union[str, list[str]],
|
59
59
|
agg_method: str = "mean",
|
60
|
-
agg_method_params: Optional[
|
60
|
+
agg_method_params: Optional[dict] = None,
|
61
61
|
conn_method: str = "correlation",
|
62
|
-
conn_method_params: Optional[
|
63
|
-
masks: Union[str,
|
62
|
+
conn_method_params: Optional[dict] = None,
|
63
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
64
64
|
name: Optional[str] = None,
|
65
65
|
) -> None:
|
66
66
|
self.parcellation = parcellation
|
@@ -74,8 +74,8 @@ class FunctionalConnectivityParcels(FunctionalConnectivityBase):
|
|
74
74
|
)
|
75
75
|
|
76
76
|
def aggregate(
|
77
|
-
self, input:
|
78
|
-
) ->
|
77
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
78
|
+
) -> dict:
|
79
79
|
"""Perform parcel aggregation.
|
80
80
|
|
81
81
|
Parameters
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
6
6
|
# License: AGPL
|
7
7
|
|
8
|
-
from typing import Any,
|
8
|
+
from typing import Any, Optional, Union
|
9
9
|
|
10
10
|
from ...api.decorators import register_marker
|
11
11
|
from ..sphere_aggregation import SphereAggregation
|
@@ -68,10 +68,10 @@ class FunctionalConnectivitySpheres(FunctionalConnectivityBase):
|
|
68
68
|
radius: Optional[float] = None,
|
69
69
|
allow_overlap: bool = False,
|
70
70
|
agg_method: str = "mean",
|
71
|
-
agg_method_params: Optional[
|
71
|
+
agg_method_params: Optional[dict] = None,
|
72
72
|
conn_method: str = "correlation",
|
73
|
-
conn_method_params: Optional[
|
74
|
-
masks: Union[str,
|
73
|
+
conn_method_params: Optional[dict] = None,
|
74
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
75
75
|
name: Optional[str] = None,
|
76
76
|
) -> None:
|
77
77
|
self.coords = coords
|
@@ -89,8 +89,8 @@ class FunctionalConnectivitySpheres(FunctionalConnectivityBase):
|
|
89
89
|
)
|
90
90
|
|
91
91
|
def aggregate(
|
92
|
-
self, input:
|
93
|
-
) ->
|
92
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
93
|
+
) -> dict:
|
94
94
|
"""Perform sphere aggregation.
|
95
95
|
|
96
96
|
Parameters
|
@@ -5,7 +5,6 @@
|
|
5
5
|
# License: AGPL
|
6
6
|
|
7
7
|
from pathlib import Path
|
8
|
-
from typing import Dict
|
9
8
|
|
10
9
|
import pytest
|
11
10
|
|
@@ -24,7 +23,7 @@ from junifer.testing.datagrabbers import PartlyCloudyTestingDataGrabber
|
|
24
23
|
)
|
25
24
|
def test_EdgeCentricFCParcels(
|
26
25
|
tmp_path: Path,
|
27
|
-
conn_method_params:
|
26
|
+
conn_method_params: dict[str, bool],
|
28
27
|
) -> None:
|
29
28
|
"""Test EdgeCentricFCParcels.
|
30
29
|
|
@@ -5,7 +5,6 @@
|
|
5
5
|
# License: AGPL
|
6
6
|
|
7
7
|
from pathlib import Path
|
8
|
-
from typing import Dict
|
9
8
|
|
10
9
|
import pytest
|
11
10
|
|
@@ -24,7 +23,7 @@ from junifer.testing.datagrabbers import SPMAuditoryTestingDataGrabber
|
|
24
23
|
)
|
25
24
|
def test_EdgeCentricFCSpheres(
|
26
25
|
tmp_path: Path,
|
27
|
-
conn_method_params:
|
26
|
+
conn_method_params: dict[str, bool],
|
28
27
|
) -> None:
|
29
28
|
"""Test EdgeCentricFCSpheres.
|
30
29
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# License: AGPL
|
7
7
|
|
8
8
|
from pathlib import Path
|
9
|
-
from typing import TYPE_CHECKING
|
9
|
+
from typing import TYPE_CHECKING
|
10
10
|
|
11
11
|
import pytest
|
12
12
|
from nilearn.connectome import ConnectivityMeasure
|
@@ -36,8 +36,8 @@ if TYPE_CHECKING:
|
|
36
36
|
)
|
37
37
|
def test_FunctionalConnectivityParcels(
|
38
38
|
tmp_path: Path,
|
39
|
-
conn_method_params:
|
40
|
-
cov_estimator:
|
39
|
+
conn_method_params: dict[str, bool],
|
40
|
+
cov_estimator: type["BaseEstimator"],
|
41
41
|
) -> None:
|
42
42
|
"""Test FunctionalConnectivityParcels.
|
43
43
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# License: AGPL
|
8
8
|
|
9
9
|
from pathlib import Path
|
10
|
-
from typing import TYPE_CHECKING
|
10
|
+
from typing import TYPE_CHECKING
|
11
11
|
|
12
12
|
import pytest
|
13
13
|
from nilearn.connectome import ConnectivityMeasure
|
@@ -37,8 +37,8 @@ if TYPE_CHECKING:
|
|
37
37
|
)
|
38
38
|
def test_FunctionalConnectivitySpheres(
|
39
39
|
tmp_path: Path,
|
40
|
-
conn_method_params:
|
41
|
-
cov_estimator:
|
40
|
+
conn_method_params: dict[str, bool],
|
41
|
+
cov_estimator: type["BaseEstimator"],
|
42
42
|
) -> None:
|
43
43
|
"""Test FunctionalConnectivitySpheres.
|
44
44
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
5
5
|
# License: AGPL
|
6
6
|
|
7
|
-
from typing import Any, ClassVar,
|
7
|
+
from typing import Any, ClassVar, Optional, Union
|
8
8
|
|
9
9
|
import numpy as np
|
10
10
|
from nilearn.image import math_img
|
@@ -96,13 +96,13 @@ class ParcelAggregation(BaseMarker):
|
|
96
96
|
|
97
97
|
def __init__(
|
98
98
|
self,
|
99
|
-
parcellation: Union[str,
|
99
|
+
parcellation: Union[str, list[str]],
|
100
100
|
method: str,
|
101
|
-
method_params: Optional[
|
101
|
+
method_params: Optional[dict[str, Any]] = None,
|
102
102
|
time_method: Optional[str] = None,
|
103
|
-
time_method_params: Optional[
|
104
|
-
masks: Union[str,
|
105
|
-
on: Union[
|
103
|
+
time_method_params: Optional[dict[str, Any]] = None,
|
104
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
105
|
+
on: Union[list[str], str, None] = None,
|
106
106
|
name: Optional[str] = None,
|
107
107
|
) -> None:
|
108
108
|
if not isinstance(parcellation, list):
|
@@ -128,8 +128,8 @@ class ParcelAggregation(BaseMarker):
|
|
128
128
|
self.time_method_params = time_method_params or {}
|
129
129
|
|
130
130
|
def compute(
|
131
|
-
self, input:
|
132
|
-
) ->
|
131
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
132
|
+
) -> dict:
|
133
133
|
"""Compute.
|
134
134
|
|
135
135
|
Parameters
|
@@ -9,7 +9,6 @@ from typing import (
|
|
9
9
|
TYPE_CHECKING,
|
10
10
|
ClassVar,
|
11
11
|
Optional,
|
12
|
-
Tuple,
|
13
12
|
)
|
14
13
|
|
15
14
|
import nibabel as nib
|
@@ -61,7 +60,7 @@ class AFNIReHo(metaclass=Singleton):
|
|
61
60
|
box_x: Optional[int] = None,
|
62
61
|
box_y: Optional[int] = None,
|
63
62
|
box_z: Optional[int] = None,
|
64
|
-
) ->
|
63
|
+
) -> tuple["Nifti1Image", Path]:
|
65
64
|
"""Compute ReHo map.
|
66
65
|
|
67
66
|
Parameters
|
@@ -9,7 +9,6 @@ from pathlib import Path
|
|
9
9
|
from typing import (
|
10
10
|
TYPE_CHECKING,
|
11
11
|
ClassVar,
|
12
|
-
Tuple,
|
13
12
|
)
|
14
13
|
|
15
14
|
import nibabel as nib
|
@@ -51,7 +50,7 @@ class JuniferReHo(metaclass=Singleton):
|
|
51
50
|
self,
|
52
51
|
data: "Nifti1Image",
|
53
52
|
nneigh: int = 27,
|
54
|
-
) ->
|
53
|
+
) -> tuple["Nifti1Image", Path]:
|
55
54
|
"""Compute ReHo map.
|
56
55
|
|
57
56
|
Parameters
|
@@ -9,9 +9,7 @@ from typing import (
|
|
9
9
|
TYPE_CHECKING,
|
10
10
|
Any,
|
11
11
|
ClassVar,
|
12
|
-
Dict,
|
13
12
|
Optional,
|
14
|
-
Tuple,
|
15
13
|
)
|
16
14
|
|
17
15
|
from ...typing import ConditionalDependencies, MarkerInOutMappings
|
@@ -82,9 +80,9 @@ class ReHoBase(BaseMarker):
|
|
82
80
|
|
83
81
|
def _compute(
|
84
82
|
self,
|
85
|
-
input_data:
|
83
|
+
input_data: dict[str, Any],
|
86
84
|
**reho_params: Any,
|
87
|
-
) ->
|
85
|
+
) -> tuple["Nifti1Image", Path]:
|
88
86
|
"""Compute voxel-wise ReHo.
|
89
87
|
|
90
88
|
Calculates Kendall's W per voxel using neighborhood voxels.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# License: AGPL
|
5
5
|
|
6
6
|
|
7
|
-
from typing import Any,
|
7
|
+
from typing import Any, Optional, Union
|
8
8
|
|
9
9
|
import numpy as np
|
10
10
|
|
@@ -92,12 +92,12 @@ class ReHoParcels(ReHoBase):
|
|
92
92
|
|
93
93
|
def __init__(
|
94
94
|
self,
|
95
|
-
parcellation: Union[str,
|
95
|
+
parcellation: Union[str, list[str]],
|
96
96
|
using: str,
|
97
|
-
reho_params: Optional[
|
97
|
+
reho_params: Optional[dict] = None,
|
98
98
|
agg_method: str = "mean",
|
99
|
-
agg_method_params: Optional[
|
100
|
-
masks: Union[str,
|
99
|
+
agg_method_params: Optional[dict] = None,
|
100
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
101
101
|
name: Optional[str] = None,
|
102
102
|
) -> None:
|
103
103
|
# Superclass init first to validate `using` parameter
|
@@ -110,9 +110,9 @@ class ReHoParcels(ReHoBase):
|
|
110
110
|
|
111
111
|
def compute(
|
112
112
|
self,
|
113
|
-
input:
|
114
|
-
extra_input: Optional[
|
115
|
-
) ->
|
113
|
+
input: dict[str, Any],
|
114
|
+
extra_input: Optional[dict[str, Any]] = None,
|
115
|
+
) -> dict[str, Any]:
|
116
116
|
"""Compute.
|
117
117
|
|
118
118
|
Parameters
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# License: AGPL
|
5
5
|
|
6
6
|
|
7
|
-
from typing import Any,
|
7
|
+
from typing import Any, Optional, Union
|
8
8
|
|
9
9
|
import numpy as np
|
10
10
|
|
@@ -107,10 +107,10 @@ class ReHoSpheres(ReHoBase):
|
|
107
107
|
using: str,
|
108
108
|
radius: Optional[float] = None,
|
109
109
|
allow_overlap: bool = False,
|
110
|
-
reho_params: Optional[
|
110
|
+
reho_params: Optional[dict] = None,
|
111
111
|
agg_method: str = "mean",
|
112
|
-
agg_method_params: Optional[
|
113
|
-
masks: Union[str,
|
112
|
+
agg_method_params: Optional[dict] = None,
|
113
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
114
114
|
name: Optional[str] = None,
|
115
115
|
) -> None:
|
116
116
|
# Superclass init first to validate `using` parameter
|
@@ -125,9 +125,9 @@ class ReHoSpheres(ReHoBase):
|
|
125
125
|
|
126
126
|
def compute(
|
127
127
|
self,
|
128
|
-
input:
|
129
|
-
extra_input: Optional[
|
130
|
-
) ->
|
128
|
+
input: dict[str, Any],
|
129
|
+
extra_input: Optional[dict[str, Any]] = None,
|
130
|
+
) -> dict[str, Any]:
|
131
131
|
"""Compute.
|
132
132
|
|
133
133
|
Parameters
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# Synchon Mandal <s.mandal@fz-juelich.de>
|
5
5
|
# License: AGPL
|
6
6
|
|
7
|
-
from typing import Any, ClassVar,
|
7
|
+
from typing import Any, ClassVar, Optional, Union
|
8
8
|
|
9
9
|
from ..api.decorators import register_marker
|
10
10
|
from ..data import get_data
|
@@ -105,11 +105,11 @@ class SphereAggregation(BaseMarker):
|
|
105
105
|
radius: Optional[float] = None,
|
106
106
|
allow_overlap: bool = False,
|
107
107
|
method: str = "mean",
|
108
|
-
method_params: Optional[
|
108
|
+
method_params: Optional[dict[str, Any]] = None,
|
109
109
|
time_method: Optional[str] = None,
|
110
|
-
time_method_params: Optional[
|
111
|
-
masks: Union[str,
|
112
|
-
on: Union[
|
110
|
+
time_method_params: Optional[dict[str, Any]] = None,
|
111
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
112
|
+
on: Union[list[str], str, None] = None,
|
113
113
|
name: Optional[str] = None,
|
114
114
|
) -> None:
|
115
115
|
self.coords = coords
|
@@ -136,9 +136,9 @@ class SphereAggregation(BaseMarker):
|
|
136
136
|
|
137
137
|
def compute(
|
138
138
|
self,
|
139
|
-
input:
|
140
|
-
extra_input: Optional[
|
141
|
-
) ->
|
139
|
+
input: dict[str, Any],
|
140
|
+
extra_input: Optional[dict] = None,
|
141
|
+
) -> dict:
|
142
142
|
"""Compute.
|
143
143
|
|
144
144
|
Parameters
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
from abc import abstractmethod
|
8
|
-
from typing import Any, ClassVar,
|
8
|
+
from typing import Any, ClassVar, Optional, Union
|
9
9
|
|
10
10
|
from nilearn import image as nimg
|
11
11
|
|
@@ -49,8 +49,8 @@ class TemporalSNRBase(BaseMarker):
|
|
49
49
|
def __init__(
|
50
50
|
self,
|
51
51
|
agg_method: str = "mean",
|
52
|
-
agg_method_params: Optional[
|
53
|
-
masks: Union[str,
|
52
|
+
agg_method_params: Optional[dict] = None,
|
53
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
54
54
|
name: Optional[str] = None,
|
55
55
|
) -> None:
|
56
56
|
self.agg_method = agg_method
|
@@ -60,8 +60,8 @@ class TemporalSNRBase(BaseMarker):
|
|
60
60
|
|
61
61
|
@abstractmethod
|
62
62
|
def aggregate(
|
63
|
-
self, input:
|
64
|
-
) ->
|
63
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
64
|
+
) -> dict[str, Any]:
|
65
65
|
"""Perform aggregation."""
|
66
66
|
raise_error(
|
67
67
|
msg="Concrete classes need to implement aggregate().",
|
@@ -70,9 +70,9 @@ class TemporalSNRBase(BaseMarker):
|
|
70
70
|
|
71
71
|
def compute(
|
72
72
|
self,
|
73
|
-
input:
|
74
|
-
extra_input: Optional[
|
75
|
-
) ->
|
73
|
+
input: dict[str, Any],
|
74
|
+
extra_input: Optional[dict] = None,
|
75
|
+
) -> dict:
|
76
76
|
"""Compute.
|
77
77
|
|
78
78
|
Parameters
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Authors: Leonard Sasse <l.sasse@fz-juelich.de>
|
4
4
|
# License: AGPL
|
5
5
|
|
6
|
-
from typing import Any,
|
6
|
+
from typing import Any, Optional, Union
|
7
7
|
|
8
8
|
from ...api.decorators import register_marker
|
9
9
|
from ..parcel_aggregation import ParcelAggregation
|
@@ -40,10 +40,10 @@ class TemporalSNRParcels(TemporalSNRBase):
|
|
40
40
|
|
41
41
|
def __init__(
|
42
42
|
self,
|
43
|
-
parcellation: Union[str,
|
43
|
+
parcellation: Union[str, list[str]],
|
44
44
|
agg_method: str = "mean",
|
45
|
-
agg_method_params: Optional[
|
46
|
-
masks: Union[str,
|
45
|
+
agg_method_params: Optional[dict] = None,
|
46
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
47
47
|
name: Optional[str] = None,
|
48
48
|
) -> None:
|
49
49
|
self.parcellation = parcellation
|
@@ -55,8 +55,8 @@ class TemporalSNRParcels(TemporalSNRBase):
|
|
55
55
|
)
|
56
56
|
|
57
57
|
def aggregate(
|
58
|
-
self, input:
|
59
|
-
) ->
|
58
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
59
|
+
) -> dict:
|
60
60
|
"""Perform parcel aggregation.
|
61
61
|
|
62
62
|
Parameters
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Authors: Leonard Sasse <l.sasse@fz-juelich.de>
|
4
4
|
# License: AGPL
|
5
5
|
|
6
|
-
from typing import Any,
|
6
|
+
from typing import Any, Optional, Union
|
7
7
|
|
8
8
|
from ...api.decorators import register_marker
|
9
9
|
from ..sphere_aggregation import SphereAggregation
|
@@ -53,8 +53,8 @@ class TemporalSNRSpheres(TemporalSNRBase):
|
|
53
53
|
radius: Optional[float] = None,
|
54
54
|
allow_overlap: bool = False,
|
55
55
|
agg_method: str = "mean",
|
56
|
-
agg_method_params: Optional[
|
57
|
-
masks: Union[str,
|
56
|
+
agg_method_params: Optional[dict] = None,
|
57
|
+
masks: Union[str, dict, list[Union[dict, str]], None] = None,
|
58
58
|
name: Optional[str] = None,
|
59
59
|
) -> None:
|
60
60
|
self.coords = coords
|
@@ -70,8 +70,8 @@ class TemporalSNRSpheres(TemporalSNRBase):
|
|
70
70
|
)
|
71
71
|
|
72
72
|
def aggregate(
|
73
|
-
self, input:
|
74
|
-
) ->
|
73
|
+
self, input: dict[str, Any], extra_input: Optional[dict] = None
|
74
|
+
) -> dict:
|
75
75
|
"""Perform sphere aggregation.
|
76
76
|
|
77
77
|
Parameters
|
junifer/markers/utils.py
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Amir Omidvarnia <a.omidvarnia@fz-juelich.de>
|
9
9
|
# License: AGPL
|
10
10
|
|
11
|
-
from typing import Callable,
|
11
|
+
from typing import Callable, Optional, Union
|
12
12
|
|
13
13
|
import numpy as np
|
14
14
|
import pandas as pd
|
@@ -19,8 +19,8 @@ from ..utils import raise_error
|
|
19
19
|
|
20
20
|
def _ets(
|
21
21
|
bold_ts: np.ndarray,
|
22
|
-
roi_names: Union[None,
|
23
|
-
) ->
|
22
|
+
roi_names: Union[None, list[str]] = None,
|
23
|
+
) -> tuple[np.ndarray, Optional[list[str]]]:
|
24
24
|
"""Compute the edge-wise time series based on BOLD time series.
|
25
25
|
|
26
26
|
Take a timeseries of brain areas, and calculate timeseries for each
|
junifer/onthefly/_brainprint.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Authors: Synchon Mandal <s.mandal@fz-juelich.de>
|
4
4
|
# License: AGPL
|
5
5
|
|
6
|
-
from typing import
|
6
|
+
from typing import Optional
|
7
7
|
|
8
8
|
import numpy as np
|
9
9
|
import pandas as pd
|
@@ -17,7 +17,7 @@ __all__ = ["normalize", "reweight"]
|
|
17
17
|
|
18
18
|
def normalize(
|
19
19
|
storage: StorageLike,
|
20
|
-
features:
|
20
|
+
features: dict[str, dict[str, Optional[str]]],
|
21
21
|
kind: str,
|
22
22
|
) -> pd.DataFrame:
|
23
23
|
"""Read stored brainprint data and normalize either surfaces or volumes.
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# License: AGPL
|
5
5
|
|
6
6
|
|
7
|
-
from typing import
|
7
|
+
from typing import Optional
|
8
8
|
|
9
9
|
import pandas as pd
|
10
10
|
|
@@ -20,8 +20,8 @@ def read_transform(
|
|
20
20
|
transform: str,
|
21
21
|
feature_name: Optional[str] = None,
|
22
22
|
feature_md5: Optional[str] = None,
|
23
|
-
transform_args: Optional[
|
24
|
-
transform_kw_args: Optional[
|
23
|
+
transform_args: Optional[tuple] = None,
|
24
|
+
transform_kw_args: Optional[dict] = None,
|
25
25
|
) -> pd.DataFrame:
|
26
26
|
"""Read stored feature and transform to specific statistical output.
|
27
27
|
|