Home

Awesome

<!-- PROJECT SHIELDS --> <div align="center"> <!-- [![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] -->

<a href="">PyPIPython</a> <a href="">build</a> <a href="">Issues</a> <br /> <a href="">Downloads</a> <a href="">GNU License</a>

</div> <!-- PROJECT LOGO --> <div align="center"> <img src="https://github.com/rraadd88/htsimaging/assets/9945034/66107572-ef49-4852-a228-f6b6aa9b42c8" alt="logo" /> <h1 align="center">htsimaging</h1> <p align="center"> High-Throughput Single-cell Imaging analysis. <br /> <a href="https://github.com/rraadd88/htsimaging#examples">Examples</a> ยท <a href="https://github.com/rraadd88/htsimaging#api">Explore the API</a> </p> </div>

image

Examples

๐Ÿ“ˆ Single-cell protein abundance and its normalization
๐Ÿ“ˆ Single-cell protein abundance by marker localization
๐Ÿ–ผ๏ธ Visualization of the images.
๐Ÿ“ˆ Quantitative analysis of endocytosis.
๐Ÿ“ˆ Single-particle tracking (SPT).
๐Ÿ“ˆ Calculating the recovery rate from a bleach-chase data

Installation

pip install htsimaging              # with basic dependencies  

With additional dependencies as required:

pip install htsimaging[spt]         # for the analysis of the Single-Particle Tracking e.g. endocytosis.

How to cite?

  1. Using BibTeX:
@software{Dandage_htsimaging,
  title   = {htsimaging: High-Throughput Single-cell Imaging analysis in python},
  author  = {Dandage, Rohan},
  year    = {2023},
  url     = {https://zenodo.org/doi/10.5281/zenodo.3697134},
  version = {v1.0.5},
  note    = {The URL is a DOI link to the permanent archive of the software.},
}
  1. DOI link: DOI, or

  2. Using citation information from CITATION.CFF file.

Future directions, for which contributions are welcome

Similar projects

API

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/bleach_chase"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.bleach_chase

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/bleach_chase.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.bleach_chase.stat

Statistical analysis of the bleach-chase


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/bleach_chase/stat.py#L5"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> exp1

exp1(x, lag, amplitude, rate)

One-term exponential.

Parameters:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/bleach_chase/stat.py#L16"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_scores

get_scores(df: DataFrame) โ†’ DataFrame

Calculate the rates other parameters.

Parameters:

Returns:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.endocytosis.io

Processing of the paths of input images to create configurations and metadata.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/io.py#L12"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> make_project_cfg

make_project_cfg(
    prjd: str,
    output_dir_path: str,
    bright_fn_marker: str = None,
    segmented_fn_marker: str = None,
    magnification: int = None,
    image_ext: str = 'tif',
    cores: int = 1,
    test: bool = False,
    force: bool = False
) โ†’ dict

Make the confguration for the analysis run.

Args:

Returns:

Notes:

Infer the magnification from the filenames: if 'T1C1' in cfg['bright_fn_marker']: cfg['magnification']=150 elif cfg['bright_fn_marker']=='_t': cfg['magnification']=100


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/io.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> make_cell_cfg

make_cell_cfg(
    cfg: dict,
    frames: list,
    cells: list,
    trial: str,
    celli: int,
    cellbox: list,
    params_get_signal_summary_by_roi: dict = {'xy_center': None, 'width': 20, 'fun_summary_frame': 'min', 'fun_summary_frames': 'median'},
    filterby_centroid: bool = False,
    scale_signal_cytoplasm: float = 1.5,
    test: bool = False,
    force: bool = False
) โ†’ dict

Make the configuration for an individual cell.

Args:

Returns:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.endocytosis

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.endocytosis.vid

To make the video of the timelapse images.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/vid.py#L9"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> make_gif

make_gif(
    cellcfg=None,
    frames: list = None,
    t_cor: DataFrame = None,
    img_bright=None,
    outd: str = None,
    particle2color: dict = None,
    test: bool = False,
    force: bool = False
)

Make a .gif file out of frames.

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.endocytosis.viz

Visualizations.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/viz.py#L8"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> plot_properties_cell

plot_properties_cell(cellcfg, df2, cols_colorby, colx='x', coly='y')

Plot properties of the cell.

Args:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/viz.py#L52"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> image_locate_particles

image_locate_particles(
    df1: DataFrame,
    frame,
    img_region,
    annotate_particles: str = False,
    fig=None,
    ax: Axes = None
) โ†’ Axes

Plot image with particles.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/viz.py#L84"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> image_trajectories

image_trajectories(
    dtraj: DataFrame,
    img_gfp=None,
    img_bright=None,
    label: bool = True,
    fig=None,
    ax: Axes = None
) โ†’ Axes

Plot trajectories.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/endocytosis/viz.py#L124"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> plot_moving_particles

plot_moving_particles(
    t_cor: DataFrame,
    img_bright=None,
    frame=None,
    framei: int = 0,
    particle2color=None,
    test: bool = False,
    outd: str = None
)

Plot moving particles.

Args:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.lib.io

I/O


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/io.py#L15"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> read_image

read_image(imp: str)

Read image.

Args:

Returns: np.array

TODOs: For a tiff file: from skimage.external import tifffile


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/io.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> arr2vid

arr2vid(
    arr_list: list,
    regions: list,
    kins_mean: float,
    vid_fh: str,
    xpixels: list,
    ypixels: list,
    dpi: int = 100
) โ†’ str

From array to video.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/io.py#L91"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> makevid

makevid(
    gfp_list_stb: list,
    brf_list_stb: list,
    cmap_gfp: str,
    cmap_brf: str,
    vid_fh: str,
    conditionn: int = None,
    interval=None,
    dpi: int = 300
) โ†’ str

Convert to a video.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/io.py#L136"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> nd2arr_list

nd2arr_list(nd_dh: str = None, nd_fns: list = [], nd_fh: str = None) โ†’ list

Raw image to list of arrays.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/io.py#L166"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> to_csv

to_csv(
    fh_xls='../test/test.xlsx',
    nd2_dh='/media/Transcend/20160219_000356_267',
    cores=16
)

Convert nd2 files to csv using parallel processing.

Args:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.lib

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.lib.stat

Statistics.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L10"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> power

power(x, A, B)

power law equation.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L13"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> power_residuals

power_residuals(p, y, x)

Deviations of data from fitted 4PL curve


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L18"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> power_peval

power_peval(x, p)

Evaluated value at x with current parameters.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L23"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> line

line(x, m, C)

power law equation.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L26"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> line_residuals

line_residuals(p, y, x)

Deviations of data from fitted 4PL curve


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L31"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> line_peval

line_peval(x, p)

Evaluated value at x with current parameters.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L36"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic4

logistic4(x, A, B, C, D)

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L38"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic4_residuals

logistic4_residuals(p, y, x)

Deviations of data from fitted 4PL curve


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L43"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic4_peval

logistic4_peval(x, p)

Evaluated value at x with current parameters.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L48"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic5

logistic5(x, A, B, C, D, E)

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L50"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic5_residuals

logistic5_residuals(p, y, x)

Deviations of data from fitted 4PL curve


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L55"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> logistic5_peval

logistic5_peval(x, p)

Evaluated value at x with current parameters.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L60"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> fit_power

fit_power(x, y, p0: list = [0, 1], plot: bool = False)

Fit power law.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L89"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> fit_line

fit_line(x, y, p0: list = [0, 1], plot: bool = False) โ†’ tuple

Fit power law.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L118"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_slope

get_slope(df: DataFrame, ds: Series) โ†’ float

Get slope for a section of the line.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/stat.py#L135"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_inflection_point

get_inflection_point(df: DataFrame, threshold_slope: float = 0.25) โ†’ DataFrame

Get inflation point.

Args:

Returns:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.lib.utils

Utilities for the image processing.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L12"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> filterframe

filterframe(frame, cutoff: float = 0)

Filter a frame.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L30"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> filterframes

filterframes(frames: list, cutoff: float = 0) โ†’ list

Filter the frames.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L48"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_data_by_regions

get_data_by_regions(
    regions: list,
    img=None,
    prop_type: str = 'area'
) โ†’ DataFrame

Get properties by regions.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L74"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> filter_regions

filter_regions(
    regions: list,
    kind='labeled',
    img=None,
    prop_type: str = 'area',
    mn: float = 0,
    mx: float = 0,
    test: bool = False,
    plotp: str = None
) โ†’ list

Filter regions.

Args:

Raises:

Returns:

Notes:

Prefer regionprops_table which is new in sklean's version 0.16.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L144"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> smoothen

smoothen(img)

Smoothen the image.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L159"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> smoothenframes

smoothenframes(frames: list) โ†’ list

Smoothen the images.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L175"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_regions

get_regions(img)

Get regions.

Args:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L199"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> raw2phasecorr

raw2phasecorr(arr_list: list, clip: int = 0) โ†’ list

Correct for the relative translative offset by phase correlation between images.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L238"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> phasecorr_with

phasecorr_with(imlist: list, imlist2: list = None, clip: int = 0)

Correct for the relative translative offset by phase correlation with a set of given images.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L285"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> imlistcropper

imlistcropper(imlist: list, loci: int) โ†’ list

Crop a list of images.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L306"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> imclipper

imclipper(im_stb, clip: float)

Crop an image.

Args:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L326"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_cellprops

get_cellprops(
    regions,
    intensity_imgtype2img,
    properties=['area', 'bbox_area', 'convex_area', 'eccentricity', 'equivalent_diameter', 'euler_number', 'extent', 'filled_area', 'label', 'major_axis_length', 'max_intensity', 'mean_intensity', 'min_intensity', 'minor_axis_length', 'orientation', 'perimeter', 'solidity', 'centroid']
) โ†’ DataFrame

Get cell properties.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/lib/utils.py#L370"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_signal_summary_by_roi

get_signal_summary_by_roi(
    cellframes: list,
    xy_center: tuple = None,
    width: int = 20,
    fun_summary_frame: str = 'min',
    fun_summary_frames: str = 'median'
)

Place of the roi in the image is defined by

Args:

Returns: summary value

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/segment"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.segment

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/segment.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.segment.region

Processing of the segmented regions.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/segment/region.py#L11"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> segmentation2cells

segmentation2cells(
    imsegp: str,
    kind: str = 'yeast',
    fiterby_border_thickness: int = None,
    magnification: int = 100,
    test: bool = False,
    **kws: dict
) โ†’ list

Segment the image to the single cells.

Args:

Returns:

Examples:

  1. Parameters: prop_type='area',mn=100,mx=8000 at 1.5X prop_type='area',mn=1500,mx=12000

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/segment/region.py#L71"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_cellboxes

get_cellboxes(
    regions: list,
    cellbox_width: int = 150,
    test: bool = False
) โ†’ list

Get the bounding boxes of the cells.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/segment/region.py#L109"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> arr_list2regions

arr_list2regions(arr_list: list, time_increment: int) โ†’ tuple

Parameterized cell-segmentation for the time lapse images.

Args:

Returns:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.spt.io

I/O


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/io.py#L10"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> to_frames

to_frames(input_path: str, channeli=None)

Convert to frames.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/io.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> expt_dh2expt_info

expt_dh2expt_info(expt_dh: str) โ†’ DataFrame

Make configuration using the directory structure for an experiment.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/io.py#L78"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> createinfo

createinfo(expt_dh: str) โ†’ str

Create information file.

Args:

Returns: path to the file containing the metadata.

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.spt

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.spt.stat

Statistical analysis of the single particle tracking.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L22"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> test_locate_particles

test_locate_particles(
    cellcfg: dict,
    params_locate: dict,
    frame=None,
    force: bool = False,
    test: bool = False
) โ†’ bool

Test locating of the particles.

Args:

Returns: bool


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L89"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> to_msd

to_msd(
    frames: list,
    coff_intesity_perc: float = 75,
    diameter=11,
    cores: int = 4,
    test: bool = False
) โ†’ tuple

MSD from the nd file.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L126"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> trim_returns

trim_returns(df1: DataFrame) โ†’ DataFrame

Trim images.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L175"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> fill_frame_jumps

fill_frame_jumps(df1: DataFrame, jump_length) โ†’ DataFrame

Fill the frame jumps.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L202"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> cellcfg2distances

cellcfg2distances(
    cellcfg: dict,
    params: dict,
    subtract_drift: bool = False,
    test: bool = False,
    force: bool = False
)

Calculate distances from cell configuration.

Args:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L308"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> apply_cellcfgp2distances

apply_cellcfgp2distances(cellcfgp: str)

Wrapper around cellcfg2distances for multiprocessing.

Args:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L325"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_distance_from_centroid

get_distance_from_centroid(df1: DataFrame, center: list = [75, 75]) โ†’ DataFrame

Get distance from the centroid.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L352"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> distance_effective

distance_effective(particle, frame1, frame2, t_cor: DataFrame) โ†’ float

Effective distance between frames.

Args:

Returns:


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/spt/stat.py#L375"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> get_distance_travelled

get_distance_travelled(t_cor: DataFrame) โ†’ DataFrame

Distance travelled.

Args:

Returns:

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.viz.colors

GLobally used variables.

Global Variables

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.viz.image

Visualization of the images.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz/image.py#L7"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> image_background

image_background(
    img_region=None,
    img=None,
    cmap: str = 'binary_r',
    alpha=1,
    linewidths=1,
    colors='cyan',
    kws_region={},
    show_scalebar=None,
    scalebar_color: str = 'w',
    show_cbar: bool = True,
    test=False,
    ax=None,
    **kws_img
) โ†’ Axes

Plot the image, to be used as a background to the annotations.

Args:

Keyword Args: parameters provided to the plt.imshow.

Returns: plt.Axes


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz/image.py#L87"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> annot_cells

annot_cells(label_image, show_boxes: bool = False, ax: Axes = None) โ†’ Axes

Annotate the cells on an image.

Args:

Returns: plt.Axes


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz/image.py#L114"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> image_regions_annotated

image_regions_annotated(
    img_region,
    img,
    show_boxes: bool = False,
    **kws_img
) โ†’ Axes

Image with the annotated regions. Usage: for QC of the segmentation.

Args:

Keyword Args: parameters provided to the image_background function.

Returns: plt.Axes

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.viz

<!-- markdownlint-disable -->

<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>module</kbd> htsimaging.viz.stat

Visualization of the statistics.


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz/stat.py#L6"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> dist_signal

dist_signal(
    img,
    threshold: float = None,
    label_threshold: float = None,
    params_axvline: dict = {'color': 'r', 'linestyle': 'dashed'},
    ax: Axes = None,
    **kws
) โ†’ Axes

Plot the distribution of intensity.

Args:

Keyword Args: parameters provided to the hist function.

Returns: plt.Axes


<a href="https://github.com/rraadd88/htsimaging/blob/master/htsimaging/viz/stat.py#L42"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

<kbd>function</kbd> plot_summary_stats

plot_summary_stats(input_paths: list, ax: Axes = None) โ†’ Axes

Plot summary stats for a set of images e.g. time-lapse images.

Args:

Returns: plt.Axes