Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

box_filter.c File Reference

#include <volume_io/internal_volume_io.h>
#include <bicpl/vols.h>
#include <bicpl/numerical.h>

Include dependency graph for box_filter.c:

Include dependency graph

Go to the source code of this file.

Defines

#define DEBUG
#define INITIALIZE_SAMPLE(half_width, receding, advancing, left_weight, right_weight)
#define GET_FIRST_SAMPLE(advancing, left_weight, size, data, sample)
#define GET_NEXT_SAMPLE(receding, advancing, left_weight, right_weight, size, data, sample)

Functions

public Volume create_box_filtered_volume (Volume volume, nc_type nc_data_type, BOOLEAN sign_flag, Real real_min_value, Real real_max_value, Real x_width, Real y_width, Real z_width)


Define Documentation

#define DEBUG
 

Definition at line 23 of file box_filter.c.

#define GET_FIRST_SAMPLE advancing,
left_weight,
size,
data,
sample   ) 
 

Value:

{ \ int _I; \ \ (sample) = 0.0; \ for_inclusive( _I, 0, MIN( (size)-1, (advancing)-1) ) \ (sample) += (data); \ \ if( (advancing) < (size) ) \ (sample) += (data) * (left_weight); \ }

Definition at line 53 of file box_filter.c.

Referenced by create_box_filtered_volume().

#define GET_NEXT_SAMPLE receding,
advancing,
left_weight,
right_weight,
size,
data,
sample   ) 
 

Value:

{ \ int _I; \ \ if( (advancing) < (size) ) \ { \ _I = (advancing); \ (sample) += (data) * (right_weight); \ } \ if( (advancing) < (size)-1 ) \ { \ _I = (advancing) + 1; \ (sample) += (data) * (left_weight); \ } \ \ if( (receding) >= 0 ) \ { \ _I = (receding); \ (sample) -= (data) * (left_weight); \ } \ if( (receding) >= -1 ) \ { \ _I = (receding) + 1; \ (sample) -= (data) * (right_weight); \ } \ }

Definition at line 65 of file box_filter.c.

Referenced by create_box_filtered_volume().

#define INITIALIZE_SAMPLE half_width,
receding,
advancing,
left_weight,
right_weight   ) 
 

Value:

{ \ Real min_pos, max_pos; \ \ min_pos = -(half_width); \ max_pos = (half_width); \ \ (receding) = ROUND( min_pos ); \ (advancing) = ROUND( max_pos ); \ \ (left_weight) = (Real) (receding) + 0.5 - min_pos; \ if( (left_weight) >= 1.0 ) \ --(advancing); \ (right_weight) = 1.0 - (left_weight); \ }

Definition at line 37 of file box_filter.c.

Referenced by create_box_filtered_volume().


Function Documentation

public Volume create_box_filtered_volume Volume  volume,
nc_type  nc_data_type,
BOOLEAN  sign_flag,
Real  real_min_value,
Real  real_max_value,
Real  x_width,
Real  y_width,
Real  z_width
 

Definition at line 113 of file box_filter.c.

References FALSE, GET_FIRST_SAMPLE, GET_NEXT_SAMPLE, INITIALIZE_SAMPLE, numerically_close(), and y.


Generated on Wed Jul 28 09:10:59 2004 for BICPL by doxygen 1.3.7