Introduction

Optical Coherence Tomography (OCT) is a non-invasive, relatively inexpensive imaging technique which is based on low-coherence interferometry and captures high-resolution multi-dimensional images from biological tissue especially the retina1. Macular OCT images are widely used to assist ophthalmologists in diagnosing ocular deformities such as Diabetic Macular Edema (DME), Age-Related Macular Degeneration, glaucoma and retinal vascular accidents2,3. In addition to that, their interesting applications in diagnosis and effective treatment of neurodegenerative diseases like Multiple Sclerosis and Neuromyelitis Optica has attracted the neurologists4.

Ocular OCT images provide cross-sectional data from intra-retinal layers which are distinguishable by contrasting their intensities. These layers typically lose their standard features (like texture, thickness and location) with the occurrence of different diseases and measuring the quantitative amount of their structural conversion, provides instructive information about the type, severity and the must-be-employed treatment procedure of that disease5. Furthermore, macular OCT is the standard test for detection of intra-retinal (IRF) and sub-retinal (SRF) fluid. It is also an essential modality for evaluating the subsequent resolution of accumulated fluids as a response to treatment6.

OCT data may be acquired in different anatomical locations in the eye. In the macular OCTs, a set of 2-dimensional cross-sectional B-Scans are acquired and stacked to generate a 3-dimensional macular cube. Besides, a 2-dimensional circumpapillary-retinal nerve fiber layer (cp-RNFL) data may be taken from the area surrounding the bundle of nerve fibers at the back of the eye, called optic nerve head (ONH)2.

Macular OCT images carry a great deal of data which needs to be quantified to provide interpretable values. The main issue in this regard is segmentation of retinal layers and localization of abnormalities like intra-retinal or sub-retinal fluid accumulations. For segmentation of intra-retinal layers and fluids in each B-Scan, assorted manual, semi-automatic and full-automatic approaches have been suggested7,8,9,10,11. The manual segmentation method is both time-consuming and exposed to probable observer errors and therefore, automatic and semi-automatic algorithms have been introduced to solve these problems. Full-automatic methods for segmentation of retinal OCT images are prone to unavoidable errors in the presence of less predictable matters such as noisy, low-quality images and in B-Scans of patients with marked macular or retinal nerve fiber layer changes12,13,14,15. Accordingly, a semi-automatic approach is considered as an in-between method to overcome the disadvantages of manual and automatic methods and to take advantage of an expert’s knowledge of a correct delineation. Table 1 summarizes a list of previous works on semi-automatic OCT segmentation. However, available semi-automatic algorithms suffer from noticeable constraints because they mostly support only one data format, are unable to suggest alternative segmentation methods to the users, lack an effective implementation of a detailed process on the input data like denoising or filtering and finally, are not integrated in an open-source software environment to serve facilitated segmentation of OCT images.

Table 1 Description of the preceding algorithms for OCT semi-automatic layer and fluid segmentation.

The purpose of our study is to design a piece of software to provide semi-automatic segmentation of layers and fluids in macular OCTs. Our proposed software considerably resolves the above-mentioned difficulties that other similar algorithms have faced. By performing an accurate and user-friendly segmentation, it helps clinicians to evaluate structural changes, especially at inner macular and cp-RNFL, with more reliable data. It is also practical in supplying the gold standard data set needed for design and evaluation of full-automatic methods21,22.

To measure the validation of this software, we tested its performance on macular OCT B-Scans of eyes from healthy controls as well as those belonging to patients with DME diagnosis by calculating the agreement (to assess inter-rater variability and to decide whether the proposed technique could be substituted with the manual segmentation) and repeatability of the proposed method23. Moreover, to demonstrate one important application of the proposed method in clinical works, we designed a particular section for computation of the irregularity index in deformed OCT images, which could be used to assess irregularities frequently seen in many layered ocular structures (e.g. retina, iris, cornea) under pathologic circumstances such as DME, Age-Related Macular Degeneration, Epiretinal Membrane (ERM)24, Vitreoretinal Interface abnormalities, Fuchs uveitis in Anterior Segment OCT images25, and corneal dystrophies. Because the manual algorithms yield erroneous and unreliable segmentation of the retinal layers in macular OCT images, they could face major problems with respect to gauging this parameter and this is another situation where the semi-automatic and full-automatic segmentation algorithms are deemed extremely helpful.

