Beispiel #1
0
	def select_folder(self, row, col):
		idx=int(self.imglst.item(row, 0).text())
		sfx=self.dp_folder.currentText()
		self.path="{}_{:02d}".format(sfx, idx)
		#if self.browser.isup == False: 
		#	self.show_browser()
		#	print("Showing {} in browser.".format(path))
		self.browser.setPath(self.path)

		vols = []
		for f in os.listdir(self.path):
			if "threed" in f:
				if "even" not in f and "odd" not in f:
					vols.append(f)#"{}".format(self.path,f))
		lastvol = sorted(vols)[-1]
		print("Displaying {} from {}".format(lastvol,self.path))
		volpath = "{}/{}".format(self.path,lastvol)
		name = os.path.basename(str(volpath))

		if self.wg_thumbnail.newnode:
			self.wg_thumbnail.newnode.setData(volpath)
		else:
			self.wg_thumbnail.newnode = EMDataItem3D(volpath)
			self.cur_3d_node=self.wg_thumbnail.newnode
			self.wg_thumbnail.insertNewNode(name, self.wg_thumbnail.newnode)
			self.wg_thumbnail.newnode.setTransform(self.wg_thumbnail.newnode.getParentMatrixProduct().inverse()*self.wg_thumbnail.newnode.getTransform())
			self.wg_thumbnail.isonode = EMIsosurface(self.wg_thumbnail.newnode, transform=Transform())
			self.wg_thumbnail.insertNewNode("Isosurface", self.wg_thumbnail.isonode, parentnode=self.wg_thumbnail.newnode)
		self.wg_thumbnail.updateSG()
Beispiel #2
0
 def menu_add_3dwin(self):
     if self.viewer == None: return
     self.viewer.append(EMScene3D())
     self.sgdata = EMDataItem3D(test_image_3d(3), transform=Transform())
     self.viewer[-1].insertNewNode('Data',
                                   self.sgdata,
                                   parentnode=self.viewer[-1])
     isosurface = EMIsosurface(self.sgdata, transform=Transform())
     self.viewer[-1].insertNewNode("Iso",
                                   isosurface,
                                   parentnode=self.sgdata)
     volslice = EMSliceItem3D(self.sgdata, transform=Transform())
     self.viewer[-1].insertNewNode("Slice",
                                   volslice,
                                   parentnode=self.sgdata)
     self.viewer[-1].show()
     self.needupdate = 1
