def OnSave(self, event=None): from Priithon.all import Mrc, U, Y fn = Y.FN(1)#, verbose=0) if not fn: return if fn[-4:] in [ ".mrc", ".dat" ]: Mrc.save(self.m_imgArr, fn) elif fn[-5:] in [ ".fits" ]: U.saveFits(self.m_imgArr, fn) else: U.saveImg8(self.m_imgArr, fn) Y.shellMessage("### section saved to '%s'\n"%fn)
def OnSave(self, event=None): from Priithon.all import Mrc, U, Y fn = Y.FN(1) #, verbose=0) if not fn: return if fn[-4:] in [".mrc", ".dat"]: Mrc.save(self.m_imgArr, fn) elif fn[-5:] in [".fits"]: U.saveFits(self.m_imgArr, fn) else: U.saveImg8(self.m_imgArr, fn) Y.shellMessage("### section saved to '%s'\n" % fn)
def OnMenuSaveND(self, ev=None): if self.data.dtype.type in (N.complex64, N.complex128): dat = self.dataCplx datX = abs(self.data) #CHECK else: dat = datX = self.data from Priithon.all import Mrc, U, FN, Y fn = FN(1,0) if not fn: return if fn[-4:] in [ ".mrc", ".dat" ]: Mrc.save(dat, fn) elif fn[-5:] in [ ".fits" ]: U.saveFits(dat, fn) else: # save as sequence of image files # if fn does contain something like '%0d' auto-insert '_%0NNd' # with NN to just fit the needed number of digits datX = datX.view() datX.shape = (-1,)+datX.shape[-2:] U.saveImg8_seq(datX, fn) Y.shellMessage("### Y.vd(%d) saved to '%s'\n"%(self.id, fn))
def OnMenuSaveND(self, ev=None): if self.data.dtype.type in (N.complex64, N.complex128): dat = self.dataCplx datX = abs(self.data) #CHECK else: dat = datX = self.data from Priithon.all import Mrc, U, FN, Y fn = FN(1, 0) if not fn: return if fn[-4:] in [".mrc", ".dat"]: Mrc.save(dat, fn) elif fn[-5:] in [".fits"]: U.saveFits(dat, fn) else: # save as sequence of image files # if fn does contain something like '%0d' auto-insert '_%0NNd' # with NN to just fit the needed number of digits datX = datX.view() datX.shape = (-1, ) + datX.shape[-2:] U.saveImg8_seq(datX, fn) Y.shellMessage("### Y.vd(%d) saved to '%s'\n" % (self.id, fn))