|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FracLac_2003August__1
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
Nested Class Summary | |
class |
FracLac_2003August__1.ColourRule
Specifies colours to use for colour coding local fractal dimensions calculated over many subareas. |
class |
FracLac_2003August__1.FracStats
|
class |
FracLac_2003August__1.LogPlotter
|
Field Summary | |
float |
alpha
Specifies the transparency of the graphic for subareas in drawit(int, int, int, java.awt.Graphics2D, int, int[], int[], double[]) . |
double |
AREA
|
int |
border
Size of border to add around images. |
int |
boxes
|
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. |
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. |
double |
maxAcross
Stores maximum of pixelated area's width or height |
double |
maxpercent
Maximum percent of image area to use as box size. |
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. |
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. |
int |
subboxsize
Size of boxes to use if doing subareas. |
int |
subsamples
Number of subareas to analyze if doing a random sample. |
java.lang.String |
tab
"Y" prints summary data. |
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_2003August__1()
|
Method Summary | |
ij.process.ImageProcessor |
addborder(ij.process.ImageProcessor ip)
|
double |
count(boolean asub,
int boxnumber,
int sze,
ij.process.ImageProcessor ip,
int x,
int y)
|
void |
doBoxCounts(boolean wassub,
ij.process.ImageProcessor ipc,
int x,
int y)
|
void |
drawit(int w,
int h,
int numShapes,
java.awt.Graphics2D g2,
int s,
int[] x,
int[] y,
double[] colours)
|
ij.process.ImageProcessor |
drawNewImage(ij.ImagePlus imp,
int numShapes,
int subboxsize,
int[] x,
int[] y,
double[] colours)
|
ij.process.ImageProcessor |
expandImage(ij.process.ImageProcessor ipOld,
double wNew,
double hNew,
double xOff,
double yOff)
|
boolean |
FindMargins(ij.process.ImageProcessor ip)
|
int[] |
findMinCover(int[][] TestArray,
int numLocs,
int numBoxes)
|
java.lang.String |
fnum(double sum,
int decimals)
|
void |
getCircularityOfConvexHull(ij.process.ImageProcessor ip)
Gets circularity of convex hull for passed ImageProcessor. |
void |
GetDimensions(ij.process.ImageProcessor ip)
|
boolean |
getInputs()
Gets user inputs from popups to set global variables. |
ij.gui.PolygonRoi |
getPolygon(ij.process.ImageProcessor ip)
|
java.lang.String |
makeheadings()
Lists the headings for the results file. |
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 |
runSubs(boolean DoRandomSquares)
Finds local fractal dimensions over portions of an image. |
void |
savecolour(double dddf,
int iter)
|
int |
stdboxsizes(double Across)
|
double |
writeFinal(FracLac_2003August__1.FracStats avgstat,
FracLac_2003August__1.FracStats min,
ij.process.ImageProcessor ipk,
FracLac_2003August__1.StoreAvgs avs,
boolean circ,
boolean issub,
java.lang.String suborglobal,
int thisiteration,
java.lang.String origins)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.awt.Rectangle rec
public int border
public float alpha
drawit(int, int, int, java.awt.Graphics2D, int, int[], int[], double[])
.
public double maxAcross
public int newNumSizes
public int boxes
public double[] colourarray
public int[] xarray
#drawnewimage
public int[] yarray
#drawnewimage
public java.lang.String sdir
openAndrun(boolean)
.
public java.lang.String sizestring
public java.lang.String countstring
public int foreground
ready(ij.process.ImageProcessor)
.
public ij.ImagePlus img
openAndrun(boolean)
.
getCircularityOfConvexHull(ij.process.ImageProcessor)
,
dosubs
public ij.process.ImageProcessor ip
openAndrun(boolean)
.
getCircularityOfConvexHull(ij.process.ImageProcessor)
,
dosubs
public ij.gui.ImageWindow win
openAndrun(boolean)
.
public int numlocations
getInputs()
.
public int incs
getInputs()
. Default is 500.
public int subboxsize
getInputs()
.
public boolean viewplots
getInputs()
.
public double maxpercent
getInputs()
.
public boolean dosubs
getInputs()
.
public boolean dosomethreshes
getInputs()
.
public int subsamples
getInputs()
.
public java.lang.String printsummary
getInputs()
.
public java.lang.String tab
getInputs()
.
public int docircul
getInputs()
.
public boolean fill
getInputs()
.
public boolean randomsquares
getInputs()
.
public boolean showcolours
getInputs()
.
public boolean userNumber
getInputs()
.
public boolean doglobal
getInputs()
.
public double perimeter
public double AREA
public double circularity
public double roundness
public double centrex
public double centrey
public double vDiameter
Constructor Detail |
public FracLac_2003August__1()
Method Detail |
public void run(java.lang.String arg)
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.
run
in interface ij.plugin.PlugIn
arg
- string not yet usedpublic void getCircularityOfConvexHull(ij.process.ImageProcessor ip)
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));
ip
- ImageProcessor of binary image to make convex hull forpublic void openAndrun(boolean DoRandomSquares)
img
variable for each opened image. Stores
file directory as sdir
. Calls ready(ij.process.ImageProcessor)
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(boolean)
if dosubs
is true.
DoRandomSquares
- boolean true to do random sample
instead of entire grid of subareaspublic void runSubs(boolean DoRandomSquares)
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
at each
starting origin over the image. Calls drawnewimage
if showcolours
is true.
DoRandomSquares
- boolean True does a random sample; false does the
entire imagepublic ij.process.ImageProcessor drawNewImage(ij.ImagePlus imp, int numShapes, int subboxsize, int[] x, int[] y, double[] colours)
imp
- numShapes
- subboxsize
- x
- y
- colours
-
public void drawit(int w, int h, int numShapes, java.awt.Graphics2D g2, int s, int[] x, int[] y, double[] colours)
w
- h
- numShapes
- g2
- s
- x
- y
- colours
- public ij.process.ImageProcessor ready(ij.process.ImageProcessor ip)
#strOldTitle
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
then sets
#XLimit
and #YLimit
to this value.
Makes a new ImageProcessor by calling addborder(ij.process.ImageProcessor)
on ip
, then calls FindMargins(ij.process.ImageProcessor)
to reset
values.
ip
- ImageProcessor on which to act
public int[] findMinCover(int[][] TestArray, int numLocs, int numBoxes)
public double writeFinal(FracLac_2003August__1.FracStats avgstat, FracLac_2003August__1.FracStats min, ij.process.ImageProcessor ipk, FracLac_2003August__1.StoreAvgs avs, boolean circ, boolean issub, java.lang.String suborglobal, int thisiteration, java.lang.String origins)
public ij.process.ImageProcessor expandImage(ij.process.ImageProcessor ipOld, double wNew, double hNew, double xOff, double yOff)
ipOld
- wNew
- hNew
- xOff
- yOff
-
public void savecolour(double dddf, int iter)
public int stdboxsizes(double Across)
public boolean FindMargins(ij.process.ImageProcessor ip)
public ij.process.ImageProcessor addborder(ij.process.ImageProcessor ip)
public double count(boolean asub, int boxnumber, int sze, ij.process.ImageProcessor ip, int x, int y)
public java.lang.String fnum(double sum, int decimals)
public double[] probmass(int epsilon)
epsilon
- integer for the box size; is only used to store final value
public void doBoxCounts(boolean wassub, ij.process.ImageProcessor ipc, int x, int y)
public ij.gui.PolygonRoi getPolygon(ij.process.ImageProcessor ip)
public void GetDimensions(ij.process.ImageProcessor ip)
public boolean getInputs()
run(java.lang.String)
when plugin is
first invoked.
dosomethreshes
,
incs
,
userNumber
,
maxpercent
,
numlocations
,
doglobal
,
printsummary
,
dosubs
,
fill
,
randomsquares
,
dosubs
,
subboxsize
,
viewplots
,
subsamples
,
docircul
public java.lang.String makeheadings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |