forked from juaml/junifer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: added more tests for the RSSETSMarker
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
# Synchon Mandal <[email protected]> | ||
# License: AGPL | ||
|
||
from pathlib import Path | ||
|
||
from nilearn import image | ||
from nilearn.maskers import NiftiLabelsMasker | ||
|
||
|
@@ -14,7 +16,7 @@ | |
from junifer.testing.datagrabbers import SPMAuditoryTestingDatagrabber | ||
|
||
|
||
def test_RSSETS() -> None: | ||
def test_compute() -> None: | ||
"""Test RSS ETS.""" | ||
atlas = "Schaefer100x17" | ||
test_atlas, _, _ = load_atlas(atlas) | ||
|
@@ -37,3 +39,32 @@ def test_RSSETS() -> None: | |
assert meta["atlas"] == "Schaefer100x17" | ||
assert meta["aggregation_method"] == "mean" | ||
assert meta["class"] == "RSSETSMarker" | ||
|
||
|
||
def test_get_output_kind() -> None: | ||
""" Test get_output_kind.""" | ||
|
||
atlas = "Schaefer100x17" | ||
ets_rss_marker = RSSETSMarker(atlas=atlas) | ||
input_list = ["BOLD"] | ||
input_list = ets_rss_marker.get_output_kind(input_list) | ||
assert len(input_list) == 1 | ||
assert input_list[0] in ["timeseries"] | ||
|
||
|
||
def test_store(tmp_path: Path) -> None: | ||
"""Test store.""" | ||
|
||
atlas = "Schaefer100x17" | ||
with SPMAuditoryTestingDatagrabber() as dg: | ||
out = dg["sub001"] | ||
niimg = image.load_img(str(out["BOLD"]["path"].absolute())) | ||
input_dict = {"data": niimg, "path": out["BOLD"]["path"]} | ||
# Compute the RSSETSMarker | ||
ets_rss_marker = RSSETSMarker(atlas=atlas) | ||
new_out = ets_rss_marker.compute(input_dict) | ||
storage = { | ||
"kind": "SQLiteFeatureStorage", | ||
"uri": str((tmp_path / "test.db").absolute()) | ||
} | ||
ets_rss_marker.store("SQLiteFeatureStorage", new_out, storage) |