def createOutputStep(self): particles = self.inputParticles.get() # Generate the SetOfAlignmet alignedSet = self._createSetOfParticles() alignedSet.copyInfo(particles) inputMd = self._getPath('aligned_particles.xmd') alignedSet.copyItems(particles, updateItemCallback=self._updateItem, itemDataIterator=md.iterRows(inputMd, sortByLabel=md.MDL_ITEM_ID)) # Remove alignment 2D alignedSet.setAlignment(ALIGN_NONE) # Define the output average avgFile = self._getExtraPath("average.xmp") imgh = ImageHandler() avgImage = imgh.computeAverage(alignedSet) avgImage.write(avgFile) avg = Particle() avg.setLocation(1, avgFile) avg.copyInfo(alignedSet) self._defineOutputs(outputAverage=avg) self._defineSourceRelation(self.inputParticles, avg) self._defineOutputs(outputParticles=alignedSet) self._defineSourceRelation(self.inputParticles, alignedSet)
def createOutputStep(self): subtomograms = self.inputSubtomograms.get() alignedSet = self._createSetOfSubTomograms() alignedSet.copyInfo(subtomograms) inputMd = self._getPath('output_subtomograms.stk') alignedSet.copyItems(subtomograms, updateItemCallback=self._updateItem, itemDataIterator=md.iterRows( inputMd, sortByLabel=md.MDL_ITEM_ID)) alignedSet.setAlignment(pwem.ALIGN_NONE) avgFile = self._getExtraPath("average.mrc") imgh = ImageHandler() avgImage = imgh.computeAverage(alignedSet) avgImage.write(avgFile) avg = AverageSubTomogram() avg.setLocation(1, avgFile) avg.copyInfo(alignedSet) self._defineOutputs(outputAverage=avg) self._defineSourceRelation(self.inputSubtomograms, avg) self._defineOutputs(outputSubtomograms=alignedSet) self._defineSourceRelation(self.inputSubtomograms, alignedSet)