Code

Utility functions

A diverse set of functions that do everything from plotting to computing centers of curvature to performing fast interpolation.

Below is a listing of the core functions along with a short description and an example of how to call the function. For details about each function, use the Matlab help command.
Ex: help computeProblemScales

binData():
Bin N-D scatter point data.
[n, cents, sz, data_limits] = binData(X, nbins, density_threshold, smooth_data, maintain_aspectRatio)
cart2hex():
Convert from cartesian points to hexagon center points.
[hx,hy] = cart2hex(cp,a,b)
computeBoundaryInformation():
Compute the boundary contours, inward pointing normal vectors, curvature, and centers of curvature.
[B,n,curvature,curvatureCenters] = computeBoundaryInformation(BW,objectScale,options)
computePotentialParameters():
Solve for the potential parameters that result in the potential depth, potential minimum location, and potential attractive extent given.
parameterStruct = computePotentialParameters(depths,minimum_Locations,extents,file)
computeProblemScales():
Compute the scale factors and data transformations for the problem.
problem_scales = computeProblemScales(options, grid_size, data_limits)
compute_objectScale():
Compute the maximum distance transform value for each object in a binary mask.
objectScale = compute_objectScale(BW, pixelList)
createObjectImages():
Create full images with N rows from a pixel list and sets of values.
varargout = createObjectImages(pixelList, N, varargin)
[Aimg, Bimg] = createObjectImages(pixelList, N, A, B)
create_test_3D_object():
Create a fake set of 3D data for testing based off of the example nuclei image, testNuclei_mask.
dat = create_test_3D_object(N)
decimateData():
Bin 2D spatial data and return a single value for each bin.
dcmt = decimateData(x,y,z)
dcmt = decimateData(x,y,z,'binSize',vS,'gridType',type,'reductionMethod',method,'cleanHexagonData',tf,'generatePlots',tf)
displayProgress():
Class to help with displaying progress during calculation.
progress = displayProgress(num_iterations, num_updates, active, is_parallel)
evaluatePerformance():
Compute the F1 and fractional distribution of the difference between the true number of nuclei in each clump and the computed number of nuclei in each clump.
[F1, dN] = evaluatePerformance(nucleiCenters, dr)
frequencyGaussianFilter():
Filter data with a Gaussian filter in frequency space.
A = frequencyGaussianFilter(A, sigma, hsize, padding)
getCurvatureAndCenters():
Compute boundary curvature and centers of curvature.
[kappa,CoC_linIdx,negKappaInds,d_bndry,CoC,kappa_s] = getCurvatureAndCenters(BWperim,imSize,sigma,maxRadius,useConvexHull)
getGridWignerSeitz():
Convert the Wigner-Seitz radius to grid space.
rs = getGridWignerSeitz(problem_scales, options)
getObjectOfInterest():
Return the Object_Of_Interest element of the input arrays.
varargout = getObjectOfInterest(Object_Of_Interest, varargin)
[A, B, C] = getObjectOfInterest(Object_Of_Interest, A_in, B_in, C_in)
A = A_in(Object_Of_Interest)
getPdistInds():
Get the indices of the pairs formed by pdist().
inds = getPdistInds(N)
get_minimum_uint_class():
Return the class name for the smallest unsigned integer class that will hold the input without overflow.
class_name = get_minimum_uint_class(A)
get_overlap_factor():
Compute the expected overlap factor of the sub-objects for each object in the binary mask BW.
overlap_factors = get_overlap_factor(BW)
hex2cart():
Convert from hexagon center points to Cartesian points.
[cpx,cpy] = hex2cart(hx,a,b)
hexplot():
Create a hexagonal scatter plot.
p = hexplot(cartCents,a,b)
p = hexplot(cartCents,a,b,'colorData',cd,'sizeData',sd,'colorScale',cs,'sizeScale',ss,'maxHexSize',mhs,'orientation',o,'parent',p)
interp2mex():
Fast 2-D bilinear interpolation
Zi = interp2mex(Z, Xi, Yi)
is_in_parallel():
Determine if function is being run in parallel.
answer = is_in_parallel()
isosurfaceProjectionPlot():
Plot isosurfaces of N-D data (N>2) projected down to 3-D, and plot the 2-D projections of the isosurfaces to the three axis planes.
fig = isosurfaceProjectionPlot(n, dims, isoLvls)
load_truth():
Load truth data about the nuclei center locations.
[truth, nuclei_per_object] = load_truth(trial_str)
nakeinterp1():
Fast 1D interpolation using a dichotomy search of indices.
idx = nakeinterp1(x, y, xi);
ndGaussianFilter():
Create an N-D Gaussian filter.
h = ndGaussianFilter(N,sigma,hsize)
publishDocumentation():
Function to create the documentation data used in creating the website.
publishDocumentation()
publishExample():
Function to publish an example script to markdown for the website.
publishExample(file)
publishExample(file, reEvaluate)
removePadding():
Remove padding from and N-D matrix.
A = removePadding(A, pad_size)
setTheme():
Set a figure theme to light or dark.
setTheme(fig,darkLight)
sizeof():
Get the size in bytes of the input numeric class.
out = sizeof(in)
visualizeNuclei():
Display 9 random nuclei clumps from the 5 test images and plot the true nuclei centers.
visualizeNuclei()
visualizeNuclei(markers)