Class ValidateMeasurementsGroundTruth

java.lang.Object
  extended by ValidateMeasurementsGroundTruth
All Implemented Interfaces:
ij.plugin.filter.PlugInFilter, ij.plugin.PlugIn

public class ValidateMeasurementsGroundTruth
extends java.lang.Object
implements ij.plugin.filter.PlugInFilter, ij.plugin.PlugIn

This ImageJ plugIn has been programmed to compare the ROIs constructed by "Vermessung_Nasenfluegel" with a ground truth. For this purpose three pairs of ROIs (left, middle and right wall) are compared and the mean and variance of the differences are computed. Each pair is made up by a ROI computed by "Vermessung_Nasenfluegel" and the corresponding ground truth. As input for this plugIn the IDs of the ROIs w.r.t. the ROIManager are required. If the mean and variance shall be computed w.r.t. pixel distances, then this plugIn does not need to be called with an image. If the mean and variance shall be computed w.r.t. millimeter distances, then this plugIn has to be called with a image corresponding to the ROIs. Right now, only pixels and millimeters are supported as units. The moments are calculated w.r.t. the signed differences as well as the absolute differences. This is essentially an ImageJ Plugin - to use it change the name so that it includes a underline '_'.


Field Summary
 
Fields inherited from interface ij.plugin.filter.PlugInFilter
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 Summary
ValidateMeasurementsGroundTruth()
           
 
Method Summary
 double calculateMean(int[] values)
          Calculates the mean of the given (integer) values.
 double calculateVariance(int[] values)
          Calculates the variance of the given (integer) values.
 double calculateVariance(int[] values, double mean)
          Calculates the variance of the given (integer) values.
 void getDifferences()
          Calculates the absolute and the signed differences between all values given in xvals[i][0] and xvals[i][1] for i = 0, 1, 2.
 void run(ij.process.ImageProcessor ip)
           
 void run(java.lang.String arg)
           
 int setup(java.lang.String arg, ij.ImagePlus imp)
           
 boolean showDialog()
          Opens the dialogue for this plugIn.
 void showResultTable()
          Method displays the result table and the calculated values for mean and variance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidateMeasurementsGroundTruth

public ValidateMeasurementsGroundTruth()
Method Detail

run

public void run(java.lang.String arg)
Specified by:
run in interface ij.plugin.PlugIn

setup

public int setup(java.lang.String arg,
                 ij.ImagePlus imp)
Specified by:
setup in interface ij.plugin.filter.PlugInFilter

run

public void run(ij.process.ImageProcessor ip)
Specified by:
run in interface ij.plugin.filter.PlugInFilter

showDialog

public boolean showDialog()
Opens the dialogue for this plugIn. You have to put in three pairs of ROIs with same length and type Roi.POLYLINE to use this plugIn. You can also choose, if you want to have the measurements in pixel or in millimeters. If millimeters is chosen, you have to call the plugIn with the corresponding image.

Returns:
Returns false, if the dialog has been canceled, true otherwise.

getDifferences

public void getDifferences()
Calculates the absolute and the signed differences between all values given in xvals[i][0] and xvals[i][1] for i = 0, 1, 2. Please note that those array x[i][k] must have the same length for all i, k. The differences are put in absdifferences resp. signeddifferences in the following order: { diff(xvals[0][0][0] - xvals[0][1][0]), ..., diff(xvals[0][0][npoints-1] - xvals[0][1][npoints-1]), diff(xvals[0][0][0] - xvals[1][1][0]), ..., diff(xvals[1][0][npoints-1] - xvals[1][1][npoints-1]), diff(xvals[0][0][0] - xvals[2][1][0]), ..., diff(xvals[2][0][npoints-1] - xvals[2][1][npoints-1]) }


calculateMean

public double calculateMean(int[] values)
Calculates the mean of the given (integer) values. Given (x1, ..., xn) the mean \mu is calculated using \mu = 1/n * \sum_{i=1}^n.

Parameters:
values - An array with Integer values.
Returns:
The mean of all values in the array.

calculateVariance

public double calculateVariance(int[] values)
Calculates the variance of the given (integer) values.

Parameters:
values - An array with integer values.
Returns:
The variance of all values in the array.

calculateVariance

public double calculateVariance(int[] values,
                                double mean)
Calculates the variance of the given (integer) values. If the mean has already been calculated for the array values, this method can be used.

Parameters:
values - An array with integer values.
Returns:
The variance of all values in the array.

showResultTable

public void showResultTable()
Method displays the result table and the calculated values for mean and variance.