TY - JOUR AU - Jelinek, Herbert Franz AB - Introduction Complex systems arise in nature through nonlinear and often repetitive interactions of physical parameters. Recently, the Nobel Prize in Physics 2021 was awarded for research on complex systems with a focus on climate and climate change [1]. Physiological processes, such as phenomena in nature, are complex systems. The rhythm of the human heart, for example, is a consequence of the nonlinear interaction of electrical excitations of a huge number of cardiac muscle cells that are modulated by the autonomic nervous system via a cardiac pacemaker. Therefore, the electrocardiogram itself or beat-to-beat intervals can be successfully investigated by nonlinear 1D signal analysis [2, 3]. Cardiac autonomic neuropathy is an example of a neuropathology that manifests as an arrhythmia and therefore can be identified using linear or nonlinear 1D signal analysis [4, 5]. Other examples from medicine include electroencephalogram or postural sway recordings and their analyses [6–8]. In other scientific fields, such as oncology or geology, dynamical systems cannot be studied directly in the time domain because the time periods are too long for experimental measurements. However, the outcome of such nonlinear dynamical systems can be investigated by their morphological characteristics with 2D images and/or 3D image volumes [9, 10]. Interestingly, 1D morphological analysis is also highly relevant in oncology, mainly because of the full compatibility of 1D analysis with irregularly shaped tumour regions of interest (ROI) in medical images [11]. Another advantage of 1D analysis is its directional sensitivity [11]. A particular example of this former research strategy is at the core of newly developed technologies for assessing neurodivergent and mental health conditions in children (e.g. attention deficit hyperactivity disorder and autism spectrum disorder). Human behaviour and cognition emerge from complex “brain-body-environment” multi-scale interactions. These interactions are controlled by goal-directed and anticipatory mechanisms, known as executive functions (EF). Atypical EF patterns are the most common features associated with neurodivergent and mental health conditions in children. Notably, these atypical EF patterns can be accurately detected using complexity measures such as the fractal dimension and lacunarity [12]. In 2D, the new fractal fragmentation index FFI quantifies the degree of object fragmentation or compaction [13]. At the same time, FFI can identify for each object separately the deviation of its shape from a Euclidean geometric shape. FFI has been successfully applied to study deforestation at the level of counties [13, 14], territorial administrative units [15], or mountain groups [16, 17], showing in all cases that the fractal fragmentation of forests increases as a result of deforestation. At present, there is no single, comprehensive and continuously maintained software for nonlinear and complexity analysis that can be operated without programming knowledge. The field is quite scattered with proprietary software (e.g. MATLAB, Dataplore) and open-source software or freeware (e.g. TISEAN, PhysioNet, FracLac). MATLAB https://www.mathworks.com is a programming language with a focus on effective matrix computations. It can be applied to any dimensional input data, but requires scientific programming experience. There are toolboxes and additional libraries for e.g. Detrending fluctuation analysis, Approximate entropy, Sample entropy, Multiscale Entropies, and Lyapunov exponents including surrogates. Dataplore https://www.ixitos.com/produkte/dataplore is mainly a 1D statistical signal processing software for the end user with a graphical user interface and a macro functionality. It contains many linear statistical methods such as statistical tests, signal manipulation, filtering, wavelet transforms, but only few nonlinear analysis algorithms such as recurrence plots, correlation dimension, Lyapunov exponents and surrogates. The latest version 2.2–3 was released in 2007. TISEAN https://www.pks.mpg.de/tisean is a dedicated command line software project for 1D time signal analyses of nonlinear deterministic or chaotic systems and includes phase space reconstructions, Lyapunov exponents, correlation dimensions, Rényi entropies and surrogate methods. The latest version 3.0.1 was released in 2007. PhysioNet https://physionet.org is a research database of complex physiological 1D signals and hosts a number of single software files written in MATLAB, Python or C for nonlinear analyses of physiological time series, especially and mainly for ECG recordings https://physionet.org/about/software. FracLac https://imagej.nih.gov/ij/plugins/fraclac/FLHelp/Introduction.htm is an end user friendly ImageJ/ImageJ1 plugin for computing fractal dimensions and lacunarities of 2D images with box-counting. Binary and greyscale algorithms are supported. Thanks to a built-in legacy layer for running ImageJ1 plugins, it can still be used in Fiji or ImageJ2. The latest version 2.5 was released in 2012. Multifrac https://www.ivangtorre.com/software is a new and end user friendly ImageJ2 plugin for computing mono- and multifractal dimensions, including lacunarity and some entropies, in 2D and 3D [18]. In summary, there is no regularly updated software package that contains a large number of algorithms and is easy to use at the same time. ComsystanJ (Complex Systems Analysis for ImageJ) was created to fill this gap. It is platform independent, user friendly for the inexperienced user, macro usable and expandable for the experienced programmer. An exclusive new feature is the support of surrogate analysis for digital images and image volumes. Surrogate analysis is implemented in ComsystanJ without the need to use another ImageJ/Fiji plugin or software. The noise sensitivity can be checked for each algorithm and its specific settings by using a dedicated plugin that adds different types and intensities of artificial noise. Also new is the generalizable support of 1D time signals as well as 2D images and 3D image volumes. It has been developed with individual plugins for each functionality and uses the plugin framework of Fiji/ImageJ2. It is written in Java and hosted as an open-source GitHub project at https://github.com/comsystan/comsystanj. Material and methods Fiji/ImageJ2 ecosystem Fiji/ImageJ2 https://imagej.net is the successor of the popular scientific image processing software ImageJ developed by Wayne R. Rasband [19, 20]. ImageJ and Fiji are widely used worldwide and are standards in scientific image processing. There exists a huge user base, a user forum https://forum.image.sc, a large list of plugin extensions https://imagej.net/list-of-extensions and several additional implementations. The current development of Fiji is based on ImageJ2, which has a completely different internal structure than the original ImageJ1. It contains several packages or libraries that can also be used independently of each other if required. A legacy layer ensures that ImageJ1 functionalities are also supported under the new concept of ImageJ2 https://imagej.net/libs/imagej-legacy. The ImageJ ecosystem [21] mainly covers 2D image processing and 3D image stack processing, including 4D applications if time is taken as an additional dimension. Unfortunately, 1D analyses of time signals are not truly an area of interest in this ecosystem, although the new ImageJ2 structure has been developed to be dimension independent. This makes it easy to add 1D processing plugins without having to use or develop another framework. A 1D equivalent ecosystem to Fiji/ImageJ for signal processing does not exist and users have to use proprietary software or individual files with different programming languages suitable only for well-trained scientific programmers. ComsystanJ ComsystanJ shows that 1D signal processing is also effectively possible with the Fiji/ImageJ2 framework. It combines 1D, 2D and 3D nonlinear algorithms to investigate complex systems regardless of dimensionality. One of the advantages of ComsystanJ is that the end user finds common and similar functionalities in all plugins and does not have to switch between and learn different programming languages. Surrogate analysis, which is typically only applied to 1D temporal signals, is supported for all dimensions. ComsystanJ includes (i) some common functionalities and linear algorithms such as: signal-, image-, volume generation, resampling, simple mathematics, filtering, noise addition, FFT, autocorrelation, descriptive statistics, event detection, QRS peak detection, standard HRV measurements, symbolic aggregation, (ii) common nonlinear and complexity analysis methods for signals and images such as: Poincare plot, Detrended fluctuation analysis, Hurst coefficient, Katz-, Petrosian-, Sevcik-, Higuchi-, FFT-, Box counting-, Minkowski-, Correlation-, Generalized dimensions, Largest Lyapunov exponent, Recurrence Quantification Analysis, Lacunarity, Succolarity, Approximate-, Sample-, Permutation entropy, Allometric scaling, and Surrogates and (iii) some very new (partly unpublished) algorithms such as: Kolmogorov complexity, Logical depth, Generalized entropies (SE, H1, H2, H3, Rényi, Tsallis, SNorm, SEscort, SEta, SKappa, SB, SBeta, SGamma), Fractal fragmentation indices, Pyramid-, RSE-, Directional correlation-, Directional Higuchi-, and Tug of war dimension. Surrogate analysis ComsystanJ includes comprehensive surrogate analyses in 1D, 2D and 3D. Surrogates are generated by modifying the input data using methods such as shuffling or power spectral methods and are used extensively in nonlinear 1D time signal analysis [22]. Shuffling or randomizing the phase before inverse Fourier transformation does not change linear measures such as the mean, median or standard deviation but does have an effect on methods that take correlations into account. This makes it possible to check whether correlations exist within a signal or not. From a mathematical point of view, there is no reason to limit surrogate tests to only one dimension. However, surrogates are not routinely used in 2D image processing. Here, we want to give a plausible explanation for this fact. 1D time signals such as auditory signals are usually visualized as two-dimensional plots and not represented, e.g., as acoustic information for our sense of hearing. Hearing would be one-dimensional in itself, but a graph is not the signal itself; it is a graphic representation suitable for our sense of sight. Therefore, we cannot detect or decide whether correlations are present in such a signal, and our sense of sight can hardly distinguish a surrogate signal from the original signal. Consequently, surrogate analysis is useful because we can use mathematics or algorithms to decide whether correlations exist or not. Most ComsystanJ 1D plugins include surrogate analysis by selecting an additional surrogate method and the number of surrogates in the GUI. Then, the plugin calculates the specific nonlinear parameter, generates the number of surrogates and shows their individual results, their average value and the standard deviation. For the end user, this is a convenient way to achieve maximum results with a single run of a plugin. 2D images of a scene or an object are perfect representations that correspond to the human sense of sight. We can easily see correlations in an image, and surrogates of images (e.g. by randomly shuffling the pixels) can obviously be distinguished. This simple fact seems to be the reason for avoiding surrogates for images, even if the algorithms used for nonlinear analyses do not have sensitivities corresponding to human senses. From a mathematical point of view, it should not make any difference whether a person has an adequate sense to recognise correlations or not. Thus, ComsystanJ also provides surrogates for analysing 2D images and 3D image stacks. With ComsystanJ, we offer scientists the possibility to use surrogates also for 2D and 3D, as the reliability of nonlinear measures can be tested and further insights can be easily gained. Fiji/ImageJ2 ecosystem Fiji/ImageJ2 https://imagej.net is the successor of the popular scientific image processing software ImageJ developed by Wayne R. Rasband [19, 20]. ImageJ and Fiji are widely used worldwide and are standards in scientific image processing. There exists a huge user base, a user forum https://forum.image.sc, a large list of plugin extensions https://imagej.net/list-of-extensions and several additional implementations. The current development of Fiji is based on ImageJ2, which has a completely different internal structure than the original ImageJ1. It contains several packages or libraries that can also be used independently of each other if required. A legacy layer ensures that ImageJ1 functionalities are also supported under the new concept of ImageJ2 https://imagej.net/libs/imagej-legacy. The ImageJ ecosystem [21] mainly covers 2D image processing and 3D image stack processing, including 4D applications if time is taken as an additional dimension. Unfortunately, 1D analyses of time signals are not truly an area of interest in this ecosystem, although the new ImageJ2 structure has been developed to be dimension independent. This makes it easy to add 1D processing plugins without having to use or develop another framework. A 1D equivalent ecosystem to Fiji/ImageJ for signal processing does not exist and users have to use proprietary software or individual files with different programming languages suitable only for well-trained scientific programmers. ComsystanJ ComsystanJ shows that 1D signal processing is also effectively possible with the Fiji/ImageJ2 framework. It combines 1D, 2D and 3D nonlinear algorithms to investigate complex systems regardless of dimensionality. One of the advantages of ComsystanJ is that the end user finds common and similar functionalities in all plugins and does not have to switch between and learn different programming languages. Surrogate analysis, which is typically only applied to 1D temporal signals, is supported for all dimensions. ComsystanJ includes (i) some common functionalities and linear algorithms such as: signal-, image-, volume generation, resampling, simple mathematics, filtering, noise addition, FFT, autocorrelation, descriptive statistics, event detection, QRS peak detection, standard HRV measurements, symbolic aggregation, (ii) common nonlinear and complexity analysis methods for signals and images such as: Poincare plot, Detrended fluctuation analysis, Hurst coefficient, Katz-, Petrosian-, Sevcik-, Higuchi-, FFT-, Box counting-, Minkowski-, Correlation-, Generalized dimensions, Largest Lyapunov exponent, Recurrence Quantification Analysis, Lacunarity, Succolarity, Approximate-, Sample-, Permutation entropy, Allometric scaling, and Surrogates and (iii) some very new (partly unpublished) algorithms such as: Kolmogorov complexity, Logical depth, Generalized entropies (SE, H1, H2, H3, Rényi, Tsallis, SNorm, SEscort, SEta, SKappa, SB, SBeta, SGamma), Fractal fragmentation indices, Pyramid-, RSE-, Directional correlation-, Directional Higuchi-, and Tug of war dimension. Surrogate analysis ComsystanJ includes comprehensive surrogate analyses in 1D, 2D and 3D. Surrogates are generated by modifying the input data using methods such as shuffling or power spectral methods and are used extensively in nonlinear 1D time signal analysis [22]. Shuffling or randomizing the phase before inverse Fourier transformation does not change linear measures such as the mean, median or standard deviation but does have an effect on methods that take correlations into account. This makes it possible to check whether correlations exist within a signal or not. From a mathematical point of view, there is no reason to limit surrogate tests to only one dimension. However, surrogates are not routinely used in 2D image processing. Here, we want to give a plausible explanation for this fact. 1D time signals such as auditory signals are usually visualized as two-dimensional plots and not represented, e.g., as acoustic information for our sense of hearing. Hearing would be one-dimensional in itself, but a graph is not the signal itself; it is a graphic representation suitable for our sense of sight. Therefore, we cannot detect or decide whether correlations are present in such a signal, and our sense of sight can hardly distinguish a surrogate signal from the original signal. Consequently, surrogate analysis is useful because we can use mathematics or algorithms to decide whether correlations exist or not. Most ComsystanJ 1D plugins include surrogate analysis by selecting an additional surrogate method and the number of surrogates in the GUI. Then, the plugin calculates the specific nonlinear parameter, generates the number of surrogates and shows their individual results, their average value and the standard deviation. For the end user, this is a convenient way to achieve maximum results with a single run of a plugin. 2D images of a scene or an object are perfect representations that correspond to the human sense of sight. We can easily see correlations in an image, and surrogates of images (e.g. by randomly shuffling the pixels) can obviously be distinguished. This simple fact seems to be the reason for avoiding surrogates for images, even if the algorithms used for nonlinear analyses do not have sensitivities corresponding to human senses. From a mathematical point of view, it should not make any difference whether a person has an adequate sense to recognise correlations or not. Thus, ComsystanJ also provides surrogates for analysing 2D images and 3D image stacks. With ComsystanJ, we offer scientists the possibility to use surrogates also for 2D and 3D, as the reliability of nonlinear measures can be tested and further insights can be easily gained. Results Installation One of the most important advantages and successes of the ImageJ and Fiji/ImageJ2 ecosystem is that installing a plugin is as easy as copying the plugin file into a plugin subfolder. Thus, it is only necessary to download a ComsystanJ release from the GitHub repository https://github.com/comsystan/comsystanj/releases. Unpack the *.zip file and copy the whole folder to the plugins folder of Fiji. Alternatively, the ComsystanJ *.jar files can be imported using the Fiji command Plugins/Install. Starting Fiji, the ComsystanJ plugins appear under Plugins/ComsystanJ. Fiji should be up to date, and the SCIFIO option (Edit/Options/ImageJ2) must be enabled. To update ComsystanJ, the old ComsystanJ folder must be replaced with a new folder. More than one ComsystanJ folder in Fiji should be avoided. It is recommended to download a clean copy of the latest Fiji version from the Fiji archive https://downloads.imagej.net/fiji/archive. The SCIFIO option (Edit/Options/ImageJ2) must be enabled in Fiji. Do not use old versions or updated versions of Fiji, as the updater is not always successful. Set of plugins More than 60 plugins are separated into 1D, 2D and 3D plugins. A 3D image stack can be used as input for both 2D and 3D plugins. It might be processed with 2D functionalities slice per slice using 2D plugins or in three dimensions using 3D plugins. A list of the available plugins and functionalities can be found in Tables 1–3. Each set of plugins contains some plugins that are not intended for nonlinear analyses, such as opening, generation and preprocessing. The number of these plugins is very limited for 2D and 3D plugins, as Fiji/ImageJ2 and its functionalities can be used directly. For 1D plugins, this number is higher to cover most of the usually required preprocessing steps for signals. A detailed description of the plugins can be found on the homepage of ComsystanJ https://comsystan.github.io/comsystanj. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 1. List of 1D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t001 Download: PPT PowerPoint slide PNG larger image TIFF original image Table 2. List of 2D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t002 Download: PPT PowerPoint slide PNG larger image TIFF original image Table 3. List of 3D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t003 Description of 1D signal plugins The internal representation of a signal for ComsystanJ and Fiji/ImageJ2 is a table (SciJava class DefaultGenericTable) and especially a table column. The first row entry represents the column header and can simply be the name of the signal or file. Several signals correspond to distinct columns. However, the first column is reserved for the corresponding row headers, which in most cases are ascending integer numbers representing the sample number. Data files for signals must meet some requirements resulting from the internal structures of Fiji/ImageJ2. Firstly, the signal files must be comma separated text files. The first row and the first column can contain any characters, the data values must be real numbers with a point as decimal place. Secondly, each column must have the same size. If the number of data values in a column is shorter, the missing data values must be filled with the character NaN. Files that meet these requirements must be opened with the ComsystanJ Opener plugin and are displayed as a table. This table contains the signal data and is the source for the signal plugins used in the following. A graphical display of the signal(s) can optionally be shown, but is not the source for the signal plugins and can be omitted for very large data series if memory is limited. A large number of artificially generated signal types can be generated with the signal generator plugin to have a convenient possibility for comparisons. Signal types might be linear (Constant, Sine,…), random (Gaussian or uniform), chaotic (Logistic, Henon…), fractal (fGn, fGm….) or binary (Cantor). A list of 1D functionalities can be seen in Table 1. The GUI of a typical analysis plugin consists of parameter settings for the specific algorithm, followed by analysis options, display options and process options common to all 1D plugins. Analysis options include the choice of simply applying the algorithm to the entire signal or to subsequent or sliding boxes (with adjustable box length), resulting in a list of result values for each window. The latter two options are a convenient way to examine the development of the result values over time without having to write a macro for it. Surrogates (with adjustable number of surrogates) can be activated for the entire signal range and then the analysis is additionally carried out automatically for several surrogates and individual surrogate result values as well as an average surrogate value are included in the result table without having to write a macro for it. The display options decide whether algorithm dependent graphs or windows are displayed or not and whether already displayed windows are overwritten or not. The process options include the possibility to activate an immediate preview when any GUI element is changed by the user. Pressing the OK button finally processes all available signals without having to write a macro for that. Typical GUIs of a signal plugin can be seen in Fig 1A and 1D. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 1. Example of 1D signal analysis. (A) GUI for generating 1D sequences. (B) Table of generated sequence data values. (C) Graphical representation of sequences with a predefined theoretical fractal dimension of 1.5. (D) GUI for determining the Higuchi dimensions. (E) Double logarithmic plot of summed up sequence lengths and delay parameter k. (F) Result table including the Higuchi dimensions Dh (around 1.5) for all three sequences. https://doi.org/10.1371/journal.pone.0292217.g001 Example of 1D signal analysis Close all open Windows or restart Fiji and generate a set of signals with the following command and parameter settings: Plugins/ComsystanJ/1D Sequence(s)/Sequence generator (see Fig 1A), Method: W-M (Weierstrass-Mandelbrot function), Number of sequences: 3, Number of data values: 1024, (W-M) Fractal dimension [1, 2]: 1.5 The remaining options can be left as defaults. Press the OK button and confirm the Display option with Yes. A set of signals will be shown in a table (Fig 1B) and additionally a window with graphs will be displayed (Fig 1C). Please note that actual values and graphs vary with each generation. The subsequent determination of e.g. the Higuchi dimension can be done with: Plugins/ComsystanJ/1D Sequence(s)/Higuchi dimension (see Fig 1D), k: 8, Regression Min: 1, Regression Max: 8, Signal range: Entire sequence, (Entire signal) Surrogates: No surrogates, Surrogates #: 10, Box length: 100, Skip zero values: Disabled, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled, Column #: 1 A preview can be started by pressing the button Process single column #. A result table and a double log plot (Fig 1E) will be displayed. The Column # may be changed and again a preview can be started. Finally, by pressing the OK button, all three signals will be processed and the results will be displayed (Fig 1F). The values in the Dh column represent the determined fractal dimensions and should be about 1.5. The column R2 shows the values of the coefficient of determination of the linear regressions. Description of 2D image plugins 2D images can be opened either with the genuine Fiji/ImageJ2 commands or with the ComsystanJ image opener plugin. The latter has the advantage that multiple images can be selected individually and when multiple images are selected, they are automatically opened as an image stack. Internally, an image or image stack is held in the primary ImageJ2 dataset container called Dataset, which provides access to pixels and metadata. The SCIFIO option must be activated in Fiji to ensure the ImageJ2 image format for input and output. An image generator plugin with more than 20 different image types is available. It includes linear types (Constant, Sine,…), random (Gaussian or uniform), fractal surfaces (FFT or MPD) or binary IFS types (Menger, Sierpinski,…..). Images can be created with selectable size, colour type and number of images and can be used for comparison purposes. A filter plugin and a noise plugin are provided, as filtering and adding noise are two direct and commonly used methods for testing nonlinear and complex analysis algorithms. Other methods can be used from the Fiji/ImageJ2 ecosystem. A list of 2D functionalities can be seen in Table 2. The typical GUI for image plugins consists of method specific settings such as the regression range in the double log plot or binary/grey value analysis options, followed by display options and process options available in each GUI. The display options can be used to set whether method-specific windows such as the double log plot or result images are displayed and whether previously displayed windows are overwritten or not. Process options include an instant preview option where calculations are started as soon as a GUI element is changed by the user, and the ability to start a preview calculation with a selectable image number (for image stacks). By pressing the OK button, all available images are processed automatically without having to write a macro. Example GUIs of an image plugin can be seen in Fig 2A and 2C. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 2. Example of 2D image analysis. (A) GUI for generating 2D images. (B) Generated grey value images with a predefined theoretical fractal dimension of 2.5. (C) GUI for determining the FFT dimensions. (D) Double logarithmic plot of summed up spectral power values and frequency parameter k. (E) Result table including the FFT dimensions Df (around 2.5) for all three images. https://doi.org/10.1371/journal.pone.0292217.g002 Example of 2D image analysis Close all open windows or restart Fiji and generate a set of images with the following command and parameter settings: Plugins/ComsystanJ/2D Image(s)/Image generator (see Fig 2A), Width [pixel]: 512, Height [pixel]: 512, Number of images: 3, Color model: Grey-8bit, Image type: Fractal surface–FFT, Grey/R: 255, (Fractal surface) Dimension: 2.5 The remaining options can be left as default values. Press the OK button and an image stack will be displayed (Fig 2B). Each image has an individual pattern but the theoretical fractal dimension is always 2.5. Actual images vary with each generation. A subsequent analysis could be the determination of the fractal dimension using FFT (fast Fourier transform) with: Plugins/ComsystanJ/2D Image(s)/FFT dimension (see Fig 2C), Maximal k: 262144, Regression Min: 1, Regression Max: 262144, Windowing: Hanning, Power spectrum: Circular average, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled, Image #: 1 A preview can be started by pressing the button Process single image #. A result table and a double log plot (Fig 2D) will be displayed. The Image # may be changed and again a preview can be started. Finally, by pressing the OK button, all three images will be processed and the results will be displayed (Fig 2E). The values in the Df column are the determined fractal dimensions and should be about 2.5. The column R2 shows the values of the coefficient of determination of the linear regressions. Description of 3D image volume plugins Equivalently to 2D, a 3D image stack or volume can be opened either with the genuine Fiji/ImageJ2 commands or with the corresponding ComsystanJ volume opener plugin. The SCIFIO option must be activated in Fiji. A 3D volume generator plugin is available to generate fractal 3D grey value volumes, a Menger cube, multiple Sierpinski pyramids and a variation of 3D Mandelbrot cubes. A comprehensive list of 12 plugins for 3D nonlinear and complexity analysis are included. These 3D plugins are very suitable for determining fractal dimensions or other complexity measures of grey scale image volumes and can be directly used for cranial MRIs, for example. Thus, these algorithms appear in ComsystanJ in 1D, 2D as well as in 3D, representing a suitable set of algorithms for any dimensionality. A list of 3D functionalities can be seen in Table 3. Example GUIs can be seen in Fig 3A and 3C. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 3. Example of 3D image volume analysis. (A) GUI for generating a 3D image volume. (B) Generated grey value image volume with a predefined theoretical fractal dimension of 3.5 and a three-dimensional representation. (C) GUI for determining the 3D FFT dimension. (D) Double logarithmic plot of summed up spectral power values and frequency parameter k. (E) Result table including the 3D FFT dimension 3D Df (around 3.5) for the image volume. https://doi.org/10.1371/journal.pone.0292217.g003 Example of 3D image volume analysis Close all open windows or restart Fiji and generate an image stack volume with the following command and parameter settings: Plugins/ComsystanJ/3D Volume/3D Image volume generator (see Fig 3A), Width [pixel]: 256, Height [pixel]: 256, Depth [pixel]: 256, Color model: Grey-8bit, Volume type: Fractal volume–FFT, Grey/R: 255, (Fractal volume) Dimension: 3.5 Please note that increased size settings will increase memory demand. Contrary to the 2D example, the fractal grey value pattern is also smooth along the third depth axis. Optionally, the volume (Fig 3B) can additionally be displayed with Fiji’s Volume Viewer (Plugins/Volume Viewer) or 3D Viewer (Plugins/3D Viewer) (Fig 3B). Actual volumes vary with each generation. The determination of the fractal dimension using FFT in 3D can be started with: Plugins/ComsystanJ/3D Volume/3D FFT dimension (see Fig 3C), Maximal k: 16777216, Regression Min: 1, Regression Max: 16777216, Windowing: Hanning, Power spectrum: Spherical average, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled A preview can be started by pressing the button Process single volume. A results table and a double log plot (Fig 3D) will be displayed. The settings may be changed and a preview can be started again. By clicking the OK button, the entire image volume will be processed in 3D and the results will be displayed (Fig 3E). The value in the 3D Df column should be about 3.5 in this case. The column R2 shows the coefficient of determination of the linear regression. Computational expense The plugins were coded in the most effective way to keep the computational overhead to a minimum. In addition, Java itself is very efficient for processing loops, which are used extensively when scrolling through long time series data or through the two-dimensional grid of a digital image. Signal and image data variables were implemented as generic and effective array classes, costly classes such as the Vector class were avoided. Exemplarily, the following computing times (Table 4) were determined for a standard PC and a high-end workstation including the display of corresponding windows. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 4. Computational expense. Mean values over three measurements. Standard PC: Windows 11Pro, 64bit, CPU Intel i5-10500 3.10GHz, 6 cores, Graphics Intel UHD 630, RAM 16GB, HD 512GB SSD. Workstation: Ubuntu 22.04.2 LTS, 64bit, CPU AMD Ryzen Threadripper pro 5955wx 4GHz, 16 cores, Graphics GeForce GT1030 2GHD4 LP OC 2GB DDR4, RAM 512GB DDR4-3200, HD 2TB M.2 SSD. https://doi.org/10.1371/journal.pone.0292217.t004 Description of limitations The graphical GUIs of the plugins extend the SciJava class ContextCommand and provide an OK and a Cancel button. This is a very convenient and short way to define @parameters like services (UIService, LogService, StatusService, OpService,…) and GUI elements. The first limitation is that GUI elements and their functionalities cannot be greyed out or switched on and off. For example, the signal and image generator plugins consist of many parameters, but only some parameters are used for a specific type of signal or image. The end user could easily be confused by the long list of parameters and may not be able to intuitively find the right parameter settings. To reduce this disadvantage, we named parameters in the ComsystanJ plugins with a leading expression in round brackets, indicating to which type of setting this individual parameter belongs. This is of course unsatisfactory, but might be solved by future versions of the class ContextCommand. A second limitation of the ContextCommand is that it is a modal UI window that does not offer the possibility to conveniently preview the plugin functionalities. It is not possible, for example, to change the linear range of the regression directly in the double log plot in a preview mode and then press OK for the final computations. These settings can only be changed after the plugin has been executed and the GUI and the plugin may have to be restarted. The SciJava class InteractiveCommand does not have this restriction because it is not modal, but unfortunately plugins can no longer be used in macros. Therefore, Fiji/ImageJ2 plugins have either good preview functionality or macro functionality and cannot be constructed to do both. To ensure macro functionality, the ComsystanJ plugins unfortunately lack some preview convenience. The third known limitation is a display problem of Fiji/ImageJ2. Colour images are sometimes incorrectly displayed with a red cast, and grey images are sometimes displayed with oversaturated grey values. This issue might be fixed in future versions of Fiji/ImageJ2. Installation One of the most important advantages and successes of the ImageJ and Fiji/ImageJ2 ecosystem is that installing a plugin is as easy as copying the plugin file into a plugin subfolder. Thus, it is only necessary to download a ComsystanJ release from the GitHub repository https://github.com/comsystan/comsystanj/releases. Unpack the *.zip file and copy the whole folder to the plugins folder of Fiji. Alternatively, the ComsystanJ *.jar files can be imported using the Fiji command Plugins/Install. Starting Fiji, the ComsystanJ plugins appear under Plugins/ComsystanJ. Fiji should be up to date, and the SCIFIO option (Edit/Options/ImageJ2) must be enabled. To update ComsystanJ, the old ComsystanJ folder must be replaced with a new folder. More than one ComsystanJ folder in Fiji should be avoided. It is recommended to download a clean copy of the latest Fiji version from the Fiji archive https://downloads.imagej.net/fiji/archive. The SCIFIO option (Edit/Options/ImageJ2) must be enabled in Fiji. Do not use old versions or updated versions of Fiji, as the updater is not always successful. Set of plugins More than 60 plugins are separated into 1D, 2D and 3D plugins. A 3D image stack can be used as input for both 2D and 3D plugins. It might be processed with 2D functionalities slice per slice using 2D plugins or in three dimensions using 3D plugins. A list of the available plugins and functionalities can be found in Tables 1–3. Each set of plugins contains some plugins that are not intended for nonlinear analyses, such as opening, generation and preprocessing. The number of these plugins is very limited for 2D and 3D plugins, as Fiji/ImageJ2 and its functionalities can be used directly. For 1D plugins, this number is higher to cover most of the usually required preprocessing steps for signals. A detailed description of the plugins can be found on the homepage of ComsystanJ https://comsystan.github.io/comsystanj. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 1. List of 1D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t001 Download: PPT PowerPoint slide PNG larger image TIFF original image Table 2. List of 2D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t002 Download: PPT PowerPoint slide PNG larger image TIFF original image Table 3. List of 3D plugins and functionalities. https://doi.org/10.1371/journal.pone.0292217.t003 Description of 1D signal plugins The internal representation of a signal for ComsystanJ and Fiji/ImageJ2 is a table (SciJava class DefaultGenericTable) and especially a table column. The first row entry represents the column header and can simply be the name of the signal or file. Several signals correspond to distinct columns. However, the first column is reserved for the corresponding row headers, which in most cases are ascending integer numbers representing the sample number. Data files for signals must meet some requirements resulting from the internal structures of Fiji/ImageJ2. Firstly, the signal files must be comma separated text files. The first row and the first column can contain any characters, the data values must be real numbers with a point as decimal place. Secondly, each column must have the same size. If the number of data values in a column is shorter, the missing data values must be filled with the character NaN. Files that meet these requirements must be opened with the ComsystanJ Opener plugin and are displayed as a table. This table contains the signal data and is the source for the signal plugins used in the following. A graphical display of the signal(s) can optionally be shown, but is not the source for the signal plugins and can be omitted for very large data series if memory is limited. A large number of artificially generated signal types can be generated with the signal generator plugin to have a convenient possibility for comparisons. Signal types might be linear (Constant, Sine,…), random (Gaussian or uniform), chaotic (Logistic, Henon…), fractal (fGn, fGm….) or binary (Cantor). A list of 1D functionalities can be seen in Table 1. The GUI of a typical analysis plugin consists of parameter settings for the specific algorithm, followed by analysis options, display options and process options common to all 1D plugins. Analysis options include the choice of simply applying the algorithm to the entire signal or to subsequent or sliding boxes (with adjustable box length), resulting in a list of result values for each window. The latter two options are a convenient way to examine the development of the result values over time without having to write a macro for it. Surrogates (with adjustable number of surrogates) can be activated for the entire signal range and then the analysis is additionally carried out automatically for several surrogates and individual surrogate result values as well as an average surrogate value are included in the result table without having to write a macro for it. The display options decide whether algorithm dependent graphs or windows are displayed or not and whether already displayed windows are overwritten or not. The process options include the possibility to activate an immediate preview when any GUI element is changed by the user. Pressing the OK button finally processes all available signals without having to write a macro for that. Typical GUIs of a signal plugin can be seen in Fig 1A and 1D. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 1. Example of 1D signal analysis. (A) GUI for generating 1D sequences. (B) Table of generated sequence data values. (C) Graphical representation of sequences with a predefined theoretical fractal dimension of 1.5. (D) GUI for determining the Higuchi dimensions. (E) Double logarithmic plot of summed up sequence lengths and delay parameter k. (F) Result table including the Higuchi dimensions Dh (around 1.5) for all three sequences. https://doi.org/10.1371/journal.pone.0292217.g001 Example of 1D signal analysis Close all open Windows or restart Fiji and generate a set of signals with the following command and parameter settings: Plugins/ComsystanJ/1D Sequence(s)/Sequence generator (see Fig 1A), Method: W-M (Weierstrass-Mandelbrot function), Number of sequences: 3, Number of data values: 1024, (W-M) Fractal dimension [1, 2]: 1.5 The remaining options can be left as defaults. Press the OK button and confirm the Display option with Yes. A set of signals will be shown in a table (Fig 1B) and additionally a window with graphs will be displayed (Fig 1C). Please note that actual values and graphs vary with each generation. The subsequent determination of e.g. the Higuchi dimension can be done with: Plugins/ComsystanJ/1D Sequence(s)/Higuchi dimension (see Fig 1D), k: 8, Regression Min: 1, Regression Max: 8, Signal range: Entire sequence, (Entire signal) Surrogates: No surrogates, Surrogates #: 10, Box length: 100, Skip zero values: Disabled, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled, Column #: 1 A preview can be started by pressing the button Process single column #. A result table and a double log plot (Fig 1E) will be displayed. The Column # may be changed and again a preview can be started. Finally, by pressing the OK button, all three signals will be processed and the results will be displayed (Fig 1F). The values in the Dh column represent the determined fractal dimensions and should be about 1.5. The column R2 shows the values of the coefficient of determination of the linear regressions. Description of 2D image plugins 2D images can be opened either with the genuine Fiji/ImageJ2 commands or with the ComsystanJ image opener plugin. The latter has the advantage that multiple images can be selected individually and when multiple images are selected, they are automatically opened as an image stack. Internally, an image or image stack is held in the primary ImageJ2 dataset container called Dataset, which provides access to pixels and metadata. The SCIFIO option must be activated in Fiji to ensure the ImageJ2 image format for input and output. An image generator plugin with more than 20 different image types is available. It includes linear types (Constant, Sine,…), random (Gaussian or uniform), fractal surfaces (FFT or MPD) or binary IFS types (Menger, Sierpinski,…..). Images can be created with selectable size, colour type and number of images and can be used for comparison purposes. A filter plugin and a noise plugin are provided, as filtering and adding noise are two direct and commonly used methods for testing nonlinear and complex analysis algorithms. Other methods can be used from the Fiji/ImageJ2 ecosystem. A list of 2D functionalities can be seen in Table 2. The typical GUI for image plugins consists of method specific settings such as the regression range in the double log plot or binary/grey value analysis options, followed by display options and process options available in each GUI. The display options can be used to set whether method-specific windows such as the double log plot or result images are displayed and whether previously displayed windows are overwritten or not. Process options include an instant preview option where calculations are started as soon as a GUI element is changed by the user, and the ability to start a preview calculation with a selectable image number (for image stacks). By pressing the OK button, all available images are processed automatically without having to write a macro. Example GUIs of an image plugin can be seen in Fig 2A and 2C. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 2. Example of 2D image analysis. (A) GUI for generating 2D images. (B) Generated grey value images with a predefined theoretical fractal dimension of 2.5. (C) GUI for determining the FFT dimensions. (D) Double logarithmic plot of summed up spectral power values and frequency parameter k. (E) Result table including the FFT dimensions Df (around 2.5) for all three images. https://doi.org/10.1371/journal.pone.0292217.g002 Example of 2D image analysis Close all open windows or restart Fiji and generate a set of images with the following command and parameter settings: Plugins/ComsystanJ/2D Image(s)/Image generator (see Fig 2A), Width [pixel]: 512, Height [pixel]: 512, Number of images: 3, Color model: Grey-8bit, Image type: Fractal surface–FFT, Grey/R: 255, (Fractal surface) Dimension: 2.5 The remaining options can be left as default values. Press the OK button and an image stack will be displayed (Fig 2B). Each image has an individual pattern but the theoretical fractal dimension is always 2.5. Actual images vary with each generation. A subsequent analysis could be the determination of the fractal dimension using FFT (fast Fourier transform) with: Plugins/ComsystanJ/2D Image(s)/FFT dimension (see Fig 2C), Maximal k: 262144, Regression Min: 1, Regression Max: 262144, Windowing: Hanning, Power spectrum: Circular average, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled, Image #: 1 A preview can be started by pressing the button Process single image #. A result table and a double log plot (Fig 2D) will be displayed. The Image # may be changed and again a preview can be started. Finally, by pressing the OK button, all three images will be processed and the results will be displayed (Fig 2E). The values in the Df column are the determined fractal dimensions and should be about 2.5. The column R2 shows the values of the coefficient of determination of the linear regressions. Description of 3D image volume plugins Equivalently to 2D, a 3D image stack or volume can be opened either with the genuine Fiji/ImageJ2 commands or with the corresponding ComsystanJ volume opener plugin. The SCIFIO option must be activated in Fiji. A 3D volume generator plugin is available to generate fractal 3D grey value volumes, a Menger cube, multiple Sierpinski pyramids and a variation of 3D Mandelbrot cubes. A comprehensive list of 12 plugins for 3D nonlinear and complexity analysis are included. These 3D plugins are very suitable for determining fractal dimensions or other complexity measures of grey scale image volumes and can be directly used for cranial MRIs, for example. Thus, these algorithms appear in ComsystanJ in 1D, 2D as well as in 3D, representing a suitable set of algorithms for any dimensionality. A list of 3D functionalities can be seen in Table 3. Example GUIs can be seen in Fig 3A and 3C. Download: PPT PowerPoint slide PNG larger image TIFF original image Fig 3. Example of 3D image volume analysis. (A) GUI for generating a 3D image volume. (B) Generated grey value image volume with a predefined theoretical fractal dimension of 3.5 and a three-dimensional representation. (C) GUI for determining the 3D FFT dimension. (D) Double logarithmic plot of summed up spectral power values and frequency parameter k. (E) Result table including the 3D FFT dimension 3D Df (around 3.5) for the image volume. https://doi.org/10.1371/journal.pone.0292217.g003 Example of 3D image volume analysis Close all open windows or restart Fiji and generate an image stack volume with the following command and parameter settings: Plugins/ComsystanJ/3D Volume/3D Image volume generator (see Fig 3A), Width [pixel]: 256, Height [pixel]: 256, Depth [pixel]: 256, Color model: Grey-8bit, Volume type: Fractal volume–FFT, Grey/R: 255, (Fractal volume) Dimension: 3.5 Please note that increased size settings will increase memory demand. Contrary to the 2D example, the fractal grey value pattern is also smooth along the third depth axis. Optionally, the volume (Fig 3B) can additionally be displayed with Fiji’s Volume Viewer (Plugins/Volume Viewer) or 3D Viewer (Plugins/3D Viewer) (Fig 3B). Actual volumes vary with each generation. The determination of the fractal dimension using FFT in 3D can be started with: Plugins/ComsystanJ/3D Volume/3D FFT dimension (see Fig 3C), Maximal k: 16777216, Regression Min: 1, Regression Max: 16777216, Windowing: Hanning, Power spectrum: Spherical average, Show double log plot: Enabled, Overwrite result display(s): Enabled, Immediate processing: Disabled A preview can be started by pressing the button Process single volume. A results table and a double log plot (Fig 3D) will be displayed. The settings may be changed and a preview can be started again. By clicking the OK button, the entire image volume will be processed in 3D and the results will be displayed (Fig 3E). The value in the 3D Df column should be about 3.5 in this case. The column R2 shows the coefficient of determination of the linear regression. Computational expense The plugins were coded in the most effective way to keep the computational overhead to a minimum. In addition, Java itself is very efficient for processing loops, which are used extensively when scrolling through long time series data or through the two-dimensional grid of a digital image. Signal and image data variables were implemented as generic and effective array classes, costly classes such as the Vector class were avoided. Exemplarily, the following computing times (Table 4) were determined for a standard PC and a high-end workstation including the display of corresponding windows. Download: PPT PowerPoint slide PNG larger image TIFF original image Table 4. Computational expense. Mean values over three measurements. Standard PC: Windows 11Pro, 64bit, CPU Intel i5-10500 3.10GHz, 6 cores, Graphics Intel UHD 630, RAM 16GB, HD 512GB SSD. Workstation: Ubuntu 22.04.2 LTS, 64bit, CPU AMD Ryzen Threadripper pro 5955wx 4GHz, 16 cores, Graphics GeForce GT1030 2GHD4 LP OC 2GB DDR4, RAM 512GB DDR4-3200, HD 2TB M.2 SSD. https://doi.org/10.1371/journal.pone.0292217.t004 Description of limitations The graphical GUIs of the plugins extend the SciJava class ContextCommand and provide an OK and a Cancel button. This is a very convenient and short way to define @parameters like services (UIService, LogService, StatusService, OpService,…) and GUI elements. The first limitation is that GUI elements and their functionalities cannot be greyed out or switched on and off. For example, the signal and image generator plugins consist of many parameters, but only some parameters are used for a specific type of signal or image. The end user could easily be confused by the long list of parameters and may not be able to intuitively find the right parameter settings. To reduce this disadvantage, we named parameters in the ComsystanJ plugins with a leading expression in round brackets, indicating to which type of setting this individual parameter belongs. This is of course unsatisfactory, but might be solved by future versions of the class ContextCommand. A second limitation of the ContextCommand is that it is a modal UI window that does not offer the possibility to conveniently preview the plugin functionalities. It is not possible, for example, to change the linear range of the regression directly in the double log plot in a preview mode and then press OK for the final computations. These settings can only be changed after the plugin has been executed and the GUI and the plugin may have to be restarted. The SciJava class InteractiveCommand does not have this restriction because it is not modal, but unfortunately plugins can no longer be used in macros. Therefore, Fiji/ImageJ2 plugins have either good preview functionality or macro functionality and cannot be constructed to do both. To ensure macro functionality, the ComsystanJ plugins unfortunately lack some preview convenience. The third known limitation is a display problem of Fiji/ImageJ2. Colour images are sometimes incorrectly displayed with a red cast, and grey images are sometimes displayed with oversaturated grey values. This issue might be fixed in future versions of Fiji/ImageJ2. Conclusions ComsystanJ is a set of Fiji/ImageJ2 plugins for the study of nonlinear and complex systems in 1D, 2D and 3D. It offers a convenient user experience for the end user, is open access and is extensible for the experienced user or programmer. More than 60 plugins offer more than 100 parameters and results that can be calculated for the characterisation of the signal, image or image volume under investigation. The surrogate analysis is implemented by default and is also strongly recommended for images and image volumes. ComsystanJ includes common algorithms such as the Box counting dimension and the FFT dimension but also recently developed methods such as the 2D/3D Higuchi dimension, the 1D/2D RSE fractal dimension, and the Kolmogorov complexity. Here we have given an overview of ComsystanJ, the technical aspects related to its functions, surrogate analysis, GUI design and interaction with the ImageJ2/Fiji ecosystem. Follow-up studies will be more specific and focus on a particular dimensionality, including the presentation of real-world data investigations. In particular, in-depth 1D signal analyses of e.g. ECG, EEG and long duration geological time signals will demonstrate the usefulness of this package for time signals, with the intention of reaching more scientists outside the ImageJ/Fiji imaging community. The project will be continuously maintained and improved by increasing the number of plugins. In particular, the number of direction-sensitive and ROI-restricted 2D/3D methods will be increased. Currently, ComsystanJ has a small bias towards cardiac or human signal and image analysis, although most features and parameters could be used universally. However, future ComsystanJ enhancements will include generally usable metrics such as the Ruler dimension, Perimeter-area dimension, Mass dimension, Gravelius compactness coefficient, order number methods (Gravelius, Horton, Strahler, Schreve, Scheidegger, Horsfield-Cumming, Graf), and new indices such as a Dendritic complexity index, Fractal allometry index, Fractal connectivity dimension, Lacunarity dispersions index and Internal succolarity. Other future improvements will be parallel computing with special threads for large image stacks and the integration of new machine learning algorithms such as convolutional neural networks, which are already being used successfully for complexity analyses [27–30]. Explainability and interpretability are important concepts in AI-based image and bio-signal analysis. ComsystanJ has the potential to incorporate explainable AI for model performance as part of classification tasks. Acknowledgments Code availability: ComsystanJ is freely available, open source and hosted on GitHub. The homepage including a description of ComsystanJ is https://comsystan.github.io/comsystanj. The source code can be found at https://github.com/comsystan/comsystanj. Ready-to-use versions of the entire plugin set for the end-user can be downloaded under https://github.com/comsystan/comsystanj/releases. TI - ComsystanJ: A collection of Fiji/ImageJ2 plugins for nonlinear and complexity analysis in 1D, 2D and 3D JF - PLoS ONE DO - 10.1371/journal.pone.0292217 DA - 2023-10-05 UR - https://www.deepdyve.com/lp/public-library-of-science-plos-journal/comsystanj-a-collection-of-fiji-imagej2-plugins-for-nonlinear-and-FppDoqM0Ws SP - e0292217 VL - 18 IS - 10 DP - DeepDyve ER -