junifer 0.0.6.dev175__py3-none-any.whl → 0.0.6.dev201__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 (78) hide show
  1. junifer/_version.py +2 -2
  2. junifer/data/__init__.pyi +17 -31
  3. junifer/data/_dispatch.py +251 -0
  4. junifer/data/coordinates/__init__.py +9 -0
  5. junifer/data/coordinates/__init__.pyi +5 -0
  6. junifer/data/coordinates/_ants_coordinates_warper.py +96 -0
  7. junifer/data/coordinates/_coordinates.py +356 -0
  8. junifer/data/coordinates/_fsl_coordinates_warper.py +83 -0
  9. junifer/data/{tests → coordinates/tests}/test_coordinates.py +25 -31
  10. junifer/data/masks/__init__.py +9 -0
  11. junifer/data/masks/__init__.pyi +6 -0
  12. junifer/data/masks/_ants_mask_warper.py +144 -0
  13. junifer/data/masks/_fsl_mask_warper.py +87 -0
  14. junifer/data/masks/_masks.py +624 -0
  15. junifer/data/{tests → masks/tests}/test_masks.py +63 -58
  16. junifer/data/parcellations/__init__.py +9 -0
  17. junifer/data/parcellations/__init__.pyi +6 -0
  18. junifer/data/parcellations/_ants_parcellation_warper.py +154 -0
  19. junifer/data/parcellations/_fsl_parcellation_warper.py +91 -0
  20. junifer/data/{parcellations.py → parcellations/_parcellations.py} +450 -473
  21. junifer/data/{tests → parcellations/tests}/test_parcellations.py +73 -81
  22. junifer/data/pipeline_data_registry_base.py +74 -0
  23. junifer/data/utils.py +4 -0
  24. junifer/markers/complexity/hurst_exponent.py +2 -2
  25. junifer/markers/complexity/multiscale_entropy_auc.py +2 -2
  26. junifer/markers/complexity/perm_entropy.py +2 -2
  27. junifer/markers/complexity/range_entropy.py +2 -2
  28. junifer/markers/complexity/range_entropy_auc.py +2 -2
  29. junifer/markers/complexity/sample_entropy.py +2 -2
  30. junifer/markers/complexity/weighted_perm_entropy.py +2 -2
  31. junifer/markers/ets_rss.py +2 -2
  32. junifer/markers/falff/falff_parcels.py +2 -2
  33. junifer/markers/falff/falff_spheres.py +2 -2
  34. junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +1 -1
  35. junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +1 -1
  36. junifer/markers/functional_connectivity/functional_connectivity_parcels.py +1 -1
  37. junifer/markers/functional_connectivity/functional_connectivity_spheres.py +1 -1
  38. junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +3 -3
  39. junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +2 -2
  40. junifer/markers/parcel_aggregation.py +11 -7
  41. junifer/markers/reho/reho_parcels.py +2 -2
  42. junifer/markers/reho/reho_spheres.py +2 -2
  43. junifer/markers/sphere_aggregation.py +11 -7
  44. junifer/markers/temporal_snr/temporal_snr_parcels.py +2 -2
  45. junifer/markers/temporal_snr/temporal_snr_spheres.py +2 -2
  46. junifer/markers/tests/test_ets_rss.py +3 -3
  47. junifer/markers/tests/test_parcel_aggregation.py +24 -24
  48. junifer/markers/tests/test_sphere_aggregation.py +6 -6
  49. junifer/pipeline/pipeline_component_registry.py +1 -1
  50. junifer/preprocess/confounds/fmriprep_confound_remover.py +6 -3
  51. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/METADATA +1 -1
  52. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/RECORD +76 -62
  53. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/WHEEL +1 -1
  54. junifer/data/coordinates.py +0 -408
  55. junifer/data/masks.py +0 -670
  56. /junifer/data/{VOIs → coordinates/VOIs}/meta/AutobiographicalMemory_VOIs.txt +0 -0
  57. /junifer/data/{VOIs → coordinates/VOIs}/meta/CogAC_VOIs.txt +0 -0
  58. /junifer/data/{VOIs → coordinates/VOIs}/meta/CogAR_VOIs.txt +0 -0
  59. /junifer/data/{VOIs → coordinates/VOIs}/meta/DMNBuckner_VOIs.txt +0 -0
  60. /junifer/data/{VOIs → coordinates/VOIs}/meta/Dosenbach2010_MNI_VOIs.txt +0 -0
  61. /junifer/data/{VOIs → coordinates/VOIs}/meta/Empathy_VOIs.txt +0 -0
  62. /junifer/data/{VOIs → coordinates/VOIs}/meta/Motor_VOIs.txt +0 -0
  63. /junifer/data/{VOIs → coordinates/VOIs}/meta/MultiTask_VOIs.txt +0 -0
  64. /junifer/data/{VOIs → coordinates/VOIs}/meta/PhysioStress_VOIs.txt +0 -0
  65. /junifer/data/{VOIs → coordinates/VOIs}/meta/Power2011_MNI_VOIs.txt +0 -0
  66. /junifer/data/{VOIs → coordinates/VOIs}/meta/Power2013_MNI_VOIs.tsv +0 -0
  67. /junifer/data/{VOIs → coordinates/VOIs}/meta/Rew_VOIs.txt +0 -0
  68. /junifer/data/{VOIs → coordinates/VOIs}/meta/Somatosensory_VOIs.txt +0 -0
  69. /junifer/data/{VOIs → coordinates/VOIs}/meta/ToM_VOIs.txt +0 -0
  70. /junifer/data/{VOIs → coordinates/VOIs}/meta/VigAtt_VOIs.txt +0 -0
  71. /junifer/data/{VOIs → coordinates/VOIs}/meta/WM_VOIs.txt +0 -0
  72. /junifer/data/{VOIs → coordinates/VOIs}/meta/eMDN_VOIs.txt +0 -0
  73. /junifer/data/{VOIs → coordinates/VOIs}/meta/eSAD_VOIs.txt +0 -0
  74. /junifer/data/{VOIs → coordinates/VOIs}/meta/extDMN_VOIs.txt +0 -0
  75. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/AUTHORS.rst +0 -0
  76. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/LICENSE.md +0 -0
  77. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/entry_points.txt +0 -0
  78. {junifer-0.0.6.dev175.dist-info → junifer-0.0.6.dev201.dist-info}/top_level.txt +0 -0
