def good_particles(state, inbox=True, inboxrad=False, fullinbox=False,<EOL>pos=None, rad=None, ishape=None):
if pos is None:<EOL><INDENT>pos = state.obj_get_positions()<EOL><DEDENT>if rad is None:<EOL><INDENT>rad = state.obj_get_radii()<EOL><DEDENT>mask = rad > <NUM_LIT:0><EOL>if (inbox | inboxrad | fullinbox):<EOL><INDENT>if fullinbox:<EOL><INDENT>mask &= trim_box(state, pos, rad=-rad, ishape=ishape)<EOL><DEDENT>elif inboxrad:<EOL><INDENT>mask &= trim_box(state, pos, rad=rad, ishape=ishape)<EOL><DEDENT>else:<EOL><INDENT>mask &= trim_box(state, pos, rad=None, ishape=ishape)<EOL><DEDENT><DEDENT>return mask<EOL>
Returns a mask of `good' particles as defined by
    * radius > 0
    * position inside box

Parameters
----------
    state : :class:`peri.states.ImageState`
        The state to identify the good particles. If pos, rad, and ishape
        are provided, then this does not need to be passed.
    inbox : Bool
        Whether to only count particle centers within the image. Default
        is True.
    inboxrad : Bool
        Whether to only count particles that overlap the image at all.
        Default is False.
    fullinbox : Bool
        Whether to only include particles which are entirely in the
        image. Default is False
    pos : [3,N] np.ndarray or None
        If not None, the particles' positions.
    rad : [N] element numpy.ndarray or None
        If not None, the particles' radii.
    ishape : 3-element list-like or None
        If not None, the inner region of the state.

Returns
-------
    mask : np.ndarray of bools
        A boolean mask of which particles are good (True) or bad.
See Also
--------
    trim_box