Update to dislocationSystem and cleanUpPseudoSym#2530
Update to dislocationSystem and cleanUpPseudoSym#2530PhilKro wants to merge 3 commits intomtex-toolbox:developfrom
Conversation
…locationSystem, these were ill-defined for hexagonal. Updated cleanUpPseudoSym.m.
|
Hi @PhilKro Thanks in advance, |
|
Hi Bhupesh, Cheers |
|
Hi @PhilKro again, Error: Have a look here about the pseudosymmetry of chlorite: Best, |
|
please run the newest version of MTEX (develop branch) and tell me if the error still occurs |
|
Hey Bhupesh, can you let me know if this worked for you? I had a limited dataset to test this function on :D Cheers Philipp |
|
Hi Phil, Cheers, |
|
I'm quite certain that you are running into this error because you don't have the newly updated grain2d/merge method. |
FWIW, I previously avoided updating on Mac OS for similar reasons, but the latest version 6.1.1 (I think) installed well for me and without the same magnitude of headaches as previous updates. |
|
Hi @PhilKro |
|
I don't understand why the error crops up. The new grain2d.merge method has 3 output arguments... |
|
Hi @PhilKro |
|
Hey Bhupesh, I just pushed an update to the PR! The To test this out on your machine, you can clone this specific branch directly into a temporary demo folder. Just run this command in your terminal (make sure to replace the path with your actual MTEX directory): git clone -b my-mtex-fix [https://github.com/PhilKro/mtex_twinSysDev.git](https://github.com/PhilKro/mtex_twinSysDev.git) "YOUR\MTEXPATH\pseudoSym_demo"Regarding the initial error you ran into: I did not have any issues with the To verify this, could you do a quick check in MATLAB? Type the following into your command window: edit grain2d.mergePlease make sure that the method that opens is exactly the same as the one currently on the develop branch here: Let me know if it runs for you now! For me the function corrected ~2800 pseudoSymmetry datapoints. I attached a before and after. It does look quite messy still... Before: After: |
|
Hey again Bhupesh, To get better results with the If you aren't getting satisfactory results with that approach, you are more than welcome to check out a much more verbose graph-based clustering function I put together here: I just implemented the multiphase handling into this version as well. Full disclosure: I haven't tested the multiphase logic on it yet, so there are no guarantees it works right out of the box. However, the benefit of this graph-based version is that you can define way more custom parameters and conditions to accurately characterize and isolate the pseudo-symmetry grains. I'd be happy if you want to test it out and tweak it. If you manage to fix or improve anything, please feel free to push your changes back to the repo! |



dislocationSystem:
Previously, the dislocationSystem class properly scaled the Burgers vector lengths for edge dislocations based on the crystal lattice (e.g., 1/3 for hexagonal, 1/2 for cubic). However, this scaling logic was missing for screw dislocations, leaving their Burgers vector lengths ill-defined and different to those of the edge dislcoations in hexagonal lattices.
I updated the constructor in geometry/@dislocationSystem/dislocationSystem.m to apply the same lattice-specific scaling to screw dislocations:
Applied a 1/3 scaling factor for hexagonal lattices.
Applied a 1/2 scaling factor for cubic lattices.
Added a warning fallback for undefined lattice types prompting the user to adjust the length manually.
cleanUpPseudoSym:
Updates cleanUpPseudoSym function to implement arrays of pseudo-misorientation and overhaul to the orientation update logic for better performance on large EBSD maps.
Fixed multi-operator bug: Resolved an out-of-bounds logical indexing error (ori(swap) = ori(swap) * mori) that occurred when passing an array of pseudo-symmetry operators. The function now evaluates all operators (plus the identity) simultaneously and applies the one that minimizes the misorientation distance.
Vectorized pixel updates: Replaced the for loop over individual merged grains. The script now extracts all affected EBSD points (merged_pts) and calculates their pseudo-symmetry rotations in a single, fully vectorized matrix operation.
Added numChanged output: Added a third output argument to return the exact number of pixels that had their orientations modified during the cleanup (important parameter for scientific analysis).
Documentation updates: Added the supported varargin parameters (delta and threshold) to the function header for ease of use.