@@ -24,8 +24,8 @@ class ALFFParcels(ALFFBase):
24
24
  Parameters
25
25
  ----------
26
26
  parcellation : str or list of str
27
- The name(s) of the parcellation(s). Check valid options by calling
28
- :func:`.list_parcellations`.
27
+ The name(s) of the parcellation(s) to use.
28
+ See :func:`.list_data` for options.
29
29
  using : {"junifer", "afni"}
30
30
  Implementation to use for computing ALFF:
31
31
 
@@ -24,8 +24,8 @@ class ALFFSpheres(ALFFBase):
24
24
  Parameters
25
25
  ----------
26
26
  coords : str
27
- The name of the coordinates list to use. See
28
- :func:`.list_coordinates` for options.
27
+ The name of the coordinates list to use.
28
+ See :func:`.list_data` for options.
29
29
  using : {"junifer", "afni"}
30
30
  Implementation to use for computing ALFF:
31
31
 
@@ -23,7 +23,7 @@ class EdgeCentricFCParcels(FunctionalConnectivityBase):
23
23
  ----------
24
24
  parcellation : str or list of str
25
25
  The name(s) of the parcellation(s) to use.
26
- See :func:`.list_parcellations` for options.
26
+ See :func:`.list_data` for options.
27
27
  agg_method : str, optional
28
28
  The method to perform aggregation using.
29
29
  See :func:`.get_aggfunc_by_name` for options
@@ -23,7 +23,7 @@ class EdgeCentricFCSpheres(FunctionalConnectivityBase):
23
23
  ----------
24
24
  coords : str
25
25
  The name of the coordinates list to use.
26
- See :func:`.list_coordinates` for options.
26
+ See :func:`.list_data` for options.
27
27
  radius : positive float, optional
28
28
  The radius of the sphere around each coordinates in millimetres.
29
29
  If None, the signal will be extracted from a single voxel.