In what follows, we explain about our main method and the overall structure of our designed software. Two disparate datasets (normal and DME) are introduced and the outcomes produced by applying our algorithm over the layers and fluid objects of these datasets are investigated by assessing the agreement and repeatability of the proposed method. Subsequently, the tables indicating validation results are provided in detail and an in-depth discussion of this research’s outcomes, performance and efficiency in comparison to other heretofore suggested methods is summed up in the closing section.

Materials and methods

Study population

To signify the clinical performance of the proposed method on retinal layers of a collected normal dataset and to calculate the agreement and repeatability of our algorithm’s layer segmentation section, 50 macular OCT B-Scans from 16 normal eyes were selected in this study. So as to identify the clinical performance of this method on the fluid objects appearing in abnormal datasets, we enrolled twenty eyes from 19 patients with the diagnosis of diabetic macular edema (DME)26. All patients had clinical and OCT-based diagnosis of DME. OCT examinations were performed using Spectralis Enhanced Depth Imaging-OCT and Spectralis Spectral Domain-OCT for the normal and DME patients, respectively. Both datasets were gathered using Heidelberg Eye Explorer (HEYEX) version 5.1 (Heidelberg Engineering, Heidelberg, Germany) by a trained technician with an automatic real-time (ART) function for image averaging and an activated eye tracker in a room with normal light. For macular volumes, 61 horizontal B-Scans (each with 512 A-Scans, with ART of 9 frames, axial resolution of 3.8 mm) with a scanning area of 6 mm \(\times\) 6 mm focusing on the fovea were taken. The normal population’s age ranged between 21 and 46 (Mean (± SD) = 30.81 ± 7.04) and 62.5 per cent of them were female. The DME group’s age were between 57 and 84 (Mean (± SD) = 68.11(± 8.58)) and 74 per cent of them were female. Protocols of the current investigation were approved by the Ethics Committee at Isfahan University of Medical Sciences (IR.MUI.RESEARCH.REC.1398.155). This study was carried out in accordance to the tenets of the Declaration of Helsinki and informed consent was obtained from all the patients.

An overview of the proposed software

Two primary goals of this study are elaborated in the next sections. We first explain an overview of the proposed software and the embedded semi-automatic segmentation algorithm and then, describe the agreement and repeatability of the studying process using the supporting dataset of OCTs from healthy controls and DME sufferers. Our proposed software consists of five independent tabs, each responsible for a specific function. First of all, in the “File” tab, the user could open the desired data format (i.e. .mat, .vol or .octbin) which is then converted to a .mat file in order to be compatible with this software and any other substituted MATLAB27 code. The next three tabs are designed for layer and fluid segmentation of macular B-Scans. Starting with the “Manual Layer Segmentation” tab, a complete manual segmentation of retinal layers using the interactive freehand over each B-Scan is provided and the resulted curves that could be mainly used for construction of gold standards are produced. Meanwhile, the “Auto Layer Segmentation” tab is responsible for the software’s main algorithm, a graph-based semi-automatic segmentation, termed “Livelayer”. Two other options embedded in this tab are a layer correction procedure used for correction of the faulty boundaries, and a grid-based segmentation method which works by dividing the whole B-Scan by an arbitrary number of vertical lines and asking the user to click on a point of that lines where the intended boundary is exactly located. This section then extrapolates the boundary from the acquired points which would of a very limited number in most cases. Fluids’ identification and localization is the “Fluid Segmentation” tab’s duty that adopts both manual (interactive freehand object) and semi-automatic (Livelayer) techniques. The last tab named “Peripapillary” is created for analysis of circumpapillary scans. Our suggested method removes the curvature, localizes the vessel shadows, eliminates the shadows, and finally provides Livelayer semi-automatic segmentation of the peripapillary boundaries. The extracted information from above-mentioned tabs is finally saved in a MATLAB “.mat” file to be readable in next applications. Figure 1 represents our proposed software’s main tabs. A brief illustration of conducted operations in our software for macular and peripapillary images from accepting the input file with a .mat, .vol or .octbin format to outputting both the segmented B-Scan and the complementary information with respect to it is shown in Fig. 2.

Figure 1
figure 1

The proposed software’s major tabs (a) the file tab, (b) the auto layer segmentation tab, (c) the fluid segmentation tab, (d) the peripapillary tab.

Figure 2
figure 2

Livelayer software’s scheme (a) Macular layer and fluid segmentation sections—after loading a proper data set, the software’s pre-processing block finds an appropriate background image on which the Livelayer could be applied and then, outputs the segmented image. (b) Peripapillary layer segmentation section—after loading a proper peripapillary data, the software aligns the B-Scan and then, tries to omit its blood vessels as much as possible. An appropriate background image for applying the Livelayer is detected and the corresponding segmented B-Scan is outputted.

The devised Livelayer algorithm

Our suggested algorithm is a graph-based semi-automatic method, called “Livelayer”, designed for straightforward segmentation of retinal layers and fluids. This method is chiefly based on Dijkstra’s Shortest Path First (SPF) algorithm28 and the Live-wire function29, together with some preprocessing operations on the to-be-segmented images. The Dijkstra’s algorithm and its interactive variant, the live-wire, find the shortest path between a pair of nodes (pixels) in a graph (that is constructed from the original image). Application of the conventional Live-wire over the original B-Scan is not capable of following the OCT boundaries due to their weak and vague appearance and it is essential to isolate and strengthen each individual boundary before being fed into the live-wire algorithm. The proposed Livelayer is created on the basis of the original live-wire and is applied to different processed versions of the original B-Scan which have the ability to sharpen the desired boundary. We detect these best sharpened boundaries by utilizing diverse methods of edge detection and morphological operations30,31,32,33,34. Livelayer can also be applied over B-Scans containing fluid objects and circumpapillary scans. To align the boundaries in the peripapillary section, we first considered ONL–IS/OS as our reference boundary and produced a shift vector by subtracting all Y-coordinates of the reference boundary from its maximum amount. We then circularly shifted each column of the image by this shift vector which has the same shape as the image’s width. In order for blood vessels to be detected, the mean value for each column of the flattened image from IPL–INL to the bottom is acquired. Local extrema of these mean values are vessels’ exact locations since they appear in black in ocular images. Following the vessel detection process, the right(left) half of the vessel is replaced with its adjacent right(left) columns and the blood vessels are entirely eliminated. Figure 3 goes into details about the pre-processing block exploited in the Livelayer. As can be seen, depending on each boundary’s brightness and location in the B-Scan, an apt background image for applying the Livelayer is designed using different image processing techniques. Additionally, the background image for fluid segmentation is acquired through implementation of an edge detection function followed by a morphological operation.

Figure 3
figure 3

An overview of the Livelayer’s pre-processing block—various operations conducted on each boundary depending on their brightness and location in the B-Scan.

Validation of the proposed software

Our dataset in this study generally consists of the normal OCT B-Scans acquired from healthy controls and abnormal OCT B-Scans that are related to DME patients. The former group of data is used for validation of our suggested method’s layer segmentation section and the latter is for the algorithm’s fluid segmentation part. In the following paragraphs, we go into concise explanations for the procedure adopted to assess our algorithm’s performance and how it can be utilized as a useful tool for clinical purposes.

Layer segmentation section

The retinal boundaries in macular OCT scans that our software is able to segment include: inner limiting membrane (ILM), boundary between retinal nerve fiber layer (RNFL) and ganglion cell layer (GCL), boundary between GCL and inner plexiform layer (IPL), boundary between IPL and inner nuclear layer (INL), boundary between INL and outer plexiform layer (OPL), boundary between OPL and outer nuclear layer (ONL), boundary between ONL and photoreceptor layer, boundary between photoreceptor layer and retinal pigmented epithelium (RPE) and finally, outer level of RPE. The peripapillary section could segment all these boundaries except for the GCL–IPL.

In order to perform a validation of our suggested method, two ophthalmologists and an engineer familiar with the concept of OCT images delineated the three most clinically important retinal boundaries (ILM, IPL–INL, OPL–ONL) on the healthy controls’ dataset and with the aid of two discrete methods. In the first stage, we trained these three independent individuals to grid-manually segment the destined retinal boundaries, which is considered to be an impotent segmentation procedure as opposed to the Livelayer algorithm. Following that, three graders were also asked to segment the same B-Scans with the Livelayer. The main manual method in this software which was created utilizing the freehand function was intolerably time-consuming and susceptible to noticeable errors, which is why it was substituted with our grid-based algorithm.

