Class FracLac_2003AugustC

java.lang.Object
  |
  +--FracLac_2003AugustC
All Implemented Interfaces:
ij.plugin.PlugIn

public class FracLac_2003AugustC
extends java.lang.Object
implements ij.plugin.PlugIn

Plugin for ImageJ returns an ImageJ results window showing fractal dimensions, lacunarity, and other measures for binary images.

Operates on single or multiple image files. Popups ask the user for parameters. Shows regression lines for the box counting dimension at the original location, an average box counting dimension, a minimum cover dimension (from the minimum count at each box size over multiple origins), and a slope corrected version.

The user can choose to use one series of grids, where each smaller sized grid is always positioned at the top left corner of the image. Or the user can choose to use several such series, where each smaller size within a series always starts at the same position but the absolute position of the series is randomly chosen from between the top left corner and the edge of the screen (a border is added to images to ensure there is space to do this).

If the subareas option is selected, calculates a distribution of local fractal dimensions over smaller subareas of the image then delivers a colour-coded graphic as well as text values of these local dimensions. This function only works on single images and the option to open multiple images is not allowed in this mode. Alternatively, contact the author for an algorithm to calculate data for the multifractal spectrum of entropies; this is a great deal of data that clutters the results file so is not automatically included.

Delivers information about variability in the image. Calculates the coefficient of variation in the fractal dimension over multiple locations and two lacunarity values, the average coefficient of variation in the pixel distribution and the probability density lacunarity.

Calculates the horizontal and vertical axes of the rectangle and oval enclosing the image, and the perimeter and area of the convex hull enclosing the image. Delivers circularity based on the convex hull. This program is free software distributed in the same way that ImageJ is. A. Karperien, Charles Sturt University, August 2003 Copyright (C) 2003 Audrey Karperien For futher information or to send comments, bugs, and feature requests contact the author or see FracLac page .

file: FracLac_2003August__1.java

IDE: Sun ONE Studio 4, Community Edition

Since:
J2SKD1.4.1_02b

Nested Class Summary
 class FracLac_2003AugustC.ColourRule
          Class specifies colours to use for colour coding local fractal dimensions calculated over many subareas.
 
Field Summary
 int actualx
          Coordinates marking where a grid started.
 int actualy
          Coordinates marking where a grid started.
 float alpha
          Specifies the transparency of the graphic for subareas in drawit method.
 double AREA
          Area of convex hull.
 double[] AveragePix
          Holds average number of pixels per box size.
 int border
          Size of border to add around images.
 double centrex
          Centre coordinate of pixelated area.
 double centrey
          Centre coordinate of pixelated area.
 double circularity
          Circularity of convex hull.
 double[] colourarray
          Holds values for each colour for each square for doing sub areas.
 java.lang.String countstring
          Holds values for box count data.
 int docircul
          If set to 1, runs circularity calculations.
 boolean doglobal
          True does entire image area.
 boolean dosomethreshes
          True runs automatic thresholding.
 boolean dosubs
          True finds fractal dimension over several subareas of the image.
 boolean fill
          True fills coloured squares if subareas are being done.
 int foreground
          Value of pixels that will be assessed.
 int[][] HadPixAllLocAllSize
          Integer array of arrays for keeping track of the boxes that had pixels over all locations.
 ij.ImagePlus img
          Is reused for each image processed.
 int incs
          Maximum number of box sizes to use in a series.
 ij.process.ImageProcessor ip
          Is reused for each image processed.
 int limit
          Integer for limit on number of boxes.
 double maxAcross
          Stores maximum of pixelated area's width or height
 double maxpercent
          Maximum percent of image area to use as box size.
 double[] mprob
          Holds probability density data.
 int newNumSizes
          Working variable for number of box sizes that is used.
 int numlocations
          Number of times to do an entire series of grids (i.e., if multiple origins are being used).
 double perimeter
          Perimeter of convex hull.
 int[] PixPerBox
          Holds count of number of pixels per box size.
 java.lang.String printsummary
          "Y" prints summary data.
 boolean randomsquares
          True checks a random sample of subareas over the image.
 java.awt.Rectangle rec
          Current rectangle enclosing image.
 double roundness
          Variable for roundness of convex hull.
 java.lang.String sdir
          Directory where files to be opened are.
 boolean showcolours
          True shows a graphic colour coded for the fractal dimension of each subarea.
 java.lang.String sizestring
          Holds values for box count data.
 double[] StdDev
          Holds standard deviations of number of pixels per box size.
 int subboxsize
          Size of boxes to use if doing subareas.
 int subsamples
          Number of subareas to analyze if doing a random sample.
 boolean userNumber
          True if the user wants to set the number of boxes rather than use a value optimized for each image size.
 double vDiameter
          Vertical axis of oval enclosing pixelated area.
 boolean viewplots
          True shows graphs of regression lines.
 ij.gui.ImageWindow win
          Is reused for each image.
 int[] xarray
          Coordinates of each origin for coloured squared for doing sub areas.
 int[] yarray
          Coordinates of each origin for coloured squared for doing sub areas.
 
Constructor Summary
FracLac_2003AugustC()
           
 
Method Summary
 ij.process.ImageProcessor addborder(ij.process.ImageProcessor ip)
          Adds a border to the image.
 double count(boolean asub, int boxnumber, int sze, ij.process.ImageProcessor ip, int x, int y)
          Sets up and calls method.
 void doBoxCounts(boolean wassub, ij.process.ImageProcessor ipc, int x, int y)
          Counts pixels at each box size by calling method for each size.
 void drawit(int w, int h, int numShapes, java.awt.Graphics2D g2, int s, int[] x, int[] y, double[] colours)
          Draws differently coloured squares as specified over an image.
 ij.process.ImageProcessor drawNewImage(ij.ImagePlus imp, int numShapes, int subboxsize, int[] x, int[] y, double[] colours)
          Makes a new BufferedImage using width and height of passed image, and draws that passed image and colours on it by calling drawit method.
 ij.process.ImageProcessor expandImage(ij.process.ImageProcessor ipOld, double wNew, double hNew, double xOff, double yOff)
          Adds a border around an image using ImageProcessor functions.
 boolean FindMargins(ij.process.ImageProcessor ip)
          Finds margins of pixelated part of binary image and sets meassurements for height, width, and span.
 int[] findMinCover(int[][] TestArray, int numLocs, int numBoxes)
          Returns an array holding the minimum value for each position in an array of arrays.
 void finishdata(int thisiteration, java.lang.String origins, ij.process.ImageProcessor ipk, FracLac_2003AugustC.StoreAvgs avs, boolean circ, boolean issub, java.lang.String suborglobal)
          Calls functions to findMinCover and findAvgCover fractal dimensions.
 java.lang.String fnum(double sum, int decimals)
          Formats numbers.
 void getCircularityOfConvexHull(ij.process.ImageProcessor ip)
          Gets circularity of convex hull for passed ImageProcessor.
 void GetDimensions(ij.process.ImageProcessor ip)
          Determines the dimensions of the image, and sets some of the important variables.
 boolean getInputs()
          Gets user inputs from popups to set global variables.
 ij.gui.PolygonRoi getPolygon(ij.process.ImageProcessor ip)
          This long-winded method determines the vertices of a polygon which forms a convex hull around the image.
 java.lang.String makeheadings()
          Lists the headings for the results file.
 int[][] makerandset(int x, int y)
          Makes a set of random x and y values within bounds x and y.
 int moveGridalloverCountPixels(int boxnum, int xstart, int ystart, int sz, int bot, int rt, ij.process.ImageProcessor ipr)
          Reinitializes PixPerBox array then goes over part of the ip using a series of smaller boxes recording number of pixels in each box and number of boxes that had pixels.
 void openAndrun(boolean DoRandomSquares)
          Opens and processes selected files.
 double[] probmass(int epsilon)
          Returns a double array holding a probability density distribution for the passed array, using as many elements as the passed number; since it is usually called after each box size is scanned, it is usually for a particular epsilon (box size) at a particular location.
 ij.process.ImageProcessor ready(ij.process.ImageProcessor ip)
          Thresholds, finds margins, and sets foreground value on image to be analyzed.
 void run(java.lang.String arg)
          Runs FracLac.
 void runFL(int thisiteration, boolean circ, boolean issub, ij.process.ImageProcessor ipk, int x, int y)
          C
 void runSubs(boolean DoRandomSquares)
          Finds local fractal dimensions over portions of an image.
 void savecolour(double dddf, int iter)
          Saves the colour in colourarray to use at each square for which a local dimension was calculated.
 int stdboxsizes(double Across)
          Calculates the array of box sizes.
 double writeFinal(FracStats avgstat, FracStats min, ij.process.ImageProcessor ipk, FracLac_2003AugustC.StoreAvgs avs, boolean circ, boolean issub, java.lang.String suborglobal, int thisiteration, java.lang.String origins)
          Writes the final values to the IJ window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PixPerBox

