| 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
img_region_stats.h File Reference

Functions to calculate statistics on image regions. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <ctype.h>`
`#include <math.h>`
`#include <time.h>`
`#include <unistd.h>`
`#include <signal.h>`
`#include "Vector3.h"`

Go to the source code of this file.

## Functions
int | img_stats_within_radii (Bimage *p, double rad_min, double rad_max)
| Calculates the statistics for an image with given radii. More...
int | img_stats_in_box (Bimage *p, int img_num, Vector3< int > start, Vector3< int > end, int type, double &avg, double &std)
| Calculates the statistics for an image within the given box. More...
int | img_stats_in_poly (Bimage *p, int img_num, int nvert, Vector3< float > *poly, double &avg, double &std)
| Calculates the statistics for an image within the given polyhedron. More...
int | img_calculate_masked_statistics (Bimage *p, Bimage *pmask)
| Calculates the statistics for an image for each level in a mask. More...

## Detailed Description

Functions to calculate statistics on image regions.

Author
  Bernard Heymann

Date
  Created: 19990321 Modified: 20140424

Definition in file img_region_stats.h.

## Function Documentation

int img_calculate_masked_statistics | ( | Bimage * | p,
|  | Bimage * | pmask
| ) |  |

Calculates the statistics for an image for each level in a mask.

Parameters

  *p | image.
  *pmask | mask with two or more levels

Returns
  int number of levels.

Definition at line 331 of file img_region_stats.cpp.

int img_stats_in_box | ( | Bimage * | p,
|  | int | img_num,
|  | Vector3< int > | start,
|  | Vector3< int > | end,
|  | int | type,
|  | double & | avg,
|  | double & | std
| ) |  |

Calculates the statistics for an image within the given box.

Parameters

  *p | image.
  img_num | sub-image number.
  start | starting coordinates.
  end | ending coordinates.
  type | type of selection: 1=rectangle, 2=ellipse.
  &avg | return value for the average.
  &std | return value for the standard deviation.

Returns
  int number of values (<0 means failure).

      If a voxel lies within the specified box, it is included in
      the statistical calculations.

Definition at line 121 of file img_region_stats.cpp.

int img_stats_in_poly | ( | Bimage * | p,
|  | int | img_num,
|  | int | nvert,
|  | Vector3< float > * | poly,
|  | double & | avg,
|  | double & | std
| ) |  |

Calculates the statistics for an image within the given polyhedron.

If a voxel lies within the specified polyhedron, it is included in the statistical calculations.

Parameters

  *p | image.
  img_num | sub-image number;
  nvert | number of polygon vertices.
  *poly | array of polygon vertices.
  &avg | return value for the average.
  &std | return value for the standard deviation.

Returns
  int number of values (<0 means failure).

Definition at line 260 of file img_region_stats.cpp.

int img_stats_within_radii | ( | Bimage * | p,
|  | double | rad_min,
|  | double | rad_max
| ) |  |

Calculates the statistics for an image with given radii.

If a voxel lies within the specified radii, it is included in the statistical calculations.

Parameters

  *p | image.
  rad_min | minimum radius (pixel units).
  rad_max | maximum radius (pixel units).

Returns
  int error code (<0 means failure).

Definition at line 29 of file img_region_stats.cpp.