To properly quantify the agreement and repeatability of the proposed semi-automatic method, we need to first define a basis for comparison that is the unsigned boundary errors. The unsigned boundary error for retinal boundaries is calculated by:

$$uerror = \frac{{\mathop \sum \nolimits_{{i = 1}}^{w} abs\left( {x_{i} - y_{i} } \right)~~}}{w},$$
(1)

where \(w\) denotes the B-Scans’s width in pixels and \(x_{i} , y_{i}\) represent the ith point of the two acquired boundaries. The lower the value of the unsigned boundary error is, the more proximity we observe between the two boundaries.

Therefore, we found the average location of each boundary grid-manually outlined by three graders on each OCT B-Scan, and assumed it to be the ground truth in our studies. Next, we calculated the unsigned error between the ground truth and each of our three grid-manual delineations to achieve the inter-rater variability for this method. This ground truth data was then compared to each of our three semi-automatic data for obtaining both the inter-rater variability of our algorithm and determine whether Livelayer could be substituted with the manual segmentation approach. To quantify our measurements, the Bland–Altman plots for each boundary were sketched, obtaining the level of agreement between each grader’s semi-automatic segmentation and the gold standard data. For determining the repeatability of the Livewire, one of our observers segmented the 50 normal B-Scans for the second time a week later and the unsigned errors between these two measurements were computed.

To indicate the timesaving capability of the software, the required time for segmenting each boundary was measured by utilizing both the semi-automatic Livelayer and the grid-manual methods. Additionally, the mean number of needed clicks by the user in Livelayer method were figured out. It should be noted that the number of clicks in Livelayer depends both on the image quality and the intrinsic characteristics of that boundary on the image.

This section also assigns a particular field for computation of the irregularity index for IPL and OPL within the semi-automatic division. This index is set for quantitative smoothness evaluation of a specific layer in macular OCT images and is defined according to this equation:

$$Irregularity~index = \frac{{L_{r} }}{{L_{b} }},$$
(2)

where \(L_{r}\) is the Euclidean distance between the beginning and the end of that boundary and \(L_{b}\) is the length of the intended detached boundary.

Fluid segmentation section

This method is not primarily designed to compete with other full-automatic fluid segmentation available methods, but to be served as a handy tool for production of an outlined dataset which could be later required for training the automatic algorithms. For obtaining the agreement and repeatability of this division, two independent persons, an ophthalmologist and a senior ophthalmology resident were trained to both manually and semi-automatically localize the intra-retinal and sub-retinal fluid objects on the DME dataset.

Here, we supposed the Dice coefficient to be a proper basis for comparison of the located fluid objects. For retinal fluids, the Dice coefficient35 which gauges the basic similarity between two mask images in which the fluid objects’ regions of interest (ROIs) are apparent is calculated by:

$$Dice = ~\frac{{2~\left( {X \cap Y} \right)}}{{\left( {X + Y} \right)}},$$
(3)

where \(X\) and \(Y\) are the two intended mask images. The smaller values of Dice coefficient indicate less similarity between two set of identified fluids.

This coefficient was computed for the two observers’ manually segmented fluids as well as for one observer’s manual and semi-automatic results to resemble inter-observer errors and the method’s performance. Because the two graders did not agree on the overall number of fluids on each B-Scan, a particular threshold was defined and marginally small fluid objects were eliminated according to that threshold. For evaluating the repeatability of this section, one of the examiners delineated the fluid objects on the DME dataset for another time 6 weeks later and the Dice coefficients for these assessments were measured.

Results

Efficiency in time and the required number of clicks

For assessment of our recommended method’s efficiency in the matter of time and the needed number of clicks, all the 50 normal macular B-Scans that were segmented semi-automatically and 20 of grid-manually segmented B-Scans were involved. Table 2 demonstrates a precise comparison between the semi-automatic and the grid-manual segmentation methods’ acquisition time and depicts the average number of clicks required for both methods. The grid-manual segmentation in this part was conducted by splitting each B-Scan into 10 portions and using the layer correction functionality of the software around the fovea. Hence, the grid-manual algorithm needed at least 10 clicks in the best case.

Table 2 A comparison between the required amount of time (in seconds) and the number of clicks for Livelayer and grid-manual.

Feasibility on the DME dataset

