Commit 87c33175 authored by Taylor Hanayik's avatar Taylor Hanayik
Browse files

remove old file

parent 77be8f38
#!/usr/bin/env pythonw
import wx
import os.path as op
import fsl.data.image as fslimage
import fsleyes.main as main
import fsleyes.views.orthopanel as ortho
import fsleyes.displaycontext as displaycontext
import fsleyes.profiles as profiles
import fsleyes.profiles.profilemap as profilemap
class ViewProfile(profiles.Profile):
def __init__(self, viewPanel, overlayList, displayCtx):
profiles.Profile.__init__(self,
viewPanel,
overlayList,
displayCtx,
['nav'])
def getEventTargets(self):
return [self.viewPanel.getXCanvas(),
self.viewPanel.getYCanvas(),
self.viewPanel.getZCanvas()]
def _navModeLeftMouseDrag(self, ev, canvas, mousePos, canvasPos):
if canvasPos is None:
return False
self.displayCtx.location = canvasPos
return True
# This is the hacky bit - there is
# currently no formal way to register
# a custom profile class with a view.
# This might change in the future.
# The first profile in the profiles
# list is used as the default.
profilemap.profiles[ortho.OrthoPanel].insert(0, 'minview')
profilemap.profileHandlers[ortho.OrthoPanel, 'minview'] = ViewProfile
app = wx.App()
# The embed function currenty creates
# and returns a FSLeyesFrame, but
# you don't have to use it. This may
# become optional in the future
# (e.g. embed(createFrame=False)).
overlayList, displayCtx, frame = main.embed()
frame = None
overlayList.append(fslimage.Image(op.expandvars('$FSLDIR/data/standard/MNI152_T1_2mm')))
# Just demonstrating the use of a
# different wx parent object, instead
# of the frame returned by embed
frame = wx.Frame(None)
frame.SetMenuBar(wx.MenuBar())
sizer = wx.BoxSizer(wx.HORIZONTAL)
frame.SetSizer(sizer)
odc = displaycontext.DisplayContext(overlayList, parent=displayCtx)
ortho = ortho.OrthoPanel(frame, overlayList, odc, None)
sizer.Add(ortho, flag=wx.EXPAND, proportion=1)
ortho.SetMinSize((-1, 200))
frame.Show()
app.MainLoop()
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