FracLac v2.4e is a plugin for ImageJ that analyzes
digital images for specialized measures of the box
counting fractal dimension, the {@link
FLAnalyzer.FLMain#doMF generalized dimension spectrum},
different types of lacunarity, and other {@link
FLAnalyzer.CircStats#measureHullandCircle morphometrics}.
The essential algorithm of the plugin is
outlined in the javadoc for the
{@link FLAnalyzer.FLMain FracLac} class and the class that
loads it, {@link GUI.FL_}.
montage of
biological cells created with ImageJ and analyzed with
FracLac using a local dimension
scan with the subarea size set
to correspond to the sizeof images making up the montage.
Colours show different fractal
dimensions of each cell contour. |
|
 |
Use it to measure difficult to describe
geometrical forms where the details of design are as
important as gross morphology.
|
Running the Plugin
FracLac runs under ImageJ. The software is
packaged as .jar file.
To install it,
place the current FracLac jar file in the plugins directory
of ImageJ and restart ImageJ. Run FracLac through the
"Plugins: Fractal Analysis" menu.
Before the first scan, the user must select either a
multifractal, regular box count, subscan,
or sliding box lacunarity scan
from the buttons on the FracLac panel. For subsequent
analyses, the user can click an analysis button to reuse settings, or
a setup button to change them.
Use
FracLac is
suitable for analyzing images of biological cells and textures,
for instance. It has been tested extensively on control images,
including various quadric fractals, Koch fractals, Sierpinski and
Menger fat fractals, multifractals (Henon Maps), diffusion
limited aggregates, and Euclidean forms, with typically low
deviations from expected and high r2 values for the
fractal dimension. It works on binary files (black pixels on a white
background, or white pixels on a black background), so images must
be thresholded prior to analysis to ensure that only the pixels
of interest are assessed. It also works on
grayscale images (2006).
Inputs:
- Open images, rois on open images, or single or multiple
unopened image files
- binary images,
generally, as single pixel wide outlines or textures
- grayscale images (e.g., of biological tissue, soil, etc.)
- user inputs for operating parameters
Outputs:
- Summarized data, data analysis, and raw data
text files (saveable ImageJ results windows)
- Saveable graphics showing colour-coded
local fractal dimensions, multifractal
spectra, and lacunarity graphs
- Saveable image legend
- Saveable graphics showing the grids in a scan
Needs:
Help and User's Guides
The FracLac code is extensively documented. In addtion, there
are several resources available:
a small online instructions page that loads with the plugin,
an online
guide , a
User's Instruction Guide, a full pdf instruction
Manual , and a zipped html help file. The author
also welcomes bug reports and feature requests (see below).
History and Development
FracLac was conceived and developed by Audrey Karperien at
Charles Sturt University in 2002-2004 as part of a master's
project supervised by Dr. Herbert Jelinek, Neuroscience
Department, School of Community Health, Charles Sturt University,
Australia. FracLac is available for
download
from the ImageJ website or as the most recent beta file from the
FracLac page. The intent was to develop a practical
tool for biological cell morphology analysis, addressing several
inherent problems associated with box counting. The box counting
algorithm was based originally on ImageJ's function and an NIH
Image plugin by Dr. Jelinek. The convex hull algorithm was
provided by Thomas R. Roy, University of Alberta, Canada. The
basic techniques represented can be found in the references
listed at the end of this page.
Features
- standard {@link FLAnalyzer.FLMain#SendImage box counting}
fractal dimensions
- graphs and {@link FLAnalyzer.FracStats#FindDfStats regression
statistics}
- {@link FLUtilities.FLutil#findAvgCover Average}
fractal dimensions and measures of {@link
FLUtilities.FLstatistics#coefVar variability} over {@link
FLAnalyzer.FLVars#GridPositions multiple
scans}
- a {@link FLAnalyzer.FracStats#LinearSmoothStats
smoothing correction} for the lack of prior knowledge of
the scaling ratio
- a {@link FLUtilities.FLutil#minMassCover minimal} or
{@link FLUtilities.FLutil#findMinCover most efficient}
covering dimension
- automatically {@link
FLAnalyzer.FLMain#MakeNewBoxSizes optimized} scans of
each image
- data for {@link FLAnalyzer.FLDataProcessor#recordRawData mass
related dimensions}
Calculations: The Box Counting Fractal Dimension Measures Complexity
- Df=-lim[logNε/logε]
- calculated as the slope of the regression line for the log-log
plot of box count on the y-axis and ε on the x
- where Nε is the count of all the boxes that
contained any pixels at a certain grid calibre, ε
- ε is nominally {@link FLAnalyzer.FLMain#BOXSIZES box size}/Length or
box size/maximum image {@link FLAnalyzer.FLVars#GreaterOfHtAndWd
dimension}
- for mass and grayscale dimensions, instead of Nε,
mass or intensityεis used.
- For the 2d variation for grayscale images, the fractal dimension,
(Dg) is calculated from the slope of the log vs log plot
of ln[(max-min)*r2] against r, where r is box size
and Dg=(3-slope/2)
- ΛDf=lim[ln σ/ln ε]
-(lim[ln λ/ln ε]/2)
- FracLac delivers
distributions of {@link FLAnalyzer.FLsetup#GetSubScanInputs local}
dimensions over an image, including colour coding showing
how the distribution of complexity changes with the scale
at which it is assessed (in addition to
{@link FLAnalyzer.FLMain#MultifractalDataProcessor multifractal}
spectra)
- {@link FLAnalyzer.FLMain#doMF Multifractal} spectra data and graphs:
DQ, τ, α, ƒ(α)
- customized sampling over {@link FLAnalyzer.FLMain#SetFourCorners
different orientations} and
{@link FLAnalyzer.FLVars#GridPositions shifted positions} as well as
{@link FLUtilities.FLutil#SmoothedArray data smoothing}
{@link FLUtilities.FLutil#minMassCover and minimizing}
- pseudorandom {@link FLAnalyzer.FLVars#RandomMassSample mass}
sampling (for example, manipulable with respect to {@link
FLAnalyzer.FLVars#FACTOR pixels sampled}, and so on)
Calculations for multifractal data
- DQ=lim[lnIQ,ε/lnε-1]/(1-Q)
- IQ,ε=∑[PiQ],
- For Q=1, let ε approach 1,
and DQ=-lim[∑Pi*ln[Pi]/lnε]
- The probability distribution is found from the number of pixels, M,
that were contained in each ith element at ε
required to cover an object:
- Thus, Piis from the probability distribution of
mass for all boxes (i) at this ε
where ∑Pi =1
- According to the method of Chhabra and Jensen
(Phys. Rev . Lett. 62: 1327, 1989):
- μi=PiQ/∑
PiQ
- α = ∑[μ*lnPi]/lnε
- ƒ(αQ)=∑[μi*lnμ
i]/lnε
- τQ=(Q-1)*DQ
- and ƒ(αQ)=
QαQ-τQ
Lacunarity (Λ)
- FracLac returns lacunarity based on the
{@link FLAnalyzer.FLData#CountPrefactorLacOverAllGrids
prefactor}
- lacunarity based on the coefficient of variation in
{@link FLAnalyzer.FLData#MassLacAtGrid pixel density}
and a binned
{@link FLAnalyzer.FLDataProcessor#BinnedProbabilityLacunarity
distribution}
Calculations: LACUNARITY measures heterogeneity
- Lacunarity=Λ=slope[ln λ/ln ε]*or
∑ λ/Nλ where
λ=1+(σ/μ)2
- Λall grid positions
= ∑λ/Nλ
- λgrid position=∑λε
/Nλε
- Slope Λ=-lim[ln λε/ln ε]
found as the slope of the
{@link FLAnalyzer.FracStats#PowerRegression log-log regression line}
- λε = 1+(σ/μ)2,
where σ
= the standard deviation of the pixel distribution at ε,
and μ = the mean
- Fλ & FΛ = calculated using foreground pixels only
- Eλ & EΛ = calculated using all image pixels
- BPDλ & BPDΛ = calculated using a
{@link FLAnalyzer.FLDataProcessor#BinnedProbabilityLacunarity
binned probability distribution}
- All of the above are based on different sampling:
- {@link FLAnalyzer.FLMain#Scan nonoverlapping}
scanning in regular box counting
- overlapping and potentially exhaustive sampling in
{@link FLAnalyzer.FLMain#GetSLACData sliding box scans}
Other Morphometrics
FracLac delivers various morphometrics based on the
foreground pixels of a binary image:
FracLac calculates the span ratio, the vertical
({@link FLAnalyzer.FLVars#MaxOverMinRadii bottom} and
{@link FLAnalyzer.FLVars#MaxRadius top})
and the horizontal (
{@link FLAnalyzer.FLVars#CVRadii left} and
{@link FLAnalyzer.FLVars#MeanRadii right})
axes,
and the perimeter and area of the
{@link FLAnalyzer.CircStats#measureHullandCircle convex hull}
enclosing the image.
It also delivers the minimum bounding circle
and a measure of {@link FLAnalyzer.FLVars#circularity}
based on the convex hull.
Working Structure:
- The plugin runs from a
{@link GUI.FL_#ShowPanelOfButtons panel}
- One settings button on the panel sets up
{@link FLAnalyzer.FLsetup#getBCInputs box counts}, another
{@link FLAnalyzer.FLsetup#GetSubScanInputs subscans},
another
{@link FLAnalyzer.FLsetup#getMFInputs multifractal}
scans, and another
{@link FLAnalyzer.FLsetup#getSLacInputs
sliding box lacunarity scans}.
- The action buttons get the
{@link GUI.FL_#DoActiveImageListener current image or roi} or
{@link GUI.FL_#DoRois roiManager} or
{@link GUI.FL_#OpenAndScanFilesWithoutShowingThem
select files} to open then
{@link GUI.FL_#DoActiveImage analyze} the image.
Types of Scans
Images
Stacks and Rois
- FracLac scans as many slices as an image has, and can
scan rois (user set or from the RoiManager)
or entire images. Rois are repeated through
all slices of a stack. The actual type of image to scan is
set by the user.
Binary Images
- In a binary scan,
only black or else white
pixels, whichever are less numerous or else whichever the
user specifies, are counted. Boxes containing pixels and the
mass (number of pixels) per box are recorded for each box
at each ε for each {@link FLAnalyzer.FLVars#GridPositions location}.
Threshholded Images
- FracLac converts images to binary
by calling ImageJ's thresholding method if the
option to automatically threshold is selected.
Grayscale Images
- In a grayscale scan, the difference between the
maximum and minimum gray values is recorded for each
box at each ε for each location. Grayscale images are
converted to rgb, padded with
a filler colour, then reconverted to grayscale for analysis.
Nonoverlapping vs Overlapping
There are two basic types of scans for all image types,
nonoverlapping or overlapping.
- Scans are non-overlapping if no boxes within a series of
εs overlap; that is, they are laid as a contiguous square grid.
- In overlapping scans, each box of size ε
is slid by {@link FLAnalyzer.FLVars#SLIDEX} horizontally and
{@link FLAnalyzer.FLVars#SLIDEY} vertically until the entire
image is covered at a box size. Thus, samples within one
scan of this type can overlap, as opposed
to fixed grid scans that cannot.
Non-Overlapping or Fixed-Grid Scan, 1 origin
- The most basic scan uses one series of εs
at one location, where one grid of each calibre in the series is
always positioned starting at the top left corner of the image.
Non-Overlapping, Multiple Origins Scan
- The same series of εs is applied from multiple
starting locations, with each smaller size within a series
always starting at the same position, in a non-overlapping scan.
The grid positions are randomly chosen, usually 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). For block scans, the origins are chosen
from within the image's borders.
Multifractal Scan
- The first four
grids in a multifractal scan are oriented so that the
last box at each size of each scan falls at the four corners
of the image,
similar to rotating by 90° each time. Scans after these are
randomly chosen based on the top left corner. This is a
non-overlapping scan.
Overlapping Sliding Lacunarity Scan
- If SLIDEX and SLIDEY are
1, a sliding box lacunarity scan is exhaustive. This scan can be modified to
stay within the image's borders or extend past them.
Subarea Scan
- A subarea scan does several fixed grid (non-overlapping) scans
over an image. If the subareas option is selected, FracLac
calculates a distribution of these local fractal dimensions over
smaller subareas of the image then delivers a
colour-coded graphic as well
as text values of these local dimensions. The
option to open multiple
files is not allowed in this
mode.
This program is free software distributed in the same
way that ImageJ is.
Related Documentation
@see T.G. Smith, Jr., G.D. Lange and W.B. Marks, Fractal Methods and Results in
Cellular Morphology, J. Neurosci. Methods,
69:1123-126, 1996.
@see E. Fernandez et al., Are neurons multifractals?,
J. Neurosci. Methods, 89:151157, 1999
@see R.E. Plotnick, R.H. Gardner, and R.V. O'Neil,
Lacunarity indices as measures of landscape
texture, in Landscape Ecology 8(3):201-211, 1993
@see Innaconne, Geometry in Biological Systems.
@see Costa and Cesar, Shape Analysis and
Classification, CRC Press, 2001
@see A. Chhabra and R.V. Jensen, Direct Determination
of the ƒ(α) singularity spectrum in
Phys. Rev . Lett. 62: 1327, 1989.
@see A. N. D. Posadas, D. GimeŽnez, M. Bittelli, C.
M. P. Vaz, and M. Flury, Multifractal
Characterization of Soil Particle-Size
Distributions, Soil Sci. Soc. Am. J.
65:13611367 2001
IDE: NetBeans IDE 4.1
@version 2.4e FracLac_ 2001-May 2006
@version 1.37g ImageJ
@author Audrey Karperien, MSc, Charles Sturt University
(akarpe01@postoffice.csu.edu.au)
@author Thomas R. Roy, BS (comp. science),
University of Alberta, Canada (convex hull)
@author ImageJ code and borrowed code from Wayne Rasband of the NIH
@author H.F. Jelinek, PhD, Charles Sturt University, Australia (idea developer)
@since jdk 1.5.0_04