As we mentioned earlier, Livelayer also performs pretty well on the B-Scans obtained from patients with DME, and despite the existence of large cysts in these images, it could segment relatively disorganized retinal layers generally caused by retinal disorders such as Diabetic Retinopathy. According to our experiments, segmenting a DME B-Scan with Livelayer required 5, 9, 16 click numbers for ILM, IPL–INL, OPL–ONL, respectively while the grid-manual method demanded 25 click numbers for each boundary. In addition to that, unsigned errors between the two methods for these layers were 1.18, 1.5, 2.79 which proves the feasibility of our software to be employed on specific kinds of datasets that could not be automatically segmented by the Heidelberg system. Figure 4 presents three B-Scan samples segmented by our introduced algorithm.

Figure 4
figure 4

Three different macular B-Scans obtained from patients with DME and segmented by the Livelayer algorithm.

Agreement and repeatability analyses

Analysis of agreement and repeatability for the Livelayer was performed using 50 normal macular B-Scans. In Fig. 5 the three boundaries are marked by our observers in both modes. In Table 3, the unsigned errors between the gold standard segmentation and each examiner’s grid-manually labeled data, the gold standard and each examiner’s semi-automatically labeled data and the two independent semi-automatic segmentation data for one grader is represented.

Figure 5
figure 5

A representation of three segmented boundaries by each grader in the (a) semi-automatic mode, (b) grid-manual mode.

Table 3 Unsigned errors (in pixels) between the gold standard and each observer’s grid-manual and semi-automatic segmentation as well as the intra-observer errors.

Bland–Altman plots for each pair of the semi-automatic segmentation coming in Table 3 is drawn in Fig. 6. As can be seen, delineation of the ILM showed 96% total agreement for graders 1, 2 and 94% for grader 3. The total agreement between the Livelayer and the gold standard data for IPL–INL was also acceptable, being 98% for grader 1 and 96% for graders 2, 3. Among these three boundaries, the least amount of agreement was expected for OPL–-ONL because of the existence of some peculiar structures that frequently occur under this boundary, called the Henle’s fiber. However, despite the occurrence of these irregularities, a good agreement between two methods could be observed for this boundary which was comparable to the other two, 94% for graders 1, 3 and 92% for grader 2. In general, the Bland–Altman plots demonstrated no significant discrepancy between the two segmentation methods and our suggested semi-automatic algorithm could be reliably substituted with typical manual segmentation methods.

Figure 6
figure 6

The Bland–Altman plots for correlating our proposed semi-automatic algorithm with the gold standard data (average of grid-manually delineated B-Scans by three examiners)—each row presents the B&A plots for each specific boundary and each column is assigned to the boundaries segmented by each examiner.

The software’s fluid segmentation performance was evaluated on 20 B-Scans of DME patients. Our proposed algorithm was proven to surpass the manual segmentation method (freehand function) by obtaining Dice scores of 0.854 and 0.743 for one grader’s manual and semi-automatic fluid (IRF and SRF) localization and two graders’ manual localization, respectively. Moreover, the fluid objects that were delineated by one of our graders for two times in 6 weeks showed 89.3% coincidence according to the calculated Dice scores. So, the proposed semi-automatic software worked with good precision on the fluid objects concerning its inter-rater variability and repeatability as well. Table 4 contains Dice coefficients for our experiments on IRF and SRF fluid segmentation.

Table 4 Dice coefficients for one grader’s manual and semi-automatic fluid localization and two graders’ manual localization as well as the intra-observer errors.

One of our graders also segmented ILM and NFL–GCL of 5 peripapillary B-Scans with both semi-automatic and grid-manual methods. The mean unsigned errors between the two algorithms was 1.53 for ILM and 1.33 for NFL–GCL. We can confirm that there is minor difference between the Livelayer and grid-manual for peripapillary images, yet the Livelayer performs more efficiently requiring less number of clicks and amount of time.

Conclusion and discussion

