junifer 0.0.6.dev285__py3-none-any.whl → 0.0.6.dev302__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 CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.0.6.dev285'
16
- __version_tuple__ = version_tuple = (0, 0, 6, 'dev285')
15
+ __version__ = version = '0.0.6.dev302'
16
+ __version_tuple__ = version_tuple = (0, 0, 6, 'dev302')
junifer/api/functions.py CHANGED
@@ -21,7 +21,7 @@ from ..pipeline import (
21
21
  from ..preprocess import BasePreprocessor
22
22
  from ..storage import BaseFeatureStorage
23
23
  from ..typing import DataGrabberLike, MarkerLike, PreprocessorLike, StorageLike
24
- from ..utils import logger, raise_error, yaml
24
+ from ..utils import logger, raise_error, warn_with_log, yaml
25
25
 
26
26
 
27
27
  __all__ = ["collect", "list_elements", "queue", "reset", "run"]
@@ -116,18 +116,18 @@ def _get_storage(storage_config: dict) -> StorageLike:
116
116
 
117
117
 
118
118
  def run(
119
- workdir: Union[str, Path],
119
+ workdir: Union[str, Path, dict],
120
120
  datagrabber: dict,
121
121
  markers: list[dict],
122
122
  storage: dict,
123
123
  preprocessors: Optional[list[dict]] = None,
124
- elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
124
+ elements: Optional[list[tuple[str, ...]]] = None,
125
125
  ) -> None:
126
126
  """Run the pipeline on the selected element.
127
127
 
128
128
  Parameters
129
129
  ----------
130
- workdir : str or pathlib.Path
130
+ workdir : str or pathlib.Path or dict
131
131
  Directory where the pipeline will be executed.
132
132
  datagrabber : dict
133
133
  DataGrabber to use. Must have a key ``kind`` with the kind of
@@ -143,23 +143,38 @@ def run(
143
143
  Storage to use. Must have a key ``kind`` with the kind of
144
144
  storage to use. All other keys are passed to the storage
145
145
  constructor.
146
- preprocessors : list of dict, optional
146
+ preprocessors : list of dict or None, optional
147
147
  List of preprocessors to use. Each preprocessor is a dict with at
148
148
  least a key ``kind`` specifying the preprocessor to use. All other keys
149
149
  are passed to the preprocessor constructor (default None).
150
- elements : str or tuple or list of str or tuple, optional
150
+ elements : list of tuple or None, optional
151
151
  Element(s) to process. Will be used to index the DataGrabber
152
152
  (default None).
153
153
 
154
+ Raises
155
+ ------
156
+ ValueError
157
+ If ``workdir.cleanup=False`` when ``len(elements) > 1``.
158
+
154
159
  """
155
- # Convert str to Path
156
- if isinstance(workdir, str):
157
- workdir = Path(workdir)
158
- # Initiate working directory manager
159
- WorkDirManager(workdir)
160
+ # Conditional to handle workdir config
161
+ if isinstance(workdir, (str, Path)):
162
+ if isinstance(workdir, str):
163
+ workdir = {"workdir": Path(workdir), "cleanup": True}
164
+ else:
165
+ workdir = {"workdir": workdir, "cleanup": True}
166
+ elif isinstance(workdir, dict):
167
+ workdir["workdir"] = workdir.pop("path")
160
168
 
161
- if not isinstance(elements, list) and elements is not None:
162
- elements = [elements]
169
+ # Initiate working directory manager with correct variation
170
+ if not workdir["cleanup"]:
171
+ if elements is None or len(elements) > 1:
172
+ raise_error(
173
+ "Cannot disable `workdir.cleanup` as "
174
+ f"{len(elements) if elements is not None else 'all'} "
175
+ "elements will be processed"
176
+ )
177
+ WorkDirManager(**workdir)
163
178
 
164
179
  # Get datagrabber to use
165
180
  datagrabber_object = _get_datagrabber(datagrabber.copy())
@@ -228,7 +243,7 @@ def queue(
228
243
  kind: str,
229
244
  jobname: str = "junifer_job",
230
245
  overwrite: bool = False,
231
- elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
246
+ elements: Optional[list[tuple[str, ...]]] = None,
232
247
  **kwargs: Union[str, int, bool, dict, tuple, list],
233
248
  ) -> None:
234
249
  """Queue a job to be executed later.
@@ -243,7 +258,7 @@ def queue(
243
258
  The name of the job (default "junifer_job").
244
259
  overwrite : bool, optional
245
260
  Whether to overwrite if job directory already exists (default False).
246
- elements : str or tuple or list of str or tuple, optional
261
+ elements : list of tuple or None, optional
247
262
  Element(s) to process. Will be used to index the DataGrabber
248
263
  (default None).
249
264
  **kwargs : dict
@@ -282,6 +297,16 @@ def queue(
282
297
  shutil.rmtree(jobdir)
283
298
  jobdir.mkdir(exist_ok=True, parents=True)
284
299
 
300
+ # Check workdir config
301
+ if "workdir" in config:
302
+ if isinstance(config["workdir"], dict):
303
+ if not config["workdir"]["cleanup"]:
304
+ warn_with_log(
305
+ "`workdir.cleanup` will be set to True when queueing"
306
+ )
307
+ # Set cleanup
308
+ config["workdir"]["cleanup"] = True
309
+
285
310
  # Load modules
286
311
  if "with" in config:
287
312
  to_load = config["with"]
@@ -381,7 +406,7 @@ def reset(config: dict) -> None:
381
406
 
382
407
  def list_elements(
383
408
  datagrabber: dict,
384
- elements: Union[str, list[Union[str, tuple]], tuple, None] = None,
409
+ elements: Optional[list[tuple[str, ...]]] = None,
385
410
  ) -> str:
386
411
  """List elements of the datagrabber filtered using `elements`.
387
412
 
@@ -391,7 +416,7 @@ def list_elements(
391
416
  DataGrabber to index. Must have a key ``kind`` with the kind of
392
417
  DataGrabber to use. All other keys are passed to the DataGrabber
393
418
  constructor.
394
- elements : str or tuple or list of str or tuple, optional
419
+ elements : list of tuple or None, optional
395
420
  Element(s) to filter using. Will be used to index the DataGrabber
396
421
  (default None).
397
422
 
@@ -88,7 +88,7 @@ def test_run_single_element(
88
88
  datagrabber=datagrabber,
89
89
  markers=markers,
90
90
  storage=storage,
91
- elements=["sub-01"],
91
+ elements=[("sub-01",)],
92
92
  )
93
93
  # Check files
94
94
  files = list(tmp_path.glob("*.sqlite"))
@@ -116,7 +116,7 @@ def test_run_single_element_with_preprocessing(
116
116
  storage["uri"] = str((tmp_path / "out.sqlite").resolve())
117
117
  # Run operations
118
118
  run(
119
- workdir=tmp_path,
119
+ workdir={"path": tmp_path, "cleanup": False},
120
120
  datagrabber={
121
121
  "kind": "PartlyCloudyTestingDataGrabber",
122
122
  "reduce_confounds": False,
@@ -128,7 +128,7 @@ def test_run_single_element_with_preprocessing(
128
128
  "kind": "fMRIPrepConfoundRemover",
129
129
  }
130
130
  ],
131
- elements=["sub-01"],
131
+ elements=[("sub-01",)],
132
132
  )
133
133
  # Check files
134
134
  files = list(tmp_path.glob("*.sqlite"))
@@ -164,7 +164,7 @@ def test_run_multi_element_multi_output(
164
164
  datagrabber=datagrabber,
165
165
  markers=markers,
166
166
  storage=storage,
167
- elements=["sub-01", "sub-03"],
167
+ elements=[("sub-01",), ("sub-03",)],
168
168
  )
169
169
  # Check files
170
170
  files = list(tmp_path.glob("*.sqlite"))
@@ -200,7 +200,7 @@ def test_run_multi_element_single_output(
200
200
  datagrabber=datagrabber,
201
201
  markers=markers,
202
202
  storage=storage,
203
- elements=["sub-01", "sub-03"],
203
+ elements=[("sub-01",), ("sub-03",)],
204
204
  )
205
205
  # Check files
206
206
  files = list(tmp_path.glob("*.sqlite"))
@@ -287,7 +287,10 @@ def test_queue_correct_yaml_config(
287
287
  queue(
288
288
  config={
289
289
  "with": "junifer.testing.registry",
290
- "workdir": str(tmp_path.resolve()),
290
+ "workdir": {
291
+ "path": str(tmp_path.resolve()),
292
+ "cleanup": True,
293
+ },
291
294
  "datagrabber": datagrabber,
292
295
  "markers": markers,
293
296
  "storage": storage,
@@ -342,7 +345,7 @@ def test_queue_invalid_job_queue(
342
345
  with monkeypatch.context() as m:
343
346
  m.chdir(tmp_path)
344
347
  queue(
345
- config={"elements": ["sub-001"]},
348
+ config={"elements": [("sub-001",)]},
346
349
  kind="ABC",
347
350
  )
348
351
 
@@ -366,13 +369,13 @@ def test_queue_assets_disallow_overwrite(
366
369
  m.chdir(tmp_path)
367
370
  # First generate assets
368
371
  queue(
369
- config={"elements": ["sub-001"]},
372
+ config={"elements": [("sub-001",)]},
370
373
  kind="HTCondor",
371
374
  jobname="prevent_overwrite",
372
375
  )
373
376
  # Re-run to trigger error
374
377
  queue(
375
- config={"elements": ["sub-001"]},
378
+ config={"elements": [("sub-001",)]},
376
379
  kind="HTCondor",
377
380
  jobname="prevent_overwrite",
378
381
  )
@@ -399,14 +402,14 @@ def test_queue_assets_allow_overwrite(
399
402
  m.chdir(tmp_path)
400
403
  # First generate assets
401
404
  queue(
402
- config={"elements": ["sub-001"]},
405
+ config={"elements": [("sub-001",)]},
403
406
  kind="HTCondor",
404
407
  jobname="allow_overwrite",
405
408
  )
406
409
  with caplog.at_level(logging.INFO):
407
410
  # Re-run to overwrite
408
411
  queue(
409
- config={"elements": ["sub-001"]},
412
+ config={"elements": [("sub-001",)]},
410
413
  kind="HTCondor",
411
414
  jobname="allow_overwrite",
412
415
  overwrite=True,
@@ -448,10 +451,16 @@ def test_queue_with_imports(
448
451
  (tmp_path / "a.py").touch()
449
452
  with caplog.at_level(logging.DEBUG):
450
453
  queue(
451
- config={"with": with_},
454
+ config={
455
+ "with": with_,
456
+ "workdir": {
457
+ "path": str(tmp_path.resolve()),
458
+ "cleanup": False,
459
+ },
460
+ },
452
461
  kind="HTCondor",
453
462
  jobname="with_import_check",
454
- elements="sub-001",
463
+ elements=[("sub-001",)],
455
464
  )
456
465
  assert "Copying" in caplog.text
457
466
  assert "Queue done" in caplog.text
@@ -465,10 +474,8 @@ def test_queue_with_imports(
465
474
  @pytest.mark.parametrize(
466
475
  "elements",
467
476
  [
468
- "sub-001",
469
- ["sub-001"],
470
- ["sub-001", "sub-002"],
471
- ("sub-001", "ses-001"),
477
+ [("sub-001",)],
478
+ [("sub-001",), ("sub-002",)],
472
479
  [("sub-001", "ses-001")],
473
480
  [("sub-001", "ses-001"), ("sub-001", "ses-002")],
474
481
  ],
@@ -477,7 +484,7 @@ def test_queue_with_elements(
477
484
  tmp_path: Path,
478
485
  monkeypatch: pytest.MonkeyPatch,
479
486
  caplog: pytest.LogCaptureFixture,
480
- elements: Union[str, list[Union[str, tuple[str]]], tuple[str]],
487
+ elements: list[tuple[str, ...]],
481
488
  ) -> None:
482
489
  """Test queue with elements.
483
490
 
@@ -489,7 +496,7 @@ def test_queue_with_elements(
489
496
  The pytest.MonkeyPatch object.
490
497
  caplog : pytest.LogCaptureFixture
491
498
  The pytest.LogCaptureFixture object.
492
- elements : str of list of str
499
+ elements : list of tuple
493
500
  The parametrized elements for the queue.
494
501
 
495
502
  """
@@ -562,7 +569,7 @@ def test_reset_run(
562
569
  datagrabber=datagrabber,
563
570
  markers=markers,
564
571
  storage=storage,
565
- elements=["sub-01"],
572
+ elements=[("sub-01",)],
566
573
  )
567
574
  # Reset operation
568
575
  reset(config={"storage": storage})
@@ -642,13 +649,13 @@ def test_reset_queue(
642
649
  @pytest.mark.parametrize(
643
650
  "elements",
644
651
  [
645
- ["sub-01"],
652
+ [("sub-01",)],
646
653
  None,
647
654
  ],
648
655
  )
649
656
  def test_list_elements(
650
657
  datagrabber: dict[str, str],
651
- elements: Optional[list[str]],
658
+ elements: Optional[list[tuple[str, ...]]],
652
659
  ) -> None:
653
660
  """Test elements listing.
654
661
 
junifer/cli/cli.py CHANGED
@@ -117,15 +117,16 @@ def run(
117
117
  filepath : click.Path
118
118
  The filepath to the configuration file.
119
119
  element : tuple of str
120
- The element to operate on.
120
+ The element(s) to operate on.
121
121
  verbose : click.Choice
122
122
  The verbosity level: warning, info or debug (default "info").
123
123
 
124
124
  """
125
+ # Setup logging
125
126
  configure_logging(level=verbose)
126
127
  # TODO(synchon): add validation
127
128
  # Parse YAML
128
- config = parse_yaml(filepath) # type: ignore
129
+ config = parse_yaml(filepath)
129
130
  # Retrieve working directory
130
131
  workdir = config["workdir"]
131
132
  # Fetch datagrabber
@@ -179,9 +180,12 @@ def collect(filepath: click.Path, verbose: Union[str, int]) -> None:
179
180
  The verbosity level: warning, info or debug (default "info").
180
181
 
181
182
  """
183
+ # Setup logging
182
184
  configure_logging(level=verbose)
183
185
  # TODO: add validation
184
- config = parse_yaml(filepath) # type: ignore
186
+ # Parse YAML
187
+ config = parse_yaml(filepath)
188
+ # Fetch storage
185
189
  storage = config["storage"]
186
190
  # Perform operation
187
191
  cli_func.collect(storage=storage)
@@ -206,7 +210,7 @@ def collect(filepath: click.Path, verbose: Union[str, int]) -> None:
206
210
  )
207
211
  def queue(
208
212
  filepath: click.Path,
209
- element: str,
213
+ element: tuple[str],
210
214
  overwrite: bool,
211
215
  submit: bool,
212
216
  verbose: Union[str, int],
@@ -219,8 +223,8 @@ def queue(
219
223
  ----------
220
224
  filepath : click.Path
221
225
  The filepath to the configuration file.
222
- element : str
223
- The element to operate using.
226
+ element : tuple of str
227
+ The element(s) to operate on.
224
228
  overwrite : bool
225
229
  Whether to overwrite existing directory.
226
230
  submit : bool
@@ -228,15 +232,26 @@ def queue(
228
232
  verbose : click.Choice
229
233
  The verbosity level: warning, info or debug (default "info").
230
234
 
235
+ Raises
236
+ ------
237
+ ValueError
238
+ If no ``queue`` section is found in the YAML.
239
+
231
240
  """
241
+ # Setup logging
232
242
  configure_logging(level=verbose)
233
243
  # TODO: add validation
244
+ # Parse YAML
234
245
  config = parse_yaml(filepath) # type: ignore
235
- elements = parse_elements(element, config)
246
+ # Check queue section
236
247
  if "queue" not in config:
237
248
  raise_error(f"No queue configuration found in {filepath}.")
249
+ # Parse elements
250
+ elements = parse_elements(element, config)
251
+ # Separate out queue section
238
252
  queue_config = config.pop("queue")
239
253
  kind = queue_config.pop("kind")
254
+ # Perform operation
240
255
  cli_func.queue(
241
256
  config=config,
242
257
  kind=kind,
@@ -366,6 +381,7 @@ def reset(
366
381
  The verbosity level: warning, info or debug (default "info").
367
382
 
368
383
  """
384
+ # Setup logging
369
385
  configure_logging(level=verbose)
370
386
  # Parse YAML
371
387
  config = parse_yaml(filepath)
@@ -408,7 +424,7 @@ def list_elements(
408
424
  filepath : click.Path
409
425
  The filepath to the configuration file.
410
426
  element : tuple of str
411
- The element to operate on.
427
+ The element(s) to operate on.
412
428
  output_file : click.Path or None
413
429
  The path to write the output to. If not None, writing to
414
430
  stdout is not performed.
@@ -416,9 +432,10 @@ def list_elements(
416
432
  The verbosity level: warning, info or debug (default "info").
417
433
 
418
434
  """
435
+ # Setup logging
419
436
  configure_logging(level=verbose)
420
437
  # Parse YAML
421
- config = parse_yaml(filepath) # type: ignore
438
+ config = parse_yaml(filepath)
422
439
  # Fetch datagrabber
423
440
  datagrabber = config["datagrabber"]
424
441
  # Parse elements
junifer/cli/parser.py CHANGED
@@ -140,7 +140,9 @@ def parse_yaml(filepath: Union[str, Path]) -> dict: # noqa: C901
140
140
  return contents
141
141
 
142
142
 
143
- def parse_elements(element: tuple[str], config: dict) -> Union[list, None]:
143
+ def parse_elements(
144
+ element: tuple[str, ...], config: dict
145
+ ) -> Union[list[tuple[str, ...]], None]:
144
146
  """Parse elements from cli.
145
147
 
146
148
  Parameters
@@ -170,7 +172,7 @@ def parse_elements(element: tuple[str], config: dict) -> Union[list, None]:
170
172
  """
171
173
  logger.debug(f"Parsing elements: {element}")
172
174
  # Early return None to continue with all elements
173
- if len(element) == 0:
175
+ if not element:
174
176
  return None
175
177
  # Check if the element is a file for single element;
176
178
  # if yes, then parse elements from it
@@ -69,7 +69,7 @@ class FSLCoordinatesWarper:
69
69
  f"{pretransform_coordinates_path.resolve()}",
70
70
  "| img2imgcoord -mm",
71
71
  f"-src {target_data['path'].resolve()}",
72
- f"-dest {target_data['reference_path'].resolve()}",
72
+ f"-dest {target_data['reference']['path'].resolve()}",
73
73
  f"-warp {warp_data['path'].resolve()}",
74
74
  f"> {transformed_coords_path.resolve()};",
75
75
  f"sed -i 1d {transformed_coords_path.resolve()}",
@@ -49,9 +49,10 @@ class ANTsMaskWarper:
49
49
  It should be empty string if ``dst="T1w"``.
50
50
  dst : str
51
51
  The data type or template space to warp to.
52
- `"T1w"` is the only allowed data type and it uses the resampled T1w
53
- found in ``target_data.reference_path``. The ``"reference_path"``
54
- key is added when :class:`.SpaceWarper` is used.
52
+ `"native"` is the only allowed data type and it uses the resampled
53
+ T1w found in ``target_data.reference``. The
54
+ ``"reference"`` key is added when :class:`.SpaceWarper` is
55
+ used or if the data is provided native space.
55
56
  target_data : dict
56
57
  The corresponding item of the data object to which the mask
57
58
  will be applied.
@@ -87,6 +88,10 @@ class ANTsMaskWarper:
87
88
  # Warp data check
88
89
  if warp_data is None:
89
90
  raise_error("No `warp_data` provided")
91
+ if "reference" not in target_data:
92
+ raise_error("No `reference` provided")
93
+ if "path" not in target_data["reference"]:
94
+ raise_error("No `path` provided in `reference`")
90
95
 
91
96
  logger.debug("Using ANTs for mask transformation")
92
97
 
@@ -104,7 +109,7 @@ class ANTsMaskWarper:
104
109
  "-n 'GenericLabel[NearestNeighbor]'",
105
110
  f"-i {prewarp_mask_path.resolve()}",
106
111
  # use resampled reference
107
- f"-r {target_data['reference_path'].resolve()}",
112
+ f"-r {target_data['reference']['path'].resolve()}",
108
113
  f"-t {warp_data['path'].resolve()}",
109
114
  f"-o {warped_mask_path.resolve()}",
110
115
  ]
@@ -74,7 +74,7 @@ class FSLMaskWarper:
74
74
  "--interp=nn",
75
75
  f"-i {prewarp_mask_path.resolve()}",
76
76
  # use resampled reference
77
- f"-r {target_data['reference_path'].resolve()}",
77
+ f"-r {target_data['reference']['path'].resolve()}",
78
78
  f"-w {warp_data['path'].resolve()}",
79
79
  f"-o {warped_mask_path.resolve()}",
80
80
  ]
@@ -50,8 +50,9 @@ class ANTsParcellationWarper:
50
50
  dst : str
51
51
  The data type or template space to warp to.
52
52
  `"T1w"` is the only allowed data type and it uses the resampled T1w
53
- found in ``target_data.reference_path``. The ``"reference_path"``
54
- key is added when :class:`.SpaceWarper` is used.
53
+ found in ``target_data.reference``. The ``"reference"``
54
+ key is added if the :class:`.SpaceWarper` is used or if the
55
+ data is provided in native space.
55
56
  target_data : dict
56
57
  The corresponding item of the data object to which the parcellation
57
58
  will be applied.
@@ -87,6 +88,10 @@ class ANTsParcellationWarper:
87
88
  # Warp data check
88
89
  if warp_data is None:
89
90
  raise_error("No `warp_data` provided")
91
+ if "reference" not in target_data:
92
+ raise_error("No `reference` provided")
93
+ if "path" not in target_data["reference"]:
94
+ raise_error("No `path` provided in `reference`")
90
95
 
91
96
  logger.debug("Using ANTs for parcellation transformation")
92
97
 
@@ -108,7 +113,7 @@ class ANTsParcellationWarper:
108
113
  "-n 'GenericLabel[NearestNeighbor]'",
109
114
  f"-i {prewarp_parcellation_path.resolve()}",
110
115
  # use resampled reference
111
- f"-r {target_data['reference_path'].resolve()}",
116
+ f"-r {target_data['reference']['path'].resolve()}",
112
117
  f"-t {warp_data['path'].resolve()}",
113
118
  f"-o {warped_parcellation_path.resolve()}",
114
119
  ]
@@ -78,7 +78,7 @@ class FSLParcellationWarper:
78
78
  "--interp=nn",
79
79
  f"-i {prewarp_parcellation_path.resolve()}",
80
80
  # use resampled reference
81
- f"-r {target_data['reference_path'].resolve()}",
81
+ f"-r {target_data['reference']['path'].resolve()}",
82
82
  f"-w {warp_data['path'].resolve()}",
83
83
  f"-o {warped_parcellation_path.resolve()}",
84
84
  ]
@@ -33,6 +33,8 @@ PATTERNS_SCHEMA = {
33
33
  "mandatory": ["pattern", "format"],
34
34
  "optional": ["mappings"],
35
35
  },
36
+ "reference": {"mandatory": ["pattern"], "optional": []},
37
+ "prewarp_space": {"mandatory": [], "optional": []},
36
38
  },
37
39
  },
38
40
  "Warp": {
@@ -30,6 +30,9 @@ class WorkDirManager(metaclass=Singleton):
30
30
  workdir : str or pathlib.Path, optional
31
31
  The path to the super-directory. If None, "TMPDIR/junifer" is used
32
32
  where TMPDIR is the platform-dependent temporary directory.
33
+ cleanup : bool, optional
34
+ If False, the directories are not cleaned up after the object is
35
+ destroyed. This is useful for debugging purposes (default True).
33
36
 
34
37
  Attributes
35
38
  ----------
@@ -39,14 +42,11 @@ class WorkDirManager(metaclass=Singleton):
39
42
  The path to the element directory.
40
43
  root_tempdir : pathlib.Path or None
41
44
  The path to the root temporary directory.
42
- cleanup : bool, optional
43
- If False, the directories are not cleaned up after the object is
44
- destroyed. This is useful for debugging purposes (default True).
45
45
 
46
46
  """
47
47
 
48
48
  def __init__(
49
- self, workdir: Optional[Union[str, Path]] = None, cleanup=True
49
+ self, workdir: Optional[Union[str, Path]] = None, cleanup: bool = True
50
50
  ) -> None:
51
51
  """Initialize the class."""
52
52
  self._workdir = Path(workdir) if isinstance(workdir, str) else workdir
@@ -59,7 +59,7 @@ class ANTsWarper:
59
59
  -------
60
60
  dict
61
61
  The ``input`` dictionary with modified ``data`` and ``space`` key
62
- values and new ``reference_path`` key whose value points to the
62
+ values and new ``reference`` key whose value points to the
63
63
  reference file used for warping.
64
64
 
65
65
  Raises
@@ -129,7 +129,7 @@ class ANTsWarper:
129
129
  # Load nifti
130
130
  input["data"] = nib.load(apply_transforms_out_path)
131
131
  # Save resampled reference path
132
- input["reference_path"] = resample_image_out_path
132
+ input["reference"] = {"path": resample_image_out_path}
133
133
  # Keep pre-warp space for further operations
134
134
  input["prewarp_space"] = input["space"]
135
135
  # Use reference input's space as warped input's space
@@ -55,7 +55,7 @@ class FSLWarper:
55
55
  -------
56
56
  dict
57
57
  The ``input`` dictionary with modified ``data`` and ``space`` key
58
- values and new ``reference_path`` key whose value points to the
58
+ values and new ``reference`` key whose value points to the
59
59
  reference file used for warping.
60
60
 
61
61
  Raises
@@ -116,7 +116,7 @@ class FSLWarper:
116
116
  # Load nifti
117
117
  input["data"] = nib.load(applywarp_out_path)
118
118
  # Save resampled reference path
119
- input["reference_path"] = flirt_out_path
119
+ input["reference"] = {"path": flirt_out_path}
120
120
  # Keep pre-warp space for further operations
121
121
  input["prewarp_space"] = input["space"]
122
122
  # Use reference input's space as warped input's space
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: junifer
3
- Version: 0.0.6.dev285
3
+ Version: 0.0.6.dev302
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>
@@ -1,13 +1,13 @@
1
1
  junifer/__init__.py,sha256=2McgH1yNue6Z1V26-uN_mfMjbTcx4CLhym-DMBl5xA4,266
2
2
  junifer/__init__.pyi,sha256=SsTvgq2Dod6UqJN96GH1lCphH6hJQQurEJHGNhHjGUI,508
3
- junifer/_version.py,sha256=VOqNBo1Uj5NzgtOfO88V2py3fLW1gPgO44Cm-fu8TeY,428
3
+ junifer/_version.py,sha256=6ivRaEJnq1nwi7sNAqQwwarVpyzKReHtuarvntATZ2E,428
4
4
  junifer/conftest.py,sha256=PWYkkRDU8ly2lYwv7VBKMHje4et6HX7Yey3Md_I2KbA,613
5
5
  junifer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  junifer/stats.py,sha256=e9aaagMGtgpRfW3Wdpz9ocpnYld1IWylCDcjFUgX9Mk,6225
7
7
  junifer/api/__init__.py,sha256=aAXW_KAEGQ8aAP5Eni2G1R4MWBF7UgjKOgM6akLuJco,252
8
8
  junifer/api/__init__.pyi,sha256=UJu55ApMFd43N0xlQyNKrYpCdzqhAxA3Jjaj0ETwCXU,169
9
9
  junifer/api/decorators.py,sha256=xphy55NJHnMZnJ-aNA70UzHUJ3SIgh5Xc8ekcozvj3U,2854
10
- junifer/api/functions.py,sha256=ebKz9WVdDcVWX32p2MHiYEEN-FEcsGcRWEN6u4pFnro,12826
10
+ junifer/api/functions.py,sha256=Tq1LKoxJuHHylcCFJ6SrPoPriIsnTLdbQ5K6w8gdTE8,13697
11
11
  junifer/api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  junifer/api/queue_context/__init__.py,sha256=glr8x4aMm4EvVrHywDIlugdNlwD1RzqV2FTDNPqYQZ4,204
13
13
  junifer/api/queue_context/__init__.pyi,sha256=LoDQFGZ9wCDmgx5a1_nhKo4zOSvqViXZ8V882DksF7U,246
@@ -40,11 +40,11 @@ junifer/api/res/fsl/flirt,sha256=tSjiUco8ui8AbHD7mTzChEwbR0Rf_4iJTgzYTPF_WuQ,42
40
40
  junifer/api/res/fsl/img2imgcoord,sha256=Zmaw3oJYrEltcXiPyEubXry9ppAq3SND52tdDWGgeZk,49
41
41
  junifer/api/res/fsl/run_fsl_docker.sh,sha256=pq-fcNdLuvHzVIQePN4GebZGlcE2UF-xj5rBIqAMz4g,1122
42
42
  junifer/api/res/fsl/std2imgcoord,sha256=-X5wRH6XMl0yqnTACJX6MFhO8DFOEWg42MHRxGvimXg,49
43
- junifer/api/tests/test_functions.py,sha256=aBAZ2EveiBHbAM5w6j2QxMHBze-XiVD3Td1kAE946ps,17786
43
+ junifer/api/tests/test_functions.py,sha256=PPkjs_FqjZZgsEa3a81ulzPxLskVh5HmnaG8TaNCwR0,18084
44
44
  junifer/cli/__init__.py,sha256=DS3kZKHeVDxt6d1MLBerZ2fcAwrEBHee5JOBhOLajUI,197
45
45
  junifer/cli/__init__.pyi,sha256=PiV4znUnzSeuSSJGz-RT8N21PiMqoSMwYcypi7nt2Js,40
46
- junifer/cli/cli.py,sha256=kzSM-5nZWgQ4iaGbcjDkU2JgdYcUF-zsYskuq9_ewM0,13195
47
- junifer/cli/parser.py,sha256=Ok_ADyoDfjlAxl9NP36dtzFHp9QTL87V_cRxCa44UKs,8336
46
+ junifer/cli/cli.py,sha256=Q0l7dBclLrM0P5MU2G0MA7W8u23VtqIQdwaeoOy-_ws,13519
47
+ junifer/cli/parser.py,sha256=ouVnk4NrOmVMNnQDMsqAjt2BaOT05bNJq0LVRsIakXI,8358
48
48
  junifer/cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  junifer/cli/utils.py,sha256=AbPQC0Kl-tHMNKiPxp_01gLAGD3IGoLbsq3rXyPMM-c,3116
50
50
  junifer/cli/tests/test_cli.py,sha256=AYL4my12GmFRCbI3JV7-rju32heYxAqbXNwnV8PwqVY,10982
@@ -81,7 +81,7 @@ junifer/data/coordinates/__init__.py,sha256=ffM8rwcHLgHAWixJbKrATrbUKzX940V1UF6R
81
81
  junifer/data/coordinates/__init__.pyi,sha256=Z-Ti5XD3HigkZ8uYN6oYsLqw40-F1GvTVQ5QAy08Wng,88
82
82
  junifer/data/coordinates/_ants_coordinates_warper.py,sha256=5RWDC-nI3VG9lkSJ-_y_hlDtjPctKSJokQOp3v8ozwY,2956
83
83
  junifer/data/coordinates/_coordinates.py,sha256=fBXVvuTxYLTNBSrQiTCiQsxpT0SdbQze3DYuGGgz_mY,12501
84
- junifer/data/coordinates/_fsl_coordinates_warper.py,sha256=GI0SrkNyAuRsoRSxI5WNvQmtPXQ3MlXvPx9lrd3NYB4,2406
84
+ junifer/data/coordinates/_fsl_coordinates_warper.py,sha256=5h7rwiPMYBQlA3sMZUImcpnNLLWvIp2-bAEaaHtzX9c,2409
85
85
  junifer/data/coordinates/VOIs/meta/AutobiographicalMemory_VOIs.txt,sha256=9af38naeL18Tlt_gy_ep6vyTAxOB336JYjbo5FvP8PQ,686
86
86
  junifer/data/coordinates/VOIs/meta/CogAC_VOIs.txt,sha256=Sr5_E712OLdeQRyUcDNM0wLBvZIyO6gc9Q7KkyJHX1A,398
87
87
  junifer/data/coordinates/VOIs/meta/CogAR_VOIs.txt,sha256=t3NLwEVUZTPP34p15SaB3UInLrQyK-7Qc4iLBuQlZu8,189
@@ -104,8 +104,8 @@ junifer/data/coordinates/VOIs/meta/extDMN_VOIs.txt,sha256=Ogx1QvqZcnXDM3ncF2ha78
104
104
  junifer/data/coordinates/tests/test_coordinates.py,sha256=_c2P4oaDGpsmui5gJBe_jN6HLGiKxONkYPR69sRBUlU,4219
105
105
  junifer/data/masks/__init__.py,sha256=eEEhHglyVEx1LrqwXjq3cOmjf4sTsgBstRx5-k7zIQU,180
106
106
  junifer/data/masks/__init__.pyi,sha256=lcgr8gmWDPibC4RxnWBXb8DDpIkO73Aax09u6VXiJJI,114
107
- junifer/data/masks/_ants_mask_warper.py,sha256=yGjC-b6Ui-MpPG3FpRnI8pEAxjMUfSSuUGVIeazjN7I,5078
108
- junifer/data/masks/_fsl_mask_warper.py,sha256=_7UkX3-wFXQs4KwxopO-QjMyB6aeq1GAkiGSGpG-OzM,2412
107
+ junifer/data/masks/_ants_mask_warper.py,sha256=6ex2jxxKI5yA4G1rebSpcAYGGisflVK-DwhtUtWY964,5348
108
+ junifer/data/masks/_fsl_mask_warper.py,sha256=VApp-ofGBKePNmCdgTg1HoEA66lMQiAPT0ihkhB2ezY,2415
109
109
  junifer/data/masks/_masks.py,sha256=96NKsSSosD6r03Jb2N1xQoyOc2Vl5miokcQdSeuM6SY,20729
110
110
  junifer/data/masks/tests/test_masks.py,sha256=1Zm09ZSdUlR278DTCZeVuxuQntryefsnYYPP02MttVE,16120
111
111
  junifer/data/masks/ukb/UKB_15K_GM_template.nii.gz,sha256=jcX1pDOrDsoph8cPMNFVKH5gZYio5G4rJNpOFXm9wJI,946636
@@ -114,8 +114,8 @@ junifer/data/masks/vickery-patil/CAT12_IXI555_MNI152_TMP_GS_GMprob0.2_clean_3mm.
114
114
  junifer/data/masks/vickery-patil/GMprob0.2_cortex_3mm_NA_rm.nii.gz,sha256=jfMe_4H9XEnArYms5bSQbqS2V1_HbLHTfI5amQa_Pes,8700
115
115
  junifer/data/parcellations/__init__.py,sha256=6-Ysil3NyZ69V6rWx4RO15_d-iDKizfbHuxSjsHNt24,188
116
116
  junifer/data/parcellations/__init__.pyi,sha256=lhBHTbMDizzqUqVHrx2eyfPFodrTBgMFeTgxfESSkQ8,140
117
- junifer/data/parcellations/_ants_parcellation_warper.py,sha256=UBjO9W8jWcM8GK80pbIzORir60ZFAhLTttGtaaDNT2g,5530
118
- junifer/data/parcellations/_fsl_parcellation_warper.py,sha256=pUsLbR34Ry3e_0_5KxngI-jU06YmXTU795k-SjJHmig,2676
117
+ junifer/data/parcellations/_ants_parcellation_warper.py,sha256=4CYieBer6ow4i8o4NjKsfufc96XdtsMGwfBbMF-Kw78,5802
118
+ junifer/data/parcellations/_fsl_parcellation_warper.py,sha256=JfJ022flg5OR48P4OAALVHHQgTVxdMBXT-fAqBl3nUM,2679
119
119
  junifer/data/parcellations/_parcellations.py,sha256=uOqoucoynv--iEftrhdnOd3jBcqq9PSDgs9DYhbeN24,65611
120
120
  junifer/data/parcellations/tests/test_parcellations.py,sha256=crluGgUjocVZ0ZIkMpUVol27A-Px6oc2eflY5g0C4BY,38315
121
121
  junifer/data/tests/test_data_utils.py,sha256=136iGPjGecCxyqgUwU8VZMHoE6imcYJ0WNC32PDGK4g,1063
@@ -128,7 +128,7 @@ junifer/datagrabber/dmcc13_benchmark.py,sha256=VMyiwvkr4qSvzBICSksPPKOI2w_WVo06H
128
128
  junifer/datagrabber/multiple.py,sha256=4tCOzojs3hoG7daHJJ7HUsx15atWR5nTmyP0S0__aig,6666
129
129
  junifer/datagrabber/pattern.py,sha256=UwJQ0MObBIS6eHH9FfoM_sBYuNM9n5NAX7DA0HdtL1A,18709
130
130
  junifer/datagrabber/pattern_datalad.py,sha256=QPWXIToYHDU4mvm9lz_hy8BjdqqoCXiGiJKCcATrT-w,4568
131
- junifer/datagrabber/pattern_validation_mixin.py,sha256=MlcQIDyPHtqPcq1eHkwvrp-m5MhZaxTG1l2j3JM6FOc,19236
131
+ junifer/datagrabber/pattern_validation_mixin.py,sha256=6IlL5EMbr-XEtiiXs_buD3DJkujjs335BmAgAiWGZ3M,19369
132
132
  junifer/datagrabber/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
133
  junifer/datagrabber/aomic/__init__.py,sha256=ATxzXq9NBPmWowTMuL77zqrmIbbnk0Wd1iXtXCP3XDg,266
134
134
  junifer/datagrabber/aomic/__init__.pyi,sha256=Rp6C075fZDdKY8VIq508_g4NhVj8bWzR6zb9yln761Q,189
@@ -268,7 +268,7 @@ junifer/pipeline/pipeline_step_mixin.py,sha256=oXfJh27yifHs1V3V_tMPCanRiHX1ggOVI
268
268
  junifer/pipeline/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
269
269
  junifer/pipeline/update_meta_mixin.py,sha256=yzGCx8AUbc9mMnWKRu4qaIXTBBSIxtNlGH5zIQIUvzM,1812
270
270
  junifer/pipeline/utils.py,sha256=27KYbUS6t1kb3vP_C5BoRBFfKPzfUKQK8Ut-aBERshk,10285
271
- junifer/pipeline/workdir_manager.py,sha256=T7-sZY_Gj0SM7p9N1ATjUFK2T-6CYIMQeYwHpBz96Gs,8616
271
+ junifer/pipeline/workdir_manager.py,sha256=r5hhizktLat2bN_A-ZGeeBVWmpRUkUCiZeIDxG-9umM,8624
272
272
  junifer/pipeline/tests/test_marker_collection.py,sha256=edBHfmwMTXG_q0ZagApbAbkFNoegi3hVEQiNcBtZOKc,6959
273
273
  junifer/pipeline/tests/test_pipeline_component_registry.py,sha256=mrbz285K_TzSILRn9X-AyzcNXuPRHGBZY6dQiq5_9So,5776
274
274
  junifer/pipeline/tests/test_pipeline_step_mixin.py,sha256=KCdhFdThm9TGkUvhGzQF3zR9SoZ9ont1z8yZELB2TtQ,7752
@@ -294,8 +294,8 @@ junifer/preprocess/smoothing/tests/test_smoothing.py,sha256=t1j3zEvJk5XLO4fzcb-w
294
294
  junifer/preprocess/tests/test_preprocess_base.py,sha256=-0rpe8QjqYES36H6MHuDs3cv_6upHBdVHnFMgQsmEX4,2571
295
295
  junifer/preprocess/warping/__init__.py,sha256=rzUUP7-6H_nygQ7a7TBZ4_RY7p0ELacosYsWQbSdVZk,214
296
296
  junifer/preprocess/warping/__init__.pyi,sha256=Drbqp8N3uprvXcKSxqdfj90fesz9XYVLgivhPnKAYcc,65
297
- junifer/preprocess/warping/_ants_warper.py,sha256=oJrTW_YG-VJ-piq_L1CX5fEoERyRtsMpFEQQ-0fUFMg,6502
298
- junifer/preprocess/warping/_fsl_warper.py,sha256=IV_vkn3TGDPWM_N-hEQv1YC4LYMTfZfDmuYu5MW_TQ8,3798
297
+ junifer/preprocess/warping/_ants_warper.py,sha256=BHfweLDtq3J8NmgUFvA7bfWIN4kDvo0RiB1fNDJ71qw,6502
298
+ junifer/preprocess/warping/_fsl_warper.py,sha256=yilHysV9t9bkBDK_eQzjROzlwhXStVzflCaEkxkwjlY,3798
299
299
  junifer/preprocess/warping/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
300
300
  junifer/preprocess/warping/space_warper.py,sha256=mf7SDu574R3TXNt82fqGl_hcEYx7SjXwz2TcmWObHQA,7706
301
301
  junifer/preprocess/warping/tests/test_space_warper.py,sha256=amFHtt-q7L7v9uL4cOvrmHEbUOGDhmoMHkLnKJ0dF7A,5543
@@ -341,10 +341,10 @@ junifer/utils/tests/test_config.py,sha256=7ltIXuwb_W4Mv_1dxQWyiyM10XgUAfsWKV6D_i
341
341
  junifer/utils/tests/test_fs.py,sha256=WQS7cKlKEZ742CIuiOYYpueeAhY9PqlastfDVpVVtvE,923
342
342
  junifer/utils/tests/test_helpers.py,sha256=k5qqfxK8dFyuewTJyR1Qn6-nFaYNuVr0ysc18bfPjyU,929
343
343
  junifer/utils/tests/test_logging.py,sha256=duO4ou365hxwa_kwihFtKPLaL6LC5XHiyhOijrrngbA,8009
344
- junifer-0.0.6.dev285.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
345
- junifer-0.0.6.dev285.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
346
- junifer-0.0.6.dev285.dist-info/METADATA,sha256=fplMcovyUZPFi6ONcaA66A1mhJkxK4a3948mXRfW328,8429
347
- junifer-0.0.6.dev285.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
348
- junifer-0.0.6.dev285.dist-info/entry_points.txt,sha256=6O8ru0BP-SP7YMUZiizFNoaZ2HvJpadO2G7nKk4PwjI,48
349
- junifer-0.0.6.dev285.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
350
- junifer-0.0.6.dev285.dist-info/RECORD,,
344
+ junifer-0.0.6.dev302.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
345
+ junifer-0.0.6.dev302.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
346
+ junifer-0.0.6.dev302.dist-info/METADATA,sha256=-xzY1LfIMeHg8ism1hOUBXsfcyjaW58Mu1VuATPtKXY,8429
347
+ junifer-0.0.6.dev302.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
348
+ junifer-0.0.6.dev302.dist-info/entry_points.txt,sha256=6O8ru0BP-SP7YMUZiizFNoaZ2HvJpadO2G7nKk4PwjI,48
349
+ junifer-0.0.6.dev302.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
350
+ junifer-0.0.6.dev302.dist-info/RECORD,,