| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions | Variables
img_edit.cpp File Reference

Library routines used for editing image contents. More...

`#include "img_edit.h"`
`#include "Complex.h"`
`#include "Matrix.h"`
`#include "matrix_linear.h"`
`#include "utilities.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 > *tet, double fill, int fill_type)
| Extracts a tetrahedral part of the image. More...

## Variables
int | verbose

## Detailed Description

Library routines used for editing image contents.

Author
  Bernard Heymann

Date
  Created: 19980520
  Modified: 20150717

Definition in file img_edit.cpp.

## 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

  *p | image.
  min | minimum of range.
  max | maximum of range.
  fill | fill value.
  fill_type | FILL_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

  *p | image.
  *tet | four 3-value vectors defining the tetrahedron.
  fill | fill value.
  fill_type | FILL_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

  *p | the 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.

## Variable Documentation

int verbose