def coordsFactory(iteration): # newCoord = Coordinate(x=i, y=i) # To avoid dict get newCoord = Coordinate() newCoord.setX(iteration) newCoord.setY(iteration) newCoord.extra1 = Integer(1) newCoord.extra2 = Integer(1) newCoord.extra3 = Integer(1) newCoord.extra4 = Integer(1) newCoord.extra5 = Integer(1) newCoord.extra6 = Integer(1) newCoord.extra7 = Integer(1) newCoord.extra8 = Integer(1) newCoord.extra9 = Integer(1) newCoord.extra10 = Integer(1) newCoord.extra11 = Integer(1) newCoord.extra12 = Integer(1) newCoord.extra13 = Integer(1) newCoord.extra14 = Integer(1) newCoord.extra15 = Integer(1) newCoord.extra16 = Integer(1) newCoord.extra17 = Integer(1) newCoord.extra18 = Integer(1) newCoord.extra19 = Integer(1) newCoord.extra20 = Integer(1) return newCoord
def basiccoordsFactory(self, iteration): # newCoord = Coordinate(x=i, y=i) # To avoid dict get newCoord = Coordinate() newCoord.setX(iteration) newCoord.setY(iteration) return newCoord
def createOutputStep(self): input = self.input.get() imgSetOut = self._createSetOfParticles() imgSetOut.setSamplingRate(input.getSamplingRate()) imgSetOut.setAlignmentProj() for i, subtomo in enumerate(input.iterItems()): idx = subtomo.getObjId() p = Particle() p.setLocation(ih._convertToLocation((i+1, self._getExtraPath("projections.mrcs")))) p._subtomogramID = String(idx) if type(subtomo) == SubTomogram: if subtomo.hasCoordinate3D(): coord = Coordinate() coord.setX(subtomo.getCoordinate3D().getX(const.BOTTOM_LEFT_CORNER)) coord.setY(subtomo.getCoordinate3D().getY(const.BOTTOM_LEFT_CORNER)) p.setCoordinate(coord) p.setClassId(subtomo.getClassId()) if subtomo.hasTransform(): transform = Transform() transform.setMatrix(subtomo.getTransform().getMatrix()) p.setTransform(transform) imgSetOut.append(p) imgSetOut.setObjComment(self.getSummary(imgSetOut)) self._defineOutputs(outputParticles=imgSetOut) self._defineSourceRelation(self.input, imgSetOut) if self.radAvg.get(): avgFile = self._getExtraPath("average.xmp") imgh = ih() avgImage = imgh.computeAverage(imgSetOut) avgImage.write(avgFile) avg = Particle() avg.setLocation(1, avgFile) avg.copyInfo(imgSetOut) self._defineOutputs(outputAverage=avg) self._defineSourceRelation(self.input, avg)