def _visualize(self, obj, **kwargs): views = [] outputClasses = getattr(obj, 'outputClasses', None) if outputClasses is not None: renderLabels = '_representative._filename _reprojection._filename' labels = 'id enabled %s _representative._xmipp_angleRot _representative._xmipp_angleTilt _representative._xmipp_classCount' % renderLabels views.append( ObjectView(self._project, outputClasses.strId(), outputClasses.getFileName(), viewParams={ showj.ORDER: labels, showj.VISIBLE: labels, showj.RENDER: renderLabels, showj.MODE: showj.MODE_MD })) # outputAverages = getattr(obj, 'outputAverages', None) # if outputAverages is not None: # renderLabels = '_filename' # labels = 'id enabled %s _xmipp_angleRot _xmipp_angleTilt _xmipp_classCount' % renderLabels # views.append(ObjectView(self._project, outputAverages.strId(), # outputAverages.getFileName(), # viewParams={showj.ORDER: labels, # showj.VISIBLE: labels, # showj.RENDER: renderLabels, # showj.MODE: showj.MODE_MD})) if hasattr(obj, 'outputVolumes'): outputVolumes = obj.outputVolumes labels = 'id enabled comment _filename ' views.append( ObjectView(self._project, outputVolumes.strId(), outputVolumes.getFileName(), viewParams={ showj.MODE: showj.MODE_MD, showj.ORDER: labels, showj.VISIBLE: labels, showj.RENDER: '_filename' })) fnBasis = self.protocol._getExtraPath('split_pc1.vol') if exists(fnBasis): views.append(DataView(fnBasis)) return views
def _visualize(self, obj, **args): if isinstance(obj, EmanProtBoxing): coords = obj.getCoords() if coords: return DataViewer._visualize(self, obj.outputCoordinates) elif isinstance(obj, EmanProtInitModel): obj = obj.outputVolumes fn = obj.getFileName() labels = 'id enabled comment _filename ' objCommands = "'%s' '%s' '%s'" % (OBJCMD_CLASSAVG_PROJS, OBJCMD_PROJS, OBJCMD_INITVOL) self._views.append( ObjectView(self._project, obj.strId(), fn, viewParams={ showj.MODE: showj.MODE_MD, showj.VISIBLE: labels, showj.RENDER: '_filename', showj.OBJCMDS: objCommands })) return self._views
def _showVolume(self, paramName=None): choice = self.displayVolume.get() views = [] for it in self._iterations: fnDir = self.protocol._getExtraPath("Iter%03d" % it) if choice == 0: if self.protocol.alignmentMethod == self.protocol.GLOBAL_ALIGNMENT: fnDir = join(fnDir, 'globalAssignment') else: fnDir = join(fnDir, 'localAssignment') fnVolume = join(fnDir, "volumeRef01.vol") elif choice == 1: fnVolume = join(fnDir, "volumeAvg.mrc") elif choice == 2: fnVolume = join(fnDir, "volumeAvgFiltered.mrc") if exists(fnVolume): samplingRate = self.protocol.readInfoField( fnDir, "sampling", MDL_SAMPLINGRATE) views.append( ObjectView(self._project, None, fnVolume, viewParams={ showj.RENDER: 'image', showj.SAMPLINGRATE: samplingRate })) return views
def _showCtf(self, paramName=None): views = [] obj = "obj = self.protocol." + self.getEnumText('outputType') exec(obj) strId = obj.strId() fn = obj.getFileName() particlesView = ObjectView(self._project, strId, fn) views.append(particlesView) return views
def _visualizePairs(self, e=None): views = [] # display metadata with selected variables labels = 'id enabled _psdFile _micObj_filename _resolution ' \ '_xmipp_consensus_resolution _xmipp_discrepancy_astigmatism' \ ' _defocusU _defocusV _defocusAngle' if hasattr(self.protocol, "outputCTF"): views.append(ObjectView( self._project, self.protocol.strId(), self.protocol.outputCTF.getFileName(), viewParams={MODE: MODE_MD, ORDER: labels, VISIBLE: labels})) if hasattr(self.protocol, "outputCTFDiscarded"): views.append(ObjectView( self._project, self.protocol.strId(), self.protocol.outputCTFDiscarded.getFileName(), viewParams={MODE: MODE_MD, ORDER: labels, VISIBLE: labels})) return views
def _viewParam(self, paramName): if paramName == 'displayModes': modes = self.protocol.outputModes return [ ObjectView(self._project, modes.strId(), modes.getFileName()) ] elif paramName == 'displayMaxDistanceProfile': fn = self.protocol._getExtraPath("maxAtomShifts.xmd") return [ createShiftPlot(fn, "Maximum atom shifts", "maximum shift") ]
def _createVolumesSqlite(self): """ Write an sqlite with all volumes selected for visualization. """ path = self.protocol._getExtraPath('xmipp_viewer_volumes.sqlite') samplingRate = self.protocol.inputVols.get().getSamplingRate() files = [] volumes = self._getVolumeNames() for volFn in volumes: if exists(volFn): files.append(volFn) self.createVolumesSqlite(files, path, samplingRate) return [ObjectView(self._project, self.protocol.strId(), path)]
def createScipionPartView(self, filename, viewParams={}): inputParticlesId = self.protocol.inputParticles.get().strId() labels = 'enabled id _size _filename _transform._matrix' viewParams = { showj.ORDER: labels, showj.VISIBLE: labels, showj.RENDER: '_filename', 'labels': 'id', } return ObjectView(self._project, self.protocol.strId(), filename, other=inputParticlesId, env=self._env, viewParams=viewParams)
def _visualizeFitTable(self, e=None): views = [] if hasattr(self.protocol, "outputPDBs"): labels = \ 'id _filename _powerfit_cc _powerfit_Fish_z _powerfit_rel_z' views.append( ObjectView(self._project, self.protocol.outputPDBs.strId(), self.protocol.outputPDBs.getFileName(), viewParams={ MODE: MODE_MD, ORDER: labels, VISIBLE: labels, SORT_BY: "_powerfit_cc desc" })) return views
def _showOutputParticles(self, paramName=None): views = [] if hasattr(self.protocol, "outputParticles"): obj = self.protocol.outputParticles fn = obj.getFileName() labels = 'id enabled _filename _xmipp_zScore _xmipp_cumulativeSSNR ' labels += '_ctfModel._defocusU _ctfModel._defocusV _xmipp_shiftX _xmipp_shiftY _xmipp_tilt _xmipp_scale _xmipp_maxCC _xmipp_weight' labels += " _xmipp_cost _xmipp_weightContinuous2 _xmipp_angleDiff0 _xmipp_weightJumper0 _xmipp_angleDiff _xmipp_weightJumper _xmipp_angleDiff2 _xmipp_weightJumper2" labels += "_xmipp_weightSSNR _xmipp_maxCCPerc _xmipp_costPerc _xmipp_continuousScaleX _xmipp_continuousScaleY _xmipp_continuousX _xmipp_continuousY _xmipp_continuousA _xmipp_continuousB" views.append( ObjectView(self._project, obj.strId(), fn, viewParams={ showj.ORDER: labels, showj.VISIBLE: labels, showj.MODE: showj.MODE_MD, showj.RENDER: '_filename' })) return views
def _visualizeParticles(self, e=None): views = [] labels = 'id enabled _index _filename _xmipp_zScoreDeepLearning1 ' labels += '_xmipp_zScore _xmipp_cumulativeSSNR ' labels += '_xmipp_scoreEmptiness' otherParam = {} objId = 0 if (isinstance(self.protocol, XmippProtScreenDeepConsensus) and self.protocol.hasAttribute('outputCoordinates')): fnParts = self.protocol._getPath("particles.sqlite") objId = self.protocol.outputCoordinates.strId() otherParam = {'other': 'deepCons'} elif (isinstance(self.protocol, XmippProtScreenDeepLearning) and self.protocol.hasAttribute('outputParticles')): parts = self.protocol.outputParticles fnParts = parts.getFileName() objId = parts.strId() if objId: views.append( ObjectView(self._project, objId, fnParts, viewParams={ ORDER: labels, VISIBLE: labels, SORT_BY: '_xmipp_zScoreDeepLearning1 asc', RENDER: '_filename', MODE: MODE_MD }, **otherParam)) else: print(" > Not output found, yet.") return views