aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/filters.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libcrystfel/src/filters.c b/libcrystfel/src/filters.c
index 5f6a0b2d..4bc41f3d 100644
--- a/libcrystfel/src/filters.c
+++ b/libcrystfel/src/filters.c
@@ -55,19 +55,15 @@ static void filter_noise_in_panel(float *data, int width, int height)
* but this filter is so horrible it's unlikely to matter. */
if ( (x==0) || (x==width-1)
|| (y==0) || (y==height-1) ) {
- if ( val < 0 ) val = 0;
+ if ( val < 0 ) {
+ data[x+width*y] = 0.0;
+ }
continue;
}
for ( dy=-1; dy<=+1; dy++ ) {
for ( dx=-1; dx<=+1; dx++ ) {
-
- int val2;
-
- val2 = data[(x+dx)+width*(y+dy)];
-
- if ( val2 < 0 ) val = 0;
-
+ if ( data[(x+dx)+width*(y+dy)] ) val = 0.0;
}
}