public int[] PixPerBox
Holds count of number of pixels per box size.


AveragePix

public double[] AveragePix
Holds average number of pixels per box size.


StdDev

public double[] StdDev
Holds standard deviations of number of pixels per box size.


HadPixAllLocAllSize

public int[][] HadPixAllLocAllSize
Integer array of arrays for keeping track of the boxes that had pixels over all locations.


mprob

public double[] mprob
Holds probability density data.


rec

public java.awt.Rectangle rec
Current rectangle enclosing image.


actualx

public int actualx
Coordinates marking where a grid started.


actualy

public int actualy
Coordinates marking where a grid started.


border

public int border
Size of border to add around images.


alpha

public float alpha
Specifies the transparency of the graphic for subareas in drawit method.


maxAcross

public double maxAcross
Stores maximum of pixelated area's width or height


newNumSizes

public int newNumSizes
Working variable for number of box sizes that is used.


limit

public int limit
Integer for limit on number of boxes.


colourarray

public double[] colourarray
Holds values for each colour for each square for doing sub areas.


xarray

public int[] xarray
Coordinates of each origin for coloured squared for doing sub areas.

See Also:
drawNewImage(ij.ImagePlus, int, int, int[], int[], double[])

yarray

public int[] yarray
Coordinates of each origin for coloured squared for doing sub areas.

See Also:
drawNewImage(ij.ImagePlus, int, int, int[], int[], double[])

sdir

public java.lang.String sdir
Directory where files to be opened are. Is set by openAndrun(boolean).


sizestring

public java.lang.String sizestring
Holds values for box count data.


countstring

public java.lang.String countstring
Holds values for box count data.


foreground

public int foreground
Value of pixels that will be assessed. Is determined in ready(ij.process.ImageProcessor).


img

public ij.ImagePlus img
Is reused for each image processed. Is set by openAndrun(boolean).

See Also:
getCircularityOfConvexHull(ij.process.ImageProcessor), dosubs

ip

public ij.process.ImageProcessor ip
Is reused for each image processed. Is set by openAndrun(boolean).

See Also:
getCircularityOfConvexHull(ij.process.ImageProcessor), dosubs

win

public ij.gui.ImageWindow win
Is reused for each image. Is set by openAndrun(boolean).


numlocations

public int numlocations
Number of times to do an entire series of grids (i.e., if multiple origins are being used). If set to 1, only one location is used. Is the number of locations to start a grid series at, rather than the number of box sizes or boxes in each grid series. Is set by getInputs().


incs

public int incs
Maximum number of box sizes to use in a series. Is set by getInputs(). Default is 500.


subboxsize

public int subboxsize
Size of boxes to use if doing subareas. Is set by getInputs().


viewplots

public boolean viewplots
True shows graphs of regression lines. Is set by getInputs().


maxpercent

public double maxpercent
Maximum percent of image area to use as box size. Based on smallest rectangle enclosing the pixelated part of the image. Is set by getInputs().


