예제 #1
0
    def _createSubSetFromMicrographsTiltPair(self, micrographsTiltPair):
        """ Create a subset of Micrographs Tilt Pair. """
        output = MicrographsTiltPair(filename=self._getPath('micrographs_pairs.sqlite'))
        print "self._dbName=%s" % self._dbName
        modifiedSet = MicrographsTiltPair(filename=self._dbName, prefix=self._dbPrefix)
        inputU = micrographsTiltPair.getUntilted()
        inputT = micrographsTiltPair.getTilted()
        outputU = SetOfMicrographs(filename=self._getPath('mics_untilted.sqlite'))
        outputT = SetOfParticles(filename=self._getPath('mics_tilted.sqlite'))
        outputU.copyInfo(inputU)
        outputT.copyInfo(inputT)
        for micPairI in modifiedSet:
            untilted = micPairI.getUntilted()
            tilted = micPairI.getTilted()
            if micPairI.isEnabled():

                micPairO = TiltPair()
                micPairO.setUntilted(untilted)
                micPairO.setTilted(tilted)
                output.append(micPairO)
                outputU.append(untilted)
                outputT.append(tilted)
        output.setUntilted(outputU)
        output.setTilted(outputT)
        # Register outputs
        outputDict = {'outputMicrographsTiltPair': output}
        self._defineOutputs(**outputDict)
        self._defineTransformRelation(micrographsTiltPair, output)
        return output
예제 #2
0
    def _createSubSetFromMicrographsTiltPair(self, micrographsTiltPair):
        """ Create a subset of Micrographs Tilt Pair. """
        output = MicrographsTiltPair(
            filename=self._getPath('micrographs_pairs.sqlite'))
        modifiedSet = MicrographsTiltPair(filename=self._dbName,
                                          prefix=self._dbPrefix)
        inputU = micrographsTiltPair.getUntilted()
        inputT = micrographsTiltPair.getTilted()
        outputU = SetOfMicrographs(
            filename=self._getPath('mics_untilted.sqlite'))
        outputT = SetOfParticles(filename=self._getPath('mics_tilted.sqlite'))
        outputU.copyInfo(inputU)
        outputT.copyInfo(inputT)

        for micPairI in modifiedSet:
            untilted = micPairI.getUntilted()
            tilted = micPairI.getTilted()

            if micPairI.isEnabled():
                micPairO = TiltPair()
                micPairO.setUntilted(untilted)
                micPairO.setTilted(tilted)
                output.append(micPairO)
                outputU.append(untilted)
                outputT.append(tilted)
        output.setUntilted(outputU)
        output.setTilted(outputT)
        # Register outputs
        outputDict = {'outputMicrographsTiltPair': output}
        self._defineOutputs(**outputDict)
        self._defineTransformRelation(micrographsTiltPair, output)
        return output
예제 #3
0
 def createTiltedPairsStep(self):
     args = {} 
     self.micsPairsSqlite = self._getPath('micrographs_pairs.sqlite')
     cleanPath(self.micsPairsSqlite) # Delete if exists
     
     micsTiltPair = MicrographsTiltPair(filename=self.micsPairsSqlite)
     micsU = self.importMicrographs(self.patternUntilted.get(), 'Untilted',
                              self.voltage.get(), self.sphericalAberration.get(), self.ampContrast.get())
     micsT = self.importMicrographs(self.patternTilted.get(), 'Tilted',
                              self.voltage.get(), self.sphericalAberration.get(), self.ampContrast.get())
     
     micsTiltPair.setUntilted(micsU)
     micsTiltPair.setTilted(micsT)
     
     for micU, micT in izip(micsU, micsT):
         micsTiltPair.append(TiltPair(micU, micT))
     
     args[self.OUTPUT_NAME] = micsTiltPair
     self._defineOutputs(**args)
예제 #4
0
    def createTiltedPairsStep(self):
        args = {}
        self.micsPairsSqlite = self._getPath('micrographs_pairs.sqlite')
        cleanPath(self.micsPairsSqlite)  # Delete if exists

        micsTiltPair = MicrographsTiltPair(filename=self.micsPairsSqlite)
        micsU = self.importMicrographs(self.patternUntilted.get(), 'Untilted',
                                       self.voltage.get(),
                                       self.sphericalAberration.get(),
                                       self.ampContrast.get())
        micsT = self.importMicrographs(self.patternTilted.get(), 'Tilted',
                                       self.voltage.get(),
                                       self.sphericalAberration.get(),
                                       self.ampContrast.get())

        micsTiltPair.setUntilted(micsU)
        micsTiltPair.setTilted(micsT)

        for micU, micT in izip(micsU, micsT):
            micsTiltPair.append(TiltPair(micU, micT))

        args[self.OUTPUT_NAME] = micsTiltPair
        self._defineOutputs(**args)
예제 #5
0
    def _createSubSetFromMicrographsTiltPair(self, micrographsTiltPair):
        """ Create a subset of Micrographs Tilt Pair. """
        output = MicrographsTiltPair(filename=self._getPath('micrographs_pairs.sqlite'))
        modifiedSet = MicrographsTiltPair(filename=self._dbName,
                                          prefix=self._dbPrefix)
        inputU = micrographsTiltPair.getUntilted()
        inputT = micrographsTiltPair.getTilted()
        outputU = SetOfMicrographs(filename=self._getPath('mics_untilted.sqlite'))
        outputT = SetOfMicrographs(filename=self._getPath('mics_tilted.sqlite'))
        outputU.copyInfo(inputU)
        outputT.copyInfo(inputT)

        for micPair, u, t in izip(modifiedSet, inputU, inputT):
            if micPair.isEnabled():
                output.append(micPair)
                outputU.append(u)
                outputT.append(t)
        output.setUntilted(outputU)
        output.setTilted(outputT)
        # Register outputs
        outputDict = {'outputMicrographsTiltPair': output}
        self._defineOutputs(**outputDict)
        self._defineTransformRelation(micrographsTiltPair, output)
        return output