MyFunctions

class MyFunctions

Fields

cal3d_center

int cal3d_center

cal3d_wmh

double[] cal3d_wmh

cal3d_z

double[] cal3d_z

caltable

ResultsTable caltable

debug

boolean debug

dtable

ResultsTable dtable

gblur

GaussianBlur gblur

live_view

ImagePlus live_view

ptable

ResultsTable ptable

ptable_lock

java.util.concurrent.locks.Lock ptable_lock

Constructors

MyFunctions

public MyFunctions(boolean live_view)

Methods

argmax

int argmax(double[] arr)

argmin

int argmin(double[] arr)

clearRegion

void clearRegion(double thrsh, ImageProcessor ip, boolean[][] mask, int xstart, int xend, int ystart, int yend)

detectParticles

int detectParticles(ImageProcessor ip, MyDialogs dg, int nframe)

Particle finding method, will search the image for particles.

Parameters:
  • ip – image to search for particles on
  • dg – dialog manager
  • nframe – the frame index corresponding to this image

dispose

public void dispose()

getClosest

int getClosest(double value, double[] arr, int center)

getMaxPositions

int[] getMaxPositions(ImageProcessor ip)

getNextImage

ImagePlus getNextImage(MyDialogs dg, int frame)

Grabs a new image on an observed folder on the case of the analysis being attached to the acquisition.

Parameters:
  • dg – dialog manager
  • frame – frame index to search for on the folder
Returns:

found image

getParticle

boolean getParticle(ImageProcessor ip, boolean[][] mask, int[] maxs, MyDialogs dg, ResultsTable ptable, int nframe)

Particle analysis method, called for each particle candidate found by detectParticles.

Parameters:
  • ip – image to search for particles on
  • dg – dialog manager
  • nframe – the frame index corresponding to this image

getParticleForCalibration

double[] getParticleForCalibration(ImageProcessor ip, MyDialogs dg, int xstart, int xend, int ystart, int yend)

getZ

double getZ(double wmh)

Given a calculated width-minus-height (wmh) converts this value into the corresponding coordinate in Z by comparing against the loaded Z-calibration table. Only used it the particle is disturbed by astigmatism.

Parameters:
  • wmh – the width-minus-height of a particle
Returns:

corresponding z-position value, will return 9999 if wmh is out of limits

initialize3d

void initialize3d()

Loads values from the calibration table into the cal3d_* arrays.

log

void log(java.lang.String txt)

mean

double mean(double[] array, int start, int stop)

movingMean

double[] movingMean(double[] arr, int window)

showTable

void showTable()