dosubs

public boolean dosubs
True finds fractal dimension over several subareas of the image. False finds it over only the entire area. Is set by getInputs().


dosomethreshes

public boolean dosomethreshes
True runs automatic thresholding. Is set by getInputs().


subsamples

public int subsamples
Number of subareas to analyze if doing a random sample. Is set by getInputs().


printsummary

public java.lang.String printsummary
"Y" prints summary data. Is set by getInputs().


docircul

public int docircul
If set to 1, runs circularity calculations. Default is 0, to not run them. Is set by getInputs().


fill

public boolean fill
True fills coloured squares if subareas are being done. Is set by getInputs().


randomsquares

public boolean randomsquares
True checks a random sample of subareas over the image. Is set by getInputs().


showcolours

public boolean showcolours
True shows a graphic colour coded for the fractal dimension of each subarea. Is set by getInputs().


userNumber

public boolean userNumber
True if the user wants to set the number of boxes rather than use a value optimized for each image size. Is set by getInputs().


doglobal

public boolean doglobal
True does entire image area. Is set by getInputs().


perimeter

public double perimeter
Perimeter of convex hull.


AREA

public double AREA
Area of convex hull.


circularity

public double circularity
Circularity of convex hull.


roundness

public double roundness
Variable for roundness of convex hull.


centrex

public double centrex
Centre coordinate of pixelated area.


centrey

public double centrey
Centre coordinate of pixelated area.


vDiameter

public double vDiameter
Vertical axis of oval enclosing pixelated area.

Constructor Detail

FracLac_2003AugustC

public FracLac_2003AugustC()
Method Detail

run

public void run(java.lang.String arg)
Runs FracLac. Calls getInputs method. If this returns true, initializes column headings for IJ results window and calls openAndrun(boolean) method, which depends on the value in randomsquares. Otherwise terminates. Calls IJ.register on this class.

Specified by:
run in interface ij.plugin.PlugIn
Parameters:
arg - string not yet used

getCircularityOfConvexHull

public void getCircularityOfConvexHull(ij.process.ImageProcessor ip)
Gets circularity of convex hull for passed ImageProcessor. Is called by writeFinal method. Calls GetDimensions method to find image coordinates, then calls getPolygon method to make an IJ polygon roi and sets this as the current roi. Uses IJ analyzer and ResultsTable to change variables for roundness, circularity, area, and perimeter.

circularity = (perimeter*perimeter)/area

If perimeter is 0 roundness = 0; otherwise roundness = 4.0*pi*(area/(perimeter*perimeter));

Parameters:
ip - ImageProcessor of binary image to make convex hull for

openAndrun

public void openAndrun(boolean DoRandomSquares)
Opens and processes selected files. Reuses global img variable for each opened image. Stores file directory as sdir. Calls ready method and sets win to current image. Makes a new colourarray, xarray, and yarray for the image's data, and when done closes win if no colour-coding is being shown. Calls runFL on ip if doglobal is true, and runSubs if dosubs is true.

Parameters:
DoRandomSquares - boolean true to do random sample instead of entire grid of subareas

runSubs

public void runSubs(boolean DoRandomSquares)
Finds local fractal dimensions over portions of an image. Calls stdboxsizes to make a series of sizes starting at subboxsize*2. If doing a random sample, resets the roi to a random location once for each subsamples, otherwise covers the whole image using rec for the margins. In both cases, calls runFL(int, boolean, boolean, ij.process.ImageProcessor, int, int) at each starting origin over the image. Calls drawnewimage if showcolours is true.

Parameters:
DoRandomSquares - boolean True does a random sample; false does the entire image

drawNewImage

public ij.process.ImageProcessor drawNewImage(ij.ImagePlus imp,
                                              int numShapes,
                                              int subboxsize,
                                              int[] x,
                                              int[] y,
                                              double[] colours)
Makes a new BufferedImage using width and height of passed image, and draws that passed image and colours on it by calling drawit method.

