Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH]: Allow BOLDWarper to warp between MNI spaces #302

Merged
merged 10 commits into from
Feb 21, 2024
Prev Previous commit
Next Next commit
update: improve test in test_bold_warper.py
  • Loading branch information
synchon committed Feb 21, 2024
commit 5a4bf8c397181f8fbe083ff5f37c346c9542e3c9
16 changes: 4 additions & 12 deletions junifer/preprocess/tests/test_bold_warper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import TYPE_CHECKING, List, Tuple

import pytest
from numpy.testing import assert_array_equal, assert_raises

from junifer.datagrabber import DataladHCP1200, DMCC13Benchmark
from junifer.datareader import DefaultDataReader
Expand Down Expand Up @@ -135,18 +136,6 @@ def test_BOLDWarper_preprocess_to_native(
("f9057kp", "wave1bas", "Rest", "AP", "1"),
"MNI152NLin6Asym",
],
[
DMCC13Benchmark(
types=["BOLD"],
sessions=["wave1bas"],
tasks=["Rest"],
phase_encodings=["AP"],
runs=["1"],
native_t1w=False,
),
("f9057kp", "wave1bas", "Rest", "AP", "1"),
"MNI152NLin2009cAsym",
],
],
)
@pytest.mark.skipif(
Expand All @@ -170,6 +159,7 @@ def test_BOLDWarper_preprocess_to_multi_mni(
with datagrabber as dg:
# Read data
element_data = DefaultDataReader().fit_transform(dg[element])
synchon marked this conversation as resolved.
Show resolved Hide resolved
pre_xfm_data = element_data["BOLD"]["data"].get_fdata().copy()
# Preprocess data
data_type, data = BOLDWarper(reference=space).preprocess(
input=element_data["BOLD"],
Expand All @@ -178,3 +168,5 @@ def test_BOLDWarper_preprocess_to_multi_mni(
assert data_type == "BOLD"
assert isinstance(data, dict)
assert data["space"] == space
with assert_raises(AssertionError):
assert_array_equal(pre_xfm_data, data["data"])
Loading