Module Expr Str ImportFrom alias alias alias Import alias Import alias identifier ImportFrom alias Import alias identifier ImportFrom alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr For TupleStore NameStore TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr ListLoad NameLoad Num Call AttributeLoad NameLoad attr ListLoad BinOpAdd NameLoad NameLoad SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore TupleLoad Call AttributeLoad NameLoad attr ListLoad NameLoad Num Call AttributeLoad NameLoad attr ListLoad BinOpAdd NameLoad NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad body Raise Call NameLoad Str Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpAdd NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad attr If UnaryOpNot CompareEq Num BinOpMod Call NameLoad NameLoad Num body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr CompareGtE Call AttributeLoad NameLoad attr NameLoad Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr If BoolOpAnd NameLoad NameLoad body If CompareNotEq Call NameLoad NameLoad BinOpSub Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad body TryExcept body Assign NameStore BinOpAdd Call NameLoad NameLoad Num handlers ExceptHandler type NameLoad body Raise Call NameLoad Str orelse If NameLoad body If CompareNotEq NameLoad Call NameLoad NameLoad body Raise Call NameLoad Str If NameLoad body If CompareNotEq BinOpSub NameLoad Num Call NameLoad NameLoad body Raise Call NameLoad Str If UnaryOpNot NameLoad body Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Assign NameStore BinOpMult Call AttributeLoad NameLoad attr BinOpSub NameLoad Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Num NameLoad Assign NameStore Call AttributeLoad AttributeLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If UnaryOpNot CompareEq Num BinOpMod Call NameLoad NameLoad Num body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr CompareGtE Call AttributeLoad NameLoad attr NameLoad Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index CompareLt NameLoad Num BinOpAdd BinOpMult Num AttributeLoad NameLoad attr SubscriptLoad NameLoad Index CompareLt NameLoad Num Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Num BinOpMult Num AttributeLoad NameLoad attr keyword BinOpAdd Num NameLoad keyword NameLoad AugAssignAdd NameStore NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad For NameStore Call NameLoad BinOpFloorDiv Call NameLoad NameLoad Num body Assign NameStore BinOpBitAnd CompareLtE SubscriptLoad NameLoad Index BinOpMult Num NameLoad NameLoad CompareLt NameLoad SubscriptLoad NameLoad Index BinOpAdd BinOpMult Num NameLoad Num Assign SubscriptStore NameLoad Index NameLoad BinOpAdd SubscriptLoad NameLoad Index NameLoad BinOpMult BinOpSub NameLoad Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num For NameStore NameLoad body For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index CompareEq NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareNotEq AttributeLoad NameLoad attr SubscriptLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Slice Num body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad SubscriptLoad NameLoad Index Num attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Call NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num TupleLoad Num Num NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad Assign NameStore CompareGt NameLoad NameLoad Assign NameStore BinOpDiv SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad Call NameLoad NameLoad CompareEq NameLoad NameLoad Index Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr CompareGt Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr BinOpAdd BinOpMult SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Index NameLoad Assign NameStore SubscriptLoad NameLoad Index CompareGt NameLoad Num Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Assign NameStore BinOpFloorDiv BinOpAdd Call AttributeLoad NameLoad attr CompareNotEq BinOpMod NameLoad Num Num NameLoad Num Num Num Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad attr If UnaryOpNot CompareEq Num BinOpMod Call NameLoad NameLoad Num body Raise Call NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr CompareGtE Call AttributeLoad NameLoad attr NameLoad Num body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If BoolOpAnd CompareIs NameLoad NameLoad CompareIs NameLoad NameLoad body Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice SubscriptLoad NameLoad Index Num Slice SubscriptLoad NameLoad Index Num orelse If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str For NameStore TupleLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad attr If UnaryOpNot CompareEq Num BinOpMod Call NameLoad NameLoad Num body Raise Call NameLoad Str Assign NameStore ListLoad For NameStore NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Return Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Assign NameStore Num For NameStore NameLoad body If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str Assign TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr ListLoad SubscriptLoad NameLoad Index Num Num Call AttributeLoad NameLoad attr ListLoad SubscriptLoad NameLoad Index Num Num Call AttributeLoad NameLoad attr ListLoad SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num Num Call AttributeLoad NameLoad attr ListLoad SubscriptLoad NameLoad Index Num BinOpSub SubscriptLoad NameLoad Index Num Num AugAssignAdd NameStore Num Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list
N/A N/A 
This module contain convenience methods to generate ROI labeled arrays for
simple shapes such as rectangles and concentric circles.
 __future__ absolute_import division print_function N/A collections N/A scipy.ndimage.measurements ndim skimage.draw line N/A numpy np N/A utils N/A logging N/A logger N/A N/A logging getLogger __name__ rectangles N/A N/A coords shape N/A N/A N/A 
    This function wil provide the indices array for rectangle region of
    interests.

    Parameters
    ----------
    coords : iterable
        coordinates of the upper-left corner and width and height of each
        rectangle: e.g., [(x, y, w, h), (x, y, w, h)]

    shape : tuple
        Image shape which is used to determine the maximum extent of output
        pixel coordinates. Order is (rr, cc).

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are specified
        in coords. Order is (rr, cc).

     N/A labels_grid N/A N/A np zeros shape dtype N/A np int64 N/A N/A i N/A col_coor row_coor col_val row_val N/A enumerate coords N/A N/A N/A left right N/A N/A N/A np max N/A col_coor 0 N/A N/A np min N/A N/A col_coor col_val N/A shape N/A 0 N/A N/A top bottom N/A N/A N/A np max N/A row_coor 0 N/A N/A np min N/A N/A row_coor row_val N/A shape N/A 1 N/A slc1 N/A slice left right N/A slc2 N/A slice top bottom N/A N/A N/A np any N/A labels_grid N/A N/A slc1 slc2 N/A N/A N/A ValueError overlapping ROIs N/A N/A labels_grid N/A N/A slc1 slc2 N/A i 1 N/A labels_grid N/A rings N/A N/A edges center shape N/A N/A N/A 
    Draw annual (ring-shaped) shaped regions of interest.

    Each ring will be labeled with an integer. Regions outside any ring will
    be filled with zeros.

    Parameters
    ----------
    edges: list
        giving the inner and outer radius of each ring
        e.g., [(1, 2), (11, 12), (21, 22)]
    center: tuple
        point in image where r=0; may be a float giving subpixel precision.
        Order is (rr, cc).
    shape: tuple
        Image shape which is used to determine the maximum extent of output
        pixel coordinates. Order is (rr, cc).

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are specified
        in edges.
     N/A edges N/A N/A N/A N/A np atleast_2d N/A N/A np asarray edges ravel N/A N/A N/A 0 N/A N/A len edges 2 N/A N/A N/A ValueError edges should have an even number of elements, giving inner, outer radii for each ring N/A N/A N/A N/A np all N/A N/A N/A np diff edges 0 N/A N/A N/A ValueError edges are expected to be monotonically increasing, giving inner and outer radii of each ring from r=0 outward N/A r_coord N/A N/A N/A N/A utils radial_grid center shape ravel N/A N/A _make_roi r_coord edges shape N/A ring_edges N/A N/A inner_radius width spacing num_rings N/A 0 None N/A N/A  Calculate the inner and outer radius of a set of rings.

    The number of rings, their widths, and any spacing between rings can be
    specified. They can be uniform or varied.

    Parameters
    ----------
    inner_radius : float
        inner radius of the inner-most ring

    width : float or list of floats
        ring thickness
        If a float, all rings will have the same thickness.

    spacing : float or list of floats, optional
        margin between rings, 0 by default
        If a float, all rings will have the same spacing. If a list,
        the length of the list must be one less than the number of
        rings.

    num_rings : int, optional
        number of rings
        Required if width and spacing are not lists and number
        cannot thereby be inferred. If it is given and can also be
        inferred, input is checked for consistency.

    Returns
    -------
    edges : array
        inner and outer radius for each ring

    Example
    -------
    # Make two rings starting at r=1px, each 5px wide
    >>> ring_edges(inner_radius=1, width=5, num_rings=2)
    [(1, 6), (6, 11)]
    # Make three rings of different widths and spacings.
    # Since the width and spacings are given individually, the number of
    # rings here is simply inferred.
    >>> ring_edges(inner_radius=1, width=(5, 4, 3), spacing=(1, 2))
    [(1, 6), (7, 11), (13, 16)]
     N/A width_is_list N/A isinstance width N/A collections Iterable N/A spacing_is_list N/A isinstance spacing N/A collections Iterable N/A N/A width_is_list spacing_is_list N/A N/A N/A N/A len width N/A N/A len spacing 1 N/A N/A N/A ValueError List of spacings must be one less than list of widths. N/A N/A num_rings None N/A N/A N/A N/A num_rings N/A len width N/A N/A N/A TypeError N/A N/A N/A N/A num_rings N/A N/A len spacing 1 N/A N/A N/A TypeError N/A N/A N/A ValueError Since width and spacing are constant, num_rings cannot be inferred and must be specified. N/A N/A width_is_list N/A N/A N/A num_rings N/A len width N/A N/A N/A ValueError num_rings does not match width list N/A spacing_is_list N/A N/A N/A N/A num_rings 1 N/A len spacing N/A N/A N/A ValueError num_rings does not match spacing list N/A N/A width_is_list N/A N/A width N/A N/A N/A np ones num_rings width N/A N/A spacing_is_list N/A N/A spacing N/A N/A N/A np ones N/A num_rings 1 spacing N/A all_spacings N/A N/A np insert spacing 0 inner_radius N/A steps N/A N/A N/A N/A N/A np array N/A all_spacings width T ravel N/A edges N/A N/A N/A N/A np cumsum steps reshape -1 2 N/A edges N/A segmented_rings N/A N/A edges segments center shape offset_angle N/A 0 N/A N/A 
    Parameters
    ----------
    edges : array
         inner and outer radius for each ring

    segments : int or list
        number of pie slices or list of angles in radians
        That is, 8 produces eight equal-sized angular segments,
        whereas a list can be used to produce segments of unequal size.

    center : tuple
        point in image where r=0; may be a float giving subpixel precision.
        Order is (rr, cc).

    shape: tuple
        Image shape which is used to determine the maximum extent of output
        pixel coordinates. Order is (rr, cc).

    angle_offset : float or array, optional
        offset in radians from offset_angle=0 along the positive X axis

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are specified
        in edges and segments

     N/A edges N/A N/A N/A N/A np asarray edges ravel N/A N/A N/A 0 N/A N/A len edges 2 N/A N/A N/A ValueError edges should have an even number of elements, giving inner, outer radii for each ring N/A N/A N/A N/A np all N/A N/A N/A np diff edges 0 N/A N/A N/A ValueError edges are expected to be monotonically increasing, giving inner and outer radii of each ring from r=0 outward N/A agrid N/A N/A utils angle_grid center shape N/A N/A agrid N/A N/A agrid 0 N/A N/A 2 N/A np pi N/A agrid N/A N/A agrid 0 N/A segments_is_list N/A isinstance segments N/A collections Iterable N/A segments_is_list N/A N/A segments N/A N/A N/A np asarray segments offset_angle N/A N/A segments N/A N/A np linspace 0 N/A 2 N/A np pi num N/A 1 segments endpoint True N/A segments offset_angle N/A ind_grid N/A N/A N/A N/A np digitize N/A N/A np ravel agrid segments right False reshape shape N/A label_array N/A N/A np zeros shape dtype N/A np int64 N/A rgrid N/A N/A utils radial_grid center shape N/A len_segments N/A len segments N/A i N/A range N/A N/A len edges 2 N/A N/A indices N/A N/A N/A edges N/A N/A 2 i rgrid N/A rgrid N/A edges N/A N/A N/A 2 i 1 N/A N/A label_array N/A indices N/A N/A ind_grid N/A indices N/A N/A len_segments 1 i N/A label_array N/A roi_max_counts N/A N/A images_sets label_array N/A N/A N/A 
    Return the brightest pixel in any ROI in any image in the image set.

    Parameters
    ----------
    images_sets : array
        iterable of 4D arrays
        shapes is: (len(images_sets), )

    label_array : array
        labeled array; 0 is background.
        Each ROI is represented by a distinct label (i.e., integer).

    Returns
    -------
    max_counts : int
        maximum pixel counts
     N/A max_cts 0 N/A img_set images_sets N/A N/A img img_set N/A N/A max_cts N/A max max_cts N/A N/A ndim maximum img label_array N/A max_cts N/A roi_pixel_values N/A N/A image labels index N/A None N/A N/A 
    This will provide intensities of the ROI's of the labeled array
    according to the pixel list
    eg: intensities of the rings of the labeled array

    Parameters
    ----------
    image : array
        image data dimensions are: (rr, cc)

    labels : array
        labeled array; 0 is background.
        Each ROI is represented by a distinct label (i.e., integer).

    index_list : list, optional
        labels list
        eg: 5 ROI's
        index = [1, 2, 3, 4, 5]

    Returns
    -------
    roi_pix : list
        intensities of the ROI's of the labeled array according
        to the pixel list

     N/A N/A N/A labels shape N/A image shape N/A N/A N/A ValueError Shape of the image data should be equal to shape of the labeled array N/A N/A index None N/A N/A index N/A N/A np arange 1 N/A N/A N/A np max labels 1 N/A roi_pix N/A N/A n index N/A N/A N/A N/A roi_pix append N/A image N/A N/A labels n N/A N/A roi_pix index N/A mean_intensity N/A N/A images labeled_array index N/A None N/A N/A Compute the mean intensity for each ROI in the image list

    Parameters
    ----------
    images : list
        List of images
    labeled_array : array
        labeled array; 0 is background.
        Each ROI is represented by a nonzero integer. It is not required that
        the ROI labels are contiguous
    index : int, list, optional
        The ROI's to use. If None, this function will extract averages for all
        ROIs

    Returns
    -------
    mean_intensity : array
        The mean intensity of each ROI for all `images`
        Dimensions:
            len(mean_intensity) == len(index)
            len(mean_intensity[0]) == len(images)
    index : list
        The labels for each element of the `mean_intensity` list
     N/A N/A N/A labeled_array shape N/A N/A N/A images N/A 0 shape N/A 0 N/A N/A N/A ValueError N/A `images` shape (%s) needs to be equal to the labeled_array shape(%s) N/A N/A N/A images N/A 0 shape N/A labeled_array shape N/A N/A index None N/A N/A index N/A list N/A N/A np unique labeled_array N/A N/A N/A index remove 0 N/A N/A N/A N/A len index N/A N/A N/A TypeError N/A N/A index N/A index N/A mean_intensity N/A N/A np zeros N/A N/A N/A images shape N/A 0 N/A len index N/A N/A n img N/A enumerate images N/A N/A N/A mean_intensity N/A n N/A N/A ndim mean img labeled_array index index N/A N/A mean_intensity index N/A circular_average N/A N/A image calibrated_center threshold nx pixel_size min_x max_x N/A 0 100 N/A 1 1 None None N/A N/A Circular average of the the image data
    The circular average is also known as the radial integration
    Parameters
    ----------
    image : array
        Image to compute the average as a function of radius
    calibrated_center : tuple
        The center of the image in pixel units
        argument order should be (row, col)
    threshold : int, optional
        Ignore counts above `threshold`
        default is zero
    nx : int, optional
        number of bins in x
        defaults is 100 bins
    pixel_size : tuple, optional
        The size of a pixel (in a real unit, like mm).
        argument order should be (pixel_height, pixel_width)
        default is (1, 1)
    min_x : float, optional number of pixels
        Left edge of first bin defaults to minimum value of x
    max_x : float, optional number of pixels
        Right edge of last bin defaults to maximum value of x
    Returns
    -------
    bin_centers : array
        The center of each bin in R. shape is (nx, )
    ring_averages : array
        Radial average of the image. shape is (nx, ).
     N/A radial_val N/A N/A utils radial_grid calibrated_center N/A image shape pixel_size N/A N/A bin_edges sums counts N/A N/A utils bin_1D N/A N/A np ravel radial_val N/A N/A np ravel image nx min_x min_x max_x max_x N/A th_mask N/A counts threshold N/A ring_averages N/A N/A sums N/A th_mask N/A counts N/A th_mask N/A bin_centers N/A N/A N/A utils bin_edges_to_centers bin_edges N/A th_mask N/A N/A bin_centers ring_averages N/A kymograph N/A N/A images labels num N/A N/A N/A 
    This function will provide data for graphical representation of pixels
    variation over time for required ROI.

    Parameters
    ----------
    images : array
        Image stack. dimensions are: (num_img, num_rows, num_cols)
    labels : array
        labeled array; 0 is background. Each ROI is represented by an integer
    num : int
        The ROI to turn into a kymograph

    Returns
    -------
    kymograph : array
        data for graphical representation of pixels variation over time
        for required ROI

     N/A kymo N/A N/A N/A n img N/A enumerate images N/A N/A N/A N/A kymo append N/A N/A roi_pixel_values img N/A labels num N/A 0 N/A N/A N/A np vstack kymo N/A extract_label_indices N/A N/A labels N/A N/A N/A 
    This will find the label's required region of interests (roi's),
    number of roi's count the number of pixels in each roi's and pixels
    list for the required roi's.

    Parameters
    ----------
    labels : array
        labeled array; 0 is background.
        Each ROI is represented by a distinct label (i.e., integer).

    Returns
    -------
    label_mask : array
        1D array labeling each foreground pixel
        e.g., [1, 1, 1, 1, 2, 2, 1, 1]

    indices : array
        1D array of indices into the raveled image for all
        foreground pixels (labeled nonzero)
        e.g., [5, 6, 7, 8, 14, 15, 21, 22]
     N/A img_dim N/A labels shape N/A w N/A N/A np where N/A N/A N/A np ravel labels 0 N/A grid N/A N/A np indices N/A N/A img_dim N/A 0 N/A img_dim N/A 1 N/A pixel_list N/A N/A N/A np ravel N/A N/A N/A grid N/A 0 N/A img_dim N/A 1 N/A grid N/A 1 N/A w N/A label_mask N/A labels N/A N/A labels 0 N/A N/A label_mask pixel_list N/A _make_roi N/A N/A coords edges shape N/A N/A N/A  Helper function to create ring rois and bar rois

    Parameters
    ----------
    coords : array
        shape is image shape
    edges : list
        List of tuples of inner (left or top) and outer (right or bottom)
        edges of each roi.
        e.g., edges=[(1, 2), (11, 12), (21, 22)]
    shape : tuple
        Shape of the image in which to create the ROIs
        e.g., shape=(512, 512)

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are
        specified in `edges`.
        Has shape=`image shape`
     N/A label_array N/A N/A np digitize coords edges right False N/A label_array N/A N/A N/A N/A np where N/A N/A label_array 2 0 label_array 0 1 2 N/A N/A N/A label_array reshape shape N/A bar N/A N/A edges shape horizontal values N/A True None N/A N/A Draw bars defined by `edges` from one edge to the other of `image_shape`

    Bars will be horizontal or vertical depending on the value of `horizontal`

    Parameters
    ----------
    edges : list
        List of tuples of inner (left or top) and outer (right or bottom)
        edges of each bar.
        e.g., edges=[(1, 2), (11, 12), (21, 22)]
    shape : tuple
        Shape of the image in which to create the ROIs
        e.g., shape=(512, 512)
    horizontal : bool, optional
        True: Make horizontal bars
        False: Make vertical bars
        Defaults to True
    values : array, optional
        image pixels co-ordinates

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are
        specified in `edges`.
        Has shape=`image shape`

    Note
    ----
    The primary use case is in GISAXS.
     N/A edges N/A N/A N/A N/A np atleast_2d N/A N/A np asarray edges ravel N/A N/A N/A 0 N/A N/A len edges 2 N/A N/A N/A ValueError edges should have an even number of elements, giving inner, outer edge value for each bar N/A N/A N/A N/A np all N/A N/A N/A np diff edges 0 N/A N/A N/A ValueError edges are expected to be monotonically increasing, giving inner and outer radii of each bar from r=0 outward N/A N/A values None N/A N/A values N/A N/A np repeat N/A range N/A shape N/A 0 N/A shape N/A 1 N/A N/A horizontal N/A N/A values N/A N/A np tile N/A range N/A shape N/A 1 N/A shape N/A 0 N/A N/A _make_roi values edges shape N/A box N/A N/A shape v_edges h_edges h_values v_values N/A None None None N/A N/A Draw box shaped rois when the horizontal and vertical edges
     are provided.

    Parameters
    ----------
    shape : tuple
        Shape of the image in which to create the ROIs
        e.g., shape=(512, 512)
    v_edges : list
        giving the inner and outer edges of each vertical bar
        e.g., [(1, 2), (11, 12), (21, 22)]
    h_edges : list, optional
        giving the inner and outer edges of each horizontal bar
        e.g., [(1, 2), (11, 12), (21, 22)]
    h_values : array, optional
        image pixels co-ordinates in horizontal direction
        shape has to be image shape
    v_values : array, optional
        image pixels co-ordinates in vertical direction
        shape has to be image shape

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are specified
        in edges.

    Note
    ----
    To draw boxes according to the image pixels co-ordinates has to provide
    both h_values and v_values. The primary use case is in GISAXS.
    e.g., v_values=gisaxs_qy, h_values=gisaxs_qx

     N/A N/A h_edges None N/A N/A h_edges v_edges N/A N/A N/A h_values None N/A v_values None N/A N/A N/A v_values h_values N/A N/A np mgrid N/A N/A N/A shape N/A 0 N/A N/A shape N/A 1 N/A N/A N/A N/A h_values shape N/A v_values shape N/A N/A N/A ValueError Shape of the h_values array should be equal to shape of the v_values array N/A edges N/A h_edges v_edges N/A N/A edges N/A N/A N/A N/A np atleast_2d N/A N/A np asarray edges ravel N/A N/A N/A 0 N/A N/A len edges 2 N/A N/A N/A ValueError edges should have an even number of elements, giving inner, outer edges for each roi N/A coords N/A N/A h h_edges N/A N/A v v_edges N/A N/A N/A N/A coords append N/A N/A h N/A 0 N/A v N/A 0 N/A N/A h N/A 1 N/A h N/A 0 N/A N/A v N/A 1 N/A v N/A 0 N/A N/A rectangles coords N/A v_values shape N/A lines N/A N/A end_points shape N/A N/A N/A 
    Parameters
    ----------
    end_points : iterable
        coordinates of the starting point and the ending point of each
        line: e.g., [(start_x, start_y, end_x, end_y), (x1, y1, x2, y2)]
    shape : tuple
        Image shape which is used to determine the maximum extent of output
        pixel coordinates. Order is (rr, cc).

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are specified
        in coords. Order is (rr, cc).

     N/A label_array N/A N/A np zeros shape dtype N/A np int64 N/A label 0 N/A points end_points N/A N/A N/A N/A len points 4 N/A N/A N/A ValueError end points should have four number of elements, giving starting co-ordinates, ending co-ordinates for each line N/A N/A rr cc N/A line N/A N/A np max N/A N/A points N/A 0 0 N/A N/A np max N/A N/A points N/A 1 0 N/A N/A np min N/A N/A points N/A 2 N/A N/A shape N/A 0 1 N/A N/A np min N/A N/A points N/A 3 N/A N/A shape N/A 1 1 N/A label 1 N/A N/A label_array N/A N/A rr cc label N/A label_array N/A