Skip to content

Commit

Permalink
FIX: fixed bug in save_3d_views handling custom parameter dicts (#439)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Huth <[email protected]>
  • Loading branch information
alexhuth and Alexander Huth authored Apr 27, 2022
1 parent 74e92f1 commit 629cea5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cortex/export/save_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def save_3d_views(
`list_surfaces`. Choices are:
'left', 'right', 'front', 'back', 'top', 'bottom', 'flatmap',
'medial_pivot', 'lateral_pivot', 'bottom_pivot',
or a custom dictionary of parameters.
or tuple of (view_name, custom dictionary of parameters).
See `angle_view_params` in this file for parameter dict examples.
list_surfaces: list of (str or dict)
Surfaces to be used. Should be of length one, or of the same length as
Expand Down Expand Up @@ -94,8 +95,9 @@ def save_3d_views(
# force flatmap correspondence
view = surface = "flatmap"
view_params = angle_view_params[view]
view_name = view
else:
view_params = view
view_name, view_params = view
if isinstance(surface, str):
surface_params = unfold_view_params[surface]
else:
Expand Down Expand Up @@ -123,7 +125,7 @@ def save_3d_views(
time.sleep(0.1)

# Save image, store file_name
file_name = file_pattern.format(base=base_name, view=view, surface=surface)
file_name = file_pattern.format(base=base_name, view=view_name, surface=surface)
file_names.append(file_name)
handle.getImage(file_name, size)

Expand Down

0 comments on commit 629cea5

Please sign in to comment.