junifer 0.0.6.dev248__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.
Files changed (131) hide show
  1. junifer/_version.py +2 -2
  2. junifer/api/decorators.py +1 -2
  3. junifer/api/functions.py +18 -18
  4. junifer/api/queue_context/gnu_parallel_local_adapter.py +4 -4
  5. junifer/api/queue_context/htcondor_adapter.py +4 -4
  6. junifer/api/queue_context/tests/test_gnu_parallel_local_adapter.py +3 -3
  7. junifer/api/queue_context/tests/test_htcondor_adapter.py +3 -3
  8. junifer/api/tests/test_functions.py +32 -32
  9. junifer/cli/cli.py +3 -3
  10. junifer/cli/parser.py +4 -4
  11. junifer/cli/tests/test_cli.py +5 -5
  12. junifer/cli/utils.py +5 -6
  13. junifer/configs/juseless/datagrabbers/ixi_vbm.py +2 -2
  14. junifer/configs/juseless/datagrabbers/tests/test_ucla.py +2 -2
  15. junifer/configs/juseless/datagrabbers/ucla.py +4 -4
  16. junifer/data/_dispatch.py +11 -14
  17. junifer/data/coordinates/_ants_coordinates_warper.py +3 -3
  18. junifer/data/coordinates/_coordinates.py +6 -6
  19. junifer/data/coordinates/_fsl_coordinates_warper.py +3 -3
  20. junifer/data/masks/_ants_mask_warper.py +3 -3
  21. junifer/data/masks/_fsl_mask_warper.py +3 -3
  22. junifer/data/masks/_masks.py +6 -9
  23. junifer/data/masks/tests/test_masks.py +4 -4
  24. junifer/data/parcellations/_ants_parcellation_warper.py +3 -3
  25. junifer/data/parcellations/_fsl_parcellation_warper.py +3 -3
  26. junifer/data/parcellations/_parcellations.py +19 -19
  27. junifer/data/parcellations/tests/test_parcellations.py +1 -2
  28. junifer/data/pipeline_data_registry_base.py +3 -2
  29. junifer/data/template_spaces.py +3 -3
  30. junifer/data/tests/test_data_utils.py +1 -2
  31. junifer/data/utils.py +4 -3
  32. junifer/datagrabber/aomic/id1000.py +2 -2
  33. junifer/datagrabber/aomic/piop1.py +5 -5
  34. junifer/datagrabber/aomic/piop2.py +5 -5
  35. junifer/datagrabber/aomic/tests/test_id1000.py +3 -3
  36. junifer/datagrabber/aomic/tests/test_piop1.py +4 -4
  37. junifer/datagrabber/aomic/tests/test_piop2.py +4 -4
  38. junifer/datagrabber/base.py +12 -11
  39. junifer/datagrabber/datalad_base.py +3 -3
  40. junifer/datagrabber/dmcc13_benchmark.py +8 -8
  41. junifer/datagrabber/hcp1200/datalad_hcp1200.py +3 -3
  42. junifer/datagrabber/hcp1200/hcp1200.py +8 -8
  43. junifer/datagrabber/hcp1200/tests/test_hcp1200.py +2 -1
  44. junifer/datagrabber/multiple.py +7 -7
  45. junifer/datagrabber/pattern.py +10 -10
  46. junifer/datagrabber/pattern_validation_mixin.py +10 -10
  47. junifer/datagrabber/tests/test_datalad_base.py +7 -8
  48. junifer/datagrabber/tests/test_dmcc13_benchmark.py +2 -2
  49. junifer/datagrabber/tests/test_pattern_validation_mixin.py +6 -6
  50. junifer/datareader/default.py +6 -6
  51. junifer/external/nilearn/junifer_connectivity_measure.py +2 -2
  52. junifer/external/nilearn/junifer_nifti_spheres_masker.py +4 -4
  53. junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +15 -15
  54. junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py +2 -3
  55. junifer/markers/base.py +8 -8
  56. junifer/markers/brainprint.py +7 -9
  57. junifer/markers/complexity/complexity_base.py +6 -8
  58. junifer/markers/complexity/hurst_exponent.py +5 -5
  59. junifer/markers/complexity/multiscale_entropy_auc.py +5 -5
  60. junifer/markers/complexity/perm_entropy.py +5 -5
  61. junifer/markers/complexity/range_entropy.py +5 -5
  62. junifer/markers/complexity/range_entropy_auc.py +5 -5
  63. junifer/markers/complexity/sample_entropy.py +5 -5
  64. junifer/markers/complexity/weighted_perm_entropy.py +5 -5
  65. junifer/markers/ets_rss.py +7 -7
  66. junifer/markers/falff/_afni_falff.py +1 -2
  67. junifer/markers/falff/_junifer_falff.py +1 -2
  68. junifer/markers/falff/falff_base.py +2 -4
  69. junifer/markers/falff/falff_parcels.py +7 -7
  70. junifer/markers/falff/falff_spheres.py +6 -6
  71. junifer/markers/functional_connectivity/crossparcellation_functional_connectivity.py +6 -6
  72. junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +7 -7
  73. junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +6 -6
  74. junifer/markers/functional_connectivity/functional_connectivity_base.py +10 -10
  75. junifer/markers/functional_connectivity/functional_connectivity_parcels.py +7 -7
  76. junifer/markers/functional_connectivity/functional_connectivity_spheres.py +6 -6
  77. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +1 -2
  78. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +1 -2
  79. junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +3 -3
  80. junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +3 -3
  81. junifer/markers/parcel_aggregation.py +8 -8
  82. junifer/markers/reho/_afni_reho.py +1 -2
  83. junifer/markers/reho/_junifer_reho.py +1 -2
  84. junifer/markers/reho/reho_base.py +2 -4
  85. junifer/markers/reho/reho_parcels.py +8 -8
  86. junifer/markers/reho/reho_spheres.py +7 -7
  87. junifer/markers/sphere_aggregation.py +8 -8
  88. junifer/markers/temporal_snr/temporal_snr_base.py +8 -8
  89. junifer/markers/temporal_snr/temporal_snr_parcels.py +6 -6
  90. junifer/markers/temporal_snr/temporal_snr_spheres.py +5 -5
  91. junifer/markers/utils.py +3 -3
  92. junifer/onthefly/_brainprint.py +2 -2
  93. junifer/onthefly/read_transform.py +3 -3
  94. junifer/pipeline/marker_collection.py +4 -4
  95. junifer/pipeline/pipeline_component_registry.py +5 -4
  96. junifer/pipeline/pipeline_step_mixin.py +7 -7
  97. junifer/pipeline/tests/test_pipeline_component_registry.py +2 -3
  98. junifer/pipeline/tests/test_pipeline_step_mixin.py +19 -19
  99. junifer/pipeline/tests/test_update_meta_mixin.py +4 -4
  100. junifer/pipeline/update_meta_mixin.py +2 -2
  101. junifer/pipeline/utils.py +5 -5
  102. junifer/preprocess/base.py +10 -10
  103. junifer/preprocess/confounds/fmriprep_confound_remover.py +11 -14
  104. junifer/preprocess/confounds/tests/test_fmriprep_confound_remover.py +1 -2
  105. junifer/preprocess/smoothing/smoothing.py +7 -7
  106. junifer/preprocess/warping/_ants_warper.py +3 -4
  107. junifer/preprocess/warping/_fsl_warper.py +3 -4
  108. junifer/preprocess/warping/space_warper.py +6 -6
  109. junifer/preprocess/warping/tests/test_space_warper.py +3 -4
  110. junifer/stats.py +4 -4
  111. junifer/storage/base.py +14 -13
  112. junifer/storage/hdf5.py +21 -20
  113. junifer/storage/pandas_base.py +12 -11
  114. junifer/storage/sqlite.py +11 -11
  115. junifer/storage/tests/test_hdf5.py +1 -2
  116. junifer/storage/tests/test_sqlite.py +2 -2
  117. junifer/storage/tests/test_utils.py +8 -7
  118. junifer/storage/utils.py +7 -7
  119. junifer/testing/datagrabbers.py +9 -10
  120. junifer/tests/test_stats.py +2 -2
  121. junifer/typing/_typing.py +6 -9
  122. junifer/utils/helpers.py +2 -3
  123. junifer/utils/logging.py +5 -5
  124. junifer/utils/singleton.py +3 -3
  125. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/METADATA +2 -2
  126. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/RECORD +131 -131
  127. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/AUTHORS.rst +0 -0
  128. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/LICENSE.md +0 -0
  129. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/WHEEL +0 -0
  130. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/entry_points.txt +0 -0
  131. {junifer-0.0.6.dev248.dist-info → junifer-0.0.6.dev252.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@
3
3
  # Authors: Synchon Mandal <s.mandal@fz-juelich.de>
4
4
  # License: AGPL
5
5
 
6
- from typing import TYPE_CHECKING, Callable, List, Optional, Tuple, Union
6
+ from typing import TYPE_CHECKING, Callable, Optional, Union
7
7
 
8
8
  import numpy as np
9
9
  from nilearn import image, masking
@@ -271,7 +271,7 @@ class _JuniferExtractionFunctor:
271
271
  def __call__(
272
272
  self,
273
273
  imgs: Union["Nifti1Image", "Nifti2Image"],
274
- ) -> Tuple["ArrayLike", None]:
274
+ ) -> tuple["ArrayLike", None]:
275
275
  """Implement function call overloading.
276
276
 
277
277
  Parameters
@@ -372,9 +372,9 @@ class JuniferNiftiSpheresMasker(NiftiSpheresMasker):
372
372
  self,
373
373
  imgs: Union["Nifti1Image", "Nifti2Image"],
374
374
  confounds: Union[
375
- str, "Path", "ArrayLike", "DataFrame", List, None
375
+ str, "Path", "ArrayLike", "DataFrame", list, None
376
376
  ] = None,
377
- sample_mask: Union["ArrayLike", List, Tuple, None] = None,
377
+ sample_mask: Union["ArrayLike", list, tuple, None] = None,
378
378
  ) -> "ArrayLike":
379
379
  """Extract signals from a single 4D niimg.
380
380
 
@@ -6,7 +6,7 @@
6
6
  import copy
7
7
  import warnings
8
8
  from math import cosh, exp, log, sinh, sqrt
9
- from typing import TYPE_CHECKING, List, Optional, Tuple, Type, Union
9
+ from typing import TYPE_CHECKING, Optional, Union
10
10
 
11
11
  import numpy as np
12
12
  import pytest
@@ -149,7 +149,7 @@ def random_spd(
149
149
 
150
150
  def _signals(
151
151
  n_subjects: int = N_SUBJECTS,
152
- ) -> Tuple[List[np.ndarray], np.ndarray]:
152
+ ) -> tuple[list[np.ndarray], np.ndarray]:
153
153
  """Generate signals and compute covariances while applying confounds.
154
154
 
155
155
  Parameters
@@ -178,7 +178,7 @@ def _signals(
178
178
 
179
179
 
180
180
  @pytest.fixture
181
- def signals() -> List[np.ndarray]:
181
+ def signals() -> list[np.ndarray]:
182
182
  """Return signals as list of np.ndarray."""
183
183
  return _signals(N_SUBJECTS)[0]
184
184
 
@@ -186,7 +186,7 @@ def signals() -> List[np.ndarray]:
186
186
  @pytest.fixture
187
187
  def signals_and_covariances(
188
188
  cov_estimator: Union[LedoitWolf, EmpiricalCovariance]
189
- ) -> Tuple[List[np.ndarray], List[float]]:
189
+ ) -> tuple[list[np.ndarray], list[float]]:
190
190
  """Return signals and covariances for a covariance estimator.
