Ejemplo n.º 1
0
        selection.start()
        selection.clearAndSelect(
            pixelselectioncourieri.ColorSelection(ms, imageobj, self.reference,
                                                  self.range))


registeredclass.Registration(
    'Color Range',
    pixelselectionmod.SelectionModifier,
    ColorRange,
    ordering=3.14,
    params=[
        whoville.WhoParameter('image',
                              whoville.getClass('Image'),
                              tip=parameter.emptyTipString),
        color.NewColorParameter('reference', tip='Reference color.'),
        colordiffparameter.ColorDifferenceParameter(
            'range', tip='Deviation from the reference color.')
    ],
    tip="Select all pixels similar to a reference color.",
    discussion="""<para>

    Select all pixels in an &image; within a given
    <varname>range</varname> of a given <varname>refererence</varname>
    color.  This command basically does the same thing that <xref
    linkend='MenuItem:OOF.Graphics_n.Toolbox.Pixel_Select.Color'/>
    does except the latter takes its <varname>reference</varname>
    input from a mouse click in the Graphics window.

    </para>""")
Ejemplo n.º 2
0
        self.operator.operate(
            selection,
            pixelselectioncourieri.ColorSelection(ms, image, ref_color,
                                                  self.range))


pixelselection.VoxelSelectionMethodRegistration(
    'Color',
    ColorSelector,
    ordering=0.6,
    events=['up'],
    params=[
        parameter.passive(
            pointparameter.iPointParameter(
                'point',
                tip="Where the mouse was clicked.",
            )),
        colordiffparameter.ColorDifferenceParameter(
            'range', tip='Acceptable deviation from the reference color.'),
        selectionoperators.SelectionOperatorParam('operator', passive=1)
    ],
    whoclasses=['Image'],
    tip="""\
Select voxels whose color is close
to that of a selected reference voxel.
Click to select just the target voxels.
Shift click to retain previously selected voxels.
Control click to toggle the target voxels.
Shift-control click to deselect the target voxels.""",
    discussion=xmlmenudump.loadFile('DISCUSSIONS/image/reg/colorselect.xml'))