Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different size outputs (between 5.10.2 and 5.11.2) when indexing from "gridified" EBSD data #2128

Open
zmichels opened this issue Apr 25, 2024 · 2 comments

Comments

@zmichels
Copy link

What do you want to do?
I want to use code that worked with v5.10.2 with v5.11.2

What data do you have?
mtexdata forsterite

What code do you use?
I am trying to setup a sliding-window style analysis that works in 5.10.2, but does not work in 5.11.2.

Please provide minimalist code with code in the following form

% load data
mtexdata forsterite

% gridify
egrid = ebsd('indexed').gridify;

% ebsd ids in grid/matrix
ids = egrid.id;

% size of matrix
[a1,b1] = size(ids);

% window width
w = 3;

% indices/ids of center points
row = 2:1:max(a1)-1;
col = 2:1:max(b1)-1;

inds = ids(2:a1-1,2:b1-1);
eId = inds(:);

phases = unique(egrid.phase);

%% initialize window
num = length(eId);

win1 = zeros(num,w*w);

for s = 1:num
    % s = 1;
    c = inds(s);

    win1(s,:) =   [   c-a1-1     c-1    c+a1-1    c-a1       c      c+a1  c-a1+1     c+1    c+a1+1   ];

end


%% assign rotations

% phase IDs
pID = egrid(win1).phase;

size(pID)

What result do you get
with 5.10.2, the resultant size of variable 'pID' is
243820 x 9

with 5.11.2, the resultant size of variable 'pID' is
2194380 x 1

What result do you expect
I expect indexing to work the same such that the size of returned variables matches with previous versions of MTEX

**What MTEX version do you use?**
5.11.2 and 5.10.2
@zmichels zmichels changed the title Different size outputs when indexing from "gridified" EBSD data Different size outputs (between 5.10.2 and 5.11.2) when indexing from "gridified" EBSD data Apr 25, 2024
@zmichels
Copy link
Author

mtexdata forsterite
p = ebsd.gridify.phase;

with MTEX 5.10.2,

size(p)

returns:
ans =

336 732

With 5.11.2, it returns:
ans =

  245952           1

@ralfHielscher
Copy link
Member

Hi Zach,
is this still a big issue for you? I can confirm, that ebsd.phase has changed its shape from M x N to MN x 1. Unfortunately, I do not recall why I did this. It is marked as a bug fix. After all you can always do

reshape(ebsd.phase,size(ebsd))

Ralf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants