From aa442d971b02f3ca2c8ae0dae416cf65ff2fdd65 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 14 Aug 2014 14:13:19 +0200 Subject: Apply overlap mask to BM_IG pixels as well ... because everything except BM_BH is used for centering. --- libcrystfel/src/integration.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c index ec8bf05d..357ab7af 100644 --- a/libcrystfel/src/integration.c +++ b/libcrystfel/src/integration.c @@ -875,16 +875,27 @@ static int check_box(struct intcontext *ic, struct peak_box *bx, int *sat) /* If this is a background pixel, it shouldn't contain any * pixels which are in the peak region of ANY reflection */ - if ( (ic->masks != NULL) && (bx->bm[p+ic->w*q] == BM_BG) - && (ic->masks[bx->pn][fs + bx->p->w*ss] > 0) ) { - bx->bm[p+ic->w*q] = BM_BH; - } + if ( ic->masks != NULL ) { - /* If this is a peak pixel, it shouldn't contain any pixels - * which are in the peak region of more than one reflection */ - if ( (ic->masks != NULL) && (bx->bm[p+ic->w*q] == BM_PK) - && (ic->masks[bx->pn][fs + bx->p->w*ss] > 1) ) { - bx->bm[p+ic->w*q] = BM_BH; + switch ( bx->bm[p+ic->w*q] ) { + + case BM_BG: + case BM_IG: + if ( ic->masks[bx->pn][fs + bx->p->w*ss] > 0 ) { + bx->bm[p+ic->w*q] = BM_BH; + } + break; + + case BM_PK: + if ( ic->masks[bx->pn][fs + bx->p->w*ss] > 1 ) { + bx->bm[p+ic->w*q] = BM_BH; + } + break; + + case BM_BH: + break; + + } } if ( (bx->bm[p+ic->w*q] != BM_IG) -- cgit v1.2.3