aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.h
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-03 17:37:10 +0100
committerThomas White <taw@physics.org>2017-03-08 16:53:19 +0100
commit61565336125a999790fb4c36219e9c46c5eb30cc (patch)
treea4762229bad75ecf7679ac5f76162b20d7b0cd66 /libcrystfel/src/index.h
parent10c3e04dda4264add6e99cb4763c9dbb31c771c9 (diff)
Allow indexing system to store its own data, independently of indexing methods
Previously, the indexing system passed all the information on to the indexing engines and then forgot about it. That made it difficult to do things like check the indexing solution after prediction refinement, because the target unit cell was unavailable. Now, the indexing system itself can keep some information. Of course, that information includes the private pointers for the indexing engines themselves. I took the opportunity to streamline things a little bit. The caller can now set up the indexing system in one step, without having to separately parse the names of the indexing methods. The caller no longer has to keep track of a separate array of methods, instead just one structure which contains everything.
Diffstat (limited to 'libcrystfel/src/index.h')
-rw-r--r--libcrystfel/src/index.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index e5f7764a..8ce553ae 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -84,7 +84,7 @@
* @INDEXING_USE_LATTICE_TYPE: Use lattice type and centering information to
* guide the indexing process.
* @INDEXING_USE_CELL_PARAMETERS: Use the unit cell parameters to guide the
- * indexingprocess.
+ * indexing process.
* @INDEXING_RETRY: If the indexer doesn't succeed, delete the weakest peaks
* and try again.
* @INDEXING_MULTI: If the indexer succeeds, delete the peaks explained by the
@@ -108,6 +108,8 @@ typedef enum {
INDEXING_DEBUG = 7,
INDEXING_ASDF = 8,
+ INDEXING_ERROR = 255, /* Unrecognised indexing engine */
+
/* Bits at the top of the IndexingMethod are flags which modify the
* behaviour of the indexer. */
INDEXING_CHECK_CELL_COMBINATIONS = 256,
@@ -136,28 +138,28 @@ extern "C" {
* IndexingPrivate:
*
* This is an opaque data structure containing information needed by the
- * indexing method.
+ * indexing system.
**/
-typedef void *IndexingPrivate;
+typedef struct _indexingprivate IndexingPrivate;
-extern IndexingMethod *build_indexer_list(const char *str);
+/* Convert indexing methods to/from text */
extern char *indexer_str(IndexingMethod indm);
+extern IndexingMethod get_indm_from_string(const char *method);
#include "detector.h"
#include "cell.h"
#include "image.h"
-extern IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
- struct detector *det, float *ltl,
- const char *options);
+extern IndexingPrivate *setup_indexing(const char *methods, UnitCell *cell,
+ struct detector *det, float *ltl,
+ int no_refine, const char *options);
-extern void index_pattern(struct image *image,
- IndexingMethod *indms, IndexingPrivate **iprivs);
+extern void index_pattern(struct image *image, IndexingPrivate *ipriv);
-extern void index_pattern_2(struct image *image, IndexingMethod *indms,
- IndexingPrivate **iprivs, int *ping);
+extern void index_pattern_2(struct image *image, IndexingPrivate *ipriv,
+ int *ping);
-extern void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs);
+extern void cleanup_indexing(IndexingPrivate *ipriv);
#ifdef __cplusplus
}