reference to non-existent field solidity

6 ビュー (過去 30 日間)
Mohamed Nasr
Mohamed Nasr 2019 年 4 月 17 日
回答済み: Mohamed Nasr 2019 年 5 月 21 日
hi I have error message in matlab 2017
reference to non-existent field 'solidity'
Error in Tumor(line denisty={stats.solidity};
how can I add reference
what did i miss ?

採用された回答

Walter Roberson
Walter Roberson 2019 年 4 月 17 日
If stats was created by calling regionprops, then the field name should be Solidity with a capital S.
  13 件のコメント
Walter Roberson
Walter Roberson 2019 年 4 月 17 日
Please attach the brain image by itself so we can test.
Mohamed Nasr
Mohamed Nasr 2019 年 4 月 17 日
c.JPG
the original image

サインインしてコメントする。

その他の回答 (2 件)

Mohamed Nasr
Mohamed Nasr 2019 年 4 月 18 日
clear all
clc
close all
img=imread('brain2.jpg');
bw=imbinarize(img , 0.9); %Thresholding value if less than 0.7 color is black ,if morr than 0.7 color is white
label=logical(bw); %area of tumor
stats =regionprops(label,'Solidity','Area'); %healthy region
denisty=[stats.Solidity];
area=[stats.Area];
high_dense_area = denisty > 0.5 ; %Area of tumor
max_area=max(area(high_dense_area)); %max area
tumor_label=find(area==max_area); %place of tumor
tumor = ismember(label,tumor_label);
s=strel('square',4);
tumor=imdilate(tumor,s);
figure;
subplot(1,3,1);imshow(img,[ ]);title('Brain' );
subplot(1,3,2);imshow(tumor,[ ]);title('Tumor alone' );
[B,L]=bwboundaries(tumor,'noholes');
subplot(1,3,3);imshow(img,[])
hold on
for i=1:length(B)
Plot(B{i}(:,2),B{i}(:,1),'Y','lenewidth',1.45)
end
title('Detected image')
hold off
this is my code dosenot run correctly what i miss in this code and it is one of optimal image attach the vidio with it
https://www.youtube.com/watch?v=UeFRo7uALhM&fbclid=IwAR1JmjjnCB3rnLYSiWwIQ1inxVJPA8WpwVUCJ-ncEy5MpKzWBHHe9jEWVjs
  13 件のコメント
Mohamed Nasr
Mohamed Nasr 2019 年 4 月 21 日
Expected input number 1, BW, to be two-dimensional. Error in bwlabel (line 65) validateattributes(BW, {'logical' 'numeric'}, {'real', '2d', 'nonsparse'}, ... Error in tumor2 (line 6) label = bwlabel(logical(bw)); %area of tumor
Walter Roberson
Walter Roberson 2019 年 4 月 21 日
Code attached.

サインインしてコメントする。


Mohamed Nasr
Mohamed Nasr 2019 年 5 月 21 日
Thanks alot really for your patient and your support

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by