def __setXmippImage(label):
     attr = '_xmipp_' + xmipp.label2Str(label)
     if not hasattr(particle, attr):
         img = Image()
         setattr(particle, attr, img)
         img.setSamplingRate(particle.getSamplingRate())
     else:
         img = getattr(particle, attr)
     img.setLocation(xmippToLocation(row.getValue(label)))
 def __setXmippImage(label):
     attr = '_xmipp_' + xmipp.label2Str(label)
     if not hasattr(particle, attr):
         img = Image()
         setattr(particle, attr, img)
         img.setSamplingRate(particle.getSamplingRate())
     else:
         img = getattr(particle, attr)
     img.setLocation(xmippToLocation(row.getValue(label)))
    def createOutputStep(self):
        # Really load the input, since in the streaming case we can not
        # use the self.inputMovies directly
        allFramesSum = self._getPath('all_frames_sum.mrc')
        allFramesAvg = self._getPath('all_frames_avg.mrc')
        self._loadInputList()
        n = len(self.listOfMovies)

        ih = ImageHandler()
        sumImg = ih.read(allFramesSum)
        sumImg.inplaceDivide(float(n))
        sumImg.write(allFramesAvg)

        outputAvg = Image()
        outputAvg.setFileName(allFramesAvg)
        outputAvg.setSamplingRate(self.listOfMovies[0].getSamplingRate())
        self._defineOutputs(outputAverage=outputAvg)
        self._defineSourceRelation(self.inputMovies, outputAvg)