public class LocalPhase
extends java.lang.Object
implements ij.plugin.filter.PlugInFilter, ij.gui.DialogListener, java.awt.event.ActionListener
Modifier and Type | Field and Description |
---|---|
protected static boolean |
do_masking
Should we use a mask to speed up calculation by analyzing only the non-zero points in the mask?
|
static boolean |
first
Internal flag, to set reference secton to image center at first run
|
protected static ij.gui.GenericDialog |
gd
The imageJ dialog
|
protected ij.ImagePlus |
imp
Image stack to analyze
|
protected ij.process.ImageProcessor |
ip
image processor at the time of starting the analysis
|
static java.lang.String |
lastMaskTitle
The title of the mask used in the last run (to remember the user choice)
|
protected boolean |
locked
Internal lock, to avoid infinite loops when programmatically updating dialog fields
|
ij.ImagePlus |
mask
Mask for enhancing calculation speed or defining region of interest
|
static int |
reference_x
x-coordinate of the reference section
|
static int |
reference_y
y-coordinate of the reference section
|
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_IMAGES, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
Constructor and Description |
---|
LocalPhase() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Event listener for the button to center the reference position to the center of the image
|
boolean |
checkSection(int x,
int y)
Checks whether at least 2 pixels in the z-profile are non-zero, otherwise no time can be defined
between peaks
|
boolean |
dialogItemChanged(ij.gui.GenericDialog gd,
java.awt.AWTEvent e)
Read the position (xy) of the reference section and masking preferences from
the user dialog
|
boolean |
doDialog()
Displays the dialog for inputting the reference position (phase 0)
and also masking options
|
static double |
doEvaluationAtxy(ij.ImagePlus inputImage,
int x,
int y,
int[] idx_ref)
Calculate the phase at a fixed xy position by comparing the local z-profile to the reference z-profile
|
static double |
doEvaluationAtxy(ij.ImagePlus inputImage,
int x,
int y,
int[] idx_ref,
ij.ImagePlus theMask)
Calculate the phase at a fixed xy position by comparing the local z-profile to the reference z-profile
|
double |
doEvaluationAtxy(int x,
int y,
int[] idx_ref)
Calculate the phase at a fixed xy position by comparing the local z-profile to the reference z-profile
non-static method, uses image passed to plugin
|
static double |
getPhaseAtxy(ij.ImagePlus theImage,
int x,
int y,
int[] idx_ref)
Get phase at position xy, without masking options
|
double |
getPhaseAtxy(int x,
int y,
int[] idx_ref)
Get phase at position xy, without masking options
Non-static version, using image assigned to the plugin
|
static ij.ImageStack |
getPhaseImage(ij.ImagePlus inputImage,
int ref_x,
int ref_y)
Calculate phase image
|
static ij.ImageStack |
getPhaseImage(ij.ImagePlus inputImage,
int ref_x,
int ref_y,
boolean showOutput)
Calculate phase image
|
static ij.ImageStack |
getPhaseImage(ij.ImagePlus inputImage,
int ref_x,
int ref_y,
ij.ImagePlus theMask)
Calculate phase image
|
static ij.ImageStack |
getPhaseImage(ij.ImagePlus inputImage,
int ref_x,
int ref_y,
ij.ImagePlus theMask,
boolean showOutput)
Calculate phase image
|
static int[] |
getStackSection(ij.ImagePlus theImage,
int x,
int y)
Get the z-profile at the point defined by x,y
|
int[] |
getStackSection(int x,
int y)
Get the z-profile at the point defined by x,y
Non-static version, uses the image assigned to this plugin
|
static int[] |
non_zero_indices(ij.ImagePlus theImage,
int x,
int y)
Get the indices to the non-zero entries in the z-profile at position x,y
|
int[] |
non_zero_indices(int x,
int y)
Get the indices to the non-zero entries in the z-profile at position x,y
Non-static version, using the Image associated with this plugin
|
void |
run(ij.process.ImageProcessor theIp)
Run the plugin: Start the dialog and recover user preferences;
Check whether the reference section contains at least two peaks (identifie by non-zero values)
Calculate and show the phase image
|
int |
setup(java.lang.String arg,
ij.ImagePlus imp)
Indicate that we need greyscale images and also
that the original image is not changed ( a new output image is generated instead)
If run for the first time, set reference section to center of image
|
void |
update_text_fields_reference_x_y()
Programmatically update the input fields for the reference positions
|
public ij.ImagePlus mask
public static java.lang.String lastMaskTitle
protected static boolean do_masking
protected boolean locked
protected static ij.gui.GenericDialog gd
protected ij.ImagePlus imp
protected ij.process.ImageProcessor ip
public static boolean first
public static int reference_x
public static int reference_y
public boolean dialogItemChanged(ij.gui.GenericDialog gd, java.awt.AWTEvent e)
dialogItemChanged
in interface ij.gui.DialogListener
public int setup(java.lang.String arg, ij.ImagePlus imp)
setup
in interface ij.plugin.filter.PlugInFilter
public void run(ij.process.ImageProcessor theIp)
run
in interface ij.plugin.filter.PlugInFilter
public static ij.ImageStack getPhaseImage(ij.ImagePlus inputImage, int ref_x, int ref_y, ij.ImagePlus theMask)
inputImage
- The image indicating peak locations (pixel value larger than 0) in the z-profiles.ref_x
- X-coordinate of the reference sectionref_y
- Y-coordinate of the reference sectiontheMask
- Mask image to limit analysis, provide null to not use this optionpublic static ij.ImageStack getPhaseImage(ij.ImagePlus inputImage, int ref_x, int ref_y, boolean showOutput)
inputImage
- The image indicating peak locations (pixel value larger than 0) in the z-profiles.ref_x
- X-coordinate of the reference sectionref_y
- Y-coordinate of the reference sectionshowOutput
- Be verbose about output (ImageJ message boxes)public static ij.ImageStack getPhaseImage(ij.ImagePlus inputImage, int ref_x, int ref_y)
inputImage
- The image indicating peak locations (pixel value larger than 0) in the z-profiles.ref_x
- X-coordinate of the reference sectionref_y
- Y-coordinate of the reference sectionpublic static ij.ImageStack getPhaseImage(ij.ImagePlus inputImage, int ref_x, int ref_y, ij.ImagePlus theMask, boolean showOutput)
inputImage
- The image indicating peak locations (pixel value larger than 0) in the z-profiles.ref_x
- X-coordinate of the reference sectionref_y
- Y-coordinate of the reference sectiontheMask
- Mask image to limit analysis, provide null to not use this optionshowOutput
- Be verbose about output (ImageJ message boxes)public static double doEvaluationAtxy(ij.ImagePlus inputImage, int x, int y, int[] idx_ref, ij.ImagePlus theMask)
inputImage
- The temporal peak image to be analyzed (the z-profile will be taken from this)x
- The x value where the phase should be determinedy
- The y value where the phase should be determinedidx_ref
- The indices (z-positions) where the peaks are in the reference sectiontheMask
- Mask to only evaluate pixels positive in the mask (provide null if not needed)public static double doEvaluationAtxy(ij.ImagePlus inputImage, int x, int y, int[] idx_ref)
inputImage
- The temporal peak image to be analyzed (the z-profile will be taken from this)x
- The x value where the phase should be determinedy
- The y value where the phase should be determinedidx_ref
- The indices (z-positions) where the peaks are in the reference sectionpublic double doEvaluationAtxy(int x, int y, int[] idx_ref)
x
- The x value where the phase should be determinedy
- The y value where the phase should be determinedidx_ref
- The indices (z-positions) where the peaks are in the reference sectionpublic static double getPhaseAtxy(ij.ImagePlus theImage, int x, int y, int[] idx_ref)
theImage
- Stack with temporal peak identificationx
- x-positiony
- y-positionidx_ref
- Location of the peaks in the reference sectionpublic double getPhaseAtxy(int x, int y, int[] idx_ref)
x
- x-positiony
- y-positionidx_ref
- Location of the peaks in the reference sectionpublic static int[] non_zero_indices(ij.ImagePlus theImage, int x, int y)
theImage
- Image stack to be analyzed for pixels with values greater than 0x
- X-position to be analyzedy
- Y-position to be analyzedpublic int[] non_zero_indices(int x, int y)
x
- X-position to be analyzedy
- Y-position to be analyzedpublic boolean checkSection(int x, int y)
x
- The x-positiony
- The y-positionpublic static int[] getStackSection(ij.ImagePlus theImage, int x, int y)
theImage
- The z-stack to be analyzedx
- The x-positiony
- The y-positionpublic int[] getStackSection(int x, int y)
x
- The x-positiony
- The y-positionpublic boolean doDialog()
public void update_text_fields_reference_x_y()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener