junifer 0.0.4.dev733__py3-none-any.whl → 0.0.4.dev782__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/tests/data/partly_cloudy_agg_mean_tian.yml +16 -0
- junifer/api/tests/test_cli.py +7 -13
- junifer/api/tests/test_functions.py +156 -102
- junifer/data/coordinates.py +1 -1
- junifer/data/masks.py +213 -54
- junifer/data/parcellations.py +91 -42
- junifer/data/template_spaces.py +33 -6
- junifer/data/tests/test_masks.py +127 -62
- junifer/data/tests/test_parcellations.py +66 -49
- junifer/data/tests/test_template_spaces.py +42 -7
- junifer/datagrabber/aomic/id1000.py +3 -0
- junifer/datagrabber/aomic/piop1.py +3 -0
- junifer/datagrabber/aomic/piop2.py +3 -0
- junifer/datagrabber/dmcc13_benchmark.py +3 -0
- junifer/datagrabber/hcp1200/hcp1200.py +3 -0
- junifer/markers/falff/tests/test_falff_parcels.py +3 -3
- junifer/markers/falff/tests/test_falff_spheres.py +3 -3
- junifer/markers/functional_connectivity/tests/test_crossparcellation_functional_connectivity.py +46 -45
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_parcels.py +34 -41
- junifer/markers/functional_connectivity/tests/test_edge_functional_connectivity_spheres.py +40 -56
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_parcels.py +62 -74
- junifer/markers/functional_connectivity/tests/test_functional_connectivity_spheres.py +99 -89
- junifer/markers/reho/tests/test_reho_parcels.py +17 -11
- junifer/markers/temporal_snr/tests/test_temporal_snr_parcels.py +38 -37
- junifer/markers/temporal_snr/tests/test_temporal_snr_spheres.py +34 -38
- junifer/markers/tests/test_collection.py +38 -37
- junifer/markers/tests/test_ets_rss.py +29 -41
- junifer/markers/tests/test_parcel_aggregation.py +600 -511
- junifer/markers/tests/test_sphere_aggregation.py +209 -163
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/METADATA +1 -1
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/RECORD +37 -36
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/AUTHORS.rst +0 -0
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/LICENSE.md +0 -0
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/WHEEL +0 -0
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/entry_points.txt +0 -0
- {junifer-0.0.4.dev733.dist-info → junifer-0.0.4.dev782.dist-info}/top_level.txt +0 -0
@@ -8,52 +8,47 @@
|
|
8
8
|
|
9
9
|
from pathlib import Path
|
10
10
|
|
11
|
-
from nilearn import image
|
12
11
|
from nilearn.maskers import NiftiLabelsMasker
|
13
12
|
|
14
|
-
from junifer.data import
|
13
|
+
from junifer.data import get_parcellation
|
14
|
+
from junifer.datareader import DefaultDataReader
|
15
15
|
from junifer.markers.ets_rss import RSSETSMarker
|
16
16
|
from junifer.storage import SQLiteFeatureStorage
|
17
|
-
from junifer.testing.datagrabbers import
|
17
|
+
from junifer.testing.datagrabbers import PartlyCloudyTestingDataGrabber
|
18
18
|
|
19
19
|
|
20
20
|
# Set parcellation
|
21
|
-
PARCELLATION = "
|
21
|
+
PARCELLATION = "TianxS1x3TxMNInonlinear2009cAsym"
|
22
22
|
|
23
23
|
|
24
24
|
def test_compute() -> None:
|
25
25
|
"""Test RSS ETS compute()."""
|
26
|
-
with
|
27
|
-
|
28
|
-
out = dg["sub001"]
|
29
|
-
# Load BOLD image
|
30
|
-
niimg = image.load_img(str(out["BOLD"]["path"].absolute()))
|
31
|
-
# Create input data
|
32
|
-
input_dict = {
|
33
|
-
"data": niimg,
|
34
|
-
"path": out["BOLD"]["path"],
|
35
|
-
"space": "MNI",
|
36
|
-
}
|
26
|
+
with PartlyCloudyTestingDataGrabber() as dg:
|
27
|
+
element_data = DefaultDataReader().fit_transform(dg["sub-01"])
|
37
28
|
# Compute the RSSETSMarker
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
#
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
29
|
+
marker = RSSETSMarker(parcellation=PARCELLATION)
|
30
|
+
rss_ets = marker.compute(element_data["BOLD"])
|
31
|
+
|
32
|
+
# Compare with nilearn
|
33
|
+
# Load testing parcellation
|
34
|
+
test_parcellation, _ = get_parcellation(
|
35
|
+
parcellation=[PARCELLATION],
|
36
|
+
target_data=element_data["BOLD"],
|
37
|
+
)
|
38
|
+
# Extract timeseries
|
39
|
+
nifti_labels_masker = NiftiLabelsMasker(labels_img=test_parcellation)
|
40
|
+
extacted_timeseries = nifti_labels_masker.fit_transform(
|
41
|
+
element_data["BOLD"]["data"]
|
42
|
+
)
|
46
43
|
# Assert the dimension of timeseries
|
47
|
-
|
48
|
-
assert n_time == len(new_out["data"])
|
44
|
+
assert extacted_timeseries.shape[0] == len(rss_ets["data"])
|
49
45
|
|
50
46
|
|
51
47
|
def test_get_output_type() -> None:
|
52
48
|
"""Test RSS ETS get_output_type()."""
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
assert output == "timeseries"
|
49
|
+
assert "timeseries" == RSSETSMarker(
|
50
|
+
parcellation=PARCELLATION
|
51
|
+
).get_output_type("BOLD")
|
57
52
|
|
58
53
|
|
59
54
|
def test_store(tmp_path: Path) -> None:
|
@@ -65,20 +60,13 @@ def test_store(tmp_path: Path) -> None:
|
|
65
60
|
The path to the test directory.
|
66
61
|
|
67
62
|
"""
|
68
|
-
with
|
69
|
-
|
70
|
-
elem = dg["sub001"]
|
71
|
-
# Load BOLD image
|
72
|
-
niimg = image.load_img(str(elem["BOLD"]["path"].absolute()))
|
73
|
-
elem["BOLD"]["data"] = niimg
|
63
|
+
with PartlyCloudyTestingDataGrabber() as dg:
|
64
|
+
element_data = DefaultDataReader().fit_transform(dg["sub-01"])
|
74
65
|
# Compute the RSSETSMarker
|
75
|
-
|
66
|
+
marker = RSSETSMarker(parcellation=PARCELLATION)
|
76
67
|
# Create storage
|
77
|
-
storage = SQLiteFeatureStorage(
|
78
|
-
uri=str((tmp_path / "test.sqlite").absolute())
|
79
|
-
)
|
68
|
+
storage = SQLiteFeatureStorage(tmp_path / "test_rss_ets.sqlite")
|
80
69
|
# Store
|
81
|
-
|
82
|
-
|
70
|
+
marker.fit_transform(input=element_data, storage=storage)
|
83
71
|
features = storage.list_features()
|
84
72
|
assert any(x["name"] == "BOLD_RSSETSMarker" for x in features.values())
|