junifer 0.0.5__py3-none-any.whl → 0.0.5.dev24__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 (194) hide show
  1. junifer/__init__.py +0 -17
  2. junifer/_version.py +2 -2
  3. junifer/api/__init__.py +1 -4
  4. junifer/api/cli.py +1 -91
  5. junifer/api/decorators.py +0 -9
  6. junifer/api/functions.py +10 -56
  7. junifer/api/parser.py +0 -3
  8. junifer/api/queue_context/__init__.py +1 -4
  9. junifer/api/res/afni/run_afni_docker.sh +1 -1
  10. junifer/api/res/ants/run_ants_docker.sh +1 -1
  11. junifer/api/res/fsl/run_fsl_docker.sh +1 -1
  12. junifer/api/tests/test_api_utils.py +2 -4
  13. junifer/api/tests/test_cli.py +0 -83
  14. junifer/api/tests/test_functions.py +2 -27
  15. junifer/configs/__init__.py +1 -1
  16. junifer/configs/juseless/__init__.py +1 -4
  17. junifer/configs/juseless/datagrabbers/__init__.py +1 -10
  18. junifer/configs/juseless/datagrabbers/aomic_id1000_vbm.py +0 -3
  19. junifer/configs/juseless/datagrabbers/camcan_vbm.py +0 -3
  20. junifer/configs/juseless/datagrabbers/ixi_vbm.py +0 -3
  21. junifer/configs/juseless/datagrabbers/tests/test_ucla.py +3 -1
  22. junifer/configs/juseless/datagrabbers/ucla.py +9 -12
  23. junifer/configs/juseless/datagrabbers/ukb_vbm.py +0 -3
  24. junifer/data/__init__.py +1 -21
  25. junifer/data/coordinates.py +19 -10
  26. junifer/data/masks.py +87 -58
  27. junifer/data/parcellations.py +3 -14
  28. junifer/data/template_spaces.py +1 -4
  29. junifer/data/tests/test_masks.py +37 -26
  30. junifer/data/utils.py +0 -3
  31. junifer/datagrabber/__init__.py +1 -18
  32. junifer/datagrabber/aomic/__init__.py +0 -3
  33. junifer/datagrabber/aomic/id1000.py +37 -70
  34. junifer/datagrabber/aomic/piop1.py +36 -69
  35. junifer/datagrabber/aomic/piop2.py +38 -71
  36. junifer/datagrabber/aomic/tests/test_id1000.py +99 -44
  37. junifer/datagrabber/aomic/tests/test_piop1.py +108 -65
  38. junifer/datagrabber/aomic/tests/test_piop2.py +102 -45
  39. junifer/datagrabber/base.py +6 -13
  40. junifer/datagrabber/datalad_base.py +1 -13
  41. junifer/datagrabber/dmcc13_benchmark.py +53 -36
  42. junifer/datagrabber/hcp1200/__init__.py +0 -3
  43. junifer/datagrabber/hcp1200/datalad_hcp1200.py +0 -3
  44. junifer/datagrabber/hcp1200/hcp1200.py +1 -4
  45. junifer/datagrabber/multiple.py +6 -45
  46. junifer/datagrabber/pattern.py +62 -170
  47. junifer/datagrabber/pattern_datalad.py +12 -25
  48. junifer/datagrabber/tests/test_datagrabber_utils.py +218 -0
  49. junifer/datagrabber/tests/test_datalad_base.py +4 -4
  50. junifer/datagrabber/tests/test_dmcc13_benchmark.py +19 -46
  51. junifer/datagrabber/tests/test_multiple.py +84 -161
  52. junifer/datagrabber/tests/test_pattern.py +0 -45
  53. junifer/datagrabber/tests/test_pattern_datalad.py +4 -4
  54. junifer/datagrabber/utils.py +230 -0
  55. junifer/datareader/__init__.py +1 -4
  56. junifer/datareader/default.py +43 -95
  57. junifer/external/__init__.py +1 -1
  58. junifer/external/nilearn/__init__.py +1 -5
  59. junifer/external/nilearn/junifer_nifti_spheres_masker.py +9 -23
  60. junifer/external/nilearn/tests/test_junifer_nifti_spheres_masker.py +1 -76
  61. junifer/markers/__init__.py +1 -23
  62. junifer/markers/base.py +28 -68
  63. junifer/markers/collection.py +2 -10
  64. junifer/markers/complexity/__init__.py +0 -10
  65. junifer/markers/complexity/complexity_base.py +43 -26
  66. junifer/markers/complexity/hurst_exponent.py +0 -3
  67. junifer/markers/complexity/multiscale_entropy_auc.py +0 -3
  68. junifer/markers/complexity/perm_entropy.py +0 -3
  69. junifer/markers/complexity/range_entropy.py +0 -3
  70. junifer/markers/complexity/range_entropy_auc.py +0 -3
  71. junifer/markers/complexity/sample_entropy.py +0 -3
  72. junifer/markers/complexity/tests/test_hurst_exponent.py +3 -11
  73. junifer/markers/complexity/tests/test_multiscale_entropy_auc.py +3 -11
  74. junifer/markers/complexity/tests/test_perm_entropy.py +3 -11
  75. junifer/markers/complexity/tests/test_range_entropy.py +3 -11
  76. junifer/markers/complexity/tests/test_range_entropy_auc.py +3 -11
  77. junifer/markers/complexity/tests/test_sample_entropy.py +3 -11
  78. junifer/markers/complexity/tests/test_weighted_perm_entropy.py +3 -11
  79. junifer/markers/complexity/weighted_perm_entropy.py +0 -3
  80. junifer/markers/ets_rss.py +42 -27
  81. junifer/markers/falff/__init__.py +0 -3
  82. junifer/markers/falff/_afni_falff.py +2 -5
  83. junifer/markers/falff/_junifer_falff.py +0 -3
  84. junifer/markers/falff/falff_base.py +46 -20
  85. junifer/markers/falff/falff_parcels.py +27 -56
  86. junifer/markers/falff/falff_spheres.py +29 -60
  87. junifer/markers/falff/tests/test_falff_parcels.py +23 -39
  88. junifer/markers/falff/tests/test_falff_spheres.py +23 -39
  89. junifer/markers/functional_connectivity/__init__.py +0 -9
  90. junifer/markers/functional_connectivity/crossparcellation_functional_connectivity.py +60 -63
  91. junifer/markers/functional_connectivity/edge_functional_connectivity_parcels.py +32 -45
  92. junifer/markers/functional_connectivity/edge_functional_connectivity_spheres.py +36 -49
  93. junifer/markers/functional_connectivity/functional_connectivity_base.py +70 -71
  94. junifer/markers/functional_connectivity/functional_connectivity_parcels.py +25 -34
  95. junifer/markers/functional_connectivity/functional_connectivity_spheres.py +30 -40
  96. junifer/markers/functional_connectivity/tests/test_crossparcellation_functional_connectivity.py +7 -11
  97. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +7 -27
  98. junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +12 -28
  99. junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +11 -35
  100. junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +62 -36
  101. junifer/markers/parcel_aggregation.py +61 -47
  102. junifer/markers/reho/__init__.py +0 -3
  103. junifer/markers/reho/_afni_reho.py +2 -5
  104. junifer/markers/reho/_junifer_reho.py +1 -4
  105. junifer/markers/reho/reho_base.py +27 -8
  106. junifer/markers/reho/reho_parcels.py +17 -28
  107. junifer/markers/reho/reho_spheres.py +18 -27
  108. junifer/markers/reho/tests/test_reho_parcels.py +3 -8
  109. junifer/markers/reho/tests/test_reho_spheres.py +3 -8
  110. junifer/markers/sphere_aggregation.py +59 -43
  111. junifer/markers/temporal_snr/__init__.py +0 -3
  112. junifer/markers/temporal_snr/temporal_snr_base.py +32 -23
  113. junifer/markers/temporal_snr/temporal_snr_parcels.py +6 -9
  114. junifer/markers/temporal_snr/temporal_snr_spheres.py +6 -9
  115. junifer/markers/temporal_snr/tests/test_temporal_snr_parcels.py +3 -6
  116. junifer/markers/temporal_snr/tests/test_temporal_snr_spheres.py +3 -6
  117. junifer/markers/tests/test_collection.py +8 -9
  118. junifer/markers/tests/test_ets_rss.py +9 -15
  119. junifer/markers/tests/test_markers_base.py +18 -17
  120. junifer/markers/tests/test_parcel_aggregation.py +32 -93
  121. junifer/markers/tests/test_sphere_aggregation.py +19 -72
  122. junifer/onthefly/__init__.py +1 -4
  123. junifer/onthefly/read_transform.py +0 -3
  124. junifer/pipeline/__init__.py +1 -9
  125. junifer/pipeline/pipeline_step_mixin.py +4 -21
  126. junifer/pipeline/registry.py +0 -3
  127. junifer/pipeline/singleton.py +0 -3
  128. junifer/pipeline/tests/test_registry.py +1 -1
  129. junifer/pipeline/update_meta_mixin.py +0 -3
  130. junifer/pipeline/utils.py +1 -67
  131. junifer/pipeline/workdir_manager.py +0 -3
  132. junifer/preprocess/__init__.py +2 -9
  133. junifer/preprocess/ants/__init__.py +4 -0
  134. junifer/preprocess/ants/ants_apply_transforms_warper.py +185 -0
  135. junifer/preprocess/ants/tests/test_ants_apply_transforms_warper.py +56 -0
  136. junifer/preprocess/base.py +3 -6
  137. junifer/preprocess/bold_warper.py +265 -0
  138. junifer/preprocess/confounds/__init__.py +0 -3
  139. junifer/preprocess/confounds/fmriprep_confound_remover.py +60 -47
  140. junifer/preprocess/confounds/tests/test_fmriprep_confound_remover.py +113 -72
  141. junifer/preprocess/fsl/__init__.py +4 -0
  142. junifer/preprocess/fsl/apply_warper.py +179 -0
  143. junifer/preprocess/fsl/tests/test_apply_warper.py +45 -0
  144. junifer/preprocess/smoothing/__init__.py +0 -3
  145. junifer/preprocess/smoothing/_afni_smoothing.py +1 -1
  146. junifer/preprocess/tests/test_bold_warper.py +159 -0
  147. junifer/preprocess/warping/__init__.py +0 -3
  148. junifer/preprocess/warping/_ants_warper.py +0 -3
  149. junifer/preprocess/warping/_fsl_warper.py +0 -3
  150. junifer/stats.py +1 -4
  151. junifer/storage/__init__.py +1 -9
  152. junifer/storage/base.py +1 -40
  153. junifer/storage/hdf5.py +9 -71
  154. junifer/storage/pandas_base.py +0 -3
  155. junifer/storage/sqlite.py +0 -3
  156. junifer/storage/tests/test_hdf5.py +10 -82
  157. junifer/storage/utils.py +0 -9
  158. junifer/testing/__init__.py +1 -4
  159. junifer/testing/datagrabbers.py +6 -13
  160. junifer/testing/tests/test_partlycloudytesting_datagrabber.py +7 -7
  161. junifer/testing/utils.py +0 -3
  162. junifer/utils/__init__.py +2 -13
  163. junifer/utils/fs.py +0 -3
  164. junifer/utils/helpers.py +1 -32
  165. junifer/utils/logging.py +4 -33
  166. junifer/utils/tests/test_logging.py +0 -8
  167. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/METADATA +16 -17
  168. junifer-0.0.5.dev24.dist-info/RECORD +265 -0
  169. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/WHEEL +1 -1
  170. junifer/api/res/freesurfer/mri_binarize +0 -3
  171. junifer/api/res/freesurfer/mri_mc +0 -3
  172. junifer/api/res/freesurfer/mri_pretess +0 -3
  173. junifer/api/res/freesurfer/mris_convert +0 -3
  174. junifer/api/res/freesurfer/run_freesurfer_docker.sh +0 -61
  175. junifer/data/masks/ukb/UKB_15K_GM_template.nii.gz +0 -0
  176. junifer/datagrabber/pattern_validation_mixin.py +0 -388
  177. junifer/datagrabber/tests/test_pattern_validation_mixin.py +0 -249
  178. junifer/external/BrainPrint/brainprint/__init__.py +0 -4
  179. junifer/external/BrainPrint/brainprint/_version.py +0 -3
  180. junifer/external/BrainPrint/brainprint/asymmetry.py +0 -91
  181. junifer/external/BrainPrint/brainprint/brainprint.py +0 -441
  182. junifer/external/BrainPrint/brainprint/surfaces.py +0 -258
  183. junifer/external/BrainPrint/brainprint/utils/__init__.py +0 -1
  184. junifer/external/BrainPrint/brainprint/utils/_config.py +0 -112
  185. junifer/external/BrainPrint/brainprint/utils/utils.py +0 -188
  186. junifer/external/nilearn/junifer_connectivity_measure.py +0 -483
  187. junifer/external/nilearn/tests/test_junifer_connectivity_measure.py +0 -1089
  188. junifer/markers/brainprint.py +0 -459
  189. junifer/markers/tests/test_brainprint.py +0 -58
  190. junifer-0.0.5.dist-info/RECORD +0 -275
  191. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/AUTHORS.rst +0 -0
  192. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/LICENSE.md +0 -0
  193. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/entry_points.txt +0 -0
  194. {junifer-0.0.5.dist-info → junifer-0.0.5.dev24.dist-info}/top_level.txt +0 -0
