# *
# * Authors: Scipion Team
# *
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License as published by
# * the Free Software Foundation; either version 2 of the License, or
# * (at your option) any later version.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# * GNU General Public License for more details.
# *
# * You should have received a copy of the GNU General Public License
# * along with this program; if not, write to the Free Software
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# * 02111-1307 USA
# *
# * All comments concerning this program package may be sent to the
# * e-mail address 'scipion-users@lists.sourceforge.net'
# *
# **************************************************************************
from os.path import join
import numpy as np
from emtable import Table
from pwem.convert.transformations import translation_from_matrix, euler_from_matrix
from pwem.emlib.image import ImageHandler
from pyworkflow.utils import getExt, removeBaseExt, replaceBaseExt, makePath
from relion.convert.convert_base import WriterBase
from reliontomo import Plugin
from reliontomo.constants import MRC, SHIFTX_ANGST, SHIFTY_ANGST, SHIFTZ_ANGST, TILT, PSI, ROT
from reliontomo.utils import getTransformMatrix
from tomo.objects import Coordinate3D
[docs]class WriterTomo(WriterBase):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.isPyseg = kwargs.get('isPyseg', False)
self.starHeaders = kwargs.get('starHeaders', None)
self.isRelion4 = Plugin.isRe40()
[docs]class ReaderTomo:
def __init__(self, starFile):
self.starFile = starFile
self.dataTable = Table()
[docs] def read(self, tableName=None):
self.dataTable.read(self.starFile, tableName=tableName)