Skip to main content Accessibility help

Weka Trainable Segmentation Plugin in ImageJ: A Semi-Automatic Tool Applied to Crystal Size Distributions of Microlites in Volcanic Rocks

  • Charline Lormand (a1), Georg F. Zellmer (a1), Károly Németh (a1), Geoff Kilgour (a2), Stuart Mead (a1), Alan S. Palmer (a3), Naoya Sakamoto (a4), Hisayoshi Yurimoto (a4) and Anja Moebis (a3)...


Crystals within volcanic rocks record geochemical and textural signatures during magmatic evolution before eruption. Clues to this magmatic history can be examined using crystal size distribution (CSD) studies. The analysis of CSDs is a standard petrological tool, but laborious due to manual hand-drawing of crystal margins. The trainable Weka segmentation (TWS) plugin in ImageJ is a promising alternative. It uses machine learning and image segmentation to classify an image. We recorded back-scattered electron (BSE) images of three volcanic samples with different crystallinity (35, 50 and ≥85 vol. %), using scanning electron microscopes (SEM) of variable image resolutions, which we then tested using TWS. Crystal measurements obtained from the automatically segmented images are compared with those of the manual segmentation. Samples up to 50 vol. % crystallinity are successfully segmented using TWS. Segmentation at significantly higher crystallinities fails, as crystal boundaries cannot be distinguished. Accuracy performance tests for the TWS classifiers yield high F-scores (>0.930), hence, TWS is a successful and fast computing tool for outlining crystals from BSE images of glassy rocks. Finally, reliable CSD’s can be derived using a low-cost desktop SEM, paving the way for a wide range of research to take advantage of this new petrological method.


Corresponding author

*Author for correspondence: Charline Lormand, E-mail:


Hide All

Cite this article: Lormand C, Zellmer GF, Németh K, Kilgour G, Mead S, Palmer AS, Sakamoto N, Yurimoto H and Moebis A (2018) Weka Trainable Segmentation Plugin in ImageJ: A Semi-Automatic Tool Applied to Crystal Size Distributions of Microlites in Volcanic Rocks. Microsc Microanal24(6), 667–675. doi: 10.1017/S1431927618015428



