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