def setDimFromMrcHdr(self, hdr, extInts=None, extFloats=None): """ set dimensions using a Mrc header """ #self.writeHeader(hdr, extInts, extFloats, byteorder) self.hdr = makeHdr_like(hdr) self.setPixelSize(*hdr.d[::-1]) nz = hdr.Num[2] // (hdr.NumWaves * hdr.NumTimes) dtype = Mrc.MrcMode2dtype(hdr.PixelType) self.setDim(hdr.Num[0], hdr.Num[1], nz, hdr.NumTimes, hdr.NumWaves, dtype, hdr.wave, hdr.ImgSequence)#, 1, False)
def setDimFromMrcHdr(self, hdr): try: # inside package from ..Priithon import Mrc except ValueError: # Attempted relative import beyond toplevel package from Priithon import Mrc #from Priithon.all import Mrc self.wave = hdr.wave self.nw = hdr.NumWaves self.nt = hdr.NumTimes self.nx = hdr.Num[0] self.ny = hdr.Num[1] self.nz = hdr.Num[2] // (self.nt * self.nw) self.imgSequence = hdr.ImgSequence self.dtype = Mrc.MrcMode2dtype(hdr.PixelType) if self.multipage: self._setSecSize() else: self._setSuffix()