Lattice Microbes 2.5
This is for whole cell modeling
Loading...
Searching...
No Matches
jLM.ImageAnalysis Namespace Reference

Classes

class  SvgContext

Functions

 _makeMaskPath (binarySlice)
 mplBoundaryPath (binarySlice, faceColor='none', edgeColor='r', extent=None)
 _processImgToDisplay (img, cmap, scl, vmin, vmax, mode='rgba')
 imshow (img, scl=None, cmap="inferno", vmin=None, vmax=None, xlines=[], ylines=[])
 alphaBlend (rgbaBottom, rgbaTop)
 _interpretColor (c)
 markup (imgIn, scl=4, cmap="inferno", vmin=None, vmax=None, markerColor="blue", markerWeight=1, markerSize=2, markers=None, mask=None, maskColor="green", maskWeight=1, svgFile=None)

Detailed Description

Image analysis tools.

Function Documentation

◆ _interpretColor()

jLM.ImageAnalysis._interpretColor ( c)
protected
Here is the caller graph for this function:

◆ _makeMaskPath()

jLM.ImageAnalysis._makeMaskPath ( binarySlice)
protected
Here is the caller graph for this function:

◆ _processImgToDisplay()

jLM.ImageAnalysis._processImgToDisplay ( img,
cmap,
scl,
vmin,
vmax,
mode = 'rgba' )
protected
Here is the caller graph for this function:

◆ alphaBlend()

jLM.ImageAnalysis.alphaBlend ( rgbaBottom,
rgbaTop )
Alpha blend two rgba images

Arguments:
    rgbaBottom:
        Image of dimensions (N,M,4) to use as base
    rgbaTop:
        Image of dimensions (N,M,4) to blend atop rgbaBottom
Returns:
    Blended rgba image

◆ imshow()

jLM.ImageAnalysis.imshow ( img,
scl = None,
cmap = "inferno",
vmin = None,
vmax = None,
xlines = [],
ylines = [] )
Quick display of array in notebook

Arguments:
    img (array):
        A grayscale image of shape (M,N) or a rgb image of shape (M,N,3)

Keyword Arguments:
    scl (int):
        Factor to upscale image

    cmap (str):
        Matplotlib colormap

    vmin (float):
        Minimum value

    vmax (float):
        Maximum value

    xlines (list):
        List of lines of constant x

    ylines (list):
        List of lines of constant y

Returns:
   PIL.Image: PIL image which is displayed in Jupyter
Here is the call graph for this function:

◆ markup()

jLM.ImageAnalysis.markup ( imgIn,
scl = 4,
cmap = "inferno",
vmin = None,
vmax = None,
markerColor = "blue",
markerWeight = 1,
markerSize = 2,
markers = None,
mask = None,
maskColor = "green",
maskWeight = 1,
svgFile = None )
Markup an image

Markup generates nearest-neighbor interpolated images with binary mask outlines,
and labeled points. Colors are specified as an RGB triple, a hex code, or a named
color.

Arguments:
    imgIn:
        Image data, either mono (N,M), rgb (N,M,3), or rgba (N,M,4)
Keyword arguments:
    scl (int):
        Upscale image by factor
    cmap (str):
        Matplotlib colormap name:
    vmin (float):
        Minimum value
    vmax (float):
        Maximum value
    markers:
        Markers to place. Either a single x,y pair, a list of x,y pairs, or a dictionary
        where keys are the marker color and the values are the x,y pair
    markerColor:
        Color of + markers.
    markerWeight:
        Linewidth of + markers in pixels
    markerSize:
        Diameter of + markers
    mask:
        Binary mask(s) to trace. Either a single numpy array, or a dictionary with color 
        keys mapping to binary arrays. The outline is placed around the True elements
    maskColor:
        Color of mask outline
    maskWeight:
        Linewidth of mask outline in pixels
    svgFile:
        Also write the SVG output to this file
        
Returns:
    IPython.core.display.SVG
Here is the call graph for this function:

◆ mplBoundaryPath()

jLM.ImageAnalysis.mplBoundaryPath ( binarySlice,
faceColor = 'none',
edgeColor = 'r',
extent = None )
Generate a Matplotlib patch defining the boundaries of a binary image.

Arguments:
    binarySlice:
        Binary 2D image
Keyword Arguments:
    faceColor:
        Matplotlib color of interior (True)
    edgeColor:
        Matplotlib color of boundary
Returns:
    matplotlib.patches.PathPatch: patches
Here is the call graph for this function: