CSDCorrections: A program for stereological corrections
CSDCorrections is an indirect, distribution-free method
for stereological calculations of Crystal Size Distributions (CSD) using
measurements of crystal outlines in thin section, outcrops etc. The
methods it uses are described in Higgins (2000, 2002,
2006, 2007). It can also be used for converting any other 2D
intersection measurements: particles, grains, bubbles, clasts, etc.
Please tell me if you find any bugs.
Windows: The program runs directly in Windows 10 and 11. Right click on the installer file (CSDCorrectionsSetUp.exe) and click on 'Run as administrator'.
MacOS: There are many ways to get Windows
programs to run on a Mac. The cheapest way to get CSDCorrections
running on MacOS is with the application Wine(also available for Linux and BSD).
This does not need an actual copy of Windows as it emulates the
necessary windows routines in the MacOS. There are several other versions
of Wine that may work better such asWineBottler
or CrossOver
(a commercial development of Wine). At the moment the new Mac M1 OS may
need CrossOver. Another approach is to use a virtual machine
such as VirtualBox
for Mac, Parallelsand VMware
Fusion, but this requires an actual copy of Windows.Get back to me if you can't get it going.
ImageJ: CSDCorrections is well integrated with the free
image processing program ImageJ
(for Windows, MacOS, Linux). If you have already
installed ImageJ on Windows then the installer will try to add a macro to
help transfer the data from ImageJ to CSDCorrections. If it does not
install correctly then download the macro CSD_output.ijm
(A simple text file; In Windows: Click right and Save as …). Then find
where ImageJ (or Fiji) is installed on your computer and save this file in
the directory: .../ImageJ/plugins. It should appear in the Plugins
menu in ImageJ as 'CSD Output'. For use of this plugin see my guide.
When you choose the units in "Analyse/Set Scale" do not use Greek letters
for micrometres: write it out as micrometres.
Quick guide: I have written a quick guide
to digitisation of data.
Data files: Data files are saved in an uncompressed XML
format -- *.csd
Test CSD file: A test file is available here test.csd
It is a XML text file. In Windows: Click right and Save as test.csd.
How the programs works
1) Measured data is compiled. Intersection lengths or widths are
classified according to the size bins that have been selected – e.g. 5
bins per decade. The number in each bin is divided by the area measured.
Up to two datasets can be combined to give a single set of number per unit
area for each size bin.
2) Model data is compiled. Parallelepipeds and triaxial ellipsoids are
created with the aspect ratio specified. The objects are sectioned 50000
times. The orientation of the section plane with respect to the model is
random but constrained by the specified fabric and orientation of the
section to the fabric. Intersection lengths and widths from the two models
are blended according to the roundness specified. The compiled length and
width of intersections are classified using the specified bin sizes, after
adjustment for the modal size value. Probability functions are calculated
for each size interval to be used in the corrections.
3) Data are corrected for cut-section effect. Starting with the largest
size bin, the influence on the smaller size bins are calculated using the
model distributions and subtracted from the actual contents of the bin.
The process then moves to the next smallest bin and continues until all
the bins have been treated or the correction is greater than the actual
contents of the bin.
4) A shape correction factor is applied to the size bins – generally
equal to Long/Intermediate axes of the model.
5) Data are corrected for the intersection probability effect. The
corrected number per unit area data are divided by the mean bin size and
bin width to get the population density.
6) Minor corrections for vesicularity and normalisation to a total volume
abundance may be made if requested.
7) Intersection orientation, position and aspect ratio data are
calculated.
Size ranges for all numerical treatment (size, shape, orientation,
position) can now be selected using checkboxes in the column Select.
In earlier versions 'Plot' checkboxes only affected the size
calculations.
Version 1.61 - May 2022
Results layout changed so that the effects of bin selection can be
seen more clearly
Width/length data treatment revised. Linear histograms or data
smoothed using kernel density functions
Crystal distributions shown as tilted ellipses
Fixed minor bugs for loading data and selection of ranges
Fixed version checker when server is down
Version 1.5
Program rewritten using Lazarus and Free Pascal (formerly written in
Delphi)
Addition of crystal position data page
Layout changes
Fixed problem with help files (1.51 - August 2015)
Fixed numerous minor problems (1.52 - March 2016)
Added DPI awareness for different screen sizes (1.52 - March 2016)
Minor fix for activation of help system (1.53 - April 2016)
Fixed dot/comma decimal separator problems (I hope) and
other minor bugs (1.54 - July 2017)
Fixed problem with operation on 32 bit Windows systems (1.55 -
August 2017)
Version 1.4
Calculates and displays orientation data
Calculates and displays "Big R" crystal position distribution
parameter.
Can handle 20 000 points in each data set
Minor layout changes
New version of ImageJ plug-in will transfer length, width, area,
angle, centroid X, centroid Y, notes data to .csd file.
Minor bug fixes - mostly concerned with second data set
Bug fixes - occasional failure to start (1.4.0.1)
Minor layout changes to regression data table (1.4.0.1)
Minor bug fixes (1.4.0.2 - September 2012)
Improved rose diagram for orientations (1.4.0.2)
Version 1.39
Significant bug fix. An error in the population density values was
introduced with version 1.37. This only affected prismatic crystals.
They were overestimated by a factor of I/L. For example, if S:I:L =
1:2:4 then ln(pop den) was 0.7 ln units too high. All other parameters
were unaffected.
Minor changes in program layout.
Minor bug fix – range in characteristic lengths (1.3.9.2).
Minor bug fix – popup menu / 'copy all' in raw data (1.3.9.3).
(August 2011)
Several minor bug fixes - decimal separator and raw data tables
(1.3.9.4). (August 2011)
Minor bug fixes - sorting of raw data (1.3.9.5). (November 2011)
Version 1.38
Minor bug fixes.
New 2D data display - length, width and area are all in one
table.
Easier to compare calculations from intersection length and width.
New version ofImageJ
plug-in will transfer all three data columns to .csd file.
Volume % calculated from intersection areas, if present.
Intersection width / intersection length of sample and model can be
compared easily.
New save / load dialogue boxes.
Plots of intersection width / length use fixed number of points in
each bin (see Higgins and Chandrasekharam, 2007)
Minor bug fixes. (1.3.8.2)
Notes now on first page (1.3.8.2)
Width/length, etc graphs now with results. (1.3.8.2)
Saving and loading of bins-pers-decade bug fixed. (1.3.8.3)
Second data set can be loaded from a second .csd file (1.3.8.3).
Version 1.37
New page format - Input and output data clearly separated
Choice of four output graphs and tables:
'Classic' ln(population density) vs size
Cumulative distribution function (lognormal)
Power Law (Fractal)
Simple population density histogram
Correction of CSD to known volumetric phase abundance (see Higgins,
2006)
Automatically checks for new version on start-up
Can handle 10 000 points (1.3.7.1)
Fixed 'copy' problem of several data tables (1.3.7.1)
Only checks for a new version once a week (1.3.7.1)
Numerous minor bug fixes (1.3.7.1)
Version 1.36
Corrections of several bugs
Reads damaged files more easily
New XML file format - easier for further expansions of method
Version 1.35
Custom and linear size bins possible
Other intersection size definitions possible - maximum length and
ellipse dimensions
Graphs of aspect ratio and normalised intersection length/width
Possible to select scale of graph
Data format is slightly different, but can read old formats.
Version 1.3 - 1.32
Uses a new, accurate algorithm for calculating intersections of a
triaxial ellipsoid
Uses a new algorithm for interpolating between a block and an
ellipsoid, for rounded crystals
Has the capacity to treat 2 data sets gathered at different
resolutions
Can use bins per decade or phi bins
Can add notes on each sample.
New style with 'pages'.
Uses a new file format. All processing parameters are retained now.
Old files (version 1.1, 1.2) can be read by version 1.3.
Copy and paste more extensively implemented - even graphs.
Just right click.
You can choose which points to plot. Just click on the plot box.
A regression weighted for the errors in each point is performed.
(Version 1.3.1)
Minor bugs corrected -- Version 1.3.2
Version 1.2
Calculates volumetric phase proportions. This is useful for
verifying that CSDs have been calculated correctly and other purposes
(Higgins, 2002).