191
191
 
192
192
  Parameters
@@ -417,7 +417,7 @@ def grad_geometric_mean(
417
417
  init: Optional["ArrayLike"] = None,
418
418
  max_iter: int = 10,
419
419
  tol: float = 1e-7,
420
- ) -> List[float]:
420
+ ) -> list[float]:
421
421
  """Compute gradient of geometric mean.
422
422
 
423
423
  Return the norm of the covariant derivative at each iteration step
@@ -615,8 +615,8 @@ def test_connectivity_measure_errors():
615
615
  @pytest.mark.parametrize("kind", CONNECTIVITY_KINDS)
616
616
  def test_connectivity_measure_generic(
617
617
  kind: str,
618
- cov_estimator: Type["BaseEstimator"],
619
- signals_and_covariances: Tuple[List[np.ndarray], List[float]],
618
+ cov_estimator: type["BaseEstimator"],
619
+ signals_and_covariances: tuple[list[np.ndarray], list[float]],
620
620
  ) -> None:
621
621
  """Test generic JuniferConnectivityMeasure.
622
622
 
@@ -778,8 +778,8 @@ def _assert_connectivity_partial_correlation(connectivities, covs) -> None:
778
778
  )
779
779
  def test_connectivity_measure_specific_for_each_kind(
780
780
  kind: str,
781
- cov_estimator: Type["BaseEstimator"],
782
- signals_and_covariances: Tuple[List[np.ndarray], List[float]],
781
+ cov_estimator: type["BaseEstimator"],
782
+ signals_and_covariances: tuple[list[np.ndarray], list[float]],
783
783
  ) -> None:
