def _showOriginalVolumeSlices(self, param=None): if self.protocol.halfVolumes.get() is True: cm = DataView(self.protocol.inputVolume.get().getFileName()) cm2 = DataView(self.protocol.inputVolume2.get().getFileName()) return [cm, cm2] else: cm = DataView(self.protocol.inputVolumes.get().getFileName()) return [cm]
def _viewParam(self, param=None): if param == 'doShowEigenImages': view = DataView(self.protocol._getFileName('eigenimages')) elif param == 'doShowReconsImages': view = DataView(self.protocol._getFileName('reconstituted')) elif param == 'doShowPcaFile': view = self.textView([self.protocol.imcFile.filename.get()], "PCA file") return [view]
def _viewParam(self, param=None): if param == 'doShowLog': view = self.textView([self.protocol.getOutputLog()], "Output log file") elif param == 'doShowAmp': view = DataView(self.protocol.getOutputAmplitudes()) elif param == 'doShowAmpRot': view = DataView(self.protocol.getOutputAmplitudesRot()) elif param == 'doShowAmpCorr': view = DataView(self.protocol.getOutputAmplitudesCorr()) return [view]
def _viewParam(self, param=None): if param == 'doShowEigenImages': view = DataView(self.protocol.getOutputEigenImages()) elif param == 'doShowEigPixImages': view = DataView(self.protocol._getFileName('msa_eigen_pixel')) elif param == 'doShowPixelVecCoordImages': view = DataView(self.protocol._getFileName('msa_pixvec_coord')) elif param == 'doShowMsaLisFile': view = self.textView([self.protocol.getOutputLis()], "MSA lis file") elif param == 'doShowMsaPltFile': view = self.textView([self.protocol.getOutputPlt()], "MSA plt file") return [view]
def openPath(self, path): "Try to open the selected path" path = expandPattern(path) # If the path is a dir, open it with scipion browser dir <path> if os.path.isdir(path): dpath = (path if os.path.isabs(path) else os.path.join( os.getcwd(), path)) subprocess.Popen([pw.getScipionScript(), 'view', dpath]) return # If it is a file, interpret it correctly and open it with DataView dirname = os.path.dirname(path) fname = os.path.basename(path) if '@' in fname: path = os.path.join(dirname, fname.split('@', 1)[-1]) else: path = os.path.join(dirname, fname) if os.path.exists(path): import xmipp fn = xmipp.FileName(path) if fn.isImage() or fn.isMetaData(): from pyworkflow.em.viewer import DataView DataView(path).show() else: _open_cmd(path) else: # This is probably one special reference, like sci-open:... that # can be interpreted with our handlers. tag = path.split(':', 1)[0] if ':' in path else None if tag in self.handlers: self.handlers[tag](path.split(':', 1)[-1]) else: print "Can't find %s" % path
def _visualize(self, obj, **kwargs): labels = 'class1.id class1._representative._filename class2.id class2._representative._filename jaccard intersection union' return [DataView(obj.outputConsensus.getFileName(), viewParams={'order': labels, 'mode': 'metadata', 'visible': labels, 'render': 'class1._representative._filename class2._representative._filename' }) ]
def _viewVolume(self, e=None): import pyworkflow.em.metadata as md viewLabels = 'id enabled _index _filename _xmipp_weight' cm = DataView(self.protocol.outputVolumes.getFileName(), viewParams={MODE : MODE_MD, ORDER : viewLabels, RENDER :'_filename', VISIBLE : viewLabels}) return [cm]
def _showInternalParticles(self, paramName=None): views = [] for it in self._iterations: fnDir = self.protocol._getExtraPath("Iter%03d"%it) fnAngles = join(fnDir,"angles.xmd") if exists(fnAngles): views.append(DataView(fnAngles, viewParams={showj.MODE: showj.MODE_MD})) return views
def _viewP(self, e=None): volId = int(self.volForCurve.get()) vol = self.protocol.outputVolumes[volId] if vol is None: # Wrong volume selection return [self.errorMessage("Invalid volume id *%d*" % volId)] pFn = vol.clusterMd.get() mdCls = md.MetaData(vol.clusterMd.get()) return [self._viewPlot("Cluster tendency parameter for each image", IMAGE_INDEX, P_INDEX, mdCls, md.MDL_IMAGE_IDX, md.MDL_WEIGHT, color='b'), DataView(pFn)]
def _visualize(self, obj, **args): if isinstance(obj, PcaFile): self._views.append(self.textView([obj.getFileName()], "PCA file")) elif isinstance(obj, SpiderProtCustomMask): mask = obj.outputMask self._visualize(mask) # Visualize the whole stack with all filenames self._views.append(DataView(mask.getFileName())) else: XmippViewer._visualize(self, obj) return self._views
def visualize(self, obj, **args): data = self.protocol._getPath('emxData/data.mrc') DataView(data).show()
def getFileActions(self, objFile): from pyworkflow.em.viewer import DataView fn = objFile.getPath() return [('Open with Xmipp viewer', lambda: DataView(fn).show(), Icon.ACTION_VISUALIZE)]
def _showOriginalVolumeSlices(self, param=None): out_cm = DataView(self.protocol.inputVolume.get().getFileName()) return [out_cm]
def _showVolumeSlices(self, param=None): out_cm = DataView(self.protocol._getFileName(FN_RESOLMAP)) return [out_cm]
def _showVolumeSlices(self, param=None): cm = DataView(self.protocol.resolution_Volume.getFileName()) return [cm]
def createDataView(self, filename, viewParams={}): return DataView(filename, viewParams)
def _visualize(self, obj, **args): self._views.append(ChimeraView(obj.outputPdb._chimeraScript)) self._views.append(DataView(obj._getExtraPath('pseudoatoms_approximation.vol')))
def showFile(path, viewParams): DataView(path, viewParams).show()