def _defineParams(self, form):
        ProtExtractMovieParticles._defineParams(self, form)
        form.addParam('inputCoordinates', PointerParam, pointerClass='SetOfCoordinates',
                      important=True,
                      label='Input coordinates')
        form.addParam('boxSize', IntParam, default=0,
                      label='Particle box size', validators=[Positive],
                      help='In pixels. The box size is the size of the boxed particles, '
                      'actual particles may be smaller than this.')
        form.addParam('applyAlignment', BooleanParam, default=False,
                      label='Apply alignments to extract?',
                      help='If the input movies contains frames alignment, '
                           'you decide whether to use that information '
                           'for extracting the particles taking into account '
                           'the shifts between frames.')
        line = form.addLine('Frames range',
                      help='Specify the frames range to extract particles from.\n'
                           '  _First_: 1 will be the first frame in the movie.\n'
                           '  _Last_: For any value <= 0, the range will go until '
                           'the last frame. ')
        line.addParam('firstFrame', IntParam, default=1,
                      label='First')
        line.addParam('lastFrame',  IntParam, default=0,
                      label='Last')
        
        form.addSection(label='Preprocess')
        form.addParam('doRemoveDust', BooleanParam, default=True, important=True,
                      label='Dust removal (Recommended)', 
                      help='Sets pixels with unusually large values to random values from a Gaussian '
                      'with zero-mean and unity-standard deviation.')
        form.addParam('thresholdDust', FloatParam, default=3.5, 
                      condition='doRemoveDust', expertLevel=LEVEL_ADVANCED,
                      label='Threshold for dust removal',
                      help='Pixels with a signal higher or lower than this value times the standard '
                      'deviation of the image will be affected. For cryo, 3.5 is a good value.'
                      'For high-contrast negative stain, the signal itself may be affected so '
                      'that a higher value may be preferable.')
        form.addParam('doInvert', BooleanParam, default=False,
                      label='Invert contrast', 
                      help='Invert the contrast if your particles are black over a white background.')
        form.addParam('doNormalize', BooleanParam, default=True,
                      label='Normalize (Recommended)', 
                      help='It subtract a ramp in the gray values and normalizes so that in the '
                      'background there is 0 mean and standard deviation 1.')
        form.addParam('normType', EnumParam, choices=['OldXmipp','NewXmipp','Ramp'], default=2, 
                      condition='doNormalize', expertLevel=LEVEL_ADVANCED,
                      display=EnumParam.DISPLAY_COMBO,
                      label='Normalization type', 
                      help='OldXmipp (mean(Image)=0, stddev(Image)=1).  \n  '
                           'NewXmipp (mean(background)=0, stddev(background)=1)  \n  '
                           'Ramp (subtract background+NewXmipp).  \n  ')
        form.addParam('backRadius', IntParam, default=-1, condition='doNormalize',
                      label='Background radius',
                      help='Pixels outside this circle are assumed to be noise and their stddev '
                      'is set to 1. Radius for background circle definition (in pix.). '
                      'If this value is 0, then half the box size is used.', 
                      expertLevel=LEVEL_ADVANCED)

        #form.addParallelSection(threads=0, mpi=0)
        form.addParallelSection(threads=2, mpi=1)
Пример #2
0
 def _insertAllSteps(self):
     #ROB: deal with the case in which sampling rate use for picking and movies
     #is different
     inputCoords = self.inputCoordinates.get()
     #coordinates sampling mic used for picking
     samplingCoords = inputCoords.getMicrographs().getSamplingRate()
     #coordinates sampling input mic
     samplingMic = self.inputMovies.get().getSamplingRate()
     self.factor = samplingMic / samplingCoords
     #factor = samplingCoords / samplingMic
     ProtExtractMovieParticles._insertAllSteps(self)
 def _insertAllSteps(self):
     #ROB: deal with the case in which sampling rate use for picking and movies
     #is different
     inputCoords = self.inputCoordinates.get()
     #coordinates sampling mic used for picking
     samplingCoords = inputCoords.getMicrographs().getSamplingRate()
     #coordinates sampling input mic
     samplingMic    = self.inputMovies.get().getSamplingRate()
     self.factor = samplingMic / samplingCoords
     #factor = samplingCoords / samplingMic
     ProtExtractMovieParticles._insertAllSteps(self)
Пример #4
0
 def __init__(self, **kwargs):
     ProtExtractMovieParticles.__init__(self, **kwargs)
     self.stepsExecutionMode = STEPS_PARALLEL
Пример #5
0
    def _defineParams(self, form):
        ProtExtractMovieParticles._defineParams(self, form)
        form.addParam('inputCoordinates',
                      PointerParam,
                      pointerClass='SetOfCoordinates',
                      important=True,
                      label='Input coordinates')
        form.addParam(
            'boxSize',
            IntParam,
            default=0,
            label='Particle box size',
            validators=[Positive],
            help='In pixels. The box size is the size of the boxed particles, '
            'actual particles may be smaller than this.')
        form.addParam('applyAlignment',
                      BooleanParam,
                      default=False,
                      label='Apply alignments to extract?',
                      help='If the input movies contains frames alignment, '
                      'you decide whether to use that information '
                      'for extracting the particles taking into account '
                      'the shifts between frames.')
        line = form.addLine(
            'Frames range',
            help='Specify the frames range to extract particles from.\n'
            '  _First_: 1 will be the first frame in the movie.\n'
            '  _Last_: For any value <= 0, the range will go until '
            'the last frame. ')
        line.addParam('firstFrame', IntParam, default=1, label='First')
        line.addParam('lastFrame', IntParam, default=0, label='Last')

        form.addSection(label='Preprocess')
        form.addParam(
            'doRemoveDust',
            BooleanParam,
            default=True,
            important=True,
            label='Dust removal (Recommended)',
            help=
            'Sets pixels with unusually large values to random values from a Gaussian '
            'with zero-mean and unity-standard deviation.')
        form.addParam(
            'thresholdDust',
            FloatParam,
            default=3.5,
            condition='doRemoveDust',
            expertLevel=LEVEL_ADVANCED,
            label='Threshold for dust removal',
            help=
            'Pixels with a signal higher or lower than this value times the standard '
            'deviation of the image will be affected. For cryo, 3.5 is a good value.'
            'For high-contrast negative stain, the signal itself may be affected so '
            'that a higher value may be preferable.')
        form.addParam(
            'doInvert',
            BooleanParam,
            default=False,
            label='Invert contrast',
            help=
            'Invert the contrast if your particles are black over a white background.'
        )
        form.addParam(
            'doNormalize',
            BooleanParam,
            default=True,
            label='Normalize (Recommended)',
            help=
            'It subtract a ramp in the gray values and normalizes so that in the '
            'background there is 0 mean and standard deviation 1.')
        form.addParam(
            'normType',
            EnumParam,
            choices=['OldXmipp', 'NewXmipp', 'Ramp'],
            default=2,
            condition='doNormalize',
            expertLevel=LEVEL_ADVANCED,
            display=EnumParam.DISPLAY_COMBO,
            label='Normalization type',
            help='OldXmipp (mean(Image)=0, stddev(Image)=1).  \n  '
            'NewXmipp (mean(background)=0, stddev(background)=1)  \n  '
            'Ramp (subtract background+NewXmipp).  \n  ')
        form.addParam(
            'backRadius',
            IntParam,
            default=-1,
            condition='doNormalize',
            label='Background radius',
            help=
            'Pixels outside this circle are assumed to be noise and their stddev '
            'is set to 1. Radius for background circle definition (in pix.). '
            'If this value is 0, then half the box size is used.',
            expertLevel=LEVEL_ADVANCED)

        #form.addParallelSection(threads=0, mpi=0)
        form.addParallelSection(threads=2, mpi=1)
Пример #6
0
 def __init__(self, **kwargs):
     ProtExtractMovieParticles.__init__(self, **kwargs)
     self.stepsExecutionMode = STEPS_SERIAL
     self.movieDict = {}
     self.ptclDict = {}
 def __init__(self, **kwargs):
     ProtExtractMovieParticles.__init__(self, **kwargs)
     self.stepsExecutionMode = STEPS_PARALLEL