필터 지우기
필터 지우기

Matlab CERR Gray Level Run Length Matrix

조회 수: 2 (최근 30일)
Laura Romero Crespo
Laura Romero Crespo 2022년 7월 4일
답변: Ayush Modi 2023년 10월 17일
When I run the code in github to obtain the GLRLM in CERR, Matlab doesn't end running and no errors appear in the command window. So I have no clue what's wrong.
Here is the function I wrote based on the code in the github wiki above.
function out = run_length_matrix
global planC;
% Define the scan index
scanNum = 1;
indexS = planC{end};
scan3M = getScanArray(planC{indexS.scan}(scanNum));
numGrLevels = 64;
minIntensity = -400;
maxIntensity = 500;
%binWidth = 25;
quantizedM = imquantize_cerr(scan3M,numGrLevels,minIntensity,maxIntensity);
numVoxels = sum(~isnan(quantizedM(:)));
dirFlag = 1; % 1: 3-d, 2: 2-d
offsetsM = getOffsets(dirFlag);
rlmType= 1; % 1: combine, 2: separate GLCMs
rlmM = calcRLM(quantizedM, offsetsM, numGrLevels, rlmType);
rlmFeatC = {'sre', 'lre', 'gln', 'glnNorm', 'rln', 'rlnNorm', 'rp', 'lglre',...
'hglre', 'srlgle', 'srhgle', 'lrlgle', 'lrhgle', 'glv', 'rlv', 're'};
rlmFlagS = cell2struct(num2cell(ones(size(rlmFeatC))),rlmFeatC,2);
featureS = rlmToScalarFeatures(rlmM, numVoxels, rlmFlagS);
out = featureS;
end

답변 (1개)

Ayush Modi
Ayush Modi 2023년 10월 17일
Hi Laura,
As per my understanding, you are not able to see any error and MATLAB is running indefinitely. As “planC” is a global variable, I am not able to reproduce the issue at my end.
You can refer the suggested solution in the community to obtain the GLRLM. Please refer the following for the same:
After opening the link, go to the functions tab at the top of the page. You can refer the file named – “grayrlmatrix.m”.
I hope this resolves the issue you were facing.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by