-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from oesteban/fix/fieldmap-reportlet
FIX: Cleanup annoying isolated dots in reportlets + new tests
- Loading branch information
Showing
7 changed files
with
41 additions
and
5 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 |
---|---|---|
|
@@ -107,3 +107,6 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# Mac OSX | ||
.DS_Store |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Test the fieldmap reportlets.""" | ||
from pathlib import Path | ||
import pytest | ||
from ..reportlets import FieldmapReportlet | ||
from ...utils.epimanip import epi_mask | ||
|
||
|
||
@pytest.mark.parametrize("mask", [True, False]) | ||
@pytest.mark.parametrize("apply_mask", [True, False]) | ||
def test_FieldmapReportlet(tmpdir, outdir, testdata_dir, mask, apply_mask): | ||
"""Generate one reportlet.""" | ||
tmpdir.chdir() | ||
|
||
if not outdir: | ||
outdir = Path.cwd() | ||
|
||
report = FieldmapReportlet( | ||
reference=str(testdata_dir / "epi.nii.gz"), | ||
moving=str(testdata_dir / "epi.nii.gz"), | ||
fieldmap=str(testdata_dir / "topup-field.nii.gz"), | ||
out_report=str( | ||
outdir / f"test-fieldmap{'-masked' * mask}{'-zeroed' * apply_mask}.svg" | ||
), | ||
apply_mask=apply_mask, | ||
) | ||
|
||
if mask: | ||
report.inputs.mask = epi_mask(str(testdata_dir / "epi.nii.gz")) | ||
|
||
report.run() |
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
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