How to calculate features of benign images?

조회 수: 2 (최근 30일)
Kevin Gjoni
Kevin Gjoni 2023년 3월 19일
답변: Rohit 2023년 4월 25일
The provided code in 'GehtMitAllenMasks.m' works for images of type 'malignant' but not for images of type 'benign' (function 'calculateFeatures').
I tried doing it like this:
oImageData = ImageData('Path', 'benign')
glcmFeatures = GehtMitAllenMasks(oImageData)
Tfeatures = glcmFeatures.calculateFeatures
Then I get this error:
Unable to perform assignment because the size of the left side is
1-by-1 and the size of the right side is 0-by-0.
Error in GehtMitAllenMasks/calculateFeatures (line 44)
featureData(objIdx,14) = sP(1).Circularity;
Since this is for a schoolproject that's due in a few days I would appreciate fast answers.
Thanks in advance!

답변 (1개)

Rohit
Rohit 2023년 4월 25일
Hi Kevin,
Upon investigating the code that you have shared, it seems that we can get features of images of type 'malignant' but in case of ‘benign’ images, there is some error.
The reason for this error is ‘regionprops’ function which finds features for 2-D images but there is an image in dataset whose mask is 3D and so some features like ‘Circularity’ are empty and thus gives error in assignment.
Some possible ways to solve this error can be:
  • Convert 3D mask to 2D by reshaping or grayscaling
  • Using regionprops3 to work with 3D Images
You can look up this MathWorks documentation links for more reference:
regionprops function:
image conversion to 2D:
For debugging your MATLAB code and see where exactly is error, you can try setting breakpoints.

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by