Exemplo n.º 1
0
    def createOutputStep(self):
        """ Register the output (the alignment and the aligned particles.)
        """
        outputStk = self._getFileName('particlesAligned')
        if not exists(outputStk):
            raise Exception('Ouptput stack %s not produced. ' % outputStk)
        particles = self.inputParticles.get()
        # Create the output average image
        avg = Particle()
        avg.copyInfo(self.inputParticles.get())
        avg.setLocation(NO_INDEX, self.getAverage())
        self._defineOutputs(outputAverage=avg)
        self._defineSourceRelation(self.inputParticles, avg)

        imgSet = self._createSetOfParticles()
        imgSet.copyInfo(particles)
        imgSet.setAlignment2D()

        imgSet.copyItems(particles,
                         updateItemCallback=self._updateItem,
                         itemDataIterator=iter(
                             range(1,
                                   particles.getSize() + 1)))

        self._defineOutputs(outputParticles=imgSet)
        self._defineTransformRelation(self.inputParticles, imgSet)