def __generateReport(self): """Generates and returns a *report*, a hierarchical dictionary containing information about the current system and *FSLeyes* state. """ import fsleyes.version as version report = OrderedDict() overlays = [] for i, ovl in enumerate(self.overlayList): overlays.append( OrderedDict([('type', type(ovl).__name__), ('name', ovl.name), ('source', ovl.dataSource)])) report['Platform'] = platform.platform() report['Python'] = '{} {}'.format(platform.python_version(), platform.python_compiler()) report['Version'] = version.__version__ report['OpenGL'] = self.__openGLReport() report['Settings'] = self.__settingsReport() report['State'] = fslstate.getState(self.__frame) return report
def _test_state(frame, overlayList, displayCtx): rfile = op.join(datadir, 'mesh_ref.nii.gz') mfile = op.join(datadir, 'mesh_l_thal.vtk') overlayList.append(Image( rfile)) overlayList.append(VTKMesh(mfile)) ref, mesh = overlayList ropts = displayCtx.getOpts(ref) mopts = displayCtx.getOpts(mesh) ropts.cmap = 'hot' mopts.refImage = ref mopts.outline = True frame.addViewPanel(OrthoPanel) frame.addViewPanel(HistogramPanel) oopts = frame.viewPanels[0].sceneOpts oopts.showXCanvas = False oopts.zzoom = 2000 frame.viewPanels[1].smooth = True frame.viewPanels[1].histType = 'count' realYield(200) st = state.getState(frame) frame.removeAllViewPanels() del overlayList[:] realYield(200) state.setState(frame, st) realYield(200) ortho, hist = frame.viewPanels assert isinstance(ortho, OrthoPanel) assert isinstance(hist, HistogramPanel) assert not ortho.sceneOpts.showXCanvas assert ortho.sceneOpts.zzoom == 2000 assert hist.smooth assert hist.histType == 'count' ref, mesh = overlayList assert isinstance(ref, Image) assert isinstance(mesh, VTKMesh) ropts = displayCtx.getOpts(ref) mopts = displayCtx.getOpts(mesh) assert ropts.cmap.name == 'hot' assert mopts.refImage is ref assert mopts.outline
def getState(): """Get the current FSLeyes state. """ return state.getState(frame)