In this paper, we introduced a semi-automatic segmentation software tool which can be used for segmentation of layers and fluids in OCTs of both normal participants and patients with DME. Then, as well as introducing a powerful clinical application of this program which is the calculation of the irregularity index of a specific boundary, we evaluated three of the software’s performance qualities including its segmentation agreement, repeatability and efficiency (in terms of time and complexity). With the purpose of achieving a reliable estimation of the software’s layer segmentation agreement, three independent individuals segmented the layers in both grid-manual and semi-automatic modes. The agreement was finally found by defining the gold standard data (which was the average of grid-manual measurements among three graders) and then comparing this data with the measured values pertinent to the grid-manual segmentation and the same type of values for the semi-automatic results. Our measurements for showing the total agreement between the grid-manual and gold standard data were carried out utilizing the unsigned errors. Those measurements for showing the total agreement between the gold standard data and Livelayer were quantified using both the unsigned errors and the Bland–Altman plots. In the next stage, the inter-rater variability of the algorithm’s fluid segmentation section was computed with the aid of Dice coefficients. Using this value, we figured out how much the mask images that were manually and semi-automatically segmented by one individual overlapped with each other, and compared their relevant Dice coefficient with the one obtained from semi-automatically detected fluids by two graders. In addition to that, we asked one observer to segment the layers and fluid objects twice and in a determined time interval to attain the repeatability of both sections, assuming that other conditions remained constant during this study.

Many ocular structures like retina and retinal pigment epithelium have layered constructions and this may open the door to quantitative evaluation of the abnormalities that commonly occur in these layers under pathologic conditions (e.g. Diabetes, Age-Related Macular Degeneration, Vitreoretinal Interface Abnormalities, Epiretinal Membrane). Due to the hyperreflective nature of IPL and OPL in OCT images when compared to their surrounding layers, these two layers can be used to calculate the smoothness or irregularity of the inner and outer retinal layers, respectively. Cho et al.24, in a retrospective cohort study, assessed correlations between the inner-retinal irregularity index (which was defined as the length ratio between the inner plexiform layer (IPL) and retinal pigment epithelium (RPE)) and visual outcomes before and after the ERM surgery. They deduced that the inner-retinal irregularity index was strongly associated with visual outcomes before and after the ERM surgery and this index had the potential to be a new alternative predictor for inner-retinal damages as well as a prognostic indicator in ERM. Inspection of the smoothness or irregularity of the outer layers of retina can also be potentially used in various retinal diseases, and OPL is suitable for this particular purpose owing to its hyperreflective nature36,37,38.

Examination of the software’s efficiency, conducted on 50 normal macular B-Scans, indicated that the proposed Livelayer algorithm, effectively integrated into the Livelayer software, was way less complicated than a common grid-manual segmentation method and thus, required a short period of time for delineation of layers in macular OCT images. Furthermore, the proposed algorithm’s performance level was evaluated by applying the Livelayer on the former set of B-Scans, deducing that even though the algorithm might vary slightly in its performance quality (i.e. the required number of clicks) depending on the image’s innate qualities, it worked more efficiently than a typical grid-manual method and almost always needed much less number of clicks. Testing the algorithm over the OCTs related to patients with the diagnosis of DME showed its practicality to segment unclear and detached retinal layers with a nearly high precision in comparison to the segmented data collected from the Heidelberg Eye Explorer (HEYEX) system.

Segmentation of retinal OCT images is an essential technique used in a variety of applications ranging from clinical to research studies. Due to the inherently layered structure of retina and changes in these layers in the presence of mild to severe retinal diseases such as diabetic retinopathy, studying these variations will help to understand the pathogenesis of various retinal disorders. Morphological analysis of each of these layers has yet to be comprehensively done except in a limited number of studies because of the large amount of time it takes to segment each layer manually. Therefore, designing a fast and reliable method that could overcome this obstacle should be of considerable importance. Manual segmentation methods are indeed tedious and complex, and full-automatic segmentation is actually deficient in its adaptability to human error correction. Semi-automatic algorithms are, however, capable of being the most preferred kind of ocular image segmentation methods among researchers and clinicians.

