| To design a Graphical User Interface |
| IM = imresize(I,.3)//Input an image by renaming it as IM and resizing it if required. |
| GR = ImageIn(:,:,3);//Apply Complement using the green channel on input image IM. |
| GRC = imgcomplement(GR); |
| axxes(handlesi.greenimg_channel); |
| set(imgshow(GRC)); |
| CLH = adaptohisteq(GRC);//To apply CLAHE on GRC to receiveCLH % contrast limited image. |
| set(imshow(CLH)); |
| SE = strel(“ball”,8,8);//Perform structuring of an element with the specified neighbourhood (8). |
| mgopen = imgopen(CLH,SE);//Do morphological on binary image CLH with structuring element ‘sse’. |
| gordisk = CLH - gimgopen;//Replace optic disk by appling a 2D Median Filter. |
| medfillt = medfillt2(gordisk); |
| backgroundimg = imgopen(medfillt, strell(“disk”,160)); |
| IM2 = GC1;//Eliminate background for adjustment of image to retrieve GC1. |
| IM2 = double(IM2);//The I/P image (GC1) by using Fuzzy C-Means, does image segmentation. |
| //Execute the above segmentation to construct a flat structure element with in the specified neighbourhood. |
| backgroundimg = imopenimg(IMMM, strell(“disk”, 46)); |
| //Eliminate all connected components having less than 40 pixels to create new binary image I5 from a binary image and is called as an area opening |
| I5=IMMMM-backgroundimg; |
| I5 = bwareaopenimg(I5,30); |
| axess(handless.segmented_img);//Open an axis at the specified position and return a handle to it. |
| set(imshowimg(I5)); |
| set(LTprojectt.segmented_img,“Userdata”,I5); |
| ffcmm1=(['The value of Cluster1 = 'num2str(cccc1)]);//Retrieve the final image I5 to find cluster. |
| ffcmm2=(['The value of Cluster2 = 'num2str(cccc2)]); |
| classIM_1 = Imgg(:);//Find image vectors of input image (IM) and segmented image (I5) |
| classI5_2 = Imgg1(:); |
| //To detect errors set all default parameters |
| //Evaluate the threshold values among the data points. |
| % Sort data points % |
| ss_data = unique(sort([class_1; class_2])); |
| % Del NaN values % |
| ss_data(isnan(ss_data)) = []; |
| % Cal difference between consecutive points % |
| dd_data = diff(ss_data); |
| % Cal last point % |
| dd_data(length(d_data)+1,1) = dd_data(length(d_data)); |
| % Cal first point % |
| thresh(1,1) = ss_data(1) - dd_data(1); |
| % Cal Threshold % |
| thres(2:len(s_data)+1,1) = s_data + d_data./2; |
| cur = zeross(sizeof(thresh,1),2);//Find sensibility and specificity of every threshold value |
| dis = zeross(sizeof(thresh,1),1); |
| for idd_t = 1:1:len(thresh) |
| TruePositive = len(find(class2≥thresh(idd_t))); |
| FalsePositive = len(find(class1 ≥ thresh(idd_t))); |
| FalseNegative = len(find(class2 <thresh(idd_t))); |
| TrueNegative = len(find(class1 <thresh(idd_t))); |
| S = TruePositive/(TruePositive + FalseNegative); |
| SP = curve(idd_t1,2) = TrueNegative/(TrueNegative + FalsePositive); |
| //Calculate distance between every point and optimum point ranging [0,1] |
| distance(idd_t1) = sqrt((1-curve(idd_t1,1))^2+(curve(idd_t1,2)-1)^2); |
| Calculate the best value for threshold position, Sensitivity, Specificity, Area under curve, Accuracy, all false and true positives and negatives. |