====== Remove Used G-vectors ====== ===== Description ===== In the [[processing:indexing_with_grainspotter|process of grain indexing]] (usually done with [[software:grainspotter|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, ''timelessRemoveUsedGVE.py'' and ''timelessClearGVEGrains''. ''timelessClearGVEGrains'' has been updated recently and has more options. ==== timelessClearGVEGrains ==== 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 http://timeless.texture.rocks 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 ==== timelessRemoveUsedGVE.py ==== The script ''timelessRemoveUsedGVE.py'' is part of the [[software:timelesstools|TIMEleSS tools]]. It should be combined with [[software:grainspotter|GrainSpotter]] and [[processing:grainspotter-merge|GrainSpotterMerge]]. timelessRemoveUsedGVE.py -h usage: timelessRemoveUsedGVE.py -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 http://timeless.texture.rocks 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) ===== Usage ===== ==== General workflow ==== Repeat these steps several times: - Run GrainSpotter - Run the G-vector removal script - 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. ==== Example ==== 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 [[software:imaged11|ImageD11]]) * **gvectors_1.gve** (//.gve// file from timelessRemoveUsedGVE.py) * **logfile.log** (//.log// file from [[software:grainspotter|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 [[software:imaged11|ImageD11]]) * **gvectors_1.gve** (//.gve// file from the first G-vector removal) * **logfile.log** (//.log// file from the first [[software:grainspotter|GrainSpotter]]) run * **logfile_1.log** (//.log// file from the second [[software:grainspotter|GrainSpotter]]) run Running ''timelessRemoveUsedGVE.py'' 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 [[processing:grainspotter-merge|GrainSpotterMerge]] to merge the produced //.log// files.