You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create new task schema for iteratively sampling orientations from ODF in MTEX #567
NB: Reported that this method converges rapidly on the origin model despite being more computationally heavy than simple random sampling, so is of a lot of interest.
We just need to write the task_schema and workflow to accompany it:
Inputs:
.crc filepaths
corrections (one set of three angles for each .crc file)
Outputs:
combined_texture.png pole figures
sampled_texture.txt
sampled_texture.png pole figures
The script uses an older version of MTEX (5.3) but should work for a later version with small tweaks.
I needed to use MTEX 5.3 due to the requirements of the industrial partners.
Let me know if this is enough to get you started!
Thanks Guy. I've tried to run the script with MTEX 5.3 and MATLAB R2024b, but get an error:
47D.crc
89 88 135
Error using loadEBSD_crc (line 30)
EBSD format 'CRC' does not match the data
file: '47D.crc'
Error in EBSD.load (line 86)
ebsd{k} = feval(['loadEBSD_',char(interface)],...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in EBSD2model_varargs>loadmap_correct (line 129)
ebsdmap = EBSD.load(filepath,CS,'interface','crc','convertSpatial2EulerReferenceFrame', 'Bunge');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in EBSD2model_varargs (line 27)
corrected_maps{m} = loadmap_correct(maps(m), CS, corrections(m,:));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Would you mind checking the files in the zip archive? Thanks
Thanks Guy. I've tried that but I get the same error, only this time will the full rather than absolute path. It's complaining that the EBSD format doesn't match the data, rather than not being able to find the file.
I met with Guy and now have some new files which ran successfully.
Notes from our chat:
Don't want ebsd_maps.txt as input for the matflow task. Want list of (any number of) file paths, and corrections for each path (list of three correction values). Also need euler_degrees: true/false as input. mtex expects degrees.
Keep two versions of mtex in the matflow task: 5.3 and latest.
New files contain three datasets. Test all three run with MATLAB before moving on.
Get code working with both MTEX 5.3 and MTEX 6.0.0
Implementing the first task in MatFlow has revealed #576.
I've been looking to reuse existing code (get_EBSD_orientations_from_CRC_file) to load the CRC files, but I'm unclear whether this will work for the purposes required here as we need to do three rotations. When I try I get this error about types:
34 corrected_maps{m} = get_EBSD_orientations_from_CRC_file(ebsd_map_path, ...
Error using MException
MESSAGE input must be a character vector or string scalar.
Error in interfaceError (line 28)
e = MException('mtex:wrongInterface',...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in loadEBSD_crc (line 32)
interfaceError(fname);
^^^^^^^^^^^^^^^^^^^^^
Error in Novelis_EBSD2model_varargs>get_EBSD_orientations_from_CRC_file (line 311)
ebsd = loadEBSD_crc(CRCFilePath, referenceFrameTransformation{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in Novelis_EBSD2model_varargs (line 34)
corrected_maps{m} = get_EBSD_orientations_from_CRC_file(ebsd_map_path, ...
I'd confused some of the required input formats around cells, but the final problem is that the MTEX rotation function looks only to be able to do one rotation at a time, so we cannot pass in a vector of 3 euler angles and use the MatFlow function.
So use Guy's code instead, and Adam is looking into #576.
Making steady progress. I could do with another chat next week if you're around on Monday? It wasn't EBSD.orientations that we needed to export to HDF, rather orientations sampled from the ODF. So I think I've done that, but can't get the pole figure quite right.
Other tasks do that, but we need to save the actual orienations rather than a sample from an ODF.
and I'm not sure whether the matflow input parameter crystal_symmetry: cubic is enough? The help/notation isn't super clear, but cubic looks to equate to the first term m-3m.
Hi @Gbowker ,
I think this is ready for you to test now. If you pull this branch, there's one thing you'd need to change in the demo workflow, which is the path to the CRC files under
Debugging info for me for later:
The same MTEXprefs value is set in MATLAB and via MatFlow for pfAnnotations.
In MATLAB, this draws the XYZ labels, but in MatFlow it doesn't. Why?
In MATLAB, adding manual annotations draws on top the existing XYZ ones, which is messy.
In MatFlow, there are no existing annotations so it works out ok.
Activity
dkfellows commentedon Sep 1, 2026
NB: Reported that this method converges rapidly on the origin model despite being more computationally heavy than simple random sampling, so is of a lot of interest.
gcapes commentedon Sep 1, 2026
Guy has a notebook which compares the two methods.
gcapes commentedon Sep 7, 2026
@Gbowker would you be able to send me something to get me started with this? Thanks
Gbowker commentedon Sep 7, 2026
Hi Gerard, Here is the script and input files I have which does this in MTEX:
texture sampling.zip
We just need to write the task_schema and workflow to accompany it:
Inputs:
Outputs:
The script uses an older version of MTEX (5.3) but should work for a later version with small tweaks.
I needed to use MTEX 5.3 due to the requirements of the industrial partners.
Let me know if this is enough to get you started!
gcapes commentedon Sep 8, 2026
Thanks Guy. I've tried to run the script with MTEX 5.3 and MATLAB R2024b, but get an error:
Would you mind checking the files in the zip archive? Thanks
Gbowker commentedon Sep 8, 2026
Hi Gerard, Matlab just needs absolute paths rather than relative ones. So you need to include your pwd in the path for each .crc file.
gcapes commentedon Sep 8, 2026
Thanks Guy. I've tried that but I get the same error, only this time will the full rather than absolute path. It's complaining that the EBSD format doesn't match the data, rather than not being able to find the file.
gcapes commentedon Sep 15, 2026
I met with Guy and now have some new files which ran successfully.
Notes from our chat:
gcapes commentedon Sep 17, 2026
For the MatFlow tasks, I think the existing MATLAB script does a few things which should be separated into distinct tasks:
The implications for the above are that
gcapes commentedon Sep 23, 2026
Implementing the first task in MatFlow has revealed #576.
I've been looking to reuse existing code (
get_EBSD_orientations_from_CRC_file) to load the CRC files, but I'm unclear whether this will work for the purposes required here as we need to do three rotations. When I try I get this error about types:gcapes commentedon Sep 24, 2026
I'd confused some of the required input formats around cells, but the final problem is that the MTEX
rotationfunction looks only to be able to do one rotation at a time, so we cannot pass in a vector of 3 euler angles and use the MatFlow function.So use Guy's code instead, and Adam is looking into #576.
gcapes commentedon Sep 24, 2026
#576 has now been fixed.
Gbowker commentedon Sep 24, 2026
Great, thankyou - how close are you to getting the MCMC task finished now?
gcapes commentedon Sep 24, 2026
Making steady progress. I could do with another chat next week if you're around on Monday?
It wasn'tEBSD.orientationsthat we needed to export to HDF, rather orientations sampled from the ODF. So I think I've done that, but can't get the pole figure quite right.Other tasks do that, but we need to save the actual orienations rather than a sample from an ODF.
gcapes commentedon Sep 28, 2026
I'm not sure whether I've captured all that is needed for the pole figures plot. Your script contains
and I'm not sure whether the matflow input parameter
crystal_symmetry: cubicis enough? The help/notation isn't super clear, but cubic looks to equate to the first termm-3m.gcapes commentedon Oct 1, 2026
Hi @Gbowker ,
I think this is ready for you to test now. If you pull this branch, there's one thing you'd need to change in the demo workflow, which is the path to the CRC files under
I'll add some demo workflow files once you're happy with the workflow.
Gbowker commentedon Oct 1, 2026
Fantastic Gerard will give that a go later today! :)
Thanks!
gcapes commentedon Oct 1, 2026
Great! I'm still looking at getting the pole figure plots the same as you made with MATLAB so watch this space 🤞
gcapes commentedon Oct 1, 2026
Debugging info for me for later:
The same MTEXprefs value is set in MATLAB and via MatFlow for
pfAnnotations.In MATLAB, this draws the XYZ labels, but in MatFlow it doesn't. Why?
In MATLAB, adding manual annotations draws on top the existing XYZ ones, which is messy.
In MatFlow, there are no existing annotations so it works out ok.
gcapes commentedon Oct 8, 2026
Maybe look at
startup_mtexscript and compare with Matflowmatlab_env.