aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src/index.h')
-rw-r--r--libcrystfel/src/index.h73
1 files changed, 43 insertions, 30 deletions
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index 2df7a311..a47ee9a0 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -3,13 +3,13 @@
*
* Perform indexing (somehow)
*
- * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
- * a research centre of the Helmholtz Association.
+ * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
* Copyright © 2012 Richard Kirian
* Copyright © 2012 Lorenzo Galli
*
* Authors:
- * 2010-2012 Thomas White <taw@physics.org>
+ * 2010-2013 Thomas White <taw@physics.org>
* 2010 Richard Kirian
* 2012 Lorenzo Galli
*
@@ -38,11 +38,22 @@
#endif
+#include "beam-parameters.h"
#include "cell.h"
#include "image.h"
#include "detector.h"
+#define INDEXING_DEFAULTS_DIRAX (INDEXING_DIRAX | INDEXING_CHECK_PEAKS \
+ | INDEXING_CHECK_CELL_COMBINATIONS)
+
+#define INDEXING_DEFAULTS_MOSFLM (INDEXING_MOSFLM | INDEXING_CHECK_PEAKS \
+ | INDEXING_CHECK_CELL_COMBINATIONS \
+ | INDEXING_USE_LATTICE_TYPE)
+
+#define INDEXING_DEFAULTS_REAX (INDEXING_REAX | INDEXING_USE_LATTICE_TYPE \
+ | INDEXING_CHECK_PEAKS)
+
/**
* IndexingMethod:
* @INDEXING_NONE: No indexing to be performed
@@ -53,21 +64,28 @@
* An enumeration of all the available indexing methods.
**/
typedef enum {
- INDEXING_NONE,
- INDEXING_DIRAX,
- INDEXING_MOSFLM,
- INDEXING_GRAINSPOTTER,
- INDEXING_REAX,
-} IndexingMethod;
-/* Cell reduction methods */
-enum {
- CELLR_NONE,
- CELLR_REDUCE,
- CELLR_COMPARE,
- CELLR_COMPARE_AB,
-};
+ INDEXING_NONE = 0,
+
+ /* The core indexing methods themselves */
+ INDEXING_DIRAX = 1,
+ INDEXING_MOSFLM = 2,
+ INDEXING_REAX = 3,
+ INDEXING_GRAINSPOTTER = 4,
+
+ /* Bits at the top of the IndexingMethod are flags which modify the
+ * behaviour of the indexer, at the moment just by adding checks. */
+ INDEXING_CHECK_CELL_COMBINATIONS = 256,
+ INDEXING_CHECK_CELL_AXES = 512,
+ INDEXING_CHECK_PEAKS = 1024,
+ INDEXING_USE_LATTICE_TYPE = 2048,
+
+} IndexingMethod;
+
+/* This defines the bits in "IndexingMethod" which are used to represent the
+ * core of the indexing method */
+#define INDEXING_METHOD_MASK (0xff)
/**
@@ -76,24 +94,19 @@ enum {
* This is an opaque data structure containing information needed by the
* indexing method.
**/
-typedef struct _indexingprivate IndexingPrivate;
+typedef void *IndexingPrivate;
-extern IndexingPrivate *indexing_private(IndexingMethod indm);
+extern IndexingMethod *build_indexer_list(const char *str);
+extern char *indexer_str(IndexingMethod indm);
extern IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
- const char *filename,
- struct detector *det,
- double nominal_photon_energy);
-
-extern void map_all_peaks(struct image *image);
-
-extern void index_pattern(struct image *image, UnitCell *cell,
- IndexingMethod *indm, int cellr, int verbose,
- IndexingPrivate **priv, int config_insane,
- const float *ltl);
+ const char *filename,
+ struct detector *det,
+ struct beam_params *beam, float *ltl);
-extern void cleanup_indexing(IndexingPrivate **priv);
+extern void index_pattern(struct image *image,
+ IndexingMethod *indms, IndexingPrivate **iprivs);
-extern IndexingMethod *build_indexer_list(const char *str, int *need_cell);
+extern void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs);
#endif /* INDEX_H */