What Segmentation Algorithm is used in this code for Brain Tumor Detection?
12 views (last 30 days)
Show older comments
matlab project
on 8 Apr 2022
Commented: Image Analyst
on 10 Apr 2022
function varargout = main(varargin)
% MAIN MATLAB code for main.fig
% MAIN, by itself, creates a new MAIN or raises the existing
% singleton*.
%
% H = MAIN returns the handle to a new MAIN or the handle to
% the existing singleton*.
%
% MAIN('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAIN.M with the given input arguments.
%
% MAIN('Property','Value',...) creates a new MAIN or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before main_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to main_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help main
% Last Modified by GUIDE v2.5 31-Jan-2019 14:07:27
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @main_OpeningFcn, ...
'gui_OutputFcn', @main_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before main is made visible.
function main_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to main (see VARARGIN)
% Choose default command line output for main
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes main wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = main_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
[filename,pathname] = uigetfile({'*.*';'*.bmp';'*.tif';'*.gif';'*.png'},'Pick an Image File');
I = imread([pathname,filename]);
I = imresize(I,[200,200]);
axes(handles.axes1);
imshow(I);
axis off
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global I
global img;
img1 = I;
if(size(img1,3)>2)
img1=rgb2gray(img1);
end
img1 = imresize(img1,[200,200]);
% Converts uint8 to Double
img=im2double(img1);
%Removing Noise by applying Median Filter
img=medfilt2(img);
axes(handles.axes3);
imshow(img);
axis off
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA
%Converting Image into Binary Image with a threshold value 0.65
global img
global img1
global I
img1 = I;
if(size(img1,3)>2)
img1=rgb2gray(img1);
end
img1 = imresize(img1,[200,200]);
% Converts uint8 to Double
img=im2double(img1);
%Removing Noise by applying Median Filter
img=medfilt2(img);
bw = im2bw(img,0.7);
imgCheck = im2bw(img1);
% Crearing 2D Binary Image Label
label = bwlabel(bw);
% For Finding the Properties of the image
% Returns a scalar specifying the proportion of the pixels in the convex hull that are also in the region
properties = regionprops(label,'Solidity','Area');
% Density of the convex Hull
density = [properties.Solidity];
% Area of the Hull
area = [properties.Area];
% High Density Areas are tumor
denseCond = density > 0.5;
% Finding the biggest tumor
denseMax = max(area(denseCond));
tumorFinal = find(area == denseMax);
% From the properties finded out earlier, we found the biggest tumor
tumor = ismember(label,tumorFinal);
% Using Morphological Operation using square structural Element
se = strel('square',3);
tumor = imdilate(tumor,se);
ref=tumor;
axes(handles.axes4);
imshow(tumor);
%mask code
% Tumor1=bwareafilt(tumor,1);
% figure(6), imshow(Tumor1);
% [m n]=size(ref);
% figure(6), subplot(131), imshow(ref);
% I1=imresize(I,[m n]);
% subplot(132), imshow(I1);
% I1=rgb2gray(I1);
% for i=1:m
% for j=1:n
% if (ref(i,j)==0)
% I1(i,j)=0;
% end
% end
% end
% subplot(133), imshow(I1);
%
% %using cc analysis
% [L Ne]=bwlabeln(ref);
% for n=1:Ne
% % http://www.mathworks.in/help/matlab/ref/find.html
% [r,c] = find(L==n);
% % http://www.mathworks.in/help/matlab/ref/max.html
%
% n1=I1(min(r):max(r),min(c):max(c));
% end
% axis off
% mask=zeros(size(I1));
% figure(7), subplot(131), imshow(n1);
% subplot(132), imshow(mask);
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img
global img1
global I
img1 = I;
if(size(img1,3)>2)
img1=rgb2gray(img1);
end
img1 = imresize(img1,[200,200]);
% Converts uint8 to Double
img=im2double(img1);
%Removing Noise by applying Median Filter
img=medfilt2(img);
bw = im2bw(img,0.7);
imgCheck = im2bw(img1);
% Crearing 2D Binary Image Label
label = bwlabel(bw);
% For Finding the Properties of the image
% Returns a scalar specifying the proportion of the pixels in the convex hull that are also in the region
properties = regionprops(label,'Solidity','Area');
% Density of the convex Hull
density = [properties.Solidity];
% Area of the Hull
area = [properties.Area];
% High Density Areas are tumor
denseCond = density > 0.5;
% Finding the biggest tumor
denseMax = max(area(denseCond));
tumorFinal = find(area == denseMax);
% From the properties finded out earlier, we found the biggest tumor
tumor = ismember(label,tumorFinal);
% Using Morphological Operation using square structural Element
se = strel('square',3);
tumor = imdilate(tumor,se);
ref=tumor;
% figure(6), imshow(Tumor1);
[m n]=size(ref);
figure(6), subplot(131), imshow(ref);
I1=imresize(I,[m n]);
subplot(132), imshow(I1);
I1=rgb2gray(I1);
for i=1:m
for j=1:n
if (ref(i,j)==0)
I1(i,j)=0;
end
end
end
subplot(133), imshow(I1);
[boundary,l1] = bwboundaries(tumor,'noholes');
% figure(3)
% imshow(img,[]);
axes(handles.axes6);
imshow(I1,[]);
title('Tumor Boundary');
hold on;
for i = 1:length(boundary)
plot(boundary{i}(:,2),boundary{i}(:,1),'r','linewidth',1.45);
end
title('Detected Tumor')
hold off;
axis off;
s1 = imgCheck(:,:);
[c1,d1,e1,f1] = dwt2(s1,'db4');
[c2,d2,e2,f2] = dwt2(c1,'db4');
[c3,d3,e3,f3] = dwt2(c2,'db4');
dwtfeat = [c3,d3,e3,f3];
% Performing the Principal Component Extraction for feature extraction
G = pca(dwtfeat);
g = graycomatrix(G);
statistics = graycoprops(g,'Contrast Correlation Energy Homogeneity');
Contrast = statistics.Contrast;
Correlation = statistics.Correlation;
Energy = statistics.Energy;
Homogeneity = statistics.Homogeneity;
Mean = mean2(G);
Standard_Deviation = std2(G);
Entropy = entropy(G);
RMS = mean2(rms(G));
%Skewness = skewness(img)
Variance = mean2(var(double(G)));
a = sum(double(G(:)));
Smoothness = 1-(1/(1+a));
Kurtosis = kurtosis(double(G(:)));
Skewness = skewness(double(G(:)));
% Inverse Difference Movement
m = size(G,1); % No. of Rows
n = size(G,2); % No. of Columns
diff = 0;
for i = 1:m
for j = 1:n
temp = G(i,j)./(1+(i-j).^2);
diff = diff + temp;
end
end
IDM = double(diff);
features = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation, Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM];
% The 30 datasets which we are training the SVM with
load myset30.mat %
svmStruct = fitcsvm(meas,label,'OptimizeHyperparameters','auto', ...
'HyperparameterOptimizationOptions',struct('ShowPlots', false), 'KernelFunction','linear');
Species = predict(svmStruct,features);
%Species = predict(svmStruct,features);
if strcmpi(Species,'MALIGNANT')
disp('Malignant Tumor ');
else
disp(' Benign Tumor ');
end
% Put the features in GUI
set(handles.edit2,'string',Mean);
set(handles.edit3,'string',Standard_Deviation);
set(handles.edit16,'string',Entropy);
set(handles.edit5,'string',RMS);
set(handles.edit6,'string',Variance);
set(handles.edit7,'string',Smoothness);
set(handles.edit8,'string',Kurtosis);
set(handles.edit9,'string',Skewness);
set(handles.edit10,'string',IDM);
set(handles.edit11,'string',Contrast);
set(handles.edit12,'string',Correlation);
set(handles.edit13,'string',Energy);
set(handles.edit14,'string',Homogeneity);
set(handles.edit15,'string',Species);
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit6 as text
% str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit7 as text
% str2double(get(hObject,'String')) returns contents of edit7 as a double
% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as text
% str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9 as text
% str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit10_Callback(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit10 as text
% str2double(get(hObject,'String')) returns contents of edit10 as a double
% --- Executes during object creation, after setting all properties.
function edit10_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit11_Callback(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit11 as text
% str2double(get(hObject,'String')) returns contents of edit11 as a double
% --- Executes during object creation, after setting all properties.
function edit11_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit12_Callback(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit12 as text
% str2double(get(hObject,'String')) returns contents of edit12 as a double
% --- Executes during object creation, after setting all properties.
function edit12_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit13 as text
% str2double(get(hObject,'String')) returns contents of edit13 as a double
% --- Executes during object creation, after setting all properties.
function edit13_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit14_Callback(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit14 as text
% str2double(get(hObject,'String')) returns contents of edit14 as a double
% --- Executes during object creation, after setting all properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit14 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit15_Callback(hObject, eventdata, handles)
% hObject handle to edit15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit15 as text
% str2double(get(hObject,'String')) returns contents of edit15 as a double
% --- Executes during object creation, after setting all properties.
function edit15_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%perimeter
% global I
% B=im2bw(I);
%
% %Fill the holes
% C=imfill(B,'holes');
%
% %Label the image
% [Label,Total]=bwlabel(C,8);
% %Object Number
% num=4;
% [row, col] = find(Label==num);BW=bwboundaries(Label==num);
% c=cell2mat(BW(1));
% Perimeter=0;
% for i=1:size(c,1)-1
% Perimeter=Perimeter+sqrt((c(i,1)-c(i+1,1)).^2+(c(i,2)-c(i+1,2)).^2);
% end
% display(Perimeter)
global I
A = I;
A = imresize(A,[200,200]);
Resolution=5; % micron/pixel
% CALCULATIONS
if size(A,3)==3
A=rgb2gray(A);
end
A=im2bw(A,graythresh(A));
A=bwmorph(A,'majority',5);
Conn=8;
[s1,s2]=size(A);
P=bwperim(A);
At=s1*s2; % Total surface
% Ag=sum(sum(A)); %Area of grains
% Ap=sum(sum(~A)); %Area of pores
Perim=sum(sum(P));
%Outputs
display(Perim)
function edit16_Callback(hObject, eventdata, handles)
% hObject handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit16 as text
% str2double(get(hObject,'String')) returns contents of edit16 as a double
% --- Executes during object creation, after setting all properties.
function edit16_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
0 Comments
Accepted Answer
Image Analyst
on 8 Apr 2022
The main segmentation is done here:
bw = im2bw(img,0.7);
so that would be a global Otsu threshold.
After that it analyzes the texture within the mask area and compares the texture values, with SVM (Support Vector Machine), to a set of previously analyzed images where the image has been definitively labeled as benign or malignant.
7 Comments
Image Analyst
on 10 Apr 2022
Since there are virtually no comments or explanation it's hard to tell. I see it computing distances so perhaps it's K Nearest Neighbor. But you'd be best off asking the author (and scolding him for not putting in comments or explanations).
More Answers (0)
See Also
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!