784
784
  """Test connectivity matrix for each kind.
785
785
 
@@ -812,7 +812,7 @@ def test_connectivity_measure_specific_for_each_kind(
812
812
 
813
813
  @pytest.mark.parametrize("kind", CONNECTIVITY_KINDS)
814
814
  def test_connectivity_measure_check_mean(
815
- kind: str, signals: List[np.ndarray]
815
+ kind: str, signals: list[np.ndarray]
816
816
  ) -> None:
817
817
  """Test mean of connectivity matrix for each kind.
818
818
 
@@ -846,7 +846,7 @@ def test_connectivity_measure_check_mean(
846
846
 
847
847
  @pytest.mark.parametrize("kind", CONNECTIVITY_KINDS)
848
848
  def test_connectivity_measure_check_vectorization_option(
849
- kind: str, signals: List[np.ndarray]
849
+ kind: str, signals: list[np.ndarray]
850
850
  ) -> None:
851
851
  """Test vectorization of connectivity matrix for each kind.
852
852
 
@@ -879,7 +879,7 @@ def test_connectivity_measure_check_vectorization_option(
879
879
  ["covariance", "correlation", "precision", "partial correlation"],
880
880
  )
881
881
  def test_connectivity_measure_check_inverse_transformation(
882
- kind: str, signals: List[np.ndarray]
882
+ kind: str, signals: list[np.ndarray]
883
883
  ) -> None:
884
884
  """Test inverse transform.
885
885
 
@@ -915,7 +915,7 @@ def test_connectivity_measure_check_inverse_transformation(
915
915
  ["covariance", "correlation", "precision", "partial correlation"],
916
916
  )
917
917
  def test_connectivity_measure_check_inverse_transformation_discard_diag(
918
- kind: str, signals: List[np.ndarray]
918
+ kind: str, signals: list[np.ndarray]
919
919
  ) -> None:
920
920
  """Test diagonal for inverse transform.
921
921
 
@@ -957,7 +957,7 @@ def test_connectivity_measure_check_inverse_transformation_discard_diag(
957
957
 
958
958
 
959
959
  def test_connectivity_measure_inverse_transform_tangent(
960
- signals: List[np.ndarray],
960
+ signals: list[np.ndarray],
961
961
  ) -> None:
962
962
  """Test that for 'tangent' kind, covariance matrices are reconstructed.
963
963
 
@@ -1067,7 +1067,7 @@ def test_confounds_connectivity_measure_errors() -> None:
1067
1067
 
1068
1068
 
1069
1069
  def test_connectivity_measure_standardize(
1070
- signals: List[np.ndarray],
1070
+ signals: list[np.ndarray],
1071
1071
  ) -> None:
1072
1072
  """Check warning is raised and then suppressed with setting standardize.
1073
1073
 
@@ -4,7 +4,6 @@
4
4
  # License: AGPL
5
5
 
6
6
  import warnings
7
- from typing import List, Tuple
8
7
 
9
8
  import nibabel
10
9
  import numpy as np
@@ -361,10 +360,10 @@ def test_nifti_spheres_masker_io_shapes() -> None:
361
360
  ],
362
361
  )
363
362
  def test_junifer_and_nilearn_mean_agg_are_equal(
364
- shape: Tuple[int, ...],
363
+ shape: tuple[int, ...],
365
364
  radius: float,
366
365
  allow_overlap: bool,
367
- coords: List[Tuple[int, int, int]],
366
+ coords: list[tuple[int, int, int]],
368
367
  ) -> None:
369
368
  """Test junifer's masker behaves same as nilearn's when agg is mean.
370
369
 
junifer/markers/base.py CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  from abc import ABC, abstractmethod
8
8
  from copy import deepcopy
9
- from typing import Any, Dict, List, Optional, Union
9
+ from typing import Any, Optional, Union
10
10
 
11
11
  from ..pipeline import PipelineStepMixin, UpdateMetaMixin
12
12
  from ..typing import StorageLike
@@ -42,7 +42,7 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
42
42
 
43
43
  def __init__(
44
44
  self,
45
- on: Optional[Union[List[str], str]] = None,
45
+ on: Optional[Union[list[str], str]] = None,
46
46
  name: Optional[str] = None,
47
47
  ) -> None:
48
48
  # Check for missing mapping attribute
@@ -65,7 +65,7 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
65
65
  raise_error(f"{self.name} cannot be computed on {wrong_on}")
66
66
  self._on = on
67
67
 
68
- def validate_input(self, input: List[str]) -> List[str]:
68
+ def validate_input(self, input: list[str]) -> list[str]:
69
69
  """Validate input.
70
70
 
71
71
  Parameters
@@ -94,7 +94,7 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
94
94
  )
95
95
  return [x for x in self._on if x in input]
96
96
 
97
- def get_valid_inputs(self) -> List[str]:
97
+ def get_valid_inputs(self) -> list[str]:
98
98
  """Get valid data types for input.
99
99
 
100
100
  Returns
@@ -124,7 +124,7 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
124
124
  return self._MARKER_INOUT_MAPPINGS[input_type][output_feature]
125
125
 
126
126
  @abstractmethod
127
- def compute(self, input: Dict, extra_input: Optional[Dict] = None) -> Dict:
127
+ def compute(self, input: dict, extra_input: Optional[dict] = None) -> dict:
128
128
  """Compute.
129
129
 
130
130
  Parameters
@@ -155,7 +155,7 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
155
155
  self,
156
156
  type_: str,
157
157
  feature: str,
158
- out: Dict[str, Any],
158
+ out: dict[str, Any],
159
159
  storage: StorageLike,
160
160
  ) -> None:
161
161
  """Store.
@@ -178,9 +178,9 @@ class BaseMarker(ABC, PipelineStepMixin, UpdateMetaMixin):
178
178
 
179
179
  def _fit_transform(
180
180
  self,
181
- input: Dict[str, Dict],
181
+ input: dict[str, dict],
182
182
  storage: Optional[StorageLike] = None,
183
- ) -> Dict:
183
+ ) -> dict:
184
184
  """Fit and transform.
185
185
 
186
186
  Parameters
@@ -8,8 +8,6 @@ from pathlib import Path
8
8
  from typing import (
9
9
  Any,
10
10
  ClassVar,
11
- Dict,
12
- List,
13
11
  Optional,
14
12
  Union,
15
13
  )
@@ -117,7 +115,7 @@ class BrainPrint(BaseMarker):
117
115
  self,
118
116
  aseg_path: Path,
119
117
  norm_path: Path,
120
- indices: List,
118
+ indices: list,
121
119
  ) -> Path:
122
120
  """Generate a surface from the aseg and label files.