Parameters:
imp - the ImagePlus to draw on
numShapes - the number of squares to draw
subboxsize - the size of each square
x - array of integers for x coordinate of each square
y - array of integers for y coordinate of each square
colours - array of doubles specifying colours
Returns:
ImageProcessor with coloured squared drawn on it

drawit

public void drawit(int w,
                   int h,
                   int numShapes,
                   java.awt.Graphics2D g2,
                   int s,
                   int[] x,
                   int[] y,
                   double[] colours)
Draws differently coloured squares as specified over an image. Uses alpha to determine transparency of coloured squares. Adds a legend bar telling what each colour represents.

Parameters:
s - integer for size of drawing squares
numShapes - the number of squares to draw
x - array of integers for x coordinate of each square
y - array of integers for y coordinate of each square
colours - array of doubles specifying colours
w - integer for width of image
h - integer for height of image
g2 - Graphics2D on which to draw

ready

public ij.process.ImageProcessor ready(ij.process.ImageProcessor ip)
Thresholds, finds margins, and sets foreground value on image to be analyzed. Changes string for title to img's current title and reinitializes sizestring and countstring before getting new stats on img. If the image is not binary and dosomethreshes is true, calls IJ's thresholding function. Gets stats again then sets foreground to 255 or 0, whichever is lesser in the image.

Kills any lefover roi then sets ip to img's current processor. Calls FindMargins(ij.process.ImageProcessor) and resets newNumSizes to value returned by stdboxsizes(double) using value in maxAcross. Resets border to the greater of 50 or half numlocations.

Makes a new ImageProcessor by calling addborder(ij.process.ImageProcessor) on ip, then calls FindMargins(ij.process.ImageProcessor) to reset values.

Parameters:
ip - ImageProcessor on which to act
Returns:
thisip the final ImageProcessor

makerandset

public int[][] makerandset(int x,
                           int y)
Makes a set of random x and y values within bounds x and y. Size of array is value currently in numlocations X 2.

Parameters:
x - integer for maximum x
y - integer for maximum y
Returns:
xy integer array of random coordinates

runFL

public void runFL(int thisiteration,
                  boolean circ,
                  boolean issub,
                  ij.process.ImageProcessor ipk,
                  int x,
                  int y)
C

Parameters:
thisiteration - integer for the location currently being done
circ - boolean true calculates convex hull parameters
issub - boolean true does local fractal dimensions
ipk - ImageProcessor ipk is analyzed
x - integer for x coordinate to start at
y - integer for y coordinate to start at

finishdata

public void finishdata(int thisiteration,
                       java.lang.String origins,
                       ij.process.ImageProcessor ipk,
                       FracLac_2003AugustC.StoreAvgs avs,
                       boolean circ,
                       boolean issub,
                       java.lang.String suborglobal)
Calls functions to findMinCover and findAvgCover fractal dimensions. Makes FracStats instances then calls writeFinal(FracStats, FracStats, ij.process.ImageProcessor, FracLac_2003AugustC.StoreAvgs, boolean, boolean, java.lang.String, int, java.lang.String) method to finish writing data. Calls internal logplotter function if appropriate to view regression line plots.

Parameters:
thisiteration - integer for keeping track of scans
origins - String of x and y where grid started
ipk - ImageProcessor on which to work
avs - StoreAvgs instance
circ - boolean true means do convex hull stats
issub - boolean true means this is a subarea
suborglobal - string for denoting subarea of global

findMinCover

public int[] findMinCover(int[][] TestArray,
                          int numLocs,
                          int numBoxes)
Returns an array holding the minimum value for each position in an array of arrays.

Parameters:
TestArray - integer array of arrays
numLocs - integer for number of arrays to use
numBoxes - integer for number of values in arrays to use
Returns:
mcover integer array holding the lowest value at each position

writeFinal

public double writeFinal(FracStats avgstat,
                         FracStats min,
                         ij.process.ImageProcessor ipk,
                         FracLac_2003AugustC.StoreAvgs avs,
                         boolean circ,
                         boolean issub,
                         java.lang.String suborglobal,
                         int thisiteration,
                         java.lang.String origins)