In Table 5 a set of elected automatic and semi-automatic segmentation methods on retinal OCT data are compared with our suggested method in terms of “simplicity and availability”, “processing time”, “capability in handling errors” and “capability in handling huge amount of data”. Lee et al. suggested a full-automatic software package, OCT Explorer (the Iowa Reference Algorithm)39,40,41 for segmentation of 12 retinal boundaries which is 3 more boundaries than what our software is capable of identifying. In contrast to our software’s error correction functionality that works independently from other segmented boundaries, in OCT Explorer, refining a single boundary highly affects other segmented boundaries on both the corresponding B-Scan and the other ones existing in the whole dataset. Furthermore, OCT Explorer fails to precisely find all boundaries of cystic B-Scans due to their obscure appearance on the image whereas the Livelayer’s ability to segment different types of OCTs was argued in the previous sections of this study. OCTMarker20 is an integrated software package that could only detect up to 3 retinal boundaries automatically. EdgeSelect16 and SAMIRIX20 are two semi-automatic methods for OCTA segmentation which are not available for free and their possible function is speculated as reported by their papers accordingly. Unlike the EdgeSelect that only segments 4 retinal boundaries, SAMIRIX is capable of segmenting 9 retinal boundaries, but accepting just one file format (.vol). However, Livelayer software reads 3 distinct input file formats making the user feel no need for volume converter software tools.

Table 5 A comparison between previously suggested segmentation algorithms and the Livelayer software.

The most remarkable superiority of our software over other previously presented methods is its feasibility to firstly, accommodate different methods of layer and fluid segmentation required by someone who may not be expert in the concepts of image processing like an ophthalmologist or a neurologist and secondly, generate the output in either a .jpg format (image file), or a .xlsx one (excel files) which could be specially advantageous while working with bulk data. Another major capability of the Livelayer software is the different filtering processes adaptable to each layer’s properties it employs. Other proposed algorithms generally apply a particular set of filtering on the to-be-segmented images which would always be constantly used regardless of the resolution of the input data as well as the quality of retinal layers. The Livelayer, on the other hand, considers each of these factors for its filtering stage by applying independent filters on each boundary and including an editable file in which the filtering parameters could be adjusted. Figure 7 displays a hierarchy of how the software creates the corresponding folders for each section and how the software’s output information is saved. In addition to that, whereas the Heidelberg system from which our peripapillary data is acquired, is not capable of segmenting all the peripapillary layers except for the pRNFL, our software could accurately segment 8 peripapillary boundaries after omitting their blood vessels and applying a set of pre-processing operations on them. The HEYEX system is not also able to exactly pinpoint the detached retinal layers occurring on the OCT B-Scans related to DME or other akin ailments, yet the Livelayer could tackle this problem with a few more than average click numbers. On account of being an open-source product, it can be upgraded to newer versions by either adding more essential tabs or improving the current ones to achieve a specific performance quality like a better denoising or to be tailored for diverse types of OCTs (e.g. rat retinal OCTs), and thus, to become even more efficient.

Figure 7
figure 7

The structure of the DME dataset we worked on and a hierarchical model for the discretely generated folders constituting the software’s output.

As it is evident from the results section, the proposed software is reasonably efficient in being time-effective and straightforward. The semi-automatic segmentation time and the number of required clicks for each of the studied retinal boundaries was far less than what they were for the manual-grid method. Regarding this analysis, ILM was the most rapidly- and easily-segmented layer with the biggest disparity between its corresponding values for two intended methods, and OPL–ONL needed considerably longer time and a greater number of clicks to be segmented. This is because of the irregular Henle’s fiber appearing under the OPL, especially its foveal portion causing the Livelayer not to rightly discriminate between this layer and the ONL. The software also showed a good level of agreement between each of the manual-grid and semi-automatic methods, and the gold standard data. Comparing the gold standard data with each grader’s grid-manual delineation yielded less than 1 pixel unsigned errors for ILM, gradually increasing to reach near 2 pixel errors for OPL–ONL. On the other hand, since our proposed method locates ILM slightly higher than its actual location, the unsigned errors between the gold standard data and the semi-automatic segmentation of ILM was larger than that of other boundaries. This error for other two boundaries fluctuated around 2 pixels with generally smaller values for IPL–INL. Analysis of repeatability which is also shown in Table 3 achieved pretty small errors for ILM and IPL–INL, but a near 1 pixel error for OPL–ONL. The Bland–Altman plots which are brought to quantify the level of agreement achieved total agreements for all boundaries with quite analogous values for ILM and IPL–INL and with an approximately 2–4 per cent decline in these values for OPL–ONL. Concerning the fluid segmentation section, the Dice score coefficients for both inter-rater variability and repeatability studies were at an acceptable level and proved that this algorithm could be used as a substitute for manual methods. The software’s main code and the necessary functions could be found at the GitHub link: https://github.com/MansoorehMontazerin/Livelayer-Software (Supplementary Notes).