@@ -16,9 +16,6 @@ from ...utils import raise_error
16
16
  from ..pattern_datalad import PatternDataladDataGrabber
17
17
 
18
18
 
19
- __all__ = ["DataladAOMICPIOP1"]
20
-
21
-
22
19
  @register_datagrabber
23
20
  class DataladAOMICPIOP1(PatternDataladDataGrabber):
24
21
  """Concrete implementation for pattern-based data fetching of AOMIC PIOP1.
@@ -29,8 +26,8 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
29
26
  The directory where the datalad dataset will be cloned. If None,
30
27
  the datalad dataset will be cloned into a temporary directory
31
28
  (default None).
32
- types: {"BOLD", "T1w", "VBM_CSF", "VBM_GM", "VBM_WM", "DWI", \
33
- "FreeSurfer"} or list of the options, optional
29
+ types: {"BOLD", "BOLD_confounds", "T1w", "VBM_CSF", "VBM_GM", \
30
+ "VBM_WM", "DWI"} or a list of the options, optional
34
31
  AOMIC data types. If None, all available data types are selected.
35
32
  (default None).
36
33
  tasks : {"restingstate", "anticipation", "emomatching", "faces", \
@@ -87,22 +84,23 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
87
84
  "space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
88
85
  ),
89
86
  "space": "MNI152NLin2009cAsym",
90
- "mask": {
91
- "pattern": (
92
- "derivatives/fmriprep/{subject}/func/"
93
- "{subject}_task-{task}_"
94
- "space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
95
- ),
96
- "space": "MNI152NLin2009cAsym",
97
- },
98
- "confounds": {
99
- "pattern": (
100
- "derivatives/fmriprep/{subject}/func/"
101
- "{subject}_task-{task}_"
102
- "desc-confounds_regressors.tsv"
103
- ),
104
- "format": "fmriprep",
105
- },
87
+ "mask_item": "BOLD_mask",
88
+ },
89
+ "BOLD_confounds": {
90
+ "pattern": (
91
+ "derivatives/fmriprep/{subject}/func/"
92
+ "{subject}_task-{task}_"
93
+ "desc-confounds_regressors.tsv"
94
+ ),
95
+ "format": "fmriprep",
96
+ },
97
+ "BOLD_mask": {
98
+ "pattern": (
99
+ "derivatives/fmriprep/{subject}/func/"
100
+ "{subject}_task-{task}_"
101
+ "space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
102
+ ),
103
+ "space": "MNI152NLin2009cAsym",
106
104
  },
107
105
  "T1w": {
108
106
  "pattern": (
@@ -111,14 +109,15 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
111
109
  "desc-preproc_T1w.nii.gz"
112
110
  ),
113
111
  "space": "MNI152NLin2009cAsym",
114
- "mask": {
115
- "pattern": (
116
- "derivatives/fmriprep/{subject}/anat/"
117
- "{subject}_space-MNI152NLin2009cAsym_"
118
- "desc-brain_mask.nii.gz"
119
- ),
120
- "space": "MNI152NLin2009cAsym",
121
- },
112
+ "mask_item": "T1w_mask",
113
+ },
114
+ "T1w_mask": {
115
+ "pattern": (
116
+ "derivatives/fmriprep/{subject}/anat/"
117
+ "{subject}_space-MNI152NLin2009cAsym_"
118
+ "desc-brain_mask.nii.gz"
119
+ ),
120
+ "space": "MNI152NLin2009cAsym",
122
121
  },
123
122
  "VBM_CSF": {
124
123
  "pattern": (
@@ -150,39 +149,6 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
150
149
  "{subject}_desc-preproc_dwi.nii.gz"
151
150
  ),
152
151
  },
153
- "FreeSurfer": {
154
- "pattern": "derivatives/freesurfer/[!f]{subject}/mri/T1.mg[z]",
155
- "aseg": {
156
- "pattern": (
157
- "derivatives/freesurfer/[!f]{subject}/mri/aseg.mg[z]"
158
- )
159
- },
160
- "norm": {
161
- "pattern": (
162
- "derivatives/freesurfer/[!f]{subject}/mri/norm.mg[z]"
163
- )
164
- },
165
- "lh_white": {
166
- "pattern": (
167
- "derivatives/freesurfer/[!f]{subject}/surf/lh.whit[e]"
168
- )
169
- },
170
- "rh_white": {
171
- "pattern": (
172
- "derivatives/freesurfer/[!f]{subject}/surf/rh.whit[e]"
173
- )
174
- },
175
- "lh_pial": {
176
- "pattern": (
177
- "derivatives/freesurfer/[!f]{subject}/surf/lh.pia[l]"
178
- )
179
- },
180
- "rh_pial": {
181
- "pattern": (
182
- "derivatives/freesurfer/[!f]{subject}/surf/rh.pia[l]"
183
- )
184
- },
185
- },
186
152
  }
187
153
  # Use native T1w assets
188
154
  self.native_t1w = False
@@ -196,13 +162,14 @@ class DataladAOMICPIOP1(PatternDataladDataGrabber):
196
162
  "{subject}_desc-preproc_T1w.nii.gz"
197
163
  ),
198
164
  "space": "native",
199
- "mask": {
200
- "pattern": (
201
- "derivatives/fmriprep/{subject}/anat/"
202
- "{subject}_desc-brain_mask.nii.gz"
203
- ),
204
- "space": "native",
205
- },
165
+ "mask_item": "T1w_mask",
166
+ },
167
+ "T1w_mask": {
168
+ "pattern": (
169
+ "derivatives/fmriprep/{subject}/anat/"
170
+ "{subject}_desc-brain_mask.nii.gz"
171
+ ),
172
+ "space": "native",
206
173
  },
207
174
  "Warp": {
208
175
  "pattern": (
@@ -16,9 +16,6 @@ from ...utils import raise_error
16
16
  from ..pattern_datalad import PatternDataladDataGrabber
17
17
 
18
18
 
19
- __all__ = ["DataladAOMICPIOP2"]
20
-
21
-
22
19
  @register_datagrabber
23
20
  class DataladAOMICPIOP2(PatternDataladDataGrabber):
24
21
  """Concrete implementation for pattern-based data fetching of AOMIC PIOP2.
