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)
def createOutputStep(self): """ Register the output (the alignment and the aligned particles.) """ 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(particles, avg) imgSet = self._createSetOfParticles() imgSet.copyInfo(particles) imgSet.setAlignment2D() outputStk = self._getFileName('particlesAligned') imgSet.readStack(outputStk, postprocessImage=lambda img: img.setTransform(Transform())) self._defineOutputs(outputParticles=imgSet) self._defineTransformRelation(particles, imgSet)
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)