123
121
 
@@ -193,7 +191,7 @@ class BrainPrint(BaseMarker):
193
191
  self,
194
192
  aseg_path: Path,
195
193
  norm_path: Path,
196
- ) -> Dict[str, Path]:
194
+ ) -> dict[str, Path]:
197
195
  """Create surfaces from FreeSurfer aseg labels.
198
196
 
199
197
  Parameters
@@ -268,7 +266,7 @@ class BrainPrint(BaseMarker):
268
266
  rh_white_path: Path,
269
267
  lh_pial_path: Path,
270
268
  rh_pial_path: Path,
271
- ) -> Dict[str, Path]:
269
+ ) -> dict[str, Path]:
272
270
  """Create cortical surfaces from FreeSurfer labels.
273
271
 
274
272
  Parameters
@@ -309,7 +307,7 @@ class BrainPrint(BaseMarker):
309
307
 
310
308
  def _fix_nan(
311
309
  self,
312
- input_data: List[Union[float, str, npt.ArrayLike]],
310
+ input_data: list[Union[float, str, npt.ArrayLike]],
313
311
  ) -> np.ndarray:
314
312
  """Convert BrainPrint output with string NaN to ``numpy.nan``.
315
313
 
@@ -330,9 +328,9 @@ class BrainPrint(BaseMarker):
330
328
 
331
329
  def compute(
332
330
  self,
333
- input: Dict[str, Any],
334
- extra_input: Optional[Dict] = None,
335
- ) -> Dict:
331
+ input: dict[str, Any],
332
+ extra_input: Optional[dict] = None,
333
+ ) -> dict:
336
334
  """Compute.
