mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Grainsize error with merged grains #106

Closed ajcross89 closed 8 years ago

ajcross89 commented 8 years ago

Dear Ralf,

I am having difficulty accessing the grainSize property of merged grains. For example, using the following code (from the merge.m file in MTEX 4.1.3):

mtexdata small
grains = smooth(calcGrains(ebsd))

% merge all neigbouring Diopside grains
gB = grains.boundary('Diopside','Diopside')
[grains_m,parentId] = merge(grains,gB)

grains_m(201:210).grainSize

Gives this output:

   (1,1)        1
   (2,1)        5
   (3,1)        1
   (4,1)        2
   (5,1)        1
   (6,1)        3
   (7,1)        2
   (8,1)        1
   (9,1)        1
  (10,1)        1

Other properties, such as grains_m.area work normally.

Best regards,

Andrew

ralfHielscher commented 8 years ago

Hi Andrew,

I do not understand your problem with the output. Is it because it gives you the result as sparse matrix? You can convert it to a ordinary matrix by

full(grains_m(201:210).grainSize)