@@ -23,7 +23,7 @@ class FunctionalConnectivityParcels(FunctionalConnectivityBase):
23
23
  ----------
24
24
  parcellation : str or list of str
25
25
  The name(s) of the parcellation(s) to use.
26
- See :func:`.list_parcellations` for options.
26
+ See :func:`.list_data` for options.
27
27
  agg_method : str, optional
28
28
  The method to perform aggregation using.
29
29
  See :func:`.get_aggfunc_by_name` for options
@@ -24,7 +24,7 @@ class FunctionalConnectivitySpheres(FunctionalConnectivityBase):
24
24
  ----------
25
25
  coords : str
26
26
  The name of the coordinates list to use.
27
- See :func:`.list_coordinates` for options.
27
+ See :func:`.list_data` for options.
28
28
  radius : positive float, optional
29
29
  The radius of the sphere around each coordinates in millimetres.
30
30
  If None, the signal will be extracted from a single voxel.
@@ -14,7 +14,7 @@ from nilearn.maskers import NiftiLabelsMasker
14
14
  from numpy.testing import assert_array_almost_equal
15
15
  from sklearn.covariance import EmpiricalCovariance, LedoitWolf
16
16
 
17
- from junifer.data import get_parcellation
17
+ from junifer.data import ParcellationRegistry
18
18
  from junifer.datareader import DefaultDataReader
19
19
  from junifer.markers.functional_connectivity import (
20
20
  FunctionalConnectivityParcels,
@@ -78,8 +78,8 @@ def test_FunctionalConnectivityParcels(
78
78
 
79
79
  # Compare with nilearn
80
80
  # Load testing parcellation for the target data
81
- testing_parcellation, _ = get_parcellation(
82
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
81
+ testing_parcellation, _ = ParcellationRegistry().get(
82
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
83
83
  target_data=element_data["BOLD"],
84
84
  )
85
85
  # Extract timeseries
@@ -15,7 +15,7 @@ from nilearn.maskers import NiftiSpheresMasker
15
15
  from numpy.testing import assert_array_almost_equal
16
16
  from sklearn.covariance import EmpiricalCovariance, LedoitWolf
17
17
 
18
- from junifer.data import get_coordinates
18
+ from junifer.data import CoordinatesRegistry
19
19
  from junifer.datareader import DefaultDataReader
20
20
  from junifer.markers.functional_connectivity import (
21
21
  FunctionalConnectivitySpheres,
@@ -80,7 +80,7 @@ def test_FunctionalConnectivitySpheres(
80
80
 
81
81
  # Compare with nilearn
82
82
  # Load testing coordinates for the target data
83
- testing_coords, _ = get_coordinates(
83
+ testing_coords, _ = CoordinatesRegistry().get(
84
84
  coords="DMNBuckner", target_data=element_data["BOLD"]
85
85
  )
86
86
  # Extract timeseries
@@ -11,7 +11,7 @@ from nilearn.image import math_img
11
11
  from nilearn.maskers import NiftiMasker
12
12
 
13
13
  from ..api.decorators import register_marker
14
- from ..data import get_mask, get_parcellation
14
+ from ..data import get_data
15
15
  from ..stats import get_aggfunc_by_name
16
16
  from ..utils import logger, raise_error, warn_with_log
17
17
  from .base import BaseMarker
@@ -27,8 +27,8 @@ class ParcelAggregation(BaseMarker):
27
27
  Parameters
28
28
  ----------
29
29
  parcellation : str or list of str
30
- The name(s) of the parcellation(s). Check valid options by calling
31
- :func:`.list_parcellations`.
30
+ The name(s) of the parcellation(s) to use.
31
+ See :func:`.list_data` for options.
32
32
  method : str
33
33
  The method to perform aggregation using. Check valid options in
34
34
  :func:`.get_aggfunc_by_name`.
@@ -168,8 +168,9 @@ class ParcelAggregation(BaseMarker):
168
168
  )
169
169
 
170
170
  # Get parcellation tailored to target image
171
- parcellation_img, labels = get_parcellation(
172
- parcellation=self.parcellation,
171
+ parcellation_img, labels = get_data(
172
+ kind="parcellation",
173
+ names=self.parcellation,
173
174
  target_data=input,
174
175
  extra_input=extra_input,
175
176
  )
@@ -183,8 +184,11 @@ class ParcelAggregation(BaseMarker):
183
184
  if self.masks is not None:
184
185
  logger.debug(f"Masking with {self.masks}")
185
186
  # Get tailored mask
186
- mask_img = get_mask(
187
- masks=self.masks, target_data=input, extra_input=extra_input
187
+ mask_img = get_data(
188
+ kind="mask",
189
+ names=self.masks,
190
+ target_data=input,
191
+ extra_input=extra_input,
188
192
  )
189
193
  # Get "logical and" version of parcellation and mask
190
194
  parcellation_bin = math_img(
@@ -24,8 +24,8 @@ class ReHoParcels(ReHoBase):
24
24
  Parameters
25
25
  ----------
26
26
  parcellation : str or list of str
27
- The name(s) of the parcellation(s). Check valid options by calling
28
- :func:`.list_parcellations`.
27
+ The name(s) of the parcellation(s) to use.
28
+ See :func:`.list_data` for options.
29
29
  using : {"junifer", "afni"}
30
30
  Implementation to use for computing ReHo:
31
31
 
@@ -24,8 +24,8 @@ class ReHoSpheres(ReHoBase):
24
24
  Parameters
25
25
  ----------
26
26
  coords : str
27
- The name of the coordinates list to use. See
28
- :func:`.list_coordinates` for options.
27
+ The name of the coordinates list to use.
28
+ See :func:`.list_data` for options.
29
29
  using : {"junifer", "afni"}
30
30
  Implementation to use for computing ReHo:
31
31
 
@@ -7,7 +7,7 @@
7
7
  from typing import Any, ClassVar, Dict, List, Optional, Set, Union
8
8
 
9
9
  from ..api.decorators import register_marker
10
- from ..data import get_coordinates, get_mask
10
+ from ..data import get_data
11
11
  from ..external.nilearn import JuniferNiftiSpheresMasker
12
12
  from ..stats import get_aggfunc_by_name
13
13
  from ..utils import logger, raise_error, warn_with_log
@@ -24,8 +24,8 @@ class SphereAggregation(BaseMarker):
24
24
  Parameters
25
25
  ----------
26
26
  coords : str
27
- The name of the coordinates list to use. See
28
- :func:`.list_coordinates` for options.
27
+ The name of the coordinates list to use.
28
+ See :func:`.list_data` for options.
29
29
  radius : float, optional
30
30
  The radius of the sphere in millimeters. If None, the signal will be
31
31
  extracted from a single voxel. See
@@ -177,8 +177,9 @@ class SphereAggregation(BaseMarker):
177
177
  )
178
178
 
179
179
  # Get seeds and labels tailored to target image
180
- coords, labels = get_coordinates(
181
- coords=self.coords,
180
+ coords, labels = get_data(
181
+ kind="coordinates",
182
+ names=self.coords,
182
183
  target_data=input,
183
184
  extra_input=extra_input,
184
185
  )
@@ -188,8 +189,11 @@ class SphereAggregation(BaseMarker):
188
189
  if self.masks is not None:
189
190
  logger.debug(f"Masking with {self.masks}")
190
191
  # Get tailored mask
191
- mask_img = get_mask(
192
- masks=self.masks, target_data=input, extra_input=extra_input
192
+ mask_img = get_data(
193
+ kind="mask",
194
+ names=self.masks,
195
+ target_data=input,
196
+ extra_input=extra_input,
193
197
  )
194
198
 
195
199
  # Initialize masker
@@ -20,8 +20,8 @@ class TemporalSNRParcels(TemporalSNRBase):
20
20
  Parameters
21
21
  ----------
22
22
  parcellation : str or list of str
23
- The name(s) of the parcellation(s). Check valid options by calling
24
- :func:`.list_parcellations`.
23
+ The name(s) of the parcellation(s) to use.
24
+ See :func:`.list_data` for options.
25
25
  agg_method : str, optional
26
26
  The method to perform aggregation using. Check valid options in
27
27
  :func:`.get_aggfunc_by_name` (default "mean").
@@ -21,8 +21,8 @@ class TemporalSNRSpheres(TemporalSNRBase):
21
21
  Parameters
22
22
  ----------
23
23
  coords : str
24
- The name of the coordinates list to use. See
25
- :func:`.list_coordinates` for options.
24
+ The name of the coordinates list to use.
25
+ See :func:`.list_data` for options.
26
26
  radius : float, optional
27
27
  The radius of the sphere in mm. If None, the signal will be extracted
28
28
  from a single voxel. See :class:`nilearn.maskers.NiftiSpheresMasker`
@@ -10,7 +10,7 @@ from pathlib import Path
10
10
 
11
11
  from nilearn.maskers import NiftiLabelsMasker
12
12
 
13
- from junifer.data import get_parcellation
13
+ from junifer.data import ParcellationRegistry
14
14
  from junifer.datareader import DefaultDataReader
15
15
  from junifer.markers.ets_rss import RSSETSMarker
16
16
  from junifer.storage import SQLiteFeatureStorage
@@ -32,8 +32,8 @@ def test_compute() -> None:
32
32
 
33
33
  # Compare with nilearn
34
34
  # Load testing parcellation
35
- test_parcellation, _ = get_parcellation(
36
- parcellation=[PARCELLATION],
35
+ test_parcellation, _ = ParcellationRegistry().get(
36
+ parcellations=[PARCELLATION],
37
37
  target_data=element_data["BOLD"],
38
38
  )
39
39
  # Extract timeseries
@@ -16,7 +16,7 @@ from nilearn.masking import compute_brain_mask
16
16
  from numpy.testing import assert_array_almost_equal, assert_array_equal
17
17
  from scipy.stats import trim_mean
18
18
 
19
- from junifer.data import get_mask, get_parcellation, register_parcellation
19
+ from junifer.data import MaskRegistry, ParcellationRegistry
20
20
  from junifer.datareader import DefaultDataReader
21
21
  from junifer.markers.parcel_aggregation import ParcelAggregation
22
22
  from junifer.storage import SQLiteFeatureStorage
@@ -98,8 +98,8 @@ def test_ParcelAggregation_3D() -> None:
98
98
 
99
99
  # Compare with nilearn
100
100
  # Load testing parcellation
101
- testing_parcellation, _ = get_parcellation(
102
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
101
+ testing_parcellation, _ = ParcellationRegistry().get(
102
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
103
103
  target_data=element_data["BOLD"],
104
104
  )
105
105
  # Binarize parcellation
@@ -206,8 +206,8 @@ def test_ParcelAggregation_4D():
206
206
 
207
207
  # Compare with nilearn
208
208
  # Load testing parcellation
209
- testing_parcellation, _ = get_parcellation(
210
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
209
+ testing_parcellation, _ = ParcellationRegistry().get(
210
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
211
211
  target_data=element_data["BOLD"],
212
212
  )
213
213
  # Extract data
@@ -295,12 +295,12 @@ def test_ParcelAggregation_3D_mask() -> None:
295
295
 
296
296
  # Compare with nilearn
297
297
  # Load testing parcellation
298
- testing_parcellation, _ = get_parcellation(
299
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
298
+ testing_parcellation, _ = ParcellationRegistry().get(
299
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
300
300
  target_data=element_data["BOLD"],
301
301
  )
302
302
  # Load mask
303
- mask_img = get_mask(
303
+ mask_img = MaskRegistry().get(
304
304
  "compute_brain_mask", target_data=element_data["BOLD"]
305
305
  )
306
306
  # Extract data
@@ -328,8 +328,8 @@ def test_ParcelAggregation_3D_mask_computed() -> None:
328
328
 
329
329
  # Compare with nilearn
330
330
  # Load testing parcellation
331
- testing_parcellation, _ = get_parcellation(
332
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
331
+ testing_parcellation, _ = ParcellationRegistry().get(
332
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
333
333
  target_data=element_data["BOLD"],
334
334
  )
335
335
  # Get a mask
@@ -396,8 +396,8 @@ def test_ParcelAggregation_3D_multiple_non_overlapping(tmp_path: Path) -> None:
396
396
  ]
397
397
 
398
398
  # Load testing parcellation
399
- testing_parcellation, labels = get_parcellation(
400
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
399
+ testing_parcellation, labels = ParcellationRegistry().get(
400
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
401
401
  target_data=element_data["BOLD"],
402
402
  )
403
403
 
@@ -424,14 +424,14 @@ def test_ParcelAggregation_3D_multiple_non_overlapping(tmp_path: Path) -> None:
424
424
  nib.save(parcellation1_img, parcellation1_path)
425
425
  nib.save(parcellation2_img, parcellation2_path)
426
426
 
427
- register_parcellation(
427
+ ParcellationRegistry().register(
428
428
  name="TianxS1x3TxMNInonlinear2009cAsym_low",
429
429
  parcellation_path=parcellation1_path,
430
430
  parcels_labels=labels1,
431
431
  space="MNI152NLin2009cAsym",
432
432
  overwrite=True,
433
433
  )
434
- register_parcellation(
434
+ ParcellationRegistry().register(
435
435
  name="TianxS1x3TxMNInonlinear2009cAsym_high",
436
436
  parcellation_path=parcellation2_path,
437
437
  parcels_labels=labels2,
@@ -498,8 +498,8 @@ def test_ParcelAggregation_3D_multiple_overlapping(tmp_path: Path) -> None:
498
498
  ]
499
499
 
500
500
  # Load testing parcellation
501
- testing_parcellation, labels = get_parcellation(
502
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
501
+ testing_parcellation, labels = ParcellationRegistry().get(
502
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
503
503
  target_data=element_data["BOLD"],
504
504
  )
505
505
 
@@ -528,14 +528,14 @@ def test_ParcelAggregation_3D_multiple_overlapping(tmp_path: Path) -> None:
528
528
  nib.save(parcellation1_img, parcellation1_path)
529
529
  nib.save(parcellation2_img, parcellation2_path)
530
530
 
531
- register_parcellation(
531
+ ParcellationRegistry().register(
532
532
  name="TianxS1x3TxMNInonlinear2009cAsym_low",
533
533
  parcellation_path=parcellation1_path,
534
534
  parcels_labels=labels1,
535
535
  space="MNI152NLin2009cAsym",
536
536
  overwrite=True,
537
537
  )
538
- register_parcellation(
538
+ ParcellationRegistry().register(
539
539
  name="TianxS1x3TxMNInonlinear2009cAsym_high",
540
540
  parcellation_path=parcellation2_path,
541
541
  parcels_labels=labels2,
@@ -609,8 +609,8 @@ def test_ParcelAggregation_3D_multiple_duplicated_labels(
609
609
  ]
610
610
 
611
611
  # Load testing parcellation
612
- testing_parcellation, labels = get_parcellation(
613
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
612
+ testing_parcellation, labels = ParcellationRegistry().get(
613
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
614
614
  target_data=element_data["BOLD"],
615
615
  )
616
616
 
@@ -637,14 +637,14 @@ def test_ParcelAggregation_3D_multiple_duplicated_labels(
637
637
  nib.save(parcellation1_img, parcellation1_path)
638
638
  nib.save(parcellation2_img, parcellation2_path)
639
639
 
640
- register_parcellation(
640
+ ParcellationRegistry().register(
641
641
  name="TianxS1x3TxMNInonlinear2009cAsym_low",
642
642
  parcellation_path=parcellation1_path,
643
643
  parcels_labels=labels1,
644
644
  space="MNI152NLin2009cAsym",
645
645
  overwrite=True,
646
646
  )
647
- register_parcellation(
647
+ ParcellationRegistry().register(
648
648
  name="TianxS1x3TxMNInonlinear2009cAsym_high",
649
649
  parcellation_path=parcellation2_path,
650
650
  parcels_labels=labels2,
@@ -719,8 +719,8 @@ def test_ParcelAggregation_4D_agg_time():
719
719
 
720
720
  # Compare with nilearn
721
721
  # Loading testing parcellation
722
- testing_parcellation, _ = get_parcellation(
723
- parcellation=["TianxS1x3TxMNInonlinear2009cAsym"],
722
+ testing_parcellation, _ = ParcellationRegistry().get(
723
+ parcellations=["TianxS1x3TxMNInonlinear2009cAsym"],
724
724
  target_data=element_data["BOLD"],
725
725
  )
726
726
  # Extract data
@@ -10,7 +10,7 @@ import pytest
10
10
  from nilearn.maskers import NiftiSpheresMasker
11
11
  from numpy.testing import assert_array_equal
12
12
 
13
- from junifer.data import get_coordinates, get_mask
13
+ from junifer.data import CoordinatesRegistry, MaskRegistry
14
14
  from junifer.datareader import DefaultDataReader
15
15
  from junifer.markers.sphere_aggregation import SphereAggregation
16
16
  from junifer.storage import SQLiteFeatureStorage
@@ -100,7 +100,7 @@ def test_SphereAggregation_3D() -> None:
100
100
 
101
101
  # Compare with nilearn
102
102
  # Load testing coordinates
103
- testing_coords, _ = get_coordinates(
103
+ testing_coords, _ = CoordinatesRegistry().get(
104
104
  coords=COORDS, target_data=element_data["VBM_GM"]
105
105
  )
106
106
  # Extract data
@@ -132,7 +132,7 @@ def test_SphereAggregation_4D() -> None:
132
132
 
133
133
  # Compare with nilearn
134
134
  # Load testing coordinates
135
- testing_coords, _ = get_coordinates(
135
+ testing_coords, _ = CoordinatesRegistry().get(
136
136
  coords=COORDS, target_data=element_data["BOLD"]
137
137
  )
138
138
  # Extract data
@@ -210,11 +210,11 @@ def test_SphereAggregation_3D_mask() -> None:
210
210
 
211
211
  # Compare with nilearn
212
212
  # Load testing coordinates
213
- testing_coords, _ = get_coordinates(
213
+ testing_coords, _ = CoordinatesRegistry().get(
214
214
  coords=COORDS, target_data=element_data["VBM_GM"]
215
215
  )
216
216
  # Load mask
217
- mask_img = get_mask(
217
+ mask_img = MaskRegistry().get(
218
218
  "compute_brain_mask", target_data=element_data["VBM_GM"]
219
219
  )
220
220
  # Extract data
@@ -253,7 +253,7 @@ def test_SphereAggregation_4D_agg_time() -> None:
253
253
 
254
254
  # Compare with nilearn
255
255
  # Load testing coordinates
256
- testing_coords, _ = get_coordinates(
256
+ testing_coords, _ = CoordinatesRegistry().get(
257
257
  coords=COORDS, target_data=element_data["BOLD"]
258
258
  )
259
259
  # Extract data
@@ -167,7 +167,7 @@ class PipelineComponentRegistry:
167
167
  """
168
168
  # Verify step
169
169
  self._check_valid_step(step)
170
- # Log and register
170
+ # Log and de-register
171
171
  name = klass.__name__
172
172
  logger.info(f"De-registering {name} in {step}")
173
173
  _ = self._components[step].pop(name)
@@ -22,7 +22,7 @@ from nilearn import image as nimg
22
22
  from nilearn._utils.niimg_conversions import check_niimg_4d
23
23
 
24
24
  from ...api.decorators import register_preprocessor
25
- from ...data import get_mask
25
+ from ...data import get_data
26
26
  from ...utils import logger, raise_error
27
27
  from ..base import BasePreprocessor
28
28
 
@@ -546,8 +546,11 @@ class fMRIPrepConfoundRemover(BasePreprocessor):
546
546
  mask_img = None
547
547
  if self.masks is not None:
548
548
  logger.debug(f"Masking with {self.masks}")
549
- mask_img = get_mask(
550
- masks=self.masks, target_data=input, extra_input=extra_input
549
+ mask_img = get_data(
550
+ kind="mask",
551
+ names=self.masks,
552
+ target_data=input,
553
+ extra_input=extra_input,
551
554
  )
552
555
  # Return the BOLD mask and link it to the BOLD data type dict;
553
556
  # this allows to use "inherit" down the pipeline
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: junifer
3
- Version: 0.0.6.dev175
3
+ Version: 0.0.6.dev201
4
4
  Summary: JUelich NeuroImaging FEature extractoR
5
5
  Author-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>
6
6
  Maintainer-email: Fede Raimondo <f.raimondo@fz-juelich.de>, Synchon Mandal <s.mandal@fz-juelich.de>