Beispiel #3
0
    def setData(self, data):
        if data == None:
            self.data = None
            return

        elif isinstance(data, str):
            self.datafile = data
            self.nimg = EMUtil.get_image_count(data)

            if self.dataidx >= 0 and self.dataidx < self.nimg:
                ii = self.dataidx
                self.nimg = 1
            else:
                ii = 0

            hdr = EMData(data, 0, 1)

            self.origdata = EMData(data, ii)

            if self.origdata["nz"] == 1:
                if self.nimg > 20 and hdr["ny"] > 512:
                    self.origdata = EMData.read_images(
                        data, list(range(0, self.nimg, self.nimg // 20))
                    )  # read regularly separated images from the file totalling ~20
                elif self.nimg > 100:
                    self.origdata = EMData.read_images(
                        data,
                        list(range(0, 72)) +
                        list(range(72, self.nimg, self.nimg // 100))
                    )  # read the first 36 then regularly separated images from the file
                elif self.nimg > 1:
                    self.origdata = EMData.read_images(data,
                                                       list(range(self.nimg)))
                else:
                    self.origdata = [self.origdata]
            else:
                self.origdata = [self.origdata]

        else:
            self.datafile = None
            if isinstance(data, EMData): self.origdata = [data]
            else: self.origdata = data

        self.nx = self.origdata[0]["nx"]
        self.ny = self.origdata[0]["ny"]
        self.nz = self.origdata[0]["nz"]
        if self.apix <= 0.0: self.apix = self.origdata[0]["apix_x"]
        EMProcessorWidget.parmdefault["apix"] = (0, (0.2, 10.0), self.apix,
                                                 None)

        origfft = self.origdata[0].do_fft()
        self.pspecorig = origfft.calc_radial_dist(old_div(self.ny, 2), 0.0,
                                                  1.0, 1)
        ds = old_div(1.0, (self.apix * self.ny))
        self.pspecs = [ds * i for i in range(len(self.pspecorig))]

        if self.viewer != None:
            for v in self.viewer:
                v.close()

        if self.nz == 1 or self.force2d or (self.nx > 320
                                            and self.safemode == False):
            if len(self.origdata) > 1:
                self.viewer = [EMImageMXWidget()]
                self.mfile_save_stack.setEnabled(True)
            else:
                self.viewer = [EMImage2DWidget()]
                self.mfile_save_stack.setEnabled(False)
        else:
            self.mfile_save_stack.setEnabled(False)
            self.viewer = [EMScene3D()]
            self.sgdata = EMDataItem3D(test_image_3d(3), transform=Transform())
            self.viewer[0].insertNewNode('Data',
                                         self.sgdata,
                                         parentnode=self.viewer[0])
            isosurface = EMIsosurface(self.sgdata, transform=Transform())
            self.viewer[0].insertNewNode("Iso",
                                         isosurface,
                                         parentnode=self.sgdata)
            volslice = EMSliceItem3D(self.sgdata, transform=Transform())
            self.viewer[0].insertNewNode("Slice",
                                         volslice,
                                         parentnode=self.sgdata)

        if self.nz > 1: self.mfile_save_map.setEnabled(True)
        else: self.mfile_save_map.setEnabled(False)

        E2loadappwin("e2filtertool", "image", self.viewer[0].qt_parent)
        if self.origdata[0].has_attr("source_path"):
            winname = str(self.origdata[0]["source_path"])
        else:
            winname = "FilterTool"
        self.viewer[0].setWindowTitle(winname)

        self.procChange(-1)
Beispiel #4
0
def main():

    usage = """prog --path <spt_xx> --iter <X> --tomo <tomogram>
	map aligned particles back to tomograms """
    parser = EMArgumentParser(usage=usage, version=EMANVERSION)
    parser.add_argument("--path",
                        type=str,
                        help="spt_xx path",
                        default="",
                        guitype='strbox',
                        row=0,
                        col=0,
                        rowspan=1,
                        colspan=1)
    parser.add_argument("--iter",
                        type=int,
                        help="iteration number",
                        default=1,
                        guitype='intbox',
                        row=0,
                        col=1,
                        rowspan=1,
                        colspan=1)
    parser.add_argument(
        "--tomo",
        type=str,
        help="tomogram file name",
        default="",
        guitype='filebox',
        browser="EMBrowserWidget(withmodal=True, startpath='tomograms')",
        row=2,
        col=0,
        rowspan=1,
        colspan=2,
    )
    parser.add_argument(
        "--avg",
        type=str,
        help="3D volume to insert. spt_xx/threed_xx if unspecified",
        default="",
        guitype='filebox',
        browser="EMBrowserWidget(withmodal=True, startpath='.')",
        row=3,
        col=0,
        rowspan=1,
        colspan=2)
    parser.add_argument("--postxf",
                        type=str,
                        help="extra shift after alignment",
                        default="")
    parser.add_argument(
        "--keep",
        type=float,
        help=
        "propotion to keep. will exclude bad particles if this is smaller than 1.0",
        default=1.0)
    parser.add_argument(
        "--gui",
        action="store_true",
        help="open the resulting map and tomogram in a GUI display",
        default=False,
        guitype="boolbox",
        row=4,
        col=0,
        rowspan=1,
        colspan=1)
    parser.add_argument("--ppid", type=int, help="ppid...", default=-1)
    (options, args) = parser.parse_args()
    logid = E2init(sys.argv)

    path = options.path
    itr = options.iter
    try:
        postxf = options.postxf.split(',')
        postxf = [float(i) for i in postxf]
        print("post shift : ", postxf)
    except:
        postxf = [0, 0, 0]

    js = js_open_dict("{}/particle_parms_{:02d}.json".format(path, itr))

    tomo = EMData(options.tomo)
    if options.gui: tomo_orig = tomo.copy()

    if len(options.avg) == 0:
        options.avg = "{}/threed_{:02d}.hdf".format(path, itr)
    avg = EMData(options.avg, 0)
    print("Using averaged map {}".format(options.avg))

    apix_tomo = tomo["apix_x"]
    apix_ptcl = avg["apix_x"]
    shrink = apix_tomo / apix_ptcl

    print(
        "Apix from tomogram {:.2f}, apix from average {:.2f}. Shrinking factor {:.1f}"
        .format(apix_tomo, apix_ptcl, shrink))

    avg.process_inplace("math.fft.resample", {"n": shrink})
    avg.process_inplace("normalize.edgemean")

    tomo.to_zero()

    ptcl = []
    scr = []
    llfile = ""
    bname = base_name(options.tomo)
    for k in js.keys():
        fsp, i = eval(k)
        if fsp[-4:] == ".lst":
            if llfile != fsp:
                llfile = fsp
                lsx = LSXFile(fsp, True)
            i, fsp, x = lsx.read(i)
        if base_name(fsp) == bname:
            ptcl.append((js[k]["score"], fsp, i, js[k]["xform.align3d"]))

    ptcl.sort()
    print(ptcl)

    nptcl = int(len(ptcl) * options.keep)
    if options.keep < 1.0:
        sthr = ptcl[nptcl][0]
    else:
        sthr = 100

    pts = []
    print("{:d} particles total.".format(int(nptcl)))
    if nptcl == 0:
        print("No particles. Exiting")
        sys.exit(0)

    for s, fsp, i, xf in ptcl:
        if s > sthr:
            continue
        a = EMData(fsp, i, True)

        if tomo.has_attr("zshift"):
            zs = tomo["zshift"]
        else:
            zs = 0
        crd = np.array(a["ptcl_source_coord"]) / shrink + [
            tomo["nx"] // 2, tomo["ny"] // 2, tomo["nz"] // 2 + zs / shrink
        ]
        ts = np.array(xf.get_trans())
        ts += postxf
        xf.set_trans((ts / shrink).tolist())
        xf = xf.inverse()
        t = avg.process("xform", {"transform": xf})
        pts.append(crd - ts / 4)
        tomo.insert_scaled_sum(t, crd.tolist())
        print("\t{}/{} finished.".format(len(pts), nptcl), end='\r')
        sys.stdout.flush()

    pts = np.array(pts)
    pfile = "{}/ptcls_pos_{:02d}.pdb".format(path, itr)
    tfile = "{}/ptcls_in_tomo_{}_{:02d}.hdf".format(path, bname, itr)
    tomo.write_compressed(tfile, 0, 8)
    numpy2pdb(fname=pfile, data=pts)
    print("Map {} particles to the tomogram".format(len(pts)))
    print("Particle coordinates written to {}".format(pfile))
    print("Map with particles written to {}".format(tfile))
    js = None
    E2end(logid)

    if options.gui:
        print("opening GUI")
        from eman2_gui.emapplication import get_application, EMApp
        from eman2_gui.emscene3d import EMScene3D
        from eman2_gui.emdataitem3d import EMDataItem3D, EMIsosurface, EMSliceItem3D
        from eman2_gui.emshape import EMShape

        app = EMApp()
        view = EMScene3D()

        # slice through the original tomogram
        tomo_orig_di = EMDataItem3D(tomo_orig, transform=Transform())
        view.insertNewNode('Data', tomo_orig_di, parentnode=view)
        volslice = EMSliceItem3D(tomo_orig_di, transform=Transform())
        view.insertNewNode("Slice", volslice, parentnode=tomo_orig_di)

        # isosurface of reconstituted particles
        tomo_di = EMDataItem3D(tomo, transform=Transform())
        view.insertNewNode('Data', tomo_di, parentnode=view)
        isosurface = EMIsosurface(tomo_di, transform=Transform())
        view.insertNewNode("Iso", isosurface, parentnode=tomo_di)

        view.show()
        try:
            view.raise_()
        except:
            pass

        app.execute()

    print("Done.")
Beispiel #5
0
    def setData(self, data):
        if data == None:
            self.data = None
            return

        elif isinstance(data, str):
            self.datafile = data
            self.nimg = EMUtil.get_image_count(data)

            self.origdata = EMData(data, 0)

            if self.origdata["nz"] == 1:
                if self.nimg > 20:
                    self.origdata = EMData.read_images(
                        data, list(range(0, self.nimg, old_div(self.nimg, 20)))
                    )  # read regularly separated images from the file totalling ~20
                elif self.nimg > 1:
                    self.origdata = EMData.read_images(data,
                                                       list(range(self.nimg)))
                else:
                    self.origdata = [self.origdata]
            else:
                self.origdata = [self.origdata]

        else:
            self.datafile = None
            if isinstance(data, EMData): self.origdata = [data]
            else: self.origdata = data

        self.nx = self.origdata[0]["nx"]
        self.ny = self.origdata[0]["ny"]
        self.nz = self.origdata[0]["nz"]
        if self.apix <= 0.0: self.apix = self.origdata[0]["apix_x"]
        EMProcessorWidget.parmdefault["apix"] = (0, (0.2, 10.0), self.apix,
                                                 None)

        origfft = self.origdata[0].do_fft()
        self.pspecorig = origfft.calc_radial_dist(old_div(self.ny, 2), 0.0,
                                                  1.0, 1)
        ds = old_div(1.0, (self.apix * self.ny))
        self.pspecs = [ds * i for i in range(len(self.pspecorig))]

        if self.viewer != None:
            for v in self.viewer:
                v.close()

        if self.nz == 1 or self.force2d:
            if len(self.origdata) > 1:
                self.viewer = [EMImageMXWidget()]
                self.mfile_save_stack.setEnabled(True)
                self.mfile_save_map.setEnabled(False)
            else:
                self.viewer = [EMImage2DWidget()]
                self.mfile_save_stack.setEnabled(False)
                self.mfile_save_map.setEnabled(True)
        else:
            self.mfile_save_stack.setEnabled(False)
            self.mfile_save_map.setEnabled(True)
            self.viewer = [EMScene3D()]
            self.sgdata = EMDataItem3D(test_image_3d(3), transform=Transform())
            self.viewer[0].insertNewNode('Data',
                                         self.sgdata,
                                         parentnode=self.viewer[0])
            isosurface = EMIsosurface(self.sgdata, transform=Transform())
            self.viewer[0].insertNewNode("Iso",
                                         isosurface,
                                         parentnode=self.sgdata)
            volslice = EMSliceItem3D(self.sgdata, transform=Transform())
            self.viewer[0].insertNewNode("Slice",
                                         volslice,
                                         parentnode=self.sgdata)

        E2loadappwin("e2filtertool", "image", self.viewer[0].qt_parent)

        self.procChange(-1)
Beispiel #6
0
    def __init__(self, application, opt):
        self.options = opt
        """application is an QApplication instance. path is the path for ouput files"""
        QtWidgets.QWidget.__init__(self)

        self.particles = None

        self.app = weakref.ref(application)

        self.setWindowTitle("Main Window (e2gmm.py)")

        # Menu Bar
        #self.mfile=self.menuBar().addMenu("File")
        #self.mfileopen=self.mfile.addAction("Select Particles")
        #self.mfileopencls=self.mfile.addAction("Particles from Classes")
        #self.mfileopencls.setEnabled(False)
        #self.mfilequit=self.mfile.addAction("Quit")

        self.setCentralWidget(QtWidgets.QWidget())
        self.gbl = QtWidgets.QGridLayout(self.centralWidget())
        cen = self.centralWidget()

        self.gbl.setColumnStretch(0, 0)
        self.gbl.setColumnStretch(2, 4)
        self.gbl.setColumnStretch(4, 5)

        # Plot
        self.wplot2d = EMPlot2DWidget()
        self.gbl.addWidget(self.wplot2d, 0, 2, 3, 1)
        self.wplot2d.set_mouse_emit(True)

        # 3-D View
        self.wview3d = EMScene3D()
        self.gbl.addWidget(self.wview3d, 0, 4, 3, 1)

        # Left pane for GMM folder and parameters
        self.gbll = QtWidgets.QGridLayout()
        self.gbl.addLayout(self.gbll, 0, 0, 4, 1)  # 4 rows tall, 1 column wide

        # gmm_XX folder selection
        self.gblfld = QtWidgets.QGridLayout()
        self.gbll.addLayout(self.gblfld, 0, 0)

        self.wlistgmm = QtWidgets.QListWidget()
        self.wlistgmm.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                    QtWidgets.QSizePolicy.Expanding)
        self.update_gmms()
        self.gblfld.addWidget(self.wlistgmm, 0, 0, 1, 2)

        self.wbutnewgmm = QtWidgets.QPushButton("New GMM")
        self.gblfld.addWidget(self.wbutnewgmm, 1, 0)

        self.wbutrefine = QtWidgets.QPushButton("refine_XX")
        self.gblfld.addWidget(self.wbutrefine, 1, 1)

        # run selection
        self.gblrun = QtWidgets.QGridLayout()
        self.gbll.addLayout(self.gblrun, 1, 0)

        self.wlistrun = QtWidgets.QListWidget()
        self.wlistrun.setSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                    QtWidgets.QSizePolicy.Expanding)
        #		self.update_runs()
        self.gblrun.addWidget(self.wlistrun, 0, 0, 1, 2)

        self.wbutrerun = QtWidgets.QPushButton("Rerun")
        self.gblrun.addWidget(self.wbutrerun, 1, 1)

        self.wbutnewrun = QtWidgets.QPushButton("New Run")
        self.gblrun.addWidget(self.wbutnewrun, 1, 0)

        # The form with details about the selected gmm_XX folder
        self.gflparm = QtWidgets.QFormLayout()
        self.gbll.addLayout(self.gflparm, 2, 0)

        self.wlpath = QtWidgets.QLabel("-")
        self.wlpath.setToolTip("Path this GMM is based on")
        self.gflparm.addRow("Path:", self.wlpath)

        self.wedbox = QtWidgets.QLineEdit("256")
        self.wedbox.setToolTip("Box size of input particles in pixels")
        self.gflparm.addRow("Box Size:", self.wedbox)

        self.wedres = QtWidgets.QLineEdit("25")
        self.wedres.setToolTip(
            "Maximum resolution to use for gaussian fitting")
        self.gflparm.addRow("Target Res:", self.wedres)

        self.wedsym = QtWidgets.QLineEdit("c1")
        self.wedsym.setToolTip("Symmetry used during refinement")
        self.gflparm.addRow("Symmetry:", self.wedsym)

        self.wedapix = QtWidgets.QLineEdit("1.0")
        self.wedapix.setToolTip("A/pix of input particles")
        self.gflparm.addRow("A/pix:", self.wedapix)

        self.wedmask = QtWidgets.QLineEdit("")
        self.wedmask.setToolTip("3-D volume mask")
        self.gflparm.addRow("Mask:", self.wedmask)

        self.wedngauss = QtWidgets.QLineEdit("64")
        self.wedngauss.setToolTip("Number of Gaussians")
        self.gflparm.addRow("N Gauss:", self.wedngauss)

        self.weddim = QtWidgets.QLineEdit("4")
        self.weddim.setToolTip(
            "Number of dimensions in the latent space (middle network layer)")
        self.gflparm.addRow("Latent Dim:", self.weddim)

        self.wedtrainiter = QtWidgets.QLineEdit("10")
        self.wedtrainiter.setToolTip("Training iterations per stage")
        self.gflparm.addRow("Train iter:", self.wedtrainiter)

        self.wbutpos = QtWidgets.QPushButton("Position")
        self.wbutpos.setCheckable(True)
        self.wbutpos.setChecked(True)
        self.wbutpos.setToolTip(
            "Include changes of position in the GMM (motion)")
        self.gflparm.addRow("Parameters", self.wbutpos)

        self.wbutamp = QtWidgets.QPushButton("Amplitude")
        self.wbutamp.setCheckable(True)
        self.wbutamp.setChecked(False)
        self.wbutamp.setToolTip(
            "Include changes of amplitude in the GMM (ligand binding)")
        self.gflparm.addRow(" ", self.wbutamp)

        self.wbutsig = QtWidgets.QPushButton("Sigma")
        self.wbutsig.setCheckable(True)
        self.wbutsig.setChecked(False)
        self.wbutsig.setToolTip(
            "Include changes of Gaussian Width in the GMM (rarely useful)")
        self.gflparm.addRow(" ", self.wbutsig)

        self.wlabruntime = QtWidgets.QLabel("-")
        self.gflparm.addRow("Run:", self.wlabruntime)

        # Widgets below plot
        self.gblpltctl = QtWidgets.QGridLayout()
        self.gbl.addLayout(self.gblpltctl, 3, 2)

        self.gblpltctl.addWidget(QtWidgets.QLabel("X Col:", self), 0, 0,
                                 Qt.AlignRight)
        self.wsbxcol = QtWidgets.QSpinBox(self)
        self.wsbxcol.setRange(0, 10)
        self.gblpltctl.addWidget(self.wsbxcol, 0, 1, Qt.AlignLeft)
        self.wsbxcol.setValue(0)

        self.gblpltctl.addWidget(QtWidgets.QLabel("Y Col:", self), 1, 0,
                                 Qt.AlignRight)
        self.wsbycol = QtWidgets.QSpinBox(self)
        self.wsbycol.setRange(0, 10)
        self.gblpltctl.addWidget(self.wsbycol, 1, 1, Qt.AlignLeft)
        self.wsbycol.setValue(1)

        self.wbutdrgrp = QtWidgets.QButtonGroup()

        self.wbutdrmid = QtWidgets.QPushButton("Net Mid")
        self.wbutdrmid.setCheckable(True)
        self.wbutdrmid.setChecked(True)
        self.gblpltctl.addWidget(self.wbutdrmid, 0, 2)
        self.wbutdrgrp.addButton(self.wbutdrmid, 0)

        self.wbutdrpca = QtWidgets.QPushButton("PCA")
        self.wbutdrpca.setCheckable(True)
        self.gblpltctl.addWidget(self.wbutdrpca, 0, 3)
        self.wbutdrgrp.addButton(self.wbutdrpca, 1)

        self.wbutdrpca = QtWidgets.QPushButton("ICA")
        self.wbutdrpca.setCheckable(True)
        self.gblpltctl.addWidget(self.wbutdrpca, 0, 4)
        self.wbutdrgrp.addButton(self.wbutdrpca, 2)

        self.gblpltctl.addWidget(QtWidgets.QLabel("New Dim:", self), 1, 3,
                                 Qt.AlignRight)
        self.wsbnewdim = QtWidgets.QSpinBox(self)
        self.wsbnewdim.setRange(2, 10)
        self.gblpltctl.addWidget(self.wsbnewdim, 1, 4, Qt.AlignLeft)

        self.wcbpntpln = QtWidgets.QComboBox()
        self.wcbpntpln.addItem("Plane")
        self.wcbpntpln.addItem("Point")
        self.wcbpntpln.addItem("Region")
        self.gblpltctl.addWidget(self.wcbpntpln, 1, 2)

        # Widgets below 3D
        self.gbl3dctl = QtWidgets.QGridLayout()
        self.gbl.addLayout(self.gbl3dctl, 3, 4)

        #self.wbutmap=QtWidgets.QPushButton("Map")
        #self.wbutmap.setCheckable(True)
        #self.wbutmap.setChecked(True)
        #self.gbl3dctl.addWidget(self.wbutmap,0,0)

        #self.wbutspheres=QtWidgets.QPushButton("Sphere Mdl")
        #self.wbutspheres.setCheckable(True)
        #self.wbutspheres.setChecked(True)
        #self.gbl3dctl.addWidget(self.wbutspheres,0,1)

        self.wvssphsz = ValSlider(self, (1, 50), "Size:", 3.0, 90)
        self.gbl3dctl.addWidget(self.wvssphsz, 0, 2)

        # Connections
        self.wlistgmm.currentRowChanged[int].connect(self.sel_gmm)
        #self.wbutspheres.clicked[bool].connect(self.new_3d_opt)
        #self.wbutmap.clicked[bool].connect(self.new_3d_opt)
        self.wvssphsz.valueChanged.connect(self.new_sph_size)
        self.wbutnewgmm.clicked[bool].connect(self.add_gmm)
        self.wbutrefine.clicked[bool].connect(self.setgmm_refine)
        self.wlistrun.currentRowChanged[int].connect(self.sel_run)
        self.wbutnewrun.clicked[bool].connect(self.new_run)
        self.wbutrerun.clicked[bool].connect(self.do_run)
        self.wbutdrgrp.buttonClicked[QtWidgets.QAbstractButton].connect(
            self.plot_mode_sel)
        self.wsbxcol.valueChanged[int].connect(self.wplot2d.setXAxisAll)
        self.wsbycol.valueChanged[int].connect(self.wplot2d.setYAxisAll)
        self.wplot2d.mousedown[QtGui.QMouseEvent,
                               tuple].connect(self.plot_mouse)
        self.wplot2d.mouseup[QtGui.QMouseEvent, tuple].connect(self.plot_mouse)
        self.wplot2d.mousedrag[QtGui.QMouseEvent,
                               tuple].connect(self.plot_mouse)
        E2loadappwin("e2gmm", "main", self)

        self.gaussplot = EMScatterPlot3D()
        self.mapdataitem = EMDataItem3D(None)
        self.mapiso = EMIsosurface(self.mapdataitem)
        self.wview3d.insertNewNode("Neutral Map", self.mapdataitem)
        self.wview3d.insertNewNode("Isosurface",
                                   self.mapiso,
                                   parentnode=self.mapdataitem)
        self.wview3d.insertNewNode("Gauss Model", self.gaussplot)