imod.utils module

This module contains utils functions for IMOD protocols

imod.utils.calculateRotationAngleFromTM(ts)[source]

This method calculates que average tilt image rotation angle from its associated transformation matrix.

imod.utils.format3DCoordinatesList(coordFilePath)[source]

This method takes an IMOD-based fiducial coordinates file path and returns a list containing each coordinate for each fiducial belonging to the tilt-series.

imod.utils.formatAngleFile(inputTs, angleFilePath)[source]

This method takes a list containing the angles for each tilt-image belonging to the tilt-series and writes the IMOD-based angle file at the given location.

imod.utils.formatAngleList(tltFilePath)[source]

This method takes an IMOD-based angle file path and returns a list containing the angles for each tilt-image belonging to the tilt-series.

imod.utils.formatFiducialList(fiducialFilePath)[source]

This method takes an IMOD-based fiducial model file path and returns a list containing the coordinates of each fiducial for each tilt-image belonging to the tilt-series.

imod.utils.formatFiducialResidList(fiducialFilePath)[source]

This method takes an IMOD-based fiducial residual model file path and returns a list containing the coordinates and residual values of each fiducial for each tilt-image belonging to the tilt-series. Since IMOD establishes a float value for each coordinate the are parsed to int.

imod.utils.formatGoldBead3DCoordinatesList(coordFilePath)[source]

This method takes the IMOD-based gold bead 3D coordinates obtained with find3dbeads program file path and returns a list containing each coordinate for each bead belonging to the tilt-series

imod.utils.formatTransformFile(ts, transformFilePath)[source]

This method takes a tilt series and the output transformation file path and creates an IMOD-based transform file in the location indicated.

imod.utils.formatTransformationMatrix(matrixFile)[source]

This method takes an IMOD-based transformation matrix file path and returns a 3D matrix containing the transformation matrices for each tilt-image belonging to the tilt-series.

imod.utils.generateCutOnFreqDictionary(ctfTomoSeries)[source]

This method generates a dictionary containing the cut-on frequency estimation information from a ctfTomoSeries object.

imod.utils.generateDefocusAngleDictionary(ctfTomoSeries)[source]

This method generates a dictionary containing the defocus angle estimation information from a ctfTomoSeries object.

imod.utils.generateDefocusIMODFileFromObject(ctfTomoSeries, defocusFilePath)[source]

This methods takes a ctfTomoSeries object a generate a defocus information file in IMOD formatting containing the same information in the specified location.

imod.utils.generateDefocusUDictionary(ctfTomoSeries)[source]

This method generates a dictionary containing the defocus U estimation information from a ctfTomoSeries object.

imod.utils.generateDefocusVDictionary(ctfTomoSeries)[source]

This method generates a dictionary containing the defocus V estimation information from a ctfTomoSeries object.

imod.utils.generateIMODFiducialTextFile(landmarkModel, outputFilePath)[source]

This method takes a Scipion LandmarkModel object and generates a text file in the sepecified location in IMOD convention that contains the information of the position of each fiducial through the tilt-series. :param landmarkModel: landmarkModel Scipion object. :param outputFilePath: location where the output file must be saved.

imod.utils.generatePhaseShiftDictionary(ctfTomoSeries)[source]

This method generates a dictionary containing the phase shift estimation information from a ctfTomoSeries object.

imod.utils.getDefocusFileFlag(defocusFilePath)[source]

This method returns the flag that indicate the information contained in an IMOD defocus file. The flag value “is the sum of:

1 if the file has astigmatism values 2 if the astigmatism axis angle is in radians, not degrees 4 if the file has phase shifts 8 if the phase shifts are in radians, not degrees
16 if tilt angles need to be inverted to match what the
program expects (what Ctfplotter would produce) with the -invert option
32 if the file has cut-on frequencies attenuating the phase

at low frequencies”

from https://bio3d.colorado.edu/imod/doc/man/ctfphaseflip.html

imod.utils.readCTFEstimationInfoFile(defocusFilePath, flag)[source]

This method takes an IMOD-based file path containing the information associated to a CTF estimation and produces a set of dictionaries containing the information of each parameter for each tilt-image belonging to the tilt-series. These dictionaries are readable information for Scipion, useful to generate the corresponding output CTFTomoSeries object.

imod.utils.readDefocusFileAsTable(defocusFilePath)[source]

This method takes an IMOD-based ctf estimation file path and returns a table containing the CTF estimation information of each tilt-image (per line) belonging to the tilt-series.

imod.utils.refactorCTFDefocusAstigmatismPhaseShiftCutOnFreqEstimationInfo(ctfInfoIMODTable)[source]

This method takes a table containing the information of an IMOD-based CTF estimation containing defocus, astigmatism, phase shift information and cut-on frequency (8 columns) and produces a new set of dictionaries containing the same information in a format readable for Scipion. Flag 37.

imod.utils.refactorCTFDefocusAstigmatismPhaseShiftEstimationInfo(ctfInfoIMODTable)[source]

This method takes a table containing the information of an IMOD-based CTF estimation containing defocus, astigmatism and phase shift information (8 columns) and produces a new set of dictionaries containing the same information in a format readable for Scipion. Flag 5.

imod.utils.refactorCTFDefocusEstimationInfo(ctfInfoIMODTable)[source]

This method takes a table containing the information of an IMOD-based CTF estimation containing only defocus information (5 columns) and produces a new dictionary containing the same information in a format readable for Scipion. Flag 0.

imod.utils.refactorCTFDefocusPhaseShiftEstimationInfo(ctfInfoIMODTable)[source]

This method takes a table containing the information of an IMOD-based CTF estimation containing defocus, and phase shift information (6 columns) and produces a new set of dictionaries containing the same information in a format readable for Scipion. Flag 4.

imod.utils.refactorCTFDesfocusAstigmatismEstimationInfo(ctfInfoIMODTable)[source]

This method takes a table containing the information of an IMOD-based CTF estimation containing defocus and astigmatism information (7 columns) and produces a set of dictionaries table containing the same information in a format readable for Scipion. Flag 1.