calculating glcm on multiple images loop

302 views Asked by At

I would like to calculate GLCM Gray level co-occurence matrices and other texture properties for a stacks of images. I would like to write a loop to make it easier, is this possible? I have tried but it seems my filenames i.e. TopSlice0641... are causing a problem. I have tried the following code, but it doesn't work.:

for Topi = 0641:10:1243
  varName = ['Top' int2str(Topi)];  %# Create the name string
  eval(['glcm_' varName ' = graycomatrix(' varName ','Offset',[0 1;-1 1;-1 0;-1 -1]);']);
end
0

There are 0 answers