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
287 stars 185 forks source link

calcGrains() failed in 5.2.1 (until 5.2 it worked) #432

Closed accessT closed 4 years ago

accessT commented 4 years ago

For my ebsd-plot: Untill mtex 5.2 i could use the function calcGrains(). But with 5.2.1 i get this error:

' Undefined function or variable 'qq'. Error in quaternion/mean (line 26) qm = qq; Error in quaternion/mean (line 42) [qm,lambda, V] = mean(q.subSet(id),varargin{:}); Error in EBSD/calcGrains (line 71) mq = mean(qind,'robust');

the lines in .\mtex-5.2.1\geometry\@quaternion\mean.m: if isempty(q) qm = quaternion.nan;
return elseif length(q) == 1 qm = qq; lambda = diag([0 0 0 1]); return end
makes it impossible to calc. But when i uncomment them, it works.

so, what is qq?

Try it by yourself: fullpath='< edithere >' CS = {'notIndexed', crystalSymmetry('m-3m', 'mineral', 'Ti (beta)'), 'notIndexed'}; ebsd = EBSD.load(fullpath,CS,'interface','generic', 'ColumnNames', { 'phi1' 'Phi' 'phi2' 'x' 'y'}, 'Bunge')

This file seems to work: klick but this ebsd file gets with 5.2.1 the error (but works fine untill 5.2): klick

ralfHielscher commented 4 years ago

Thank you for reporting this. qq is a typo it should by q.

Ralf.

accessT commented 4 years ago

Thank you for reporting this. qq is a typo it should by q.

Ralf.

Thank you for the hotfix. I've tested 5.2.2. But still cannot plot the second link.
Just recalculated them. Seems that all the new calculations (with 5.2+) get a negativ y-coordinate. But untill 5.2 (and below) it can be ploted without problems..

Error: Output argument "V" (and maybe others) not assigned during call to "quaternion/mean". Error in quaternion/mean (line 42) [qm,lambda, V] = mean(q.subSet(id),varargin{:}); Error in EBSD/calcGrains (line 71) mq = mean(qind,'robust');

ralfHielscher commented 4 years ago

Hi,

thank you for trying MTEX 5.2.2. I hope I have fixed it in the most recent release. Your data look very interesting. Do you have a little bit of a story about them? How they are measured? What do they represent? Why are they at such an irregular grid?

Especially because of the last I would like to include them into MTEX as an example data set.

All the best,

Ralf.

accessT commented 4 years ago

Your data look very interesting. Do you have a little bit of a story about them? How they are measured? What do they represent? Why are they at such an irregular grid?

I was using the code from Gerrit-ter-Haar to reconstruct Ti beta (from given Ti alpha) with a threshold of 30 and an angle of 5° (older maybe 15°..). Initially, the x-y coordinates were positive at the beginning with mtex 5. Interestingly enough, now I mostly get negative y-coordinate. Must still find out why.

Especially because of the last I would like to include them into MTEX as an example data set.

the following plot has grainsize 100 (pixels) and smoothen by value 1 plotx2east as an Grainsplot: plotx2east

ralfHielscher commented 4 years ago

Hi, i try to structure my questions more clearly:

  1. Did MTEX 5.2.3 fixes your problem?
  2. Can you post the original Titatium alpha data?
  3. Does the code of Gerrit-ter-Haar changes x and y coordinates? Why?
  4. I tried to understand the code of Gerrit and posted a corresponding question at https://groups.google.com/forum/#!topic/mtexmail/-qKxLqZoqjE
  5. Looking at you data I would suspect that something went wrong during beta phase reconstruction.

Ralf

accessT commented 4 years ago

ad 1) Yes, Now it works. Thank you! ad 2) EDXLMDTi64_alpha.zip ad 3) untill MTEX 5.1.1 i get positive y-coordinates. With MTEX 5.2.0 - 5.2.3 i get negative y-coordinates... still don't know why. ad 4) I will discuss it with my team. ad 5) #todo going to re-analyse the code and give a feedback later..

accessT commented 4 years ago
5. Looking at you data I would suspect that something went wrong during beta phase reconstruction.
3. Does the code of Gerrit-ter-Haar changes x and y coordinates? Why?

The problem seems to be while loading the ebsd-file or exporting it: ebsd = loadEBSD(fullpath,'interface','crc', 'convertSpatial2EulerReferenceFrame'); export(ebsd, 'ebsdTo.txt'); with MTEX 5.1.1 it works, but with 5.2 + it changes the y-coordinate Screenshots: 5.1.1 - at start ebsd_511 5.2.3 - at start ebsd_523 5.1.1 - at line 100k ebsd_511_10k 5.2.3 - at line 100k ebsd_523_10k

just tried it with MTEX 4.4.0 (Matlab 2019b). Looks like this older versions of MTEX does the same (negative Y-Coordinate).

######################## ok, the version beteen 5.0 and 5.1.1 imported the files not correct. With 5.2.0+ they do it correctly.