Skip to content

Commit 5084648

Browse files
committed
ENH: suggestions from @oesteban review
1 parent a8aea89 commit 5084648

File tree

3 files changed

+135
-228
lines changed

3 files changed

+135
-228
lines changed

niworkflows/tests/test_viz.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,30 @@
1010

1111
def test_carpetplot():
1212
"""Write a carpetplot"""
13-
out_file = None
13+
out_file_nifti = None
14+
out_file_cifti = None
1415
save_artifacts = os.getenv('SAVE_CIRCLE_ARTIFACTS', False)
1516
if save_artifacts:
16-
out_file = os.path.join(save_artifacts, 'carpetplot.svg')
17+
out_file_nifti = os.path.join(save_artifacts, 'carpetplot_nifti.svg')
18+
out_file_cifti = os.path.join(save_artifacts, 'carpetplot_cifti.svg')
19+
20+
# volumetric NIfTI
1721
viz.plot_carpet(
1822
os.path.join(datadir, 'sub-ds205s03_task-functionallocalizer_run-01_bold_volreg.nii.gz'),
19-
np.asanyarray(nb.load(os.path.join(
23+
atlaslabels=np.asanyarray(nb.load(os.path.join(
2024
datadir,
2125
'sub-ds205s03_task-functionallocalizer_run-01_bold_parc.nii.gz')).dataobj),
22-
output_file=out_file,
26+
output_file=out_file_nifti,
2327
legend=True
2428
)
2529

26-
27-
def test_cifti_carpetplot():
28-
out_file = None
29-
save_artifacts = os.getenv('SAVE_CIRCLE_ARTIFACTS', False)
30-
if save_artifacts:
31-
out_file = os.path.join(save_artifacts, 'carpetplot2.svg')
32-
viz.plot_cifti_carpet(
30+
# CIFTI
31+
viz.plot_carpet(
3332
os.path.join(
3433
datadir,
3534
'sub-01_task-mixedgamblestask_run-02_space-fsLR_den-91k_bold.dtseries.nii'
3635
),
37-
output_file=out_file
36+
output_file=out_file_cifti,
3837
)
3938

4039

niworkflows/viz/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
from __future__ import absolute_import, division, print_function, unicode_literals
55

6-
from .plots import plot_carpet, plot_cifti_carpet
6+
from .plots import plot_carpet
77
from .utils import SVGNS
88

9-
__all__ = ['plot_carpet', 'plot_cifti_carpet', 'SVGNS']
9+
__all__ = ['plot_carpet', 'SVGNS']

0 commit comments

Comments
 (0)