コード例 #1
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
コード例 #2
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
コード例 #3
0
ファイル: protocol_batch.py プロジェクト: josegutab/scipion
    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)

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

                micPairO = TiltPair()
                micPairO.setUntilted(untilted)
                micPairO.setTilted(tilted)
                output.append(micPairO)
        # Register outputs
        outputDict = {'outputMicrographsTiltPair': output}
        self._defineOutputs(**outputDict)
        return output
コード例 #4
0
ファイル: protocol_tiltpairs.py プロジェクト: I2PC/scipion
 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 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)
コード例 #6
0
ファイル: protocol_batch.py プロジェクト: I2PC/scipion
    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