Skip to content
New issue

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

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

Already on GitHub? # to your account

FIX do not use a default layout selection for multiple volumes #503

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions cortex/webgl/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def make_static(outpath, data, types=("inflated",), recache=False, cmap="RdBu_r"
title : str, optional
The title that is displayed on the viewer website when it is loaded in
a browser.
layout : None or list of (int, int)
The layout of the viewer subwindows for showing multiple subjects, passed to
the template generator.
Default to None, corresponding to no subwindows.

Notes
-----
Expand Down Expand Up @@ -133,8 +137,6 @@ def make_static(outpath, data, types=("inflated",), recache=False, cmap="RdBu_r"
package.reorder(ctms)

db.auxfile = None
if layout is None:
layout = [None, (1, 1), (2, 1), (3, 1), (2, 2), (3, 2), (3, 2), (3, 3), (3, 3), (3, 3)][len(subjects)]

## Rename files to anonymize
submap = dict()
Expand Down Expand Up @@ -305,9 +307,10 @@ def show(data, types=("inflated", ), recache=False, cmap='RdBu_r', layout=None,
title : str, optional
The title that is displayed on the viewer website when it is loaded in
a browser.
layout : (int, int), optional
The layout of the viewer subwindows for showing multiple subjects.
Default None, which selects the layout based on the number of subjects.
layout : None or list of (int, int), optional
The layout of the viewer subwindows for showing multiple subjects, passed to
the template generator.
Default None, corresponding to no subwindows.
"""

# populate default webshow args
Expand Down Expand Up @@ -344,8 +347,6 @@ def show(data, types=("inflated", ), recache=False, cmap='RdBu_r', layout=None,
subjectjs = json.dumps(dict((subj, "ctm/%s/"%subj) for subj in subjects))
db.auxfile = None

if layout is None:
layout = [None, (1, 1), (2, 1), (3, 1), (2, 2), (3, 2), (3, 2), (3, 3), (3, 3), (3, 3)][len(subjects)]

linear = lambda x, y, m: (1.-m)*x + m*y
mixes = dict(
Expand Down
Loading