junifer 0.0.6.dev349__py3-none-any.whl → 0.0.6.dev366__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/data/masks/_masks.py +26 -19
- junifer/data/parcellations/_parcellations.py +56 -39
- junifer/data/parcellations/tests/test_parcellations.py +45 -19
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/METADATA +1 -1
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/RECORD +11 -11
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/AUTHORS.rst +0 -0
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/LICENSE.md +0 -0
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/WHEEL +0 -0
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/entry_points.txt +0 -0
- {junifer-0.0.6.dev349.dist-info → junifer-0.0.6.dev366.dist-info}/top_level.txt +0 -0
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.
|
16
|
-
__version_tuple__ = version_tuple = (0, 0, 6, '
|
15
|
+
__version__ = version = '0.0.6.dev366'
|
16
|
+
__version_tuple__ = version_tuple = (0, 0, 6, 'dev366')
|
junifer/data/masks/_masks.py
CHANGED
@@ -14,8 +14,8 @@ from typing import (
|
|
14
14
|
)
|
15
15
|
|
16
16
|
import nibabel as nib
|
17
|
+
import nilearn.image as nimg
|
17
18
|
import numpy as np
|
18
|
-
from nilearn.image import get_data, new_img_like, resample_to_img
|
19
19
|
from nilearn.masking import (
|
20
20
|
compute_background_mask,
|
21
21
|
compute_epi_mask,
|
@@ -168,14 +168,14 @@ def compute_brain_mask(
|
|
168
168
|
)
|
169
169
|
# Resample template to target image
|
170
170
|
else:
|
171
|
-
resampled_template = resample_to_img(
|
171
|
+
resampled_template = nimg.resample_to_img(
|
172
172
|
source_img=template, target_img=target_data["data"]
|
173
173
|
)
|
174
174
|
|
175
175
|
# Threshold resampled template and get mask
|
176
|
-
mask = (get_data(resampled_template) >= threshold).astype("int8")
|
176
|
+
mask = (nimg.get_data(resampled_template) >= threshold).astype("int8")
|
177
177
|
|
178
|
-
return new_img_like(target_data["data"], mask) # type: ignore
|
178
|
+
return nimg.new_img_like(target_data["data"], mask) # type: ignore
|
179
179
|
|
180
180
|
|
181
181
|
class MaskRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
@@ -523,7 +523,7 @@ class MaskRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
523
523
|
)
|
524
524
|
logger.debug("Resampling inherited mask to target image.")
|
525
525
|
# Resample inherited mask to target image
|
526
|
-
mask_img = resample_to_img(
|
526
|
+
mask_img = nimg.resample_to_img(
|
527
527
|
source_img=mask_img,
|
528
528
|
target_img=target_data["data"],
|
529
529
|
)
|
@@ -568,34 +568,41 @@ class MaskRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
568
568
|
"mask."
|
569
569
|
)
|
570
570
|
|
571
|
+
# Set here to simplify things later
|
572
|
+
mask_img: nib.nifti1.Nifti1Image = mask_object
|
573
|
+
|
571
574
|
# Resample and warp mask to standard space
|
572
575
|
if mask_space != target_std_space:
|
573
576
|
logger.debug(
|
574
577
|
f"Warping {t_mask} to {target_std_space} space "
|
575
|
-
"using
|
578
|
+
"using ANTs."
|
576
579
|
)
|
577
580
|
mask_img = ANTsMaskWarper().warp(
|
578
581
|
mask_name=mask_name,
|
579
|
-
mask_img=
|
582
|
+
mask_img=mask_img,
|
580
583
|
src=mask_space,
|
581
584
|
dst=target_std_space,
|
582
585
|
target_data=target_data,
|
583
586
|
warp_data=warper_spec,
|
584
587
|
)
|
588
|
+
# Remove extra dimension added by ANTs
|
589
|
+
mask_img = nimg.math_img(
|
590
|
+
"np.squeeze(img)", img=mask_img
|
591
|
+
)
|
585
592
|
|
586
|
-
|
587
|
-
#
|
593
|
+
if target_space != "native":
|
594
|
+
# No warping is going to happen, just resampling,
|
595
|
+
# because we are in the correct space
|
588
596
|
logger.debug(f"Resampling {t_mask} to target image.")
|
589
|
-
|
590
|
-
mask_img
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
#
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
if target_space == "native":
|
597
|
+
mask_img = nimg.resample_to_img(
|
598
|
+
source_img=mask_img,
|
599
|
+
target_img=target_img,
|
600
|
+
)
|
601
|
+
else:
|
602
|
+
# Warp mask if target space is native as
|
603
|
+
# either the image is in the right non-native space or
|
604
|
+
# it's warped from one non-native space to another
|
605
|
+
# non-native space
|
599
606
|
logger.debug(
|
600
607
|
"Warping mask to native space using "
|
601
608
|
f"{warper_spec['warper']}."
|
@@ -16,9 +16,10 @@ from typing import TYPE_CHECKING, Any, Optional, Union
|
|
16
16
|
|
17
17
|
import httpx
|
18
18
|
import nibabel as nib
|
19
|
+
import nilearn.image as nimg
|
19
20
|
import numpy as np
|
20
21
|
import pandas as pd
|
21
|
-
from nilearn import datasets
|
22
|
+
from nilearn import datasets
|
22
23
|
|
23
24
|
from ...utils import logger, raise_error, warn_with_log
|
24
25
|
from ...utils.singleton import Singleton
|
@@ -269,6 +270,7 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
269
270
|
def load(
|
270
271
|
self,
|
271
272
|
name: str,
|
273
|
+
target_space: str,
|
272
274
|
parcellations_dir: Union[str, Path, None] = None,
|
273
275
|
resolution: Optional[float] = None,
|
274
276
|
path_only: bool = False,
|
@@ -282,6 +284,8 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
282
284
|
----------
|
283
285
|
name : str
|
284
286
|
The name of the parcellation.
|
287
|
+
target_space : str
|
288
|
+
The desired space of the parcellation.
|
285
289
|
parcellations_dir : str or pathlib.Path, optional
|
286
290
|
Path where the parcellations files are stored. The default location
|
287
291
|
is "$HOME/junifer/data/parcellations" (default None).
|
@@ -328,6 +332,14 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
328
332
|
else:
|
329
333
|
space = parcellation_definition["space"]
|
330
334
|
|
335
|
+
# Check and get highest resolution
|
336
|
+
if space != target_space:
|
337
|
+
logger.info(
|
338
|
+
f"Parcellation will be warped from {space} to {target_space} "
|
339
|
+
"using highest resolution"
|
340
|
+
)
|
341
|
+
resolution = None
|
342
|
+
|
331
343
|
# Check if the parcellation family is custom or built-in
|
332
344
|
if t_family == "CustomUserParcellation":
|
333
345
|
parcellation_fname = Path(parcellation_definition["path"])
|
@@ -441,13 +453,14 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
441
453
|
img, labels, _, space = self.load(
|
442
454
|
name=name,
|
443
455
|
resolution=resolution,
|
456
|
+
target_space=target_space,
|
444
457
|
)
|
445
458
|
|
446
459
|
# Convert parcellation spaces if required;
|
447
460
|
# cannot be "native" due to earlier check
|
448
461
|
if space != target_std_space:
|
449
462
|
logger.debug(
|
450
|
-
f"Warping {name} to {target_std_space} space using
|
463
|
+
f"Warping {name} to {target_std_space} space using ANTs."
|
451
464
|
)
|
452
465
|
raw_img = ANTsParcellationWarper().warp(
|
453
466
|
parcellation_name=name,
|
@@ -458,18 +471,46 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
458
471
|
warp_data=None,
|
459
472
|
)
|
460
473
|
# Remove extra dimension added by ANTs
|
461
|
-
img =
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
474
|
+
img = nimg.math_img("np.squeeze(img)", img=raw_img)
|
475
|
+
|
476
|
+
if target_space != "native":
|
477
|
+
# No warping is going to happen, just resampling, because
|
478
|
+
# we are in the correct space
|
479
|
+
logger.debug(f"Resampling {name} to target image.")
|
480
|
+
# Resample parcellation to target image
|
481
|
+
img = nimg.resample_to_img(
|
482
|
+
source_img=img,
|
483
|
+
target_img=target_img,
|
484
|
+
interpolation="nearest",
|
485
|
+
copy=True,
|
486
|
+
)
|
487
|
+
else:
|
488
|
+
# Warp parcellation if target space is native as either
|
489
|
+
# the image is in the right non-native space or it's
|
490
|
+
# warped from one non-native space to another non-native space
|
491
|
+
logger.debug(
|
492
|
+
"Warping parcellation to native space using "
|
493
|
+
f"{warper_spec['warper']}."
|
494
|
+
)
|
495
|
+
# extra_input check done earlier and warper_spec exists
|
496
|
+
if warper_spec["warper"] == "fsl":
|
497
|
+
img = FSLParcellationWarper().warp(
|
498
|
+
parcellation_name="native",
|
499
|
+
parcellation_img=img,
|
500
|
+
target_data=target_data,
|
501
|
+
warp_data=warper_spec,
|
502
|
+
)
|
503
|
+
elif warper_spec["warper"] == "ants":
|
504
|
+
img = ANTsParcellationWarper().warp(
|
505
|
+
parcellation_name="native",
|
506
|
+
parcellation_img=img,
|
507
|
+
src="",
|
508
|
+
dst="native",
|
509
|
+
target_data=target_data,
|
510
|
+
warp_data=warper_spec,
|
511
|
+
)
|
471
512
|
|
472
|
-
all_parcellations.append(
|
513
|
+
all_parcellations.append(img)
|
473
514
|
all_labels.append(labels)
|
474
515
|
|
475
516
|
# Avoid merging if there is only one parcellation
|
@@ -485,30 +526,6 @@ class ParcellationRegistry(BasePipelineDataRegistry, metaclass=Singleton):
|
|
485
526
|
labels_lists=all_labels,
|
486
527
|
)
|
487
528
|
|
488
|
-
# Warp parcellation if target space is native
|
489
|
-
if target_space == "native":
|
490
|
-
logger.debug(
|
491
|
-
"Warping parcellation to native space using "
|
492
|
-
f"{warper_spec['warper']}."
|
493
|
-
)
|
494
|
-
# extra_input check done earlier and warper_spec exists
|
495
|
-
if warper_spec["warper"] == "fsl":
|
496
|
-
resampled_parcellation_img = FSLParcellationWarper().warp(
|
497
|
-
parcellation_name="native",
|
498
|
-
parcellation_img=resampled_parcellation_img,
|
499
|
-
target_data=target_data,
|
500
|
-
warp_data=warper_spec,
|
501
|
-
)
|
502
|
-
elif warper_spec["warper"] == "ants":
|
503
|
-
resampled_parcellation_img = ANTsParcellationWarper().warp(
|
504
|
-
parcellation_name="native",
|
505
|
-
parcellation_img=resampled_parcellation_img,
|
506
|
-
src="",
|
507
|
-
dst="native",
|
508
|
-
target_data=target_data,
|
509
|
-
warp_data=warper_spec,
|
510
|
-
)
|
511
|
-
|
512
529
|
return resampled_parcellation_img, labels
|
513
530
|
|
514
531
|
|
@@ -1786,7 +1803,7 @@ def merge_parcellations(
|
|
1786
1803
|
"The parcellations have different resolutions!"
|
1787
1804
|
"Resampling all parcellations to the first one in the list."
|
1788
1805
|
)
|
1789
|
-
t_parc =
|
1806
|
+
t_parc = nimg.resample_to_img(
|
1790
1807
|
t_parc, ref_parc, interpolation="nearest", copy=True
|
1791
1808
|
)
|
1792
1809
|
|
@@ -1812,6 +1829,6 @@ def merge_parcellations(
|
|
1812
1829
|
"parcellation that was first in the list."
|
1813
1830
|
)
|
1814
1831
|
|
1815
|
-
parcellation_img_res =
|
1832
|
+
parcellation_img_res = nimg.new_img_like(parcellations_list[0], parc_data)
|
1816
1833
|
|
1817
1834
|
return parcellation_img_res, labels
|
@@ -60,7 +60,9 @@ def test_register_already_registered() -> None:
|
|
60
60
|
space="MNI152Lin",
|
61
61
|
)
|
62
62
|
assert (
|
63
|
-
ParcellationRegistry()
|
63
|
+
ParcellationRegistry()
|
64
|
+
.load("testparc", target_space="MNI152Lin", path_only=True)[2]
|
65
|
+
.name
|
64
66
|
== "testparc.nii.gz"
|
65
67
|
)
|
66
68
|
|
@@ -81,7 +83,9 @@ def test_register_already_registered() -> None:
|
|
81
83
|
)
|
82
84
|
|
83
85
|
assert (
|
84
|
-
ParcellationRegistry()
|
86
|
+
ParcellationRegistry()
|
87
|
+
.load("testparc", target_space="MNI152Lin", path_only=True)[2]
|
88
|
+
.name
|
85
89
|
== "testparc2.nii.gz"
|
86
90
|
)
|
87
91
|
|
@@ -96,7 +100,8 @@ def test_parcellation_wrong_labels_values(tmp_path: Path) -> None:
|
|
96
100
|
|
97
101
|
"""
|
98
102
|
schaefer, labels, schaefer_path, _ = ParcellationRegistry().load(
|
99
|
-
"Schaefer100x7"
|
103
|
+
"Schaefer100x7",
|
104
|
+
"MNI152NLin6Asym",
|
100
105
|
)
|
101
106
|
assert schaefer is not None
|
102
107
|
|
@@ -106,7 +111,7 @@ def test_parcellation_wrong_labels_values(tmp_path: Path) -> None:
|
|
106
111
|
)
|
107
112
|
|
108
113
|
with pytest.raises(ValueError, match=r"has 100 parcels but 10"):
|
109
|
-
ParcellationRegistry().load("WrongLabels")
|
114
|
+
ParcellationRegistry().load("WrongLabels", "MNI152NLin6Asym")
|
110
115
|
|
111
116
|
# Test wrong number of labels
|
112
117
|
ParcellationRegistry().register(
|
@@ -114,7 +119,7 @@ def test_parcellation_wrong_labels_values(tmp_path: Path) -> None:
|
|
114
119
|
)
|
115
120
|
|
116
121
|
with pytest.raises(ValueError, match=r"has 100 parcels but 101"):
|
117
|
-
ParcellationRegistry().load("WrongLabels2")
|
122
|
+
ParcellationRegistry().load("WrongLabels2", "MNI152NLin6Asym")
|
118
123
|
|
119
124
|
schaefer_data = schaefer.get_fdata().copy()
|
120
125
|
schaefer_data[schaefer_data == 50] = 0
|
@@ -126,7 +131,7 @@ def test_parcellation_wrong_labels_values(tmp_path: Path) -> None:
|
|
126
131
|
"WrongValues", new_schaefer_path, labels[:-1], "MNI152Lin"
|
127
132
|
)
|
128
133
|
with pytest.raises(ValueError, match=r"must have all the values in the"):
|
129
|
-
ParcellationRegistry().load("WrongValues")
|
134
|
+
ParcellationRegistry().load("WrongValues", "MNI152NLin6Asym")
|
130
135
|
|
131
136
|
schaefer_data = schaefer.get_fdata().copy()
|
132
137
|
schaefer_data[schaefer_data == 50] = 200
|
@@ -138,7 +143,7 @@ def test_parcellation_wrong_labels_values(tmp_path: Path) -> None:
|
|
138
143
|
"WrongValues2", new_schaefer_path, labels, "MNI152Lin"
|
139
144
|
)
|
140
145
|
with pytest.raises(ValueError, match=r"must have all the values in the"):
|
141
|
-
ParcellationRegistry().load("WrongValues2")
|
146
|
+
ParcellationRegistry().load("WrongValues2", "MNI152NLin6Asym")
|
142
147
|
|
143
148
|
|
144
149
|
@pytest.mark.parametrize(
|
@@ -202,7 +207,7 @@ def test_register(
|
|
202
207
|
assert name in ParcellationRegistry().list
|
203
208
|
# Load registered parcellation
|
204
209
|
_, lbl, fname, parcellation_space = ParcellationRegistry().load(
|
205
|
-
name=name, path_only=True
|
210
|
+
name=name, target_space=space, path_only=True
|
206
211
|
)
|
207
212
|
# Check values for registered parcellation
|
208
213
|
assert lbl == parcels_labels
|
@@ -239,7 +244,7 @@ def test_list_correct(parcellation_name: str) -> None:
|
|
239
244
|
def test_load_incorrect() -> None:
|
240
245
|
"""Test loading of invalid parcellations."""
|
241
246
|
with pytest.raises(ValueError, match=r"not found"):
|
242
|
-
ParcellationRegistry().load("wrongparcellation")
|
247
|
+
ParcellationRegistry().load("wrongparcellation", "MNI152NLin6Asym")
|
243
248
|
|
244
249
|
|
245
250
|
def test_retrieve_parcellation_incorrect() -> None:
|
@@ -323,6 +328,7 @@ def test_schaefer(
|
|
323
328
|
# Load parcellation
|
324
329
|
img, label, img_path, space = ParcellationRegistry().load(
|
325
330
|
name=parcellation_name,
|
331
|
+
target_space="MNI152NLin6Asym",
|
326
332
|
parcellations_dir=tmp_path,
|
327
333
|
resolution=resolution,
|
328
334
|
)
|
@@ -392,6 +398,7 @@ def test_suit(tmp_path: Path, space_key: str, space: str) -> None:
|
|
392
398
|
# Load parcellation
|
393
399
|
img, label, img_path, parcellation_space = ParcellationRegistry().load(
|
394
400
|
name=f"SUITx{space_key}",
|
401
|
+
target_space=space,
|
395
402
|
parcellations_dir=tmp_path,
|
396
403
|
)
|
397
404
|
assert img is not None
|
@@ -441,7 +448,9 @@ def test_tian_3T_6thgeneration(
|
|
441
448
|
assert "TianxS4x3TxMNI6thgeneration" in parcellations
|
442
449
|
# Load parcellation
|
443
450
|
img, lbl, fname, parcellation_space_1 = ParcellationRegistry().load(
|
444
|
-
name=f"TianxS{scale}x3TxMNI6thgeneration",
|
451
|
+
name=f"TianxS{scale}x3TxMNI6thgeneration",
|
452
|
+
parcellations_dir=tmp_path,
|
453
|
+
target_space="MNI152NLin2009cAsym",
|
445
454
|
)
|
446
455
|
fname1 = f"Tian_Subcortex_S{scale}_3T_1mm.nii.gz"
|
447
456
|
assert img is not None
|
@@ -452,6 +461,7 @@ def test_tian_3T_6thgeneration(
|
|
452
461
|
# Load parcellation
|
453
462
|
img, lbl, fname, parcellation_space_2 = ParcellationRegistry().load(
|
454
463
|
name=f"TianxS{scale}x3TxMNI6thgeneration",
|
464
|
+
target_space="MNI152NLin6Asym",
|
455
465
|
parcellations_dir=tmp_path,
|
456
466
|
resolution=2,
|
457
467
|
)
|
@@ -489,6 +499,7 @@ def test_tian_3T_nonlinear2009cAsym(
|
|
489
499
|
# Load parcellation
|
490
500
|
img, lbl, fname, space = ParcellationRegistry().load(
|
491
501
|
name=f"TianxS{scale}x3TxMNInonlinear2009cAsym",
|
502
|
+
target_space="MNI152NLin2009cAsym",
|
492
503
|
parcellations_dir=tmp_path,
|
493
504
|
)
|
494
505
|
fname1 = f"Tian_Subcortex_S{scale}_3T_2009cAsym.nii.gz"
|
@@ -524,7 +535,9 @@ def test_tian_7T_6thgeneration(
|
|
524
535
|
assert "TianxS4x7TxMNI6thgeneration" in parcellations
|
525
536
|
# Load parcellation
|
526
537
|
img, lbl, fname, space = ParcellationRegistry().load(
|
527
|
-
name=f"TianxS{scale}x7TxMNI6thgeneration",
|
538
|
+
name=f"TianxS{scale}x7TxMNI6thgeneration",
|
539
|
+
target_space="MNI152NLin6Asym",
|
540
|
+
parcellations_dir=tmp_path,
|
528
541
|
)
|
529
542
|
fname1 = f"Tian_Subcortex_S{scale}_7T.nii.gz"
|
530
543
|
assert img is not None
|
@@ -611,7 +624,9 @@ def test_aicha(tmp_path: Path, version: int) -> None:
|
|
611
624
|
assert f"AICHA_v{version}" in ParcellationRegistry().list
|
612
625
|
# Load parcellation
|
613
626
|
img, label, img_path, space = ParcellationRegistry().load(
|
614
|
-
name=f"AICHA_v{version}",
|
627
|
+
name=f"AICHA_v{version}",
|
628
|
+
target_space="IXI549Space",
|
629
|
+
parcellations_dir=tmp_path,
|
615
630
|
)
|
616
631
|
assert img is not None
|
617
632
|
assert img_path.name == "AICHA.nii"
|
@@ -680,6 +695,7 @@ def test_shen(
|
|
680
695
|
# Load parcellation
|
681
696
|
img, label, img_path, space = ParcellationRegistry().load(
|
682
697
|
name=f"Shen_{year}_{n_rois}",
|
698
|
+
target_space="MNI152NLin2009cAsym",
|
683
699
|
parcellations_dir=tmp_path,
|
684
700
|
resolution=resolution,
|
685
701
|
)
|
@@ -875,7 +891,8 @@ def test_yan(
|
|
875
891
|
)
|
876
892
|
# Load parcellation
|
877
893
|
img, label, img_path, space = ParcellationRegistry().load(
|
878
|
-
name=parcellation_name,
|
894
|
+
name=parcellation_name,
|
895
|
+
target_space="MNI152NLin6Asym",
|
879
896
|
parcellations_dir=tmp_path,
|
880
897
|
resolution=resolution,
|
881
898
|
)
|
@@ -1012,6 +1029,7 @@ def test_brainnetome(
|
|
1012
1029
|
# Load parcellation
|
1013
1030
|
img, label, img_path, space = ParcellationRegistry().load(
|
1014
1031
|
name=parcellation_name,
|
1032
|
+
target_space="MNI152NLin6Asym",
|
1015
1033
|
parcellations_dir=tmp_path,
|
1016
1034
|
resolution=resolution,
|
1017
1035
|
)
|
@@ -1044,10 +1062,11 @@ def test_merge_parcellations() -> None:
|
|
1044
1062
|
"""Test merging parcellations."""
|
1045
1063
|
# load some parcellations for testing
|
1046
1064
|
schaefer_parcellation, schaefer_labels, _, _ = ParcellationRegistry().load(
|
1047
|
-
"Schaefer100x17"
|
1065
|
+
"Schaefer100x17", target_space="MNI152NLin2009cAsym"
|
1048
1066
|
)
|
1049
1067
|
tian_parcellation, tian_labels, _, _ = ParcellationRegistry().load(
|
1050
|
-
"TianxS2x3TxMNInonlinear2009cAsym"
|
1068
|
+
"TianxS2x3TxMNInonlinear2009cAsym",
|
1069
|
+
target_space="MNI152NLin2009cAsym",
|
1051
1070
|
)
|
1052
1071
|
# prepare the list of the actual parcellations
|
1053
1072
|
parcellation_list = [schaefer_parcellation, tian_parcellation]
|
@@ -1079,7 +1098,9 @@ def test_merge_parcellations_3D_multiple_non_overlapping(
|
|
1079
1098
|
|
1080
1099
|
"""
|
1081
1100
|
# Get the testing parcellation
|
1082
|
-
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1101
|
+
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1102
|
+
"Schaefer100x7", target_space="MNI152NLin2009cAsym"
|
1103
|
+
)
|
1083
1104
|
|
1084
1105
|
assert parcellation is not None
|
1085
1106
|
|
@@ -1114,7 +1135,9 @@ def test_merge_parcellations_3D_multiple_overlapping() -> None:
|
|
1114
1135
|
"""Test merge_parcellations with multiple overlapping parcellations."""
|
1115
1136
|
|
1116
1137
|
# Get the testing parcellation
|
1117
|
-
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1138
|
+
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1139
|
+
"Schaefer100x7", target_space="MNI152NLin2009cAsym"
|
1140
|
+
)
|
1118
1141
|
|
1119
1142
|
assert parcellation is not None
|
1120
1143
|
|
@@ -1149,7 +1172,9 @@ def test_merge_parcellations_3D_multiple_duplicated_labels() -> None:
|
|
1149
1172
|
"""Test merge_parcellations with duplicated labels."""
|
1150
1173
|
|
1151
1174
|
# Get the testing parcellation
|
1152
|
-
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1175
|
+
parcellation, labels, _, _ = ParcellationRegistry().load(
|
1176
|
+
"Schaefer100x7", target_space="MNI152NLin2009cAsym"
|
1177
|
+
)
|
1153
1178
|
|
1154
1179
|
assert parcellation is not None
|
1155
1180
|
|
@@ -1198,6 +1223,7 @@ def test_get_single() -> None:
|
|
1198
1223
|
# Get raw parcellation
|
1199
1224
|
raw_parcellation, raw_labels, _, _ = ParcellationRegistry().load(
|
1200
1225
|
"TianxS1x3TxMNInonlinear2009cAsym",
|
1226
|
+
target_space="MNI152NLin2009cAsym",
|
1201
1227
|
resolution=1.5,
|
1202
1228
|
)
|
1203
1229
|
resampled_raw_parcellation = resample_to_img(
|
@@ -1240,7 +1266,7 @@ def test_get_multi_same_space() -> None:
|
|
1240
1266
|
]
|
1241
1267
|
for name in parcellations_names:
|
1242
1268
|
img, labels, _, _ = ParcellationRegistry().load(
|
1243
|
-
name=name, resolution=1.5
|
1269
|
+
name=name, target_space="MNI152NLin2009cAsym", resolution=1.5
|
1244
1270
|
)
|
1245
1271
|
# Resample raw parcellations
|
1246
1272
|
resampled_img = resample_to_img(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: junifer
|
3
|
-
Version: 0.0.6.
|
3
|
+
Version: 0.0.6.dev366
|
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,6 +1,6 @@
|
|
1
1
|
junifer/__init__.py,sha256=2McgH1yNue6Z1V26-uN_mfMjbTcx4CLhym-DMBl5xA4,266
|
2
2
|
junifer/__init__.pyi,sha256=SsTvgq2Dod6UqJN96GH1lCphH6hJQQurEJHGNhHjGUI,508
|
3
|
-
junifer/_version.py,sha256=
|
3
|
+
junifer/_version.py,sha256=t-3cRoRiLKJo00UFpf7tn_vToC9PLS2rVeH50rEhEGs,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
|
@@ -106,7 +106,7 @@ junifer/data/masks/__init__.py,sha256=eEEhHglyVEx1LrqwXjq3cOmjf4sTsgBstRx5-k7zIQ
|
|
106
106
|
junifer/data/masks/__init__.pyi,sha256=lcgr8gmWDPibC4RxnWBXb8DDpIkO73Aax09u6VXiJJI,114
|
107
107
|
junifer/data/masks/_ants_mask_warper.py,sha256=Mwgc2_ZMf28vS_-fviRvZnHyT7JoQ1cQLozo7nUZSyM,5350
|
108
108
|
junifer/data/masks/_fsl_mask_warper.py,sha256=VApp-ofGBKePNmCdgTg1HoEA66lMQiAPT0ihkhB2ezY,2415
|
109
|
-
junifer/data/masks/_masks.py,sha256=
|
109
|
+
junifer/data/masks/_masks.py,sha256=ZJ5kmZQCL854k0gwXQhsWnWVI2hzdDnz2O6kIe2Ih2A,26194
|
110
110
|
junifer/data/masks/tests/test_masks.py,sha256=W0bzRB5Bp-iGO44VtEmaf7BuT-joe_2tQI0lma5NQHA,16090
|
111
111
|
junifer/data/masks/ukb/UKB_15K_GM_template.nii.gz,sha256=jcX1pDOrDsoph8cPMNFVKH5gZYio5G4rJNpOFXm9wJI,946636
|
112
112
|
junifer/data/masks/vickery-patil/CAT12_IXI555_MNI152_TMP_GS_GMprob0.2_clean.nii.gz,sha256=j6EY8EtRnUuRxeKgD65Q6B0GPEPIALKDJEIje1TfnAU,88270
|
@@ -116,8 +116,8 @@ junifer/data/parcellations/__init__.py,sha256=6-Ysil3NyZ69V6rWx4RO15_d-iDKizfbHu
|
|
116
116
|
junifer/data/parcellations/__init__.pyi,sha256=lhBHTbMDizzqUqVHrx2eyfPFodrTBgMFeTgxfESSkQ8,140
|
117
117
|
junifer/data/parcellations/_ants_parcellation_warper.py,sha256=YUCJC0_wutGw7j_n9JRU3LCwm9Ttg5PIlJUgqejfRhs,5806
|
118
118
|
junifer/data/parcellations/_fsl_parcellation_warper.py,sha256=JfJ022flg5OR48P4OAALVHHQgTVxdMBXT-fAqBl3nUM,2679
|
119
|
-
junifer/data/parcellations/_parcellations.py,sha256=
|
120
|
-
junifer/data/parcellations/tests/test_parcellations.py,sha256=
|
119
|
+
junifer/data/parcellations/_parcellations.py,sha256=JUUglL0ZM_UKL5jTG1q-3x6Fd3CUO6Hl4YAGAUsGtmI,67019
|
120
|
+
junifer/data/parcellations/tests/test_parcellations.py,sha256=ESQI-KWsepmgKB2BWWWUxjkpjOWeIZhhlKxNuTsRPJg,39268
|
121
121
|
junifer/data/tests/test_data_utils.py,sha256=136iGPjGecCxyqgUwU8VZMHoE6imcYJ0WNC32PDGK4g,1063
|
122
122
|
junifer/data/tests/test_template_spaces.py,sha256=ZEicEcLqOJ-NpuBZ5SYh4yZ0xZRkhYHnYXiC_YSxjrY,3219
|
123
123
|
junifer/datagrabber/__init__.py,sha256=EHIK-lbjuvkt0V8ypFvLSt85OAAXSkaxBmVlCbNNz8M,323
|
@@ -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.
|
345
|
-
junifer-0.0.6.
|
346
|
-
junifer-0.0.6.
|
347
|
-
junifer-0.0.6.
|
348
|
-
junifer-0.0.6.
|
349
|
-
junifer-0.0.6.
|
350
|
-
junifer-0.0.6.
|
344
|
+
junifer-0.0.6.dev366.dist-info/AUTHORS.rst,sha256=rmULKpchpSol4ExWFdm-qu4fkpSZPYqIESVJBZtGb6E,163
|
345
|
+
junifer-0.0.6.dev366.dist-info/LICENSE.md,sha256=MqCnOBu8uXsEOzRZWh9EBVfVz-kE9NkXcLCrtGXo2yU,34354
|
346
|
+
junifer-0.0.6.dev366.dist-info/METADATA,sha256=1bnN5jpKnbFsIC94NMUL1xwIOpl-LhdAYQmDFrKNa3g,8429
|
347
|
+
junifer-0.0.6.dev366.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
348
|
+
junifer-0.0.6.dev366.dist-info/entry_points.txt,sha256=6O8ru0BP-SP7YMUZiizFNoaZ2HvJpadO2G7nKk4PwjI,48
|
349
|
+
junifer-0.0.6.dev366.dist-info/top_level.txt,sha256=4bAq1R2QFQ4b3hohjys2JBvxrl0GKk5LNFzYvz9VGcA,8
|
350
|
+
junifer-0.0.6.dev366.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|