how make brain tumor classification
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
clc;
clear all;
close all;
[I,path]=uigetfile('*.jpg','D:\matlab aml\dataset3');
str=strcat(path,I);
s=imread(str);
num_iter = 10;
delta_t = 1/7;
kappa = 15;
option = 2;
disp('Preprocessing image please wait . . .');
ad = anisodiff2D(s,num_iter,delta_t,kappa,option);
figure, subplot 121, imshow(s,[]),title('Input image'), subplot 122, imshow(ad,[]),title('Fitered image'),l1=30;l2=37;l3=40;l4=42;q1=53;q2=39;q3=36;q4=40;z1=26;z2=16;z3=53;z4=60;
fprintf('\nPress any key \n');
pause;
disp('classifying tumor boundary');
m = zeros(size(ad,1),size(ad,2)); %-- create initial mask
m(90:100,110:135) = 1; % main 2
ad = imresize(ad,.5); %-- make image smaller
m = imresize(m,.5); % for fast computation
figure
subplot(2,2,1); imshow(ad,[]); title('Input Image');
% bounding box start
%hold on
if(strcmp(I,'a1.jpg')||strcmp(I,'a.jpg'))
for aa=1:10
subplot(2,2,2); imshow(ad,[]);title('Locating Bounding box');
rectangle('Position',[l1 l2 l3 l4],'EdgeColor','y'); %a1
pause(0.5);
l1=l1+1;l2=l2+1;l3=l3-2;l4=l4-2;
end;
% rectangle('Position',[40 47 20 22],'EdgeColor','y'); %a1
end;
if(strcmp(I,'b1.jpg')||strcmp(I,'b.jpg'))
for aa=1:10
subplot(2,2,2); imshow(ad,[]);title('Locating Bounding box');
rectangle('Position',[q1 q2 q3 q4],'EdgeColor','y'); %a1
pause(0.5);
q1=q1+1;q2=q2+1;q3=q3-2;q4=q4-2;
end;
%rectangle('Position',[61 49 18 20],'EdgeColor','y'); %b1
end;
if(strcmp(I,'c1.jpg')||strcmp(I,'c.jpg'))
for aa=1:10
subplot(2,2,2); imshow(ad,[]);title('Locating Bounding box');
rectangle('Position',[z1 z2 z3 z4],'EdgeColor','y'); %a1
pause(0.5);
z1=z1+1;z2=z2+1;z3=z3-2;z4=z4-2;
end;
%rectangle('Position',[35 26 34 40],'EdgeColor','y'); %c1
end;
%bounding box end
subplot(2,2,3); title('Segmentation');
seg = svm(ad, m, 50); %-- Run segmentation
subplot(2,2,4); imshow(seg); title('Segmented Tumor');
%imwrite(seg,'test.jpg');
how to correct my error
Unrecognized function or variable 'anisodiff2D'.
Error in svm (line 12)
ad = anisodiff2D(s,num_iter,delta_t,kappa,option);
>>
0 comentarios
Respuestas (1)
Omega
el 7 de Abr. de 2025
Hi Mohamed,
The error message you are encountering indicates that MATLAB cannot find the function "anisodiff2D". This function is likely not a built-in MATLAB function, so you will need to ensure it is available in your MATLAB path. You might want to check the following to fix the issue as it could be potentially because of the reasons mentioned below:
Ensure that "anisodiff2D" exists in your working directory or is included in the MATLAB path. If it's located in a different directory, use:
>> addpath('path_to_directory')
to add that directory to the MATLAB path. If you don't have the function, you might need to download it from a reliable source or implement it yourself. Additionally, make sure that the function's input parameters match how you're calling it in your script, and double-check for any typos in the function name or usage.
These steps should help resolve the error.
0 comentarios
Ver también
Categorías
Más información sobre Medical Physics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!