Commit 7b094406 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: redo tracto tests, run in 2D

parent 936b472d
......@@ -107,7 +107,7 @@ sleep 5
export MESA_GL_VERSION_OVERRIDE=3.3
export FSLEYES_TEST_GL=3.3
export LOCAL_TEST_FSLEYES=1
((pytest --cov-report= --cov-append -m "gl33test" && echo "0" > status) || echo "1" > status) || true
((pytest --cov-report= --cov-append -m "overlayclitest and gl33test" && echo "0" > status) || echo "1" > status) || true
status=`cat status`
failed=`echo "$status + $failed" | bc`
......
......@@ -14,62 +14,127 @@ from fsleyes.tests import run_cli_tests, haveGL
pytestmark = pytest.mark.overlayclitest
prefix = '-s3d -z 40'
cli_tests = f"""
{prefix} tractogram/spirals.trk
{prefix} tractogram/spirals.trk -lw 3
{prefix} tractogram/spirals.trk -lw 5
# 3d/ortho views have diffferent cli
# flags and scalings for zoom factor
zooms3d = {
'zoom20' : '-z 20',
'zoom40' : '-z 40',
'zoom200' : '-z 200',
}
zoomsortho = {
'zoom20' : '-xz 75 -yz 75 -zz 75',
'zoom40' : '-xz 90 -yz 90 -zz 90',
'zoom200' : '-xz 1500 -yz 1500 -zz 1500',
}
# GL21 3D does not support line width
# scaling (it just uses glLineWidth).
# So these tests are only run on gl33,
# and linewidth is adapted in the
# remaining tests below.
cli_tests_linewidth = """
{prefix} {zoom40} tractogram/spirals.trk
{prefix} {zoom40} tractogram/spirals.trk -lw 3
{prefix} {zoom40} tractogram/spirals.trk -lw 5
{prefix} {zoom40} tractogram/spirals.trk -lw 10
{prefix} {zoom20} tractogram/spirals.trk
{prefix} {zoom20} tractogram/spirals.trk -lw 3
{prefix} {zoom20} tractogram/spirals.trk -lw 5
{prefix} {zoom20} tractogram/spirals.trk -lw 10
{prefix} {zoom200} tractogram/spirals.trk
{prefix} {zoom200} tractogram/spirals.trk -lw 3
{prefix} {zoom200} tractogram/spirals.trk -lw 5
{prefix} {zoom200} tractogram/spirals.trk -lw 10
"""
cli_tests = """
# Colour/clip by data baked into the streamline file
{prefix} tractogram/spirals.trk -lw 5 -co vdata -cm hsv -dr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -co vdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -co sdata -cm hsv -dr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -co sdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -co vdata -cl sdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -co sdata -cl vdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} tractogram/spirals.trk -lw 5 -cl vdata -cm hsv -cr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co vdata -cm hsv -dr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co vdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co sdata -cm hsv -dr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co sdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co vdata -cl sdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co sdata -cl vdata -cm hsv -dr -0.75 0.75 -cr -0.75 0.75
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -cl vdata -cm hsv -cr -0.75 0.75
# neg cmap
{prefix} tractogram/spirals.trk -lw 5 -co vdata -cm red-yellow -nc blue-lightblue -un
{prefix} tractogram/spirals.trk -lw 5 -co vdata -cm red-yellow -nc blue-lightblue -un -dr 0.25 1
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co vdata -cm red-yellow -nc blue-lightblue -un
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co vdata -cm red-yellow -nc blue-lightblue -un -dr 0.25 1
# code pathways for per-streamline/vertex data are
# more or less identical, so no need to test both
{prefix} tractogram/spirals.trk -lw 5 -co tractogram/spirals_streamline_data.txt
{prefix} tractogram/spirals.trk -lw 5 -co tractogram/spirals_vertex_data.txt
{prefix} tractogram/spirals.trk -lw 5 -co tractogram/spirals_vertex_data.txt -cm hsv
{prefix} tractogram/spirals.trk -lw 5 -co tractogram/spirals_vertex_data.txt -cm hsv -ll -dr 0 25 -cr 25 50
{prefix} tractogram/spirals.trk -lw 5 -co tractogram/spirals_vertex_data.txt -cl tractogram/spirals_streamline_data.txt -cm hsv -ll -dr 0 25 -cr 25 50
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co tractogram/spirals_streamline_data.txt
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co tractogram/spirals_vertex_data.txt
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co tractogram/spirals_vertex_data.txt -cm hsv
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co tractogram/spirals_vertex_data.txt -cm hsv -ll -dr 0 25 -cr 25 50
{prefix} {zoom40} tractogram/spirals.trk -lw {linewidth} -co tractogram/spirals_vertex_data.txt -cl tractogram/spirals_streamline_data.txt -cm hsv -ll -dr 0 25 -cr 25 50
# colour/clip by image
{prefix} 3d -d tractogram/spirals.trk -lw 5 -co 3d
{prefix} 3d -d tractogram/spirals.trk -lw 5 -co 3d -cm hot
{prefix} 3d -d tractogram/spirals.trk -lw 5 -cl 3d -cr 5000 8000
{prefix} 3d -d tractogram/spirals.trk -lw 5 -co 3d -cl vdata -cm hot -dr 4000 8000 -cr -0.75 0.75
{prefix} {zoom40} 3d -d tractogram/spirals.trk -lw {linewidth} -co 3d
{prefix} {zoom40} 3d -d tractogram/spirals.trk -lw {linewidth} -co 3d -cm hot
{prefix} {zoom40} 3d -d tractogram/spirals.trk -lw {linewidth} -cl 3d -cr 5000 8000
{prefix} {zoom40} 3d -d tractogram/spirals.trk -lw {linewidth} -co 3d -cl vdata -cm hot -dr 4000 8000 -cr -0.75 0.75
"""
cli_tube_tests = f"""
{prefix} tractogram/spirals.trk -lw 10
{prefix} tractogram/spirals.trk -lw 20
{prefix} tractogram/spirals.trk -lw 50
{prefix} tractogram/spirals.trk -lw 20 -r 3
{prefix} tractogram/spirals.trk -lw 20 -r 6
{prefix} tractogram/spirals.trk -lw 20 -r 10
{prefix} -dl tractogram/spirals.trk -lw 20 -r 3
{prefix} -dl tractogram/spirals.trk -lw 20 -r 6
{prefix} -dl tractogram/spirals.trk -lw 20 -r 10
cli_tube_tests = """
-s3d -z 40 tractogram/spirals.trk -lw 20 -r 3
-s3d -z 40 tractogram/spirals.trk -lw 20 -r 6
-s3d -z 40 tractogram/spirals.trk -lw 20 -r 10
-s3d -z 40 -dl tractogram/spirals.trk -lw 20 -r 3
-s3d -z 40 -dl tractogram/spirals.trk -lw 20 -r 6
-s3d -z 40 -dl tractogram/spirals.trk -lw 20 -r 10
"""
@pytest.mark.skipif('not haveGL(2.1)')
def test_overlay_tractogram():
run_cli_tests('test_overlay_tractogram', cli_tests)
def test_overlay_tractogram_2d_gl21():
fmtargs = { 'prefix' : '-sortho -wl 0 -10 25',
'linewidth' : '10',
**zoomsortho}
tests = cli_tests_linewidth + cli_tests
tests = tests.format(**fmtargs)
run_cli_tests('test_overlay_tractogram_2d_gl21', tests)
@pytest.mark.skipif('not haveGL(3.3)')
@pytest.mark.gl33test
@pytest.mark.overlayclitest
def test_overlay_tractogram_2d_gl33():
fmtargs = { 'prefix' : '-sortho -wl 0 -10 25',
'linewidth' : '10',
**zoomsortho}
tests = cli_tests_linewidth + cli_tests
tests = tests.format(**fmtargs)
run_cli_tests('test_overlay_tractogram_2d_gl33', tests)
@pytest.mark.skipif('not haveGL(2.1)')
def test_overlay_tractogram_3d_gl21():
fmtargs = { 'prefix' : '-s3d',
'linewidth' : '10',
**zooms3d}
tests = cli_tests.format(**fmtargs)
run_cli_tests('test_overlay_tractogram_3d_gl21', tests)
@pytest.mark.skipif('not haveGL(3.3)')
@pytest.mark.gl33test
@pytest.mark.overlayclitest
def test_overlay_tractogram_3d_gl33():
fmtargs = { 'prefix' : '-s3d',
'linewidth' : '5',
**zooms3d}
tests = cli_tests_linewidth + cli_tests
tests = tests.format(**fmtargs)
run_cli_tests('test_overlay_tractogram_3d_gl33', tests)
@pytest.mark.skipif('not haveGL(3.3)')
@pytest.mark.gl33test
def test_overlay_tractogram_tubes():
run_cli_tests('test_overlay_tractogram_tubes', cli_tube_tests)
@pytest.mark.overlayclitest
def test_overlay_tractogram_3d_tubes():
run_cli_tests('test_overlay_tractogram_3d_tubes', cli_tube_tests)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment