# MedicalSeg: A Medical GUI Application for Image Segmentation Management
## 3 Methods  
### GUI Interface Design  
Herein, a detailed description of the design used to develop the GUI application is explained. The first step is to define the path definition workspace (highlighted on blue box 1 in Figure 2). The users should select an input folder and all the images contained in the folder will be loaded. Moreover, the output folder must be selected to save all the results provided by the segmentation process. In this sense, MedicalSeg is designed in an intuitive way for an easy management of medical images. Once all the files are successfully loaded, the first image defined as \"original image\" is displayed. Prior to the segmentation process, a image processing tools panel is enabled (highlighted on green box 2 in Figure 2). Users can use a pre-processing tools, such as gamma contrast, median, Gaussian, Laplacian, and log spatial filters and morphological filters (erode, dilate, open, and close). Once all the files are successfully loaded and the pre-processing is finished, a panel to manage all the segmentation techniques is enabled (highlighted on red box 3 in Figure 2). Then, users should select all the segmentation techniques by clicking the checkbox area. One of the advantages of MedicalSeg application is that it is possible to select multiple techniques. For each selected technique, the corresponding panel is enabled containing all the parameters that users should fill. These parameters are implemented according to the features of each segmentation technique (Section 3.2). The main goal of the tool is to concentrate those results from previous efforts (algorithms discussed in Section 3.2) in a single one application to make it accessible to the scientific community. Once the user has filled all the parameters the \"Generate\" button should be pressed to trigger the segmentation process (highlighted on black box 4 in Figure 2). A \"cancel\" button can be used to cancel the segmentation process, and \"reset\" button to refresh the application as an empty state in order to start with a new workspace. As a consequence of the choices given by the user and an automated manner, new folders are created corresponding to each segmentation technique selected by the user (in the path defined in the output definition). It is important to remark that for each segmented technique a new folder containing the segmented and masked images is generated. The MedicalSeg application offers a log information to know the status of each action (highlighted on cyan box 5 in Figure 2). It is very useful because users can see and verify the process, or visualize errors in case that some procedure went wrong. During the segmentation process, the users can follow the evolution of the segmentation in the visualization panel (highlighted on orange box 6 in Figure 2). Once the segmentation process is completed, the original, segmented, and masked images are displayed. In the right part of the visualization panel information related to the original image and the selected segmentation technique is depicted. A pop-up menu appears according to the checkbox area in the segmentation technique panel (highlighted on brown box 7 in Figure 2). To load the results obtained from other techniques, users can change the visualization via a pop-up button. Moreover, a slider bar is also available in order to forward or go back the visualization (next or previous image). The MedicalSeg application supports basic functionalities, such as zoom in/out, move, or rotate between others, to help the visualization of the images. This pre-visualization provides an overview of the results and stored in the selected output folder. As can be seen in an example (Figure 3), a folder is created for each segmentation technique containing all the segmented results according to the criteria chosen by users. The format of the images is saved in jpeg format and in a \"mat file\". This option is important if we want to later continue with further post-processing tasks with the obtained results.