Copyright 2014-2017, All rights reserved
Technical University of Denmark, Kongens Lyngby, Denmark
Code written by A. Cereser and S. Schmidt
All software was developed analyzing software collected at J-PARC, beamline ID06 (SENJU).
TiGraMa can analyze data collected using the two ToF 3DND methodologies:
Methodology 1, with which data are collected by an imaging detector with high spatial and temporal resolution, mounted in transmission
Methodology 2, with which data are collected by both an imaging detector mounted in transmission and by diffraction detector banks
In the current version, only Methodology 1 is supported
All TiGraMa scripts were developed during proof-of-principle data analyses. As such, the code is not optimized for speed. To speed up calculations, it is recommended to run the TiGraMa scripts on a high performance computer.
The reconstruction steps are described in details in 2. The scripts were tested for the Malab versions R2015a to R2017a.
Grain shape reconstruction
Preprocess the collected frames. The aim is to reduce the noise and enhance the signal.
The code to perform the overlap correction was originally developed by A. Tremsin for the Windows platform, and has been ported to Unix by P.M. Larsen. To run it on a Mac, you need to
On a terminal, launch
brew install cfitsio
Overlap_correction/linux_correctionfolder, compile the code using
make clean && make
./fits_correction source_folder/example_file.fits destination_folder
To run the code on a Linux machine, change the path to
Makefileand in the
0.2. Calculate, from the open beam collected before and after the measurements, the open beam for the considered projection. Script:
0.3. Divide the collected dataset by the corresponding open beam. Script:
OB_correction.m, which calls
0.4. Normalise using a rolling median. Script:
Correction_background.m, which calls
Step 0.1 should run on a laptop (with data on an external drive) before uploading data to a server, where the more computationally consuming steps (0.2 to 0.4) run using Matlab.
Filter the frames using a signal enhancement filter, such as Murofi 1 (not included in TiGraMa)
Isolate the extinction spots with the selected area. Script:
2_Blobs_detector.m, which calls
The next steps are computationally intensive. You should run them on an HPC machine
Divide the extinction spots by projection using
3_Divide_blobs_proj.shor something similar
For each projection, calculate the similarity between different extinction spots
4_Blobs_similarity.m, which calls
Output: files in
Results_blobs_comp/. The files in
Map_blobs/list the properties of the blobs and the files in
List_minima/list the parameters used to measure how similar two blobs are
Using the angular parameters in
List_minima/combine similar extinction spots using
5_Track_lambda.m, which calls
Lambda_IM_before_HT.txt, listing the properties of the combined images, and the combined images, stored in
Comb_blobs/. Approximately, the number of extinction spots per projection should be the same
Separate the combined extinction spots in folders (one per projection) using
Export the information relative to the spots in
Plot the distribution of extinction spots per projection. Script:
Clean the set of combined extinction spots by considering their centre of mass. This is done by considering a series of cylinders, and for each cylinder combining the spots with centre of mass within it that have similar area, with condition A_min > 0.5*A_max. Additional operations are performed to avoid repetitions
9_IM_comb_2.m, which calls
Considering a rolling interval, group the extinction spots relative to the same grain using the Hough transform.
At first, look at the point distribution using
10_Funct_HT_sec_Murofi_final.mand tune the parameters. Then comment the figure option and run for all intervals
- Clean the results of the Hough transform, grouping the centre of mass values , to avoid repetitions. In this way, for a given grain we determine its centre of mass and group the corresponding combined extinction spots.
Point_grouping_to_3D.m, which calls
Reconstruct the 3D shape of the grains. Script:
Visualize the reconstructed volume using Paraview. For a quick introduction to how to visualize volumes using Paraview, see Sec. 1.4.4 of the Recon3D manual. Scripts:
13_Slides_to_vtk.m. If you are using the matryoshka doll approach (multiple grain reconstructions), use
For all reconstructed grains, get (omega, lambda) values of the corresponding extinction spots. Scripts:
14_OL_curves_final.m, which calls
14_Unify_OL_values.m. Final output:
Calculate the centre of mass of the grains. Script:
15_HT_orientation_sections.m, which calls
Save the properties of the isolated extinction spots images. Script:
Clean the (omega, lambda) list, keeping only the values relative to extinction spots which contain the projection of the centre of mass of the corresponding grain. Code:
Calculate the grain orientation from the distribution of (omega, lambda) values. Script:
Feel free to download TiGraMa and use it to analyze your dataset. If you spot a bug, send an email to email@example.com or flag it here on GitHub.
How to quote the code
To cite TiGraMa, please refer to the article presenting ToF 3DND1.
1: A. Cereser, M. Strobl, S. A. Hall, A. Steuwer, R. Kiyanagi, A. S. Tremsin, E. Bergbäck Knudsen, T. Shinohara, P. K. Willendrup, A. Bastos da Silva Fanta, S. Iyengar, P. M. Larsen, T. Hanashima, T. Moyoshi, P. M. Kadletz, P. Krooß, T. Niendorf, M. Sales, W. W. Schmahl & S. Schmidt (2017). “Time-of-Flight Three Dimensional Neutron Diffraction in Transmission Mode for Mapping Crystal Grain Structures.” Scientific Reports 7 (1): 9561, 9561. doi:10.1038/s41598-017-09717-w.
2: A. Cereser, S. A. Hall, A. Steuwer, M. Strobl & S. Schmidt (2016). Time-of-flight 3D Neutron Diffraction for Multigrain Crystallography. Department of Physics, Technical University of Denmark.
This software is covered by the GNU General Public License.