VIA - Volumetric Image Analysis
Functions
ShapeMoments.c File Reference

Functions

void VolumeCentroid (Volume v, double mean[3])
 Compute center of gravity of a volume.
double VolumeMoment (Volume v, double mean[3], int m0, int m1, int m2)
 Compute central moments of a volume.
void VBinCentroid (VImage src, double mean[3])
 Compute central moments of a binary raster image.
double VBinMoment (VImage src, double mean[3], int m0, int m1, int m2)
 Compute central moments of a binary raster image.
long VolumeSize (Volume v)
 compute volume size, output the number of voxels of a single volume
long VBinSize (VImage src)
 count number of foreground voxels.
float VolumeDir (Volume vol, float *e, float x[3])
 computer principal direction of a volume from its interia matrix
void VolumeEigen (Volume vol, gsl_vector *eval, gsl_matrix *evec)
 computer principal directions of a volume from its interia matrix

Detailed Description

Compute 3D shape features and moments.

The following functions compute several shape features, including central moments, center of gravity, and volume size.

Author:
Gabriele Lohmann, MPI-CBS

Function Documentation

void VolumeCentroid ( Volume  v,
double  mean[3] 
)

Compute center of gravity of a volume.

Parameters
vinput volume.
*meanoutput array. The center of gravity is returned in mean[0],mean[1],mean[2]. Sufficient memory must have been allocated for <mean> prior to the call.
double VolumeMoment ( Volume  v,
double  mean[3],
int  m0,
int  m1,
int  m2 
)

Compute central moments of a volume.

Parameters
vinput volume
*meaninput array containing the center of gravity as mean[0],mean[1],mean[2] (slice,row,column). If mean is NULL, the center of gravity is taken to be (0,0,0).
m0first index of moment
m1second index of moment
m2third index of moment
void VBinCentroid ( VImage  src,
double  mean[3] 
)

Compute central moments of a binary raster image.

Parameters
srcinput image (bit repn)
*meanoutput array. The center of gravity is returned in mean[0],mean[1],mean[2]. Sufficient memory must have been allocated for <mean> prior to the call.
double VBinMoment ( VImage  src,
double  mean[3],
int  m0,
int  m1,
int  m2 
)

Compute central moments of a binary raster image.

Parameters
srcinput image (bit repn)
*meaninput array containing the center of gravity as mean[0],mean[1],mean[2] (slice,row,column). If mean is NULL, the center of gravity is taken to be (0,0,0);
m0first index of moment
m1second index of moment
m2third index of moment
long VolumeSize ( Volume  v)

compute volume size, output the number of voxels of a single volume

Parameters
va single volume
long VBinSize ( VImage  src)

count number of foreground voxels.

Parameters
srcinput image (bit repn)
float VolumeDir ( Volume  vol,
float *  e,
float  x[3] 
)

computer principal direction of a volume from its interia matrix

Parameters
volinput volume
eoutput largest eigenvalue
xoutput first eigenvector
void VolumeEigen ( Volume  vol,
gsl_vector *  eval,
gsl_matrix *  evec 
)

computer principal directions of a volume from its interia matrix

Parameters
volinput volume
evaloutput eigenvalues
evecoutput matrix of eigenvectors (columns)