diff options
author | Thomas White <taw@physics.org> | 2021-09-07 16:26:37 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-09-07 16:26:37 +0200 |
commit | 5692430eac2d781f10cd8756045326bb84e4aadb (patch) | |
tree | cb86f3d1a95789676377bc1c4d6fc87831fe9047 /libcrystfel/src | |
parent | 3f025979f473bb70f0cabc149ece98fddb5d1d73 (diff) |
filter_noise_in_panel: Fix panel edge behaviour
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/filters.c | 12 |
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; } } |