pwem.protocols.protocol_set_editor module

class pwem.protocols.protocol_set_editor.ProtSetEditor(**kwargs)[source]

Bases: pwem.protocols.protocol.EMProtocol

Protocol to edit attributes of all the items of a set using a formula. This could be useful for editing some values in the set. Use this protocol with extreme care, you can easily produce a set that is not consistent. Some predefined operation are offered as given a set of particles with projection alignment modify the alignment matrix so when reconstructed the volume is rotated.

CHOICE_FORMULA = 0
CHOICE_LABEL = {0: 'formula', 1: 'rotate to vector', 2: 'rotate icosahedral'}
CHOICE_ROTATE_ICOSAHEDRAL = 2
CHOICE_ROTATE_VECTOR = 1
LOCAL_SYM_NAME = {6: 'I1', 7: 'I2', 8: 'I3', 9: 'I4', 10: 'I5', 11: 'I6', 12: 'I7', 13: 'I8'}
createOutput(inputSet, modifiedSet)[source]
formulaStep()[source]

Goes through all items in the input set and applies the formula to each of them using exec. Complex python code could be run separating lines with ; To use numpy you could do import numpy; item._resolution.set(numpy.random.randint(10))

rotateIcoStep()[source]

Compute rotation matrix from one icosahedral symmetry to another and apply it to projection directions. Reconstructed volume should change symmetry

rotateStep()[source]
Compute rotation matrix between user provided vectors
(x,y,z) and (x’,y’,z’) and apply it

to projection directions. Reconstructed volume should rotate