Hide All
Arganda-Carreras, I, Kaynig, V, Rueden, C, Eliceiri, KW, Schindelin, J, Cardona, A Seung, HS (2017) Trainable Weka segmentation: A machine learning tool for microscopy pixel classification. Bioinformatics 33(15), 24242426.
Armienti, P, Francalanci, L Landi, P (2007) Textural effects of steady state behaviour of the Stromboli feeding system. J Volcanol Geotherm Res 160(1–2), 8698.
Armienti, P, Pareschi, MT, Innocenti, F Pompilio, M (1994) Effects of magma storage and ascent on the kinetics of crystal growth. Contrib Mineral Petrol 115, 402414.
Auer, A, Martin, CE, Palin, JM, White, JDL, Nakagawa, M Stirling, C (2015) The evolution of hydrous magmas in the Tongariro Volcanic Centre: The 10 ka Pahoka-Mangamate eruptions. New Zeal J Geol Geophys 58(4), 364384.
Belgiu, M Drăguţ, L (2016) Random forest in remote sensing: A review of applications and future directions. ISPRS J Photogramm Remote Sens 114, 2431.
Benz, UC, Hofmann, P, Willhauck, G, Lingenfelder, I Heynen, M (2004) Multi-resolution, object-oriented fuzzy analysis of remote sensing data for GIS-ready information. ISPRS J Photogramm Remote Sens 58(3–4), 239258.
Berger, A, Herwegh, M, Schwarz, J-O Putlitz, B (2011) Quantitative analysis of crystal/grain sizes and their distributions in 2D and 3D. J Struct Geol 33(12), 17511763.
Bindeman, IN (2003) Crystal sizes in evolving silicic magma chambers. Geology 31(4), 367370.
Blaschke, T (2010) Object based image analysis for remote sensing. ISPRS J Photogramm Remote Sens 65(1), 216.
Blaschke, T, Lang, S Hay, GJ (2008) Object-Based Image Analysis: Spatial Concepts for Knowledge-Driven Remote Sensing Applications. Berlin: Springer.
Breiman, L (2001) Random forests. Mach Learn 45(1), 532.
Brugger, C Hammer, J (2010) Crystal size distribution analysis of plagioclase in experimentally decompressed hydrous rhyodacite magma. Earth Planet Sci Lett 300(3–4), 246254.
Cashman, KV McConnell, SM (2005) Multiple levels of magma storage during the 1980 summer eruptions of Mount St. Helens, WA. Bull Volcanol 68, 5775.
Cato, MJ, Fagan, AL Gross, J (2016) Crystal size distribution of low-Ti lunar basalt Northwest-Africa 8632. In 47th Lunar and Planetary Science Conference, The Woodlands, Texas, March 21–25, 2016.
Chardot, L, Jolly, AD, Kennedy, BM, Fournier, N Sherburn, S (2015) Using volcanic tremor for eruption forecasting at White Island volcano (Whakaari), New Zealand. J Volcanol Geotherm Res 302, 1123.
Chen, X, Zhou, X Wong, STC (2006) Automated segmentation, classification, and tracking of cancer cell nuclei in time-lapse microscopy. IEEE Trans Biomed Eng 53(4), 762766.
Cheng, L, Costa, F Carniel, R (2017) Unraveling the presence of multiple plagioclase populations and identification of representative two-dimensional sections using a statistical and numerical approach. Am Mineral 102, 18941905.
Crabtree, SM Lange, RA (2010) Complex phenocryst textures and zoning patterns in andesites and dacites: Evidence of degassing-induced rapid crystallization? J Petrol 52(1), 3–38.
Drignon, MJ, Bechon, T, Arbaret, L, Burgisser, A, Komorowski, J, Martel, C, Miller, H Yaputra, R (2016) Preexplosive conduit conditions during the 2010 eruption of Merapi volcano (Java, Indonesia). Geophys Res Lett 43(22), 1159511602.
Fawcett, T (2006) An introduction to ROC analysis. Pattern Recognit Lett 27, 861874.
Gutierrez, F Parada, MA (2010) Numerical modeling of time-dependent fluid dynamics and differentiation of a shallow basaltic magma chamber. J Petrol 51(3), 731762.
Hammer, J, Cashman, KV, Hoblitt, RP Newman, S (1999) Degassing and microlite crystallization during pre-climatic events of the 1991 eruption of Mt. Pinatubo, Philippines. Bull Volcanol 60, 355380.
Hibert, C, Mangeney, A, Grandjean, G Shapiro, NM (2011) Slope instabilities in Dolomieu crater, Réunion Island: From seismic signals to rockfall characteristics. J Geophy Res 116, F04032.
Higgins, MD (1996a) Crystal size distributions and other quantitative textural measurements in lavas and tuff from Egmont volcano (Mt. Taranaki), New Zealand. Bull Volcanol 58, 194204.
Higgins, MD (1996b) Magma dynamics beneath Kameni volcano, Thera, Greece, as revealed by crystal size and shape measurements. J Volcanol Geotherm Res 70, 3748.
Higgins, MD (2000) Measurement of crystal size distributions. Am Mineral 85, 11051116.
Higgins, MD (2002) Closure in crystal size distributions (CSD), verification of CSD calculations, and the significance of CSD fans. Am Mineral 87, 171175.
Higgins, MD Roberge, J (2007) Three magmatic components in the 1973 eruption of Eldfell volcano, Iceland: Evidence from plagioclase crystal size distribution (CSD) and geochemistry. J Volcanol Geotherm Res 161(3), 247260.
Jerram, DA, Dobson, KJ, Morgan, DJ Pankhurst, MJ (2018) Chapter 8 – The petrogenesis of magmatic systems: Using igneous textures to understand magmatic processes. In: Volcanic and Igneous Plumbing Systems, Burchardt S (Ed.), pp 191229. Amsterdam: Elsevier.
Jerram, DA Higgins, MD (2007) 3D analysis of rock textures; quantifying igneous microstructures. Elements 3(4), 239245.
Jerram, DA, Mock, A, Davis, G, Field, M Brown, R (2009) 3D crystal size distributions: A case study on quantifying olivine populations in kimberlites. Lithos 112, 223235.
Kile, DE Eberl, DD (2003) On the origin of size-dependent and size-independent crystal growth: Influence of advection and diffusion. Am Mineral 88, 15141521.
Lentz, RCF McSween, Jr HY (2000) Crystallization of the basaltic shergottites: Insights from crystal size distribution (CSD) analysis of pyroxenes. Meteorit Planet Sci 35(5), 919927.
Lesher, CE Spera, FJ (2015) Thermodynamic and transport properties of silicate melts and magma. In: The Encyclopedia of Volcanoes, Sigurdsson, H (Ed.), San Diego, CA: Elsevier.
Magee, C, O’Driscoll, B Chambers, AD (2010) Crystallization and textural evolution of a closed-system magma chamber: Insights from a crystal size distribution study of the Lilloise layered intrusion, East Greenland. Geol Mag 147(3), 363379.
Mahapatra, D (2014) Analyzing training information from random forests for Improved image segmentation. IEEE Transactions on Image Processing 23(4), 15041512.
Mangan, MT (1990) Crystal size distribution systematics and the determination of magma storage times: The 1959 eruption of Kilauea volcano, Hawaii. J Volcanol Geotherm Res 44, 295302.
Marsh, BD (1988) Crystal size distribution (CSD) in rocks and the kinetics and dynamics of crystallisation. I: Theory. Contrib Mineral Petrol 99, 277291.
Marsh, BD (1998) On the interpretation of crystal size distributions in magmatic systems. J Petrol 39, 553599.
Meyer, FJ, McAlpin, DB, Gong, W, Ajadi, O, Arko, S, Webley, PW Dehn, J (2015) Integrating SAR and derived products into operational volcano monitoring and decision support systems. ISPRS J Photogramm Remote Sens 100, 106117.
Mock, A Jerram, DA (2005) Crystal size distributions (CSD) in three dimensions: Insights from the 3D reconstruction of a highly porphyritic rhyolite. J Petrol 46(8), 15251541.
Moebis, A (2010) Understanding the Holocene Explosive Eruption Record of the Tongariro Volcanic Centre. PhD thesis, Massey University, Palmerston North.
Morgan, D Jerram, D (2006) On estimating crystal shape for crystal size distribution analysis. J Volcanol Geotherm Res 154(1–2), 17.
Morgan, DJ, Jerram, DA, Chertkoff, DG, Davidson, JP, Pearson, DG, Kronz, A Nowell, GM (2007) Combining CSD and isotopic microanalysis: Magma supply and mixing processes at Stromboli Volcano, Aeolian Islands, Italy. Earth Planet Sci Lett 260(3–4), 419431.
Moss, RA, Hance, GA, Umbaugh, SE Stoecker, WV (1996) Unsupervised color image segmentation: with application to skin tumor borders. IEEE Engineering in Medicine and Biology Magazine, Institute of Electrical and Electronics Engineers (IEEE), Jan 1996.
Muir, DD, Blundy, J Rust, AC (2012) Multiphase petrography of volcanic rocks using element maps: A method applied to Mount St. Helens, 1980–2005. Bull Volcanol 74, 11011120.
Pedersen, GBM (2016) Semi-automatic classification of glaciovolcanic landforms: An object-based mapping approach base on geomorphology. J Volcanol Geotherm Res 311, 2940.
Petrelli, M, Bizzarri, R, Morgavi, D, Baldanza, A Perugini, D (2017) Combining machine learning techniques, microanalyses and large geochemical datasets for tephrochronological studies in complex volcanic areas: New age constraints for the Pleistocene magmatism of central Italy. Quaternary Geochronol 40, 3344.
Pham, DL, Xu, C Prince, JL (2000) Current methods in medical image segmentation. Ann Rev Biomed Eng 2, 315337.
Rannou, E Caroff, M (2010) Crystal size distribution in magmatic rocks: Proposition of a synthetic theoretical model. J Petrol 51(5), 10871098.
Riggelsen, C Ohrnberger, M (2014) A machine learning approach for improving the detection capabilities at 3C seismic stations. Pure Appl Geophys 171, 395411.
Sable, JE, Houghton, BF, Wilson, CJN Carey, RJ (2009) Eruption mechanisms during the climax of the Tarawera 1886 basaltic Plinian eruption inferred from microtextural characteristics of the deposits. Studies in Volcanology: The Legacy of George Walker. Geol Soc Lond Spec Publ IAVCEI 2, 129154.
Simakin, AG Bindeman, IN (2008) Evolution of crystal sizes in the series of dissolution and precipitation events in open magma systems. J Volcanol Geotherm Res 177(4), 9971010.
Sing, T, Sander, O, Beerenwinkel, N Lengauer, T (2005) ROCR: Visualizing classifier performance in R. Bioinform Appl Note 21(20), 39403941.
Szramek, L, Gardner, JE Hort, M (2010) Cooling-induced crystallization of microlite crystals in two basaltic pumice clasts. Am Mineral 95(4), 503509.
van Rijsbergen, CJ (1979) Information Retrieval. London: Butterworths.
Vasuki, Y, Holden, E-J, Kovesi, P Micklethwaite, S (2017) An interactive image segmentation method for lithological boundary detection: A rapid mapping tool for geologists. Comput Geosci 100, 2740.
Vona, A Romano, C (2013) The effects of undercooling and deformation rates on the crystallization kinetics of Stromboli and Etna basalts. Contrib Mineral Petrol 166, 491509.
Witten, IH, Frank, E, Trigg, L, Hall, M Holmes, G (1999) Weka: Practical Machine Learning Tools and Techniques with Java Implementations, Computer Science Working Papers. Hamilton: University of Waikato, Department of Computer Science.



Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed