diff options
-rw-r--r-- | libcrystfel/src/image.c | 13 | ||||
-rw-r--r-- | libcrystfel/src/image.h | 3 | ||||
-rw-r--r-- | libcrystfel/src/peaks.c | 5 | ||||
-rw-r--r-- | src/dw-hdfsee.c | 2 |
4 files changed, 18 insertions, 5 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); diff --git a/libcrystfel/src/image.h b/libcrystfel/src/image.h index d8ffa0ff..f19a7427 100644 --- a/libcrystfel/src/image.h +++ b/libcrystfel/src/image.h @@ -196,7 +196,8 @@ extern void image_remove_feature(ImageFeatureList *flist, int idx); extern struct imagefeature *image_feature_closest(ImageFeatureList *flist, double fs, double ss, - double *d, int *idx); + double *d, int *idx, + struct detector *det); extern int image_feature_count(ImageFeatureList *flist); extern struct imagefeature *image_get_feature(ImageFeatureList *flist, int idx); diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index 47bec10c..a38e4d4d 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -526,7 +526,8 @@ static void search_peaks_in_panel(struct image *image, float threshold, } /* Check for a nearby feature */ - image_feature_closest(image->features, f_fs, f_ss, &d, &idx); + image_feature_closest(image->features, f_fs, f_ss, &d, &idx, + image->det); if ( d < 2.0*ir_inn ) { nrej_pro++; continue; @@ -727,7 +728,7 @@ void validate_peaks(struct image *image, double min_snr, } /* Check for a nearby feature */ - image_feature_closest(flist, f_fs, f_ss, &d, &idx); + image_feature_closest(flist, f_fs, f_ss, &d, &idx, image->det); if ( d < 2.0*ir_inn ) { n_prx++; continue; diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index f71e865c..058b05ff 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -1529,7 +1529,7 @@ static void numbers_update(DisplayWindow *dw) char text[64]; f = image_feature_closest(dw->image->features, ffs, fss, - &dmin, &imin); + &dmin, &imin, dw->image->det); if ( dmin < dw->ring_radius*dw->binning ) { strncpy(text, f->name, 32); } else { |