337
335
 
338
336
  Parameters
@@ -8,8 +8,6 @@ from typing import (
8
8
  TYPE_CHECKING,
9
9
  Any,
10
10
  ClassVar,
11
- Dict,
12
- List,
13
11
  Optional,
14
12
  Union,
15
13
  )
@@ -61,10 +59,10 @@ class ComplexityBase(BaseMarker):
61
59
 
62
60
  def __init__(
63
61
  self,
64
- parcellation: Union[str, List[str]],
62
+ parcellation: Union[str, list[str]],
65
63
  agg_method: str = "mean",
66
- agg_method_params: Optional[Dict] = None,
67
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
64
+ agg_method_params: Optional[dict] = None,
65
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
68
66
  name: Optional[str] = None,
69
67
  ) -> None:
70
68
  self.parcellation = parcellation
@@ -86,9 +84,9 @@ class ComplexityBase(BaseMarker):
86
84
 
87
85
  def compute(
88
86
  self,
89
- input: Dict[str, Any],
90
- extra_input: Optional[Dict[str, Any]] = None,
91
- ) -> Dict[str, Any]:
87
+ input: dict[str, Any],
88
+ extra_input: Optional[dict[str, Any]] = None,
89
+ ) -> dict[str, Any]:
92
90
  """Compute.
93
91
 
94
92
  Parameters
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -55,11 +55,11 @@ class HurstExponent(ComplexityBase):
55
55
 
56
56
  def __init__(
57
57
  self,
58
- parcellation: Union[str, List[str]],
58
+ parcellation: Union[str, list[str]],
59
59
  agg_method: str = "mean",
60
- agg_method_params: Optional[Dict] = None,
61
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
62
- params: Optional[Dict] = None,
60
+ agg_method_params: Optional[dict] = None,
61
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
62
+ params: Optional[dict] = None,
63
63
  name: Optional[str] = None,
64
64
  ) -> None:
65
65
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -56,11 +56,11 @@ class MultiscaleEntropyAUC(ComplexityBase):
56
56
 
57
57
  def __init__(
58
58
  self,
59
- parcellation: Union[str, List[str]],
59
+ parcellation: Union[str, list[str]],
60
60
  agg_method: str = "mean",
61
- agg_method_params: Optional[Dict] = None,
62
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
63
- params: Optional[Dict] = None,
61
+ agg_method_params: Optional[dict] = None,
62
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
63
+ params: Optional[dict] = None,
64
64
  name: Optional[str] = None,
65
65
  ) -> None:
66
66
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -56,11 +56,11 @@ class PermEntropy(ComplexityBase):
56
56
 
57
57
  def __init__(
58
58
  self,
59
- parcellation: Union[str, List[str]],
59
+ parcellation: Union[str, list[str]],
60
60
  agg_method: str = "mean",
61
- agg_method_params: Optional[Dict] = None,
62
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
63
- params: Optional[Dict] = None,
61
+ agg_method_params: Optional[dict] = None,
62
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
63
+ params: Optional[dict] = None,
64
64
  name: Optional[str] = None,
65
65
  ) -> None:
66
66
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -56,11 +56,11 @@ class RangeEntropy(ComplexityBase):
56
56
 
57
57
  def __init__(
58
58
  self,
59
- parcellation: Union[str, List[str]],
59
+ parcellation: Union[str, list[str]],
60
60
  agg_method: str = "mean",
61
- agg_method_params: Optional[Dict] = None,
62
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
63
- params: Optional[Dict] = None,
61
+ agg_method_params: Optional[dict] = None,
62
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
63
+ params: Optional[dict] = None,
64
64
  name: Optional[str] = None,
65
65
  ) -> None:
66
66
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -56,11 +56,11 @@ class RangeEntropyAUC(ComplexityBase):
56
56
 
57
57
  def __init__(
58
58
  self,
59
- parcellation: Union[str, List[str]],
59
+ parcellation: Union[str, list[str]],
60
60
  agg_method: str = "mean",
61
- agg_method_params: Optional[Dict] = None,
62
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
63
- params: Optional[Dict] = None,
61
+ agg_method_params: Optional[dict] = None,
62
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
63
+ params: Optional[dict] = None,
64
64
  name: Optional[str] = None,
65
65
  ) -> None:
66
66
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -57,11 +57,11 @@ class SampleEntropy(ComplexityBase):
57
57
 
58
58
  def __init__(
59
59
  self,
60
- parcellation: Union[str, List[str]],
60
+ parcellation: Union[str, list[str]],
61
61
  agg_method: str = "mean",
62
- agg_method_params: Optional[Dict] = None,
63
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
64
- params: Optional[Dict] = None,
62
+ agg_method_params: Optional[dict] = None,
63
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
64
+ params: Optional[dict] = None,
65
65
  name: Optional[str] = None,
66
66
  ) -> None:
67
67
  super().__init__(
@@ -4,7 +4,7 @@
4
4
  # Leonard Sasse <l.sasse@fz-juelich.de>
5
5
  # License: AGPL
6
6
 
7
- from typing import Dict, List, Optional, Union
7
+ from typing import Optional, Union
8
8
 
9
9
  import neurokit2 as nk
10
10
  import numpy as np
@@ -57,11 +57,11 @@ class WeightedPermEntropy(ComplexityBase):
57
57
 
58
58
  def __init__(
59
59
  self,
60
- parcellation: Union[str, List[str]],
60
+ parcellation: Union[str, list[str]],
61
61
  agg_method: str = "mean",
62
- agg_method_params: Optional[Dict] = None,
63
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
64
- params: Optional[Dict] = None,
62
+ agg_method_params: Optional[dict] = None,
63
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
64
+ params: Optional[dict] = None,
65
65
  name: Optional[str] = None,
66
66
  ) -> None:
67
67
  super().__init__(
@@ -6,7 +6,7 @@
6
6
  # Synchon Mandal <s.mandal@fz-juelich.de>
7
7
  # License: AGPL
8
8
 
9
- from typing import Any, ClassVar, Dict, List, Optional, Union
9
+ from typing import Any, ClassVar, Optional, Union
10
10
 
11
11
  import numpy as np
12
12
 
@@ -56,10 +56,10 @@ class RSSETSMarker(BaseMarker):
56
56
 
57
57
  def __init__(
58
58
  self,
59
- parcellation: Union[str, List[str]],
59
+ parcellation: Union[str, list[str]],
60
60
  agg_method: str = "mean",
61
- agg_method_params: Optional[Dict] = None,
62
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
61
+ agg_method_params: Optional[dict] = None,
62
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
63
63
  name: Optional[str] = None,
64
64
  ) -> None:
65
65
  self.parcellation = parcellation
@@ -70,9 +70,9 @@ class RSSETSMarker(BaseMarker):
70
70
 
71
71
  def compute(
72
72
  self,
73
- input: Dict[str, Any],
74
- extra_input: Optional[Dict] = None,
75
- ) -> Dict:
73
+ input: dict[str, Any],
74
+ extra_input: Optional[dict] = None,
75
+ ) -> dict:
76
76
  """Compute.
