junifer 0.0.4.dev782__py3-none-any.whl → 0.0.4.dev814__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- junifer/_version.py +2 -2
- junifer/api/res/ants/ResampleImage +0 -0
- junifer/api/res/ants/antsApplyTransforms +0 -0
- junifer/api/res/ants/antsApplyTransformsToPoints +0 -0
- junifer/api/res/ants/run_ants_docker.sh +0 -0
- junifer/api/res/fsl/img2imgcoord +0 -0
- junifer/api/res/run_venv.sh +0 -0
- junifer/configs/juseless/datagrabbers/aomic_id1000_vbm.py +6 -1
- junifer/configs/juseless/datagrabbers/camcan_vbm.py +6 -1
- junifer/configs/juseless/datagrabbers/ixi_vbm.py +6 -1
- junifer/configs/juseless/datagrabbers/ucla.py +42 -24
- junifer/configs/juseless/datagrabbers/ukb_vbm.py +6 -1
- junifer/datagrabber/aomic/id1000.py +98 -91
- junifer/datagrabber/aomic/piop1.py +97 -73
- junifer/datagrabber/aomic/piop2.py +97 -73
- junifer/datagrabber/base.py +6 -4
- junifer/datagrabber/datalad_base.py +0 -2
- junifer/datagrabber/dmcc13_benchmark.py +87 -50
- junifer/datagrabber/hcp1200/hcp1200.py +21 -19
- junifer/datagrabber/pattern.py +124 -25
- junifer/datagrabber/pattern_datalad.py +111 -13
- junifer/datagrabber/tests/test_base.py +0 -6
- junifer/datagrabber/tests/test_datagrabber_utils.py +204 -76
- junifer/datagrabber/tests/test_datalad_base.py +0 -6
- junifer/datagrabber/tests/test_multiple.py +43 -10
- junifer/datagrabber/tests/test_pattern.py +125 -178
- junifer/datagrabber/tests/test_pattern_datalad.py +44 -25
- junifer/datagrabber/utils.py +141 -21
- junifer/datareader/default.py +6 -7
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/METADATA +1 -1
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/RECORD +30 -30
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/AUTHORS.rst +0 -0
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/LICENSE.md +0 -0
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/WHEEL +0 -0
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/entry_points.txt +0 -0
- {junifer-0.0.4.dev782.dist-info → junifer-0.0.4.dev814.dist-info}/top_level.txt +0 -0
@@ -74,50 +74,78 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
|
|
74
74
|
self.tasks = tasks
|
75
75
|
# The patterns
|
76
76
|
patterns = {
|
77
|
-
"BOLD":
|
78
|
-
"
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
"
|
84
|
-
"
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
"
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
"
|
101
|
-
|
102
|
-
"
|
103
|
-
"
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
"
|
109
|
-
"
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
77
|
+
"BOLD": {
|
78
|
+
"pattern": (
|
79
|
+
"derivatives/fmriprep/sub-{subject}/func/"
|
80
|
+
"sub-{subject}_task-{task}_"
|
81
|
+
"space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
|
82
|
+
),
|
83
|
+
"space": "MNI152NLin2009cAsym",
|
84
|
+
"mask_item": "BOLD_mask",
|
85
|
+
},
|
86
|
+
"BOLD_confounds": {
|
87
|
+
"pattern": (
|
88
|
+
"derivatives/fmriprep/sub-{subject}/func/"
|
89
|
+
"sub-{subject}_task-{task}_"
|
90
|
+
"desc-confounds_regressors.tsv"
|
91
|
+
),
|
92
|
+
"format": "fmriprep",
|
93
|
+
},
|
94
|
+
"BOLD_mask": {
|
95
|
+
"pattern": (
|
96
|
+
"derivatives/fmriprep/sub-{subject}/func/"
|
97
|
+
"sub-{subject}_task-{task}_"
|
98
|
+
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
|
99
|
+
),
|
100
|
+
"space": "MNI152NLin2009cAsym",
|
101
|
+
},
|
102
|
+
"T1w": {
|
103
|
+
"pattern": (
|
104
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
105
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_"
|
106
|
+
"desc-preproc_T1w.nii.gz"
|
107
|
+
),
|
108
|
+
"space": "MNI152NLin2009cAsym",
|
109
|
+
"mask_item": "T1w_mask",
|
110
|
+
},
|
111
|
+
"T1w_mask": {
|
112
|
+
"pattern": (
|
113
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
114
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_"
|
115
|
+
"desc-brain_mask.nii.gz"
|
116
|
+
),
|
117
|
+
"space": "MNI152NLin2009cAsym",
|
118
|
+
},
|
119
|
+
"probseg_CSF": {
|
120
|
+
"pattern": (
|
121
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
122
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-"
|
123
|
+
"CSF_probseg.nii.gz"
|
124
|
+
),
|
125
|
+
"space": "MNI152NLin2009cAsym",
|
126
|
+
},
|
127
|
+
"probseg_GM": {
|
128
|
+
"pattern": (
|
129
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
130
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-"
|
131
|
+
"GM_probseg.nii.gz"
|
132
|
+
),
|
133
|
+
"space": "MNI152NLin2009cAsym",
|
134
|
+
},
|
135
|
+
"probseg_WM": {
|
136
|
+
"pattern": (
|
137
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
138
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-"
|
139
|
+
"WM_probseg.nii.gz"
|
140
|
+
),
|
141
|
+
"space": "MNI152NLin2009cAsym",
|
142
|
+
},
|
143
|
+
"DWI": {
|
144
|
+
"pattern": (
|
145
|
+
"derivatives/dwipreproc/sub-{subject}/dwi/"
|
146
|
+
"sub-{subject}_desc-preproc_dwi.nii.gz"
|
147
|
+
),
|
148
|
+
},
|
121
149
|
}
|
122
150
|
# Use native T1w assets
|
123
151
|
self.native_t1w = False
|
@@ -125,19 +153,30 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
|
|
125
153
|
self.native_t1w = True
|
126
154
|
patterns.update(
|
127
155
|
{
|
128
|
-
"T1w":
|
129
|
-
"
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
"
|
134
|
-
"
|
135
|
-
|
136
|
-
"
|
137
|
-
"
|
138
|
-
|
139
|
-
|
140
|
-
|
156
|
+
"T1w": {
|
157
|
+
"pattern": (
|
158
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
159
|
+
"sub-{subject}_desc-preproc_T1w.nii.gz"
|
160
|
+
),
|
161
|
+
"space": "native",
|
162
|
+
"mask_item": "T1w_mask",
|
163
|
+
},
|
164
|
+
"T1w_mask": {
|
165
|
+
"pattern": (
|
166
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
167
|
+
"sub-{subject}_desc-brain_mask.nii.gz"
|
168
|
+
),
|
169
|
+
"space": "native",
|
170
|
+
},
|
171
|
+
"Warp": {
|
172
|
+
"pattern": (
|
173
|
+
"derivatives/fmriprep/sub-{subject}/anat/"
|
174
|
+
"sub-{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
175
|
+
"mode-image_xfm.h5"
|
176
|
+
),
|
177
|
+
"src": "MNI152NLin2009cAsym",
|
178
|
+
"dst": "native",
|
179
|
+
},
|
141
180
|
}
|
142
181
|
)
|
143
182
|
# Set default types
|
@@ -192,19 +231,4 @@ class DataladAOMICPIOP2(PatternDataladDataGrabber):
|
|
192
231
|
specified element.
|
193
232
|
|
194
233
|
"""
|
195
|
-
|
196
|
-
if out.get("BOLD"):
|
197
|
-
out["BOLD"]["mask_item"] = "BOLD_mask"
|
198
|
-
# Add space information
|
199
|
-
out["BOLD"].update({"space": "MNI152NLin2009cAsym"})
|
200
|
-
if out.get("T1w"):
|
201
|
-
out["T1w"]["mask_item"] = "T1w_mask"
|
202
|
-
# Add space information
|
203
|
-
if self.native_t1w:
|
204
|
-
out["T1w"].update({"space": "native"})
|
205
|
-
else:
|
206
|
-
out["T1w"].update({"space": "MNI152NLin2009cAsym"})
|
207
|
-
if out.get("Warp"):
|
208
|
-
# Add source space information
|
209
|
-
out["Warp"].update({"src": "MNI152NLin2009cAsym"})
|
210
|
-
return out
|
234
|
+
return super().get_item(subject=subject, task=f"{task}_acq-seq")
|
junifer/datagrabber/base.py
CHANGED
@@ -59,7 +59,9 @@ class BaseDataGrabber(ABC, UpdateMetaMixin):
|
|
59
59
|
"""
|
60
60
|
yield from self.get_elements()
|
61
61
|
|
62
|
-
def __getitem__(
|
62
|
+
def __getitem__(
|
63
|
+
self, element: Union[str, Tuple[str, ...]]
|
64
|
+
) -> Dict[str, Dict]:
|
63
65
|
"""Enable indexing support.
|
64
66
|
|
65
67
|
Parameters
|
@@ -183,7 +185,7 @@ class BaseDataGrabber(ABC, UpdateMetaMixin):
|
|
183
185
|
raise_error(
|
184
186
|
msg="Concrete classes need to implement get_element_keys().",
|
185
187
|
klass=NotImplementedError,
|
186
|
-
)
|
188
|
+
) # pragma: no cover
|
187
189
|
|
188
190
|
@abstractmethod
|
189
191
|
def get_elements(self) -> List[Union[str, Tuple[str]]]:
|
@@ -200,7 +202,7 @@ class BaseDataGrabber(ABC, UpdateMetaMixin):
|
|
200
202
|
raise_error(
|
201
203
|
msg="Concrete classes need to implement get_elements().",
|
202
204
|
klass=NotImplementedError,
|
203
|
-
)
|
205
|
+
) # pragma: no cover
|
204
206
|
|
205
207
|
@abstractmethod
|
206
208
|
def get_item(self, **element: Dict) -> Dict[str, Dict]:
|
@@ -221,4 +223,4 @@ class BaseDataGrabber(ABC, UpdateMetaMixin):
|
|
221
223
|
raise_error(
|
222
224
|
msg="Concrete classes need to implement get_item().",
|
223
225
|
klass=NotImplementedError,
|
224
|
-
)
|
226
|
+
) # pragma: no cover
|
@@ -17,12 +17,10 @@ import datalad.api as dl
|
|
17
17
|
from datalad.support.exceptions import IncompleteResultsError
|
18
18
|
from datalad.support.gitrepo import GitRepo
|
19
19
|
|
20
|
-
from ..api.decorators import register_datagrabber
|
21
20
|
from ..utils import logger, raise_error, warn_with_log
|
22
21
|
from .base import BaseDataGrabber
|
23
22
|
|
24
23
|
|
25
|
-
@register_datagrabber
|
26
24
|
class DataladDataGrabber(BaseDataGrabber):
|
27
25
|
"""Abstract base class for datalad-based data fetching.
|
28
26
|
|
@@ -139,43 +139,69 @@ class DMCC13Benchmark(PatternDataladDataGrabber):
|
|
139
139
|
self.runs = runs
|
140
140
|
# The patterns
|
141
141
|
patterns = {
|
142
|
-
"BOLD":
|
143
|
-
"
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
"
|
150
|
-
"
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
"
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
142
|
+
"BOLD": {
|
143
|
+
"pattern": (
|
144
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/ses-{session}/"
|
145
|
+
"func/sub-{subject}_ses-{session}_task-{task}_acq-mb4"
|
146
|
+
"{phase_encoding}_run-{run}_"
|
147
|
+
"space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz"
|
148
|
+
),
|
149
|
+
"space": "MNI152NLin2009cAsym",
|
150
|
+
"mask_item": "BOLD_mask",
|
151
|
+
},
|
152
|
+
"BOLD_confounds": {
|
153
|
+
"pattern": (
|
154
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/ses-{session}/"
|
155
|
+
"func/sub-{subject}_ses-{session}_task-{task}_acq-mb4"
|
156
|
+
"{phase_encoding}_run-{run}_desc-confounds_regressors.tsv"
|
157
|
+
),
|
158
|
+
"format": "fmriprep",
|
159
|
+
},
|
160
|
+
"BOLD_mask": {
|
161
|
+
"pattern": (
|
162
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/ses-{session}/"
|
163
|
+
"/func/sub-{subject}_ses-{session}_task-{task}_acq-mb4"
|
164
|
+
"{phase_encoding}_run-{run}_"
|
165
|
+
"space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
|
166
|
+
),
|
167
|
+
"space": "MNI152NLin2009cAsym",
|
168
|
+
},
|
169
|
+
"T1w": {
|
170
|
+
"pattern": (
|
171
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
172
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz"
|
173
|
+
),
|
174
|
+
"space": "MNI152NLin2009cAsym",
|
175
|
+
"mask_item": "T1w_mask",
|
176
|
+
},
|
177
|
+
"T1w_mask": {
|
178
|
+
"pattern": (
|
179
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
180
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz"
|
181
|
+
),
|
182
|
+
"space": "MNI152NLin2009cAsym",
|
183
|
+
},
|
184
|
+
"probseg_CSF": {
|
185
|
+
"pattern": (
|
186
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
187
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz"
|
188
|
+
),
|
189
|
+
"space": "MNI152NLin2009cAsym",
|
190
|
+
},
|
191
|
+
"probseg_GM": {
|
192
|
+
"pattern": (
|
193
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
194
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz"
|
195
|
+
),
|
196
|
+
"space": "MNI152NLin2009cAsym",
|
197
|
+
},
|
198
|
+
"probseg_WM": {
|
199
|
+
"pattern": (
|
200
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
201
|
+
"sub-{subject}_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz"
|
202
|
+
),
|
203
|
+
"space": "MNI152NLin2009cAsym",
|
204
|
+
},
|
179
205
|
}
|
180
206
|
# Use native T1w assets
|
181
207
|
self.native_t1w = False
|
@@ -183,19 +209,30 @@ class DMCC13Benchmark(PatternDataladDataGrabber):
|
|
183
209
|
self.native_t1w = True
|
184
210
|
patterns.update(
|
185
211
|
{
|
186
|
-
"T1w":
|
187
|
-
"
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
"
|
192
|
-
"
|
193
|
-
|
194
|
-
"
|
195
|
-
"
|
196
|
-
|
197
|
-
|
198
|
-
|
212
|
+
"T1w": {
|
213
|
+
"pattern": (
|
214
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
215
|
+
"sub-{subject}_desc-preproc_T1w.nii.gz"
|
216
|
+
),
|
217
|
+
"space": "native",
|
218
|
+
"mask_item": "T1w_mask",
|
219
|
+
},
|
220
|
+
"T1w_mask": {
|
221
|
+
"pattern": (
|
222
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
223
|
+
"sub-{subject}_desc-brain_mask.nii.gz"
|
224
|
+
),
|
225
|
+
"space": "native",
|
226
|
+
},
|
227
|
+
"Warp": {
|
228
|
+
"pattern": (
|
229
|
+
"derivatives/fmriprep-1.3.2/sub-{subject}/anat/"
|
230
|
+
"sub-{subject}_from-MNI152NLin2009cAsym_to-T1w_"
|
231
|
+
"mode-image_xfm.h5"
|
232
|
+
),
|
233
|
+
"src": "MNI152NLin2009cAsym",
|
234
|
+
"dst": "native",
|
235
|
+
},
|
199
236
|
}
|
200
237
|
)
|
201
238
|
# Set default types
|
@@ -106,14 +106,26 @@ class HCP1200(PatternDataGrabber):
|
|
106
106
|
types = ["BOLD", "T1w", "Warp"]
|
107
107
|
# The patterns
|
108
108
|
patterns = {
|
109
|
-
"BOLD":
|
110
|
-
"
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
109
|
+
"BOLD": {
|
110
|
+
"pattern": (
|
111
|
+
"{subject}/MNINonLinear/Results/"
|
112
|
+
"{task}_{phase_encoding}/"
|
113
|
+
"{task}_{phase_encoding}"
|
114
|
+
f"{suffix}.nii.gz"
|
115
|
+
),
|
116
|
+
"space": "MNI152NLin6Asym",
|
117
|
+
},
|
118
|
+
"T1w": {
|
119
|
+
"pattern": "{subject}/T1w/T1w_acpc_dc_restore.nii.gz",
|
120
|
+
"space": "native",
|
121
|
+
},
|
122
|
+
"Warp": {
|
123
|
+
"pattern": (
|
124
|
+
"{subject}/MNINonLinear/xfms/standard2acpc_dc.nii.gz"
|
125
|
+
),
|
126
|
+
"src": "MNI152NLin6Asym",
|
127
|
+
"dst": "native",
|
128
|
+
},
|
117
129
|
}
|
118
130
|
# The replacements
|
119
131
|
replacements = ["subject", "task", "phase_encoding"]
|
@@ -150,19 +162,9 @@ class HCP1200(PatternDataGrabber):
|
|
150
162
|
else:
|
151
163
|
new_task = f"tfMRI_{task}"
|
152
164
|
|
153
|
-
|
165
|
+
return super().get_item(
|
154
166
|
subject=subject, task=new_task, phase_encoding=phase_encoding
|
155
167
|
)
|
156
|
-
# Add space for BOLD data type
|
157
|
-
if "BOLD" in out:
|
158
|
-
out["BOLD"].update({"space": "MNI152NLin6Asym"})
|
159
|
-
# Add space for T1w data type
|
160
|
-
if "T1w" in out:
|
161
|
-
out["T1w"].update({"space": "native"})
|
162
|
-
# Add source space for Warp data type
|
163
|
-
if "Warp" in out:
|
164
|
-
out["Warp"].update({"src": "MNI152NLin6Asym"})
|
165
|
-
return out
|
166
168
|
|
167
169
|
def get_elements(self) -> List:
|
168
170
|
"""Implement fetching list of elements in the dataset.
|