@@ -29,12 +26,12 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
29
26
  The directory where the datalad dataset will be cloned. If None,
30
27
  the datalad dataset will be cloned into a temporary directory
31
28
  (default None).
32
- types: {"BOLD", "T1w", "VBM_CSF", "VBM_GM", "VBM_WM", "DWI", \
33
- "FreeSurfer"} or list of the options, optional
29
+ types: {"BOLD", "BOLD_confounds", "T1w", "VBM_CSF", "VBM_GM", \
30
+ "VBM_WM", "DWI"} or a list of the options, optional
34
31
  AOMIC data types. If None, all available data types are selected.
35
32
  (default None).
36
- tasks : {"restingstate", "stopsignal", "workingmemory"} or \
37
- list of the options, optional
33
+ tasks : {"restingstate", "stopsignal", "workingmemory"} \
34
+ or list of the options, optional
38
35
  AOMIC PIOP2 task sessions. If None, all available task sessions are
39
36
  selected (default None).
40
37
  native_t1w : bool, optional
@@ -84,22 +81,23 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
84
81
  "space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
85
82
  ),
86
83
  "space": "MNI152NLin2009cAsym",
87
- "mask": {
88
- "pattern": (
89
- "derivatives/fmriprep/{subject}/func/"
90
- "{subject}_task-{task}_"
91
- "space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
92
- ),
93
- "space": "MNI152NLin2009cAsym",
94
- },
95
- "confounds": {
96
- "pattern": (
97
- "derivatives/fmriprep/{subject}/func/"
98
- "{subject}_task-{task}_"
99
- "desc-confounds_regressors.tsv"
100
- ),
101
- "format": "fmriprep",
102
- },
84
+ "mask_item": "BOLD_mask",
85
+ },
86
+ "BOLD_confounds": {
87
+ "pattern": (
88
+ "derivatives/fmriprep/{subject}/func/"
89
+ "{subject}_task-{task}_"
90
+ "desc-confounds_regressors.tsv"
91
+ ),
92
+ "format": "fmriprep",
93
+ },
94
+ "BOLD_mask": {
95
+ "pattern": (
96
+ "derivatives/fmriprep/{subject}/func/"
97
+ "{subject}_task-{task}_"
98
+ "space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
99
+ ),
100
+ "space": "MNI152NLin2009cAsym",
103
101
  },