77
77
 
78
78
  Take a timeseries of brain areas, and calculate timeseries for each
@@ -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
@@ -55,7 +54,7 @@ class AFNIALFF(metaclass=Singleton):
55
54
  highpass: float,
56
55
  lowpass: float,
57
56
  tr: Optional[float],
58
- ) -> Tuple["Nifti1Image", "Nifti1Image", Path, Path]:
57
+ ) -> tuple["Nifti1Image", "Nifti1Image", Path, Path]:
59
58
  """Compute ALFF + fALFF map.
60
59
 
61
60
  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
@@ -52,7 +51,7 @@ class JuniferALFF(metaclass=Singleton):
52
51
  highpass: float,
53
52
  lowpass: float,
54
53
  tr: Optional[float],
55
- ) -> Tuple["Nifti1Image", "Nifti1Image", Path, Path]:
54
+ ) -> tuple["Nifti1Image", "Nifti1Image", Path, Path]:
56
55
  """Compute ALFF + fALFF map.
57
56
 
58
57
  Parameters
@@ -11,9 +11,7 @@ from typing import (
11
11
  TYPE_CHECKING,
12
12
  Any,
13
13
  ClassVar,
14
- Dict,
15
14
  Optional,
16
- Tuple,
17
15
  )
18
16
 
19
17
  from ...typing import ConditionalDependencies, MarkerInOutMappings
@@ -116,8 +114,8 @@ class ALFFBase(BaseMarker):
116
114
 
117
115
  def _compute(
118
116
  self,
119
- input_data: Dict[str, Any],
120
- ) -> Tuple["Nifti1Image", "Nifti1Image", Path, Path]:
117
+ input_data: dict[str, Any],
118
+ ) -> tuple["Nifti1Image", "Nifti1Image", Path, Path]:
121
119
  """Compute ALFF and fALFF.
122
120
 
123
121
  Parameters
@@ -6,7 +6,7 @@
6
6
  # Synchon Mandal <s.mandal@fz-juelich.de>
7
7
  # License: AGPL
8
8
 
9
- from typing import Any, Dict, List, Optional, Union
9
+ from typing import Any, Optional, Union
10
10
 
11
11
  from ...api.decorators import register_marker
12
12
  from ...utils import logger
@@ -70,14 +70,14 @@ class ALFFParcels(ALFFBase):
70
70
 
71
71
  def __init__(
72
72
  self,
73
- parcellation: Union[str, List[str]],
73
+ parcellation: Union[str, list[str]],
74
74
  using: str,
75
75
  highpass: float = 0.01,
76
76
  lowpass: float = 0.1,
77
77
  tr: Optional[float] = None,
78
78
  agg_method: str = "mean",
79
- agg_method_params: Optional[Dict] = None,
80
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
79
+ agg_method_params: Optional[dict] = None,
80
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
81
81
  name: Optional[str] = None,
82
82
  ) -> None:
83
83
  # Superclass init first to validate `using` parameter
@@ -95,9 +95,9 @@ class ALFFParcels(ALFFBase):
95
95
 
96
96
  def compute(
97
97
  self,
98
- input: Dict[str, Any],
99
- extra_input: Optional[Dict[str, Any]] = None,
100
- ) -> Dict[str, Any]:
98
+ input: dict[str, Any],
99
+ extra_input: Optional[dict[str, Any]] = None,
100
+ ) -> dict[str, Any]:
101
101
  """Compute.
102
102
 
103
103
  Parameters
@@ -6,7 +6,7 @@
6
6
  # Synchon Mandal <s.mandal@fz-juelich.de>
7
7
  # License: AGPL
8
8
 
9
- from typing import Any, Dict, List, Optional, Union
9
+ from typing import Any, Optional, Union
10
10
 
11
11
  from ...api.decorators import register_marker
12
12
  from ...utils import logger
@@ -85,8 +85,8 @@ class ALFFSpheres(ALFFBase):
85
85
  lowpass: float = 0.1,
86
86
  tr: Optional[float] = None,
87
87
  agg_method: str = "mean",
88
- agg_method_params: Optional[Dict] = None,
89
- masks: Union[str, Dict, List[Union[Dict, str]], None] = None,
88
+ agg_method_params: Optional[dict] = None,
89
+ masks: Union[str, dict, list[Union[dict, str]], None] = None,
90
90
  name: Optional[str] = None,
91
91
  ) -> None:
92
92
  # Superclass init first to validate `using` parameter
@@ -106,9 +106,9 @@ class ALFFSpheres(ALFFBase):
106
106
 
107
107
  def compute(
108
108
  self,
109
- input: Dict[str, Any],
110
- extra_input: Optional[Dict[str, Any]] = None,
111
- ) -> Dict[str, Any]:
109
+ input: dict[str, Any],
110
+ extra_input: Optional[dict[str, Any]] = None,
111
+ ) -> dict[str, Any]:
112
112
  """Compute.
113
113
 
114
114
  Parameters