User Tools

Site Tools


Remove Used G-vectors


In the process of grain indexing (usually done with GrainSpotter), you won't index all grains in the first try. Usually, one has to perform several indexing runs. To make life easier (and to cut down calculation time), this script removes all G-vectors which were used already in the previous run. Then you can perform another run with the reduced G-vector file. After that, this process can be repeated until GrainSpotter doesn't index anything anymore.

The downside is that one has to modify the .ini file and the input of this tool before every new run (we are currently working on a script which avoids this). However, it is worth it: Experience says that you can increase the number of indexed grains easily by more than 30 %, simply by repeating the GrainSpotter algorithm. Usually, 5-6 repetitions are enough before GrainSpotter does not find any new grains anymore.

For historical reasons, there are two competing TIMEleSS tools for this task, and timelessClearGVEGrains. timelessClearGVEGrains has been updated recently and has more options.


timelessClearGVEGrains  -h
usage: timelessClearGVEGrains GSFile oldGVE.gve newGVE.gve

Creates a new list of g-vectors, removing g-vectors which have already been
assigned to grains by GrainSpotter This is part of the TIMEleSS project

positional arguments:
  gsfile                Name of GrainSpotter output file (required)
  oldGVE                G-vector file used for indexing (required)
  newGVE                Name of G-vector file to be created (required)

optional arguments:
  -h, --help            show this help message and exit
  -v VERBOSE, --verbose VERBOSE
                        Write out more details about what it does. Default is
                        Default is False
  -s SKIPBOGUS, --skipbogus SKIPBOGUS
                        Skip bogus grains in GrainSpotter output. Default is
                        Default is False

The script is part of the TIMEleSS tools. It should be combined with GrainSpotter and GrainSpotterMerge. -h
usage: -l logfilestem.log -i gve_input.gve -o gve_output.gve

Takes a logfile from GrainSpotter and a G-vector file from ImageD11 as input.
Compares both and creates a new G-vector file with all those G-vectors which
could not be indexed. Now GrainSpotter can be run again with the new G-vector
file. This is part of the TIMEleSS project

optional arguments:
  -h, --help            show this help message and exit
  -l LOGFILE, --logfile LOGFILE
                        File name of the indexing log file (required)
  -i GVE_INPUT, --gve_input GVE_INPUT
                        File name of the input g-vector file (required)
  -o GVE_OUTPUT, --gve_output GVE_OUTPUT
                        Output g-vector file (.gve file)(required)


General workflow

Repeat these steps several times:

  1. Run GrainSpotter
  2. Run the G-vector removal script
  3. Change your .ini file (gvecsfile and outputfile)

You should continue repeating the steps until GrainSpotter doesn't find anything anymore two times in a row. Depending on your dataset, this usually happens in run 5 - 8.


You should start with a G-vector file from ImageD11. Let's call it gvectors.gve.

Run GrainSpotter (step 1) and then the G-vector removal script (step 2). The output will then be a new G-vector file. After that, you may have these files:

  • gvectors.gve (.gve file from ImageD11)
  • gvectors_1.gve (.gve file from
  • logfile.log (.log file from GrainSpotter)

Next, you have to change your .ini file (step 3) so that it is referring to gvectors_1.gve instead of gvectors.gve. Also, change the output file so it does not overwrite the existing .log file.

Then, run GrainSpotter again (step 1). You will see, it will be faster this time but still find some grains.

Now, after the second GrainSpotter run, you may have a file collection like this:

  • gvectors.gve (.gve file from ImageD11)
  • gvectors_1.gve (.gve file from the first G-vector removal)
  • logfile.log (.log file from the first GrainSpotter) run
  • logfile_1.log (.log file from the second GrainSpotter) run

Running again (step 2) will produce you another G-vector file (Don't forget to change the input logfile and the output G-vector file in the options!). After that, you can change your .ini file again, run GrainSpotter and so on and so on…

Merging the output

Use GrainSpotterMerge to merge the produced .log files.

processing/remove-used-gve.txt · Last modified: 2020/11/10 08:56 by smerkel