Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_edit.h File Reference

Header file for functions for editing image contents. More...

#include "rwimg.h"

Go to the source code of this file.

Functions

int img_delete_range (Bimage *p, double min, double max, double fill, int fill_type)
 Replaces values in a given range with the fill value. More...
 
int img_gradient_correction (Bimage *p)
 Calculates and corrects for a linear gradient across an image. More...
 
int img_extract_tetrahedron (Bimage *p, Vector3< float > *vec, double fill, int fill_type)
 Extracts a tetrahedral part of the image. More...
 

Detailed Description

Header file for functions for editing image contents.

Author
Bernard Heymann
Date
Created: 19980520
Modified: 20150717

Definition in file img_edit.h.

Function Documentation

int img_delete_range ( Bimage *  p,
double  min,
double  max,
double  fill,
int  fill_type 
)

Replaces values in a given range with the fill value.

Parameters
*pimage.
minminimum of range.
maxmaximum of range.
fillfill value.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
Returns
int number of values changed.
All voxels within a given range are set to a given fill value.
The new data replaces the old data.

Definition at line 31 of file img_edit.cpp.

int img_extract_tetrahedron ( Bimage *  p,
Vector3< float > *  tet,
double  fill,
int  fill_type 
)

Extracts a tetrahedral part of the image.

Parameters
*pimage.
*tetfour 3-value vectors defining the tetrahedron.
fillfill value.
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER.
Returns
int 0.
All voxels outside a tetrahedron defined by four points or vectors 
are set to a given fill value.
The new data replaces the old data.

Definition at line 151 of file img_edit.cpp.

int img_gradient_correction ( Bimage *  p)

Calculates and corrects for a linear gradient across an image.

Parameters
*pthe image.
Returns
int 0.
The linear gradient across an image is calculated as:
    density(x,y,z) = b0 + b1*x + b2*y + b3*z
The image is converted to floating point and corrected for the gradient.

Definition at line 69 of file img_edit.cpp.