From f62745115e6a66531bef56f8e1af4b575bdc457f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 20 Oct 2012 19:40:02 -0700 Subject: integrate_peak(): Restore check for bad region This fixes a regression introduced by ad2c84d0, predating the initial CrystFEL release. --- libcrystfel/src/peaks.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index b0b48c2e..4ae4bb30 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -264,6 +264,11 @@ static int integrate_peak(struct image *image, int cfs, int css, if ( (p_cfs+dfs >= p_w) || (p_css+dss >= p_h) || (p_cfs+dfs < 0 ) || (p_css+dss < 0) ) return 1; + /* Wandered into a bad region? */ + if ( in_bad_region(image->det, p_cfs+dfs, p_css+dss) ) { + return 1; + } + /* Check if there is a peak in the background region */ if ( (bgPkMask != NULL) && bgPkMask[(p_cfs+dfs) + p_w*(p_css+dss)] ) continue; @@ -318,6 +323,11 @@ static int integrate_peak(struct image *image, int cfs, int css, if ( (p_cfs+dfs >= p_w) || (p_css+dss >= p_h) || (p_cfs+dfs < 0 ) || (p_css+dss < 0) ) return 1; + /* Wandered into a bad region? */ + if ( in_bad_region(image->det, p_cfs+dfs, p_css+dss) ) { + return 1; + } + idx = dfs+cfs+image->width*(dss+css); /* Veto this peak if we tried to integrate in a bad region */ -- cgit v1.2.3