Skip to content
Snippets Groups Projects
Commit 67309857 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

FSLEyes no longer treats 'ortho' and 'lightbox' separately - they are

now default perspectives.
parent 9ef40556
No related branches found
No related tags found
No related merge requests found
...@@ -868,9 +868,11 @@ melodic = TypeDict({ ...@@ -868,9 +868,11 @@ melodic = TypeDict({
}) })
perspectives = { perspectives = {
'default' : 'Default layout', 'default' : 'Default layout',
'melodic' : 'Melodic mode', 'melodic' : 'Melodic mode',
'feat' : 'FEAT mode', 'feat' : 'FEAT mode',
'ortho' : 'Plain orthographic',
'lightbox' : 'Plain lightbox',
} }
tensor = { tensor = {
......
...@@ -627,4 +627,19 @@ BUILT_IN_PERSPECTIVES = collections.OrderedDict(( ...@@ -627,4 +627,19 @@ BUILT_IN_PERSPECTIVES = collections.OrderedDict((
layout2|name=Panel;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=OverlayDisplayToolBar;caption=Display toolbar;state=67382012;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=860;besth=49;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=LocationPanel;caption=Location;state=67373052;dir=3;layer=2;row=0;pos=1;prop=98544;bestw=440;besth=109;minw=440;minh=109;maxw=-1;maxh=-1;floatx=2730;floaty=1104;floatw=440;floath=125;notebookid=-1;transparent=255|name=AtlasPanel;caption=Atlases;state=67373052;dir=2;layer=1;row=0;pos=0;prop=98904;bestw=318;besth=84;minw=318;minh=84;maxw=-1;maxh=-1;floatx=1091;floaty=143;floatw=318;floath=100;notebookid=-1;transparent=255|name=OverlayListPanel;caption=Overlay list;state=67373052;dir=3;layer=2;row=0;pos=0;prop=87792;bestw=197;besth=80;minw=197;minh=80;maxw=-1;maxh=-1;floatx=2608;floaty=1116;floatw=197;floath=96;notebookid=-1;transparent=255|name=OrthoToolBar;caption=Ortho view toolbar;state=67382012;dir=1;layer=10;row=1;pos=0;prop=100000;bestw=815;besth=34;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=2072;floaty=80;floatw=824;floath=50;notebookid=-1;transparent=255|name=ClusterPanel;caption=Cluster browser;state=67373052;dir=2;layer=1;row=0;pos=1;prop=114760;bestw=390;besth=96;minw=390;minh=96;maxw=-1;maxh=-1;floatx=3516;floaty=636;floatw=390;floath=112;notebookid=-1;transparent=255|dock_size(5,0,0)=10|dock_size(2,1,0)=566|dock_size(1,10,0)=51|dock_size(1,10,1)=36|dock_size(3,2,0)=130| layout2|name=Panel;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=OverlayDisplayToolBar;caption=Display toolbar;state=67382012;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=860;besth=49;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|name=LocationPanel;caption=Location;state=67373052;dir=3;layer=2;row=0;pos=1;prop=98544;bestw=440;besth=109;minw=440;minh=109;maxw=-1;maxh=-1;floatx=2730;floaty=1104;floatw=440;floath=125;notebookid=-1;transparent=255|name=AtlasPanel;caption=Atlases;state=67373052;dir=2;layer=1;row=0;pos=0;prop=98904;bestw=318;besth=84;minw=318;minh=84;maxw=-1;maxh=-1;floatx=1091;floaty=143;floatw=318;floath=100;notebookid=-1;transparent=255|name=OverlayListPanel;caption=Overlay list;state=67373052;dir=3;layer=2;row=0;pos=0;prop=87792;bestw=197;besth=80;minw=197;minh=80;maxw=-1;maxh=-1;floatx=2608;floaty=1116;floatw=197;floath=96;notebookid=-1;transparent=255|name=OrthoToolBar;caption=Ortho view toolbar;state=67382012;dir=1;layer=10;row=1;pos=0;prop=100000;bestw=815;besth=34;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=2072;floaty=80;floatw=824;floath=50;notebookid=-1;transparent=255|name=ClusterPanel;caption=Cluster browser;state=67373052;dir=2;layer=1;row=0;pos=1;prop=114760;bestw=390;besth=96;minw=390;minh=96;maxw=-1;maxh=-1;floatx=3516;floaty=636;floatw=390;floath=112;notebookid=-1;transparent=255|dock_size(5,0,0)=10|dock_size(2,1,0)=566|dock_size(1,10,0)=51|dock_size(1,10,1)=36|dock_size(3,2,0)=130|
;; ;;
layout2|name=FigureCanvasWxAgg;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=640;besth=480;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=642| layout2|name=FigureCanvasWxAgg;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=640;besth=480;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=642|
""")),
('ortho',
textwrap.dedent("""
OrthoPanel
layout2|name=OrthoPanel 1;caption=Ortho View 1;state=67376064;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=22|
;syncLocation=True,syncOverlayOrder=True,syncOverlayDisplay=True;layout=horizontal,showLabels=True,bgColour=#000000ff,showCursor=True,showZCanvas=True,cursorColour=#00ff00ff,showColourBar=False,showYCanvas=True,showXCanvas=True,colourBarLocation=top
layout2|name=Panel;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=22|
""")),
('lightbox',
textwrap.dedent("""
LightBoxPanel
layout2|name=LightBoxPanel 1;caption=Lightbox View 1;state=67376064;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=22|
;syncLocation=True,syncOverlayOrder=True,syncOverlayDisplay=True;bgColour=#000000ff,showCursor=True,cursorColour=#00ff00ff,highlightSlice=False,zax=0,showColourBar=False,showGridLines=False,colourBarLocation=top
layout2|name=Panel;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1;notebookid=-1;transparent=255|dock_size(5,0,0)=10|
""")))) """))))
...@@ -47,15 +47,17 @@ def parseArgs(argv): ...@@ -47,15 +47,17 @@ def parseArgs(argv):
add_help=False, add_help=False,
formatter_class=argparse.RawDescriptionHelpFormatter) formatter_class=argparse.RawDescriptionHelpFormatter)
# TODO Dynamically generate perspective list
# in description. To do this, you will need
# to make fsl.utils.settings work without a
# wx.App (so we can retrieve the perspective
# list before the GUI is created).
name = 'fsleyes' name = 'fsleyes'
description = textwrap.dedent("""\ description = textwrap.dedent("""\
FSLeyes - the FSL image viewer. FSLeyes - the FSL image viewer.
The '--scene' option may be used to: Use the '--scene' option to load a saved perspective (e.g. 'default',
'melodic', 'feat', 'ortho', or 'lightbox').
- Specify a single view to open ('ortho' or 'lightbox').
- Specify a saved perspective to open (TODO list saved
perspectives here).
If no '--scene' is specified, the previous layout is restored. If no '--scene' is specified, the previous layout is restored.
""") """)
...@@ -195,17 +197,13 @@ def interface(parent, args, ctx): ...@@ -195,17 +197,13 @@ def interface(parent, args, ctx):
# If a scene or perspective has not been # If a scene or perspective has not been
# specified, the default behaviour is to # specified, the default behaviour is to
# restore the previous frame layout. And # restore the previous frame layout.
# if a scene is specified, the layout is
# not saved on exit.
restore = scene is None restore = scene is None
save = scene not in ('ortho', 'lightbox')
status.update('Creating FSLeyes interface...') status.update('Creating FSLeyes interface...')
frame = fsleyesframe.FSLEyesFrame( frame = fsleyesframe.FSLEyesFrame(
parent, overlayList, displayCtx, restore, save) parent, overlayList, displayCtx, restore, True)
# Make sure the new frame is shown # Make sure the new frame is shown
# before destroying the splash screen # before destroying the splash screen
...@@ -221,14 +219,10 @@ def interface(parent, args, ctx): ...@@ -221,14 +219,10 @@ def interface(parent, args, ctx):
splashFrame.Update() splashFrame.Update()
wx.CallLater(250, splashFrame.Close) wx.CallLater(250, splashFrame.Close)
# If a scene is specified, we add
# the panel corresponding to the scene.
if args.scene == 'ortho': frame.addViewPanel(views.OrthoPanel)
elif args.scene == 'lightbox': frame.addViewPanel(views.LightBoxPanel)
# Otherwise, if a perspective has been # If a perspective has been specified,
# specified, we load the perspective # we load the perspective
elif args.scene is not None: if args.scene is not None:
perspectives.loadPerspective(frame, args.scene) perspectives.loadPerspective(frame, args.scene)
# The viewPanel is assumed to be a CanvasPanel # The viewPanel is assumed to be a CanvasPanel
...@@ -247,23 +241,6 @@ def interface(parent, args, ctx): ...@@ -247,23 +241,6 @@ def interface(parent, args, ctx):
fsleyes_parseargs.applySceneArgs( fsleyes_parseargs.applySceneArgs(
args, overlayList, displayCtx, viewOpts) args, overlayList, displayCtx, viewOpts)
if args.scene == 'ortho':
viewPanel = viewPanels[0]
displayCtx = viewPanel.getDisplayContext()
xcentre = args.xcentre
ycentre = args.ycentre
zcentre = args.zcentre
if xcentre is None: xcentre = displayCtx.location.yz
if ycentre is None: ycentre = displayCtx.location.xz
if zcentre is None: zcentre = displayCtx.location.xy
viewPanel.getXCanvas().centreDisplayAt(*xcentre)
viewPanel.getYCanvas().centreDisplayAt(*ycentre)
viewPanel.getZCanvas().centreDisplayAt(*zcentre)
return frame return frame
......
...@@ -345,9 +345,9 @@ def run(args, context): ...@@ -345,9 +345,9 @@ def run(args, context):
c.bgColour = sceneOpts.bgColour c.bgColour = sceneOpts.bgColour
c.renderMode = sceneOpts.renderMode c.renderMode = sceneOpts.renderMode
c.resolutionLimit = sceneOpts.resolutionLimit c.resolutionLimit = sceneOpts.resolutionLimit
c.sliceSpacing = sceneOpts.sliceSpacing
c.nrows = sceneOpts.nrows c.nrows = sceneOpts.nrows
c.ncols = sceneOpts.ncols c.ncols = sceneOpts.ncols
c.sliceSpacing = sceneOpts.sliceSpacing
c.zrange = sceneOpts.zrange c.zrange = sceneOpts.zrange
c.showGridLines = sceneOpts.showGridLines c.showGridLines = sceneOpts.showGridLines
c.highlightSlice = sceneOpts.highlightSlice c.highlightSlice = sceneOpts.highlightSlice
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment