diff options
author | Valerio Mariani <valerio.mariani@desy.de> | 2014-07-23 13:26:30 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2014-07-24 13:26:34 +0200 |
commit | 7141d24cce2edfcafae40dce6213c108798e9dc5 (patch) | |
tree | 9c8643fa25762c21f4c4a43651282dd45c8d1984 /libcrystfel/src/image.c | |
parent | 282dee197bce06f9d37655c1775f53f6646e2e5d (diff) |
Fixes closest feature detection bug
Diffstat (limited to 'libcrystfel/src/image.c')
-rw-r--r-- | libcrystfel/src/image.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index f4a3384f..6a0495b1 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -106,15 +106,26 @@ void image_feature_list_free(ImageFeatureList *flist) struct imagefeature *image_feature_closest(ImageFeatureList *flist, double fs, double ss, - double *d, int *idx) + double *d, int *idx, + struct detector *det) { int i; double dmin = +HUGE_VAL; int closest = 0; + struct panel *p1; + + p1 = find_panel(det, fs, ss); for ( i=0; i<flist->n_features; i++ ) { double ds; + struct panel *p2; + + p2 = find_panel(det, flist->features[i].fs, flist->features[i].ss); + + if ( p1 != p2 ) { + continue; + } ds = distance(flist->features[i].fs, flist->features[i].ss, fs, ss); |