Functions
The list of functions. Full API documentation is available at megafish package.
load
Workflow Functions |
Description |
|---|---|
Creates Zarr arrays for image data in cycle, tile, and spatial (z, y, x) dimensions, then loads .ims images into these arrays using metadata from an image path CSV. |
|
Creates Zarr arrays for image data in cycle, tile, and spatial (z, y, x) dimensions, then loads TIFF images into these arrays using metadata from an image path CSV. |
|
Reads a single stitched .ims image and divides it into smaller tile_y, tile_x segments for loading. This segmented image is primarily used for registration purposes. |
|
Reads a single stitched TIFF image and divides it into smaller tile_y, tile_x segments for loading. |
Helper Functions |
Description |
|---|---|
Generates a CSV file listing all cycle directories within a specified image directory. Each cycle directory must contain tiled images organized by color, z, y, and x. |
|
Generates a CSV file mapping image paths to cycle, tile, and channel information based on a directory list CSV file. |
|
Generates a CSV file mapping image paths to cycle, tile, and channel information using CSV files containing image paths and cycle directories. |
register
Workflow Functions |
Description |
|---|---|
Calculates and stores cycle shifts for aligning image tiles based on phase correlation and feature matching. |
|
Calculates and stores tile shifts for aligning image tiles based on phase correlation and feature matching. |
|
Creates a dummy tile shifts CSV file with identity transformation values. |
|
Merges cycle and tile shift transformations and saves the combined shifts as a CSV file. |
|
Registers and stitches image tiles based on transformation matrices, creating a registered dataset in Zarr format. |
|
Registers and stitches image tiles based on transformation matrices, creating a registered dataset in Zarr format. This version does not use a reference stitched image group, but instead takes the stitched shape directly as input. |
process
Workflow Functions |
Description |
|---|---|
Creates a projection of the image data along a specified dimension using the specified method. |
|
Applies a mask to the image data, setting masked regions to zero. |
|
Applies a Gaussian blur to the image data. |
|
Applies binarization to the image data based on a threshold. |
segment
Workflow Functions |
Description |
|---|---|
Applies a binary dilation operation to the image data. |
|
Merges split labels in an image dataset by applying offsets and resolving conflicts. |
|
Expands labeled regions in an image using a Voronoi-like approach, filling the image based on the nearest labeled pixel within a specified maximum distance. |
|
Applies a mask to the target image data, setting values outside the mask to zero. |
|
Fills holes in labeled regions of an image dataset. |
|
Removes labeled regions touching the edges of the image. |
|
Identifies and labels the edges of labeled regions in an image dataset, with adjustable thickness. |
|
Repeats an image dataset over multiple cycles. |
|
Generates segment information CSV files from image data stored in a Zarr file, summarizing properties such as area and centroid for each segment. Merges the CSV files into a single summary. |
|
Merges multiple groups of image data from a Zarr file into a single output group. |
|
Normalizes intensity values across groups within an image dataset and computes the maximum intensity projection (MIP). |
|
Selects a slice from an image dataset along a specified dimension. |
|
Merges multiple groups of image data from a Zarr file into a single output group. |
|
Normalizes intensity values across a specified dimension and computes the maximum intensity projection (MIP). |
tif
Workflow Functions |
Description |
|---|---|
Saves image data from a Zarr file as individual TIFF files for each chunk. |
|
Loads TIFF images into a Zarr dataset using the structure of a template group. |
|
Creates a tiled montage of images from a Zarr file and saves it as a single TIFF file. |
|
Saves the entire image from a Zarr file as a TIFF file, with an option to clip the image. |
|
Saves specific chunks of image data from a Zarr file as individual TIFF files. |
|
Combines individual red, green, and blue image groups from a Zarr file into RGB images and saves them as TIFF files. |
seqfish
Workflow Functions |
Description |
|---|---|
Applies a Difference of Gaussians (DoG) filter to the image data in a Zarr file. |
|
Detects local maxima in the image data within a Zarr file using a specified footprint. |
|
Selects spots in the image data based on intensity, using a threshold defined by the mean intensity and standard deviation. |
|
Selects spots in the image data based on a specified intensity threshold. |
|
Counts spots within labeled segments in the image data stored in a Zarr file and saves the results as CSV files. |
|
Summarizes spot counts across multiple groups and cycles, merging the results with segment data and optionally gene names. |
|
Extracts coordinates of spots from the image data stored in a Zarr file and saves them as CSV files. |
|
Computes the intensity of spots within segmented regions for each chunk of the image data and saves the results as CSV files. |
Helper Functions |
Description |
|---|---|
Calculates the standard deviations for the Difference of Gaussians (DoG) based on the point spread function (PSF) and imaging parameters. |
|
Calculates the footprint for detecting local maxima based on the point spread function (PSF) and imaging parameters. |
decode
Workflow Functions |
Description |
|---|---|
Applies MERFISH prefiltering steps, including high-pass filtering, Richardson-Lucy deconvolution, and low-pass filtering. |
|
Scales the intensity of the image data stored in a Zarr file based on a given percentile and scaling factor. |
|
Calculates the L2 norm (Euclidean norm) of the image data across cycles stored in a Zarr file. |
|
Divides the filtered image data by the calculated norm values for normalization. |
|
Calculates the nearest neighbor for each pixel’s intensity trace in an image dataset using a precomputed codebook. |
|
Splits the nearest neighbor dataset into two separate datasets: one for the code indices and one for the distances. |
|
Filters decoded spots based on intensity, distance, and area criteria. |
|
Extracts and records the coordinates of decoded spots within nuclei, saving the information in a CSV file for each chunk. |
Helper Functions |
Description |
|---|---|
Generates a Gaussian kernel for spatial filtering. This kernel is used for spatial filtering in the MERFISH prefiltering step. |
seqif
Workflow Functions |
Description |
|---|---|
Subtracts consecutive cycles in the image data, assuming cycles are organized as TCEP and non-TCEP pairs. |
|
Selects and retains only the even cycles in the dataset, removing all odd cycles. |
|
Calculates the mean intensity of labeled segments in an image dataset and saves the results as a CSV file. |
|
Summarizes intensity data for multiple groups and saves the results as a CSV file. |
view
Workflow Functions |
Description |
|---|---|
Generates a pyramid of downsampled image data from a zarr dataset and writes it back to zarr storage. |
|
Creates an edge mask around binary regions in an image using dilation and erosion. |
napari
Function Name |
Description |
|---|---|
Visualizes 2D tiled image data from a Zarr dataset using napari. |
|
Visualizes multiscale registered image data from a Zarr dataset using napari, with optional gene name display. |
|
Visualizes registered image data with image stitching from a Zarr dataset using napari, with optional gene name display. |
|
Visualizes segmented and labeled image data from a Zarr dataset using napari, with support for multiscale images. |
misc
Module Name |
Description |
|---|---|
Manages the resource configuration for the MEGA-FISH framework, allowing for GPU usage and scheduling settings with Dask. |
|
Provides utility functions for natural sorting, generating tile coordinates based on scanning patterns. |