Writes the final values to the IJ window.

Parameters:
avgstat - FracStats instance holding all original data
min - Fracstats instance holding all data for minimum cover
ipk - ImageProcessor on which to work
avs - StoreAvgs instance holding average values
circ - boolean true includes circularity and other convex hull data
issub - boolean true includes subarea data
suborglobal - string specifies data type
thisiteration - int for subareas or global
origins - String of x and y coordinates
Returns:
double average df

expandImage

public ij.process.ImageProcessor expandImage(ij.process.ImageProcessor ipOld,
                                             double wNew,
                                             double hNew,
                                             double xOff,
                                             double yOff)
Adds a border around an image using ImageProcessor functions.

Parameters:
ipOld - THe ImageProcessor to act on
wNew - double for new width
hNew - double for new height
xOff - double for offset from x coordinate
yOff - double for offset from y coordinate
Returns:
ipNew ImageProcessor with border

savecolour

public void savecolour(double dddf,
                       int iter)
Saves the colour in colourarray to use at each square for which a local dimension was calculated. Uses previously stored values in actualx and actualy to change xarray and yarray.

Parameters:
dddf - double for the fractal dimension
iter - integer for the number in the list

stdboxsizes

public int stdboxsizes(double Across)
Calculates the array of box sizes. limit is first set to a percentage of the passed value. The minimum is 15 boxes. If the user wants to choose the number of boxes (if userNumber is true), number of boxes is set to the lesser of limit or the number the user set in the setup. The increment between box sizes is set as limit divided by number of boxes.

Also reinitializes arrays: AveragePix, StdDev, problac, MeanOfProbDistributionAtEpsilon, and StdDevOfProbDistributionAtEpsilon.

Parameters:
Across - double for distance across image
Returns:
int for number of boxes in the series

FindMargins

public boolean FindMargins(ij.process.ImageProcessor ip)
Finds margins of pixelated part of binary image and sets meassurements for height, width, and span. Uses value set in foreground to search for pixels of that colour.

Parameters:
ip - ImageProcessor to work on
Returns:
boolean always returns true when done

addborder

public ij.process.ImageProcessor addborder(ij.process.ImageProcessor ip)
Adds a border to the image. Uses value currently in border. Calls expandImage to do the work.

Parameters:
ip - ImageProcessor
Returns:
ImageProcessor with border around it

count

public double count(boolean asub,
                    int boxnumber,
                    int sze,
                    ij.process.ImageProcessor ip,
                    int x,
                    int y)
Sets up and calls method. In doing this, changes global variable for boxes and global arrays for number of pixels and density. Is called by method. Changes x and y for main, not sub, checks, for placing the starting grad at systematic multiple origins around the start. For subs, makes the area to check into a smaller rectangle but for mains just leaves the area to check as the whole image.

Parameters:
asub - boolean true if doing subareas
boxnumber - integer for keeping track
sze - integer for size of box
ip - ImageProcessor to work on
x - integer for starting x coordinate
y - integer for starting y coordinate
Returns:
boxes double for number of boxes with pixels in them

fnum

public java.lang.String fnum(double sum,
                             int decimals)
Formats numbers.

Parameters:
sum - number to format
decimals - number of decimal places
Returns:
String spelling formatted number

probmass

public double[] probmass(int epsilon)
Returns a double array holding a probability density distribution for the passed array, using as many elements as the passed number; since it is usually called after each box size is scanned, it is usually for a particular epsilon (box size) at a particular location. The array holds at each element the percent of boxes that had the number of pixels that corresponds to the index of the element, so to access the probability that a box had 3 pixels, get the value at index 3. Calculates statistics from array named mprob: the mean of the probability distribution is: sum of all(i*mprob[i]) where i is the index and value, and mprob[i] is the weight the variance of the probability distribution is: sum of all (((mprob[i]-meanProb)*(mprob[i]-meanProb))*i); the Probability Density Lacunarity at this epsilon is: (sumMsq - (sumM*sumM))/(sumM*sumM); where sumM=sum of all(i*mprob[i]) and sumMsq = sum of all (i*i*mprob[i]); These are all stored in arrays and written to the final file.

Parameters:
epsilon - integer for the box size; is only used to store final value
Returns:
mprob double array of probabilities of a number of pixels being found in an area

doBoxCounts

public void doBoxCounts(boolean wassub,
                        ij.process.ImageProcessor ipc,
                        int x,
                        int y)
Counts pixels at each box size by calling method for each size. Calls method also. Sums values stored by these calls in PixPerBox array and stores average and standard deviation of pixels per box in StdDev and AveragePix arrays. Finally, stores the number of boxes that had pixels at this location in a global storage array (HadPixAllLocAllSize). Will be rewritten to use FracStats class only.

Parameters:
wassub - boolean true if this was a subarea
ipc - ImageProcessor to work on
x - integer for starting x coordinate
y - integer for startign y coordinate

getPolygon

public ij.gui.PolygonRoi getPolygon(ij.process.ImageProcessor ip)
This long-winded method determines the vertices of a polygon which forms a convex hull around the image. It does this by first mapping the vertical contours of the image. (Horizontal or vertical contours could have been used, but only one is necessary.) After they are mapped, all of the points which can be enclosed by connecting any other points are eliminated. This leaves only the outermost points, the ones that form the convex hull. Returns a polygon created with these points.

written by Thomas Roy, University of Alberta, Canada

Parameters:
ip - ImageProcessor to work on
Returns:
ij.gui.PolygonRoi that is convex hull enclosing the image

GetDimensions

public void GetDimensions(ij.process.ImageProcessor ip)
Determines the dimensions of the image, and sets some of the important variables. Sets img to current window; sets width and height as well as left, right, top, bottom, centrex, and centrey values.

Parameters:
ip - ImageProcessor to work on

getInputs

public boolean getInputs()
Gets user inputs from popups to set global variables. Is invoked by run(java.lang.String) when plugin is first invoked.

Returns:
false if cancelled
See Also:
dosomethreshes, incs, userNumber, maxpercent, numlocations, doglobal, printsummary, dosubs, fill, randomsquares, dosubs, subboxsize, viewplots, subsamples, docircul

makeheadings

public java.lang.String makeheadings()
Lists the headings for the results file.

"FracLac2003 FILE"

"AVG Box Count Df"

"r squared"

"Corrected"

"r squared"

"Coef Var Lacunarity"

"Avg Coef Var for Y-Int at Multiple Origins"

"Probability Density Lacunarity (Coef Var over all epsilon at Multiple Locations)"

"HULL AREA"

"HULL PERIMETER"

"ROUNDNESS"

"CIRCULARITY"

"WIDTH"

"HEIGHT"

"VERTICAL"

"HORIZONTAL"

"CENTRE (origin)"

"NUM BOXES"

"adjusted NUM BOXES"

"Minimum Cover Df"

"r squared"

"Corrected"

"r squared"

"Coef Var for all Y-int"

"Coef Variation Df"

"Number of origins"

Returns:
string of headings.

moveGridalloverCountPixels

public int moveGridalloverCountPixels(int boxnum,
                                      int xstart,
                                      int ystart,
                                      int sz,
                                      int bot,
                                      int rt,
                                      ij.process.ImageProcessor ipr)
Reinitializes PixPerBox array then goes over part of the ip using a series of smaller boxes recording number of pixels in each box and number of boxes that had pixels. Is called by method. Changes variables for actualx and actualy each time.

Parameters:
ystart - integer for y coordinate to start at
sz - integer for size of box
bot - integer for bottom edge limit
rt - integer for right edge limit
boxnum - integer for later implementation of grid density
xstart - integer for starting x coordinate
ipr - ImageProcessor to analyze
Returns:
countboxes int for number of boxes that had pixels