104
102
  "T1w": {
105
103
  "pattern": (
@@ -108,14 +106,15 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
108
106
  "desc-preproc_T1w.nii.gz"
109
107
  ),
110
108
  "space": "MNI152NLin2009cAsym",
111
- "mask": {
112
- "pattern": (
113
- "derivatives/fmriprep/{subject}/anat/"
114
- "{subject}_space-MNI152NLin2009cAsym_"
115
- "desc-brain_mask.nii.gz"
116
- ),
117
- "space": "MNI152NLin2009cAsym",
118
- },
109
+ "mask_item": "T1w_mask",
110
+ },
111
+ "T1w_mask": {
112
+ "pattern": (
113
+ "derivatives/fmriprep/{subject}/anat/"
114
+ "{subject}_space-MNI152NLin2009cAsym_"
115
+ "desc-brain_mask.nii.gz"
116
+ ),
117
+ "space": "MNI152NLin2009cAsym",
119
118
  },
120
119
  "VBM_CSF": {
121
120
  "pattern": (
@@ -147,39 +146,6 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
147
146
  "{subject}_desc-preproc_dwi.nii.gz"
148
147
  ),
149
148
  },
150
- "FreeSurfer": {
151
- "pattern": "derivatives/freesurfer/[!f]{subject}/mri/T1.mg[z]",
152
- "aseg": {
153
- "pattern": (
154
- "derivatives/freesurfer/[!f]{subject}/mri/aseg.mg[z]"
155
- )
156
- },
157
- "norm": {
158
- "pattern": (
159
- "derivatives/freesurfer/[!f]{subject}/mri/norm.mg[z]"
160
- )
161
- },
162
- "lh_white": {
163
- "pattern": (
164
- "derivatives/freesurfer/[!f]{subject}/surf/lh.whit[e]"
165
- )
166
- },
167
- "rh_white": {
168
- "pattern": (
169
- "derivatives/freesurfer/[!f]{subject}/surf/rh.whit[e]"
170
- )
171
- },
172
- "lh_pial": {
173
- "pattern": (
174
- "derivatives/freesurfer/[!f]{subject}/surf/lh.pia[l]"
175
- )
176
- },
177
- "rh_pial": {
178
- "pattern": (
179
- "derivatives/freesurfer/[!f]{subject}/surf/rh.pia[l]"
180
- )
181
- },
182
- },
183
149
  }
184
150
  # Use native T1w assets
185
151
  self.native_t1w = False
@@ -193,13 +159,14 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
193
159
  "{subject}_desc-preproc_T1w.nii.gz"
194
160
  ),
195
161
  "space": "native",
196
- "mask": {
197
- "pattern": (
198
- "derivatives/fmriprep/{subject}/anat/"
199
- "{subject}_desc-brain_mask.nii.gz"
200
- ),
201
- "space": "native",
202
- },
162
+ "mask_item": "T1w_mask",
163
+ },
164
+ "T1w_mask": {
165
+ "pattern": (
166
+ "derivatives/fmriprep/{subject}/anat/"
167
+ "{subject}_desc-brain_mask.nii.gz"
168
+ ),
169
+ "space": "native",
203
170
  },
204
171
  "Warp": {
205
172
  "pattern": (
@@ -7,7 +7,7 @@
7
7
  # Synchon Mandal <s.mandal@fz-juelich.de>
8
8
  # License: AGPL
9
9
 
10
- from typing import List, Optional, Union
10
+ from typing import List, Union
11
11
 
12
12
  import pytest
13
13
 
@@ -17,70 +17,125 @@ from junifer.datagrabber.aomic.id1000 import DataladAOMICID1000
17
17
  URI = "https://gin.g-node.org/juaml/datalad-example-aomic1000"
18
18
 
19
19
 
20
- @pytest.mark.parametrize(
21
- "type_, nested_types",
22
- [
23
- ("BOLD", ["confounds", "mask"]),
24
- ("T1w", ["mask"]),
25
- ("VBM_CSF", None),
26
- ("VBM_GM", None),
27
- ("VBM_WM", None),
28
- ("DWI", None),
29
- ("FreeSurfer", None),
30
- ],
31
- )
32
- def test_DataladAOMICID1000(
33
- type_: str,
34
- nested_types: Optional[List[str]],
35
- ) -> None:
36
- """Test DataladAOMICID1000 DataGrabber.
37
-
38
- Parameters
39
- ----------
40
- type_ : str
41
- The parametrized type.
42
- nested_types : list of str or None
43
- The parametrized nested types.
44
-
45
- """
46
- dg = DataladAOMICID1000(types=type_)
20
+ def test_DataladAOMICID1000() -> None:
21
+ """Test DataladAOMICID1000 DataGrabber."""
22
+ dg = DataladAOMICID1000()
47
23
  # Set URI to Gin
48
24
  dg.uri = URI
49
25
 
50
26
  with dg:
51
- # Get all elements
52
27
  all_elements = dg.get_elements()
53
- # Get test element
54
28
  test_element = all_elements[0]
55
- # Get test element data
29
+
56
30
  out = dg[test_element]
57
- # Assert data type
58
- assert type_ in out
59
- assert out[type_]["path"].exists()
60
- assert out[type_]["path"].is_file()
61
- # Asserts data type metadata
62
- assert "meta" in out[type_]
63
- meta = out[type_]["meta"]
31
+
32
+ # asserts type "BOLD"
33
+ assert "BOLD" in out
34
+
35
+ assert (
36
+ out["BOLD"]["path"].name == f"{test_element}_task-moviewatching_"
37
+ "space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
38
+ )
39
+
40
+ assert out["BOLD"]["path"].exists()
41
+ assert out["BOLD"]["path"].is_file()
42
+
43
+ # asserts type "BOLD_confounds"
44
+ assert "BOLD_confounds" in out
45
+
46
+ assert (
47
+ out["BOLD_confounds"]["path"].name
48
+ == f"{test_element}_task-moviewatching_"
49
+ "desc-confounds_regressors.tsv"
50
+ )
51
+
52
+ assert out["BOLD_confounds"]["path"].exists()
53
+ assert out["BOLD_confounds"]["path"].is_file()
54
+
55
+ # assert BOLD_mask
56
+ assert out["BOLD_mask"]["path"].exists()
57
+
58
+ # asserts type "T1w"
59
+ assert "T1w" in out
60
+
61
+ assert (
62
+ out["T1w"]["path"].name
63
+ == f"{test_element}_space-MNI152NLin2009cAsym_"
64
+ "desc-preproc_T1w.nii.gz"
65
+ )
66
+
67
+ assert out["T1w"]["path"].exists()
68
+ assert out["T1w"]["path"].is_file()
69
+
70
+ # asserts T1w_mask
71
+ assert out["T1w_mask"]["path"].exists()
72
+
73
+ # asserts type "VBM_CSF"
74
+ assert "VBM_CSF" in out
75
+
76
+ assert (
77
+ out["VBM_CSF"]["path"].name
78
+ == f"{test_element}_space-MNI152NLin2009cAsym_label-"
79
+ "CSF_probseg.nii.gz"
80
+ )
81
+
82
+ assert out["VBM_CSF"]["path"].exists()
83
+ assert out["VBM_CSF"]["path"].is_file()
84
+
85
+ # asserts type "VBM_GM"
86
+ assert "VBM_GM" in out
87
+
88
+ assert (
89
+ out["VBM_GM"]["path"].name
90
+ == f"{test_element}_space-MNI152NLin2009cAsym_label-"
91
+ "GM_probseg.nii.gz"
92
+ )
93
+
94
+ assert out["VBM_GM"]["path"].exists()
95
+ assert out["VBM_GM"]["path"].is_file()
96
+
97
+ # asserts type "VBM_WM"
98
+ assert "VBM_WM" in out
99
+
100
+ assert (
101
+ out["VBM_WM"]["path"].name
102
+ == f"{test_element}_space-MNI152NLin2009cAsym_label-"
103
+ "WM_probseg.nii.gz"
104
+ )
105
+
106
+ assert out["VBM_WM"]["path"].exists()
107
+ assert out["VBM_WM"]["path"].is_file()
108
+
109
+ # asserts type "DWI"
110
+ assert "DWI" in out
111
+
112
+ assert (
113
+ out["DWI"]["path"].name
114
+ == f"{test_element}_desc-preproc_dwi.nii.gz"
115
+ )
116
+
117
+ assert out["DWI"]["path"].exists()
118
+ assert out["DWI"]["path"].is_file()
119
+
120
+ # asserts meta
121
+ assert "meta" in out["BOLD"]
122
+ meta = out["BOLD"]["meta"]
64
123
  assert "element" in meta
65
124
  assert "subject" in meta["element"]
66
125
  assert test_element == meta["element"]["subject"]
67
- # Assert nested data type if not None
68
- if nested_types is not None:
69
- for nested_type in nested_types:
70
- assert out[type_][nested_type]["path"].exists()
71
- assert out[type_][nested_type]["path"].is_file()
72
126
 
73
127
 
74
128
  @pytest.mark.parametrize(
75
129
  "types",
76
130
  [
77
131
  "BOLD",
132
+ "BOLD_confounds",
78
133
  "T1w",
79
134
  "VBM_CSF",
80
135
  "VBM_GM",
81
136
  "VBM_WM",
82
137
  "DWI",
83
- ["BOLD", "VBM_CSF"],
138
+ ["BOLD", "BOLD_confounds"],
84
139
  ["T1w", "VBM_CSF"],
85
140
  ["VBM_GM", "VBM_WM"],
86
141
  ["DWI", "BOLD"],