Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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
*pimage.
*pmaskmask 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
*pimage.
img_numsub-image number.
startstarting coordinates.
endending coordinates.
typetype of selection: 1=rectangle, 2=ellipse.
&avgreturn value for the average.
&stdreturn 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
*pimage.
img_numsub-image number;
nvertnumber of polygon vertices.
*polyarray of polygon vertices.
&avgreturn value for the average.
&stdreturn 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
*pimage.
rad_minminimum radius (pixel units).
rad_maxmaximum radius (pixel units).
Returns
int error code (<0 means failure).

Definition at line 29 of file img_region_stats.cpp.