Classes | Defines | Functions | Variables

tools/gtgen_common.cc File Reference

#include <cmath>
#include <i3d/image3d.h>
#include <i3d/regions.h>
#include <i3d/basic.h>
#include "ofRegistration.h"
#include "ofImageTransformation.h"
#include "ofImageStatistic.h"
#include <i3d/LevelSet.h>
#include <i3d/neighbours.h>
#include <i3d/morphology.h>
#include <i3d/DistanceTransform.h>
#include "ofSeparableConvolution.h"
#include <sys/time.h>
#include <ctype.h>
#include <fstream>
#include <iomanip>
#include <list>
#include "gtgen.h"
#include "random.cc"

Classes

struct  V

Defines

#define FILTER_RADIUS   4

Functions

template<class IT , class OT >
void CartesianToPolar (IT x, IT y, OT &r, OT &phi)
template<class IT , class OT >
void PolarToCartesian (IT r, IT phi, OT &x, OT &y)
template<class T >
void DoRotation (Image3d< T > &XI, Image3d< T > &YI, int xc, int yc, T rangle)
template<class T >
void DoRotationPseudo3d (Image3d< T > &XI, Image3d< T > &YI, int xc, int yc, T rangle)
template<class T >
void DoTranslation (Image3d< T > &XI, Image3d< T > &YI, T xc, T yc)
template<class T >
void DoTranslation3d (Image3d< T > &XI, Image3d< T > &YI, Image3d< T > &ZI, T xc, T yc, T zc)
template<class T >
void ComputeSimpleGT (Image3d< T > &XI, Image3d< T > &YI, int xc, int yc, T ra, T xt, T yt)
template<class T >
void ComputeSimpleGT3d (Image3d< T > &XI, Image3d< T > &YI, Image3d< T > &ZI, int xc, int yc, T ra, T xt, T yt, T zt)
template<class FT >
int AddFlowField (Image3d< FT > &fXI, Image3d< FT > &fYI, Image3d< FT > &fZI, Image3d< FT > const &sXI, Image3d< FT > const &sYI, Image3d< FT > const &sZI)
template<class FT >
int AddFlowField (Image3d< FT > &fXI, Image3d< FT > &fYI, Image3d< FT > &fZI, const FT sXI, const FT sYI, const FT sZI)
template<class FT >
int ConcatenateFlowField (Image3d< FT > &fXI, Image3d< FT > &fYI, Image3d< FT > &fZI, Image3d< FT > &sXI, Image3d< FT > &sYI, Image3d< FT > &sZI)
template<class IT , class MT >
int FindPossibleMovements (LabeledImage3d< size_t, IT > const &sub, const size_t label, Image3d< MT > const &mask, Image3d< MT > &movs, const int distance, const int file_no)
float VectorsAngle (const float x1, const float y1, const float z1, const float x2, const float y2, const float z2)
float AngleVariance (const int level)
int GetLevel (const float x, const float y, const float z)
template<class MT >
char DetectCollision (struct V const &shift, list< struct V > const &obj, Image3d< MT > const &mask)
template<class IT >
void ExportShiftList (list< struct V > const &s, const int dim_x, const int dim_y, const int dim_z, Image3d< IT > &img, const IT val=200)
template<class IT , class MT >
int FindPossibleMovements (Image3d< IT > const &sub, const IT label, const VOI< PIXELS > *voi, Image3d< MT > const &mask, Image3d< MT > &movs, const int distance, const int file_no)
template<class MT >
void PossibleMovementsInvolveDistance (Image3d< MT > &movs)
template<class MT >
void PossibleMovementsInvolveDirection (Image3d< MT > &movs, const float vx, const float vy, const float vz)
template<class MT >
int SelectPossibleMovementVector (Image3d< MT > const &movs, float &rx, float &ry, float &rz, const char equal)
template<class FT >
int MoveVOI (valarray< Image3d< FT > * > const &res, const int SeqLength, VOI< i3d::PIXELS > const &inVOI, VOI< i3d::PIXELS > &outVOI)
template<class MT , class FT >
int CreateSeparateFlowFields (Image3d< MT > const &mask, Image3d< MT > const &movs_mask, valarray< Image3d< FT > * > const &res, const unsigned int SeqLength, const unsigned int Sigma, vector< Image3d< MT > * > &fg_masks, vector< Image3d< FT > * > &X_FF, vector< Image3d< FT > * > &Y_FF, vector< Image3d< FT > * > &Z_FF, int &NumberOfComponents)
void ShowLocalPaths (vector< Image3d< GRAY8 > * > const &fg_masks, map< size_t, int > &thresholds, const GRAY8 val, Image3d< GRAY8 > const &movs_mask, Image3d< GRAY8 > &debug_image)
void LocalFFsDebug (vector< Image3d< GRAY8 > * > const &fg_masks, vector< Image3d< float > * > const &X_FF, vector< Image3d< float > * > const &Y_FF, vector< Image3d< float > * > const &Z_FF, const char *basename, const int SeqNo)
template<class T >
void EnlargeMask (Image3d< T > const &in, Image3d< T > &out, int count)
template<class VOXEL >
int EstimateThreshold (Image3d< VOXEL > const &img, const int size)
void FloatToGray8Threshold (const Image3d< float > &fimg, Image3d< GRAY8 > &gimg, float thres, const GRAY8 gmin, const GRAY8 gmax)
template<class T >
void ApplyLODGaussianBlur (Image3d< T > *XI, Image3d< T > *YI, Image3d< T > *ZI, T sigma)
template<class MT >
float SumUpImage (Image3d< MT > const &i)
template<class MT >
void EnhanceImage (Image3d< MT > &i)
template<class T , class MT >
double MeanFromCellBackground (Image3d< T > &input, Image3d< MT > &mask, Image3d< MT > &Mask, int slice)
template<class T >
GenerateMoreBackground (Image3d< T > &input, Image3d< T > &mask, Image3d< T > &Mask, size_t slice, char init)
template<class T >
GenerateMoreBackground_nonPerSlices (Image3d< T > &input, Image3d< T > &mask, Image3d< T > &Mask, char init)
template<class IN , class OUT >
void FillInHoles (Image3d< IN > &input, Image3d< OUT > &out, Image3d< IN > &mask, OUT bg_value)
template<class IN , class OUT >
void FillInCell (Image3d< IN > &input, Image3d< OUT > &out, Image3d< IN > &mask, Image3d< IN > &Mask)
template<class IN , class OUT , class MT >
void ExtractComponents (Image3d< IN > &input, Image3d< OUT > &out, Image3d< MT > &mask)
template<class IN , class OUT , class MT >
void InsertComponents (Image3d< IN > &input, Image3d< OUT > &out, Image3d< MT > &mask, float alter)
template<class IN , class OUT , class MT >
void InsertComponents_nonInterleaved (Image3d< IN > &input, Image3d< OUT > &out, Image3d< MT > &mask, float alter)
template<class MT , class VT >
void ApplyMask (Image3d< MT > *Mask, Image3d< VT > *XI, Image3d< VT > *YI, Image3d< VT > *ZI, VT val)
template<class VOXEL >
void SaveResults (char *FName, Image3d< VOXEL > *XI, Image3d< VOXEL > *YI, Image3d< VOXEL > *ZI)
void ShowStats (Image3d< float > &orig, Image3d< float > &created, Image3d< GRAY8 > &Mask)
template void DoTranslation (Image3d< float > &XI, Image3d< float > &YI, float xc, float yc)
template void DoTranslation3d (Image3d< float > &XI, Image3d< float > &YI, Image3d< float > &ZI, float xc, float yc, float zc)
template void ComputeSimpleGT (Image3d< float > &XI, Image3d< float > &YI, int xc, int yc, float ra, float xt, float yt)
template void ComputeSimpleGT3d (Image3d< float > &XI, Image3d< float > &YI, Image3d< float > &ZI, int xc, int yc, float ra, float xt, float yt, float zt)
template int AddFlowField (Image3d< float > &fXI, Image3d< float > &fYI, Image3d< float > &fZI, Image3d< float > const &sXI, Image3d< float > const &sYI, Image3d< float > const &sZI)
template int AddFlowField (Image3d< float > &fXI, Image3d< float > &fYI, Image3d< float > &fZI, const float sXI, const float sYI, const float sZI)
template int ConcatenateFlowField (Image3d< float > &fXI, Image3d< float > &fYI, Image3d< float > &fZI, Image3d< float > &sXI, Image3d< float > &sYI, Image3d< float > &sZI)
template int FindPossibleMovements (LabeledImage3d< size_t, GRAY8 > const &sub, const size_t label, Image3d< GRAY8 > const &mask, Image3d< GRAY8 > &movs, const int distance, const int file_no)
template int FindPossibleMovements (Image3d< size_t > const &sub, const size_t label, const VOI< PIXELS > *voi, Image3d< GRAY8 > const &mask, Image3d< GRAY8 > &movs, const int distance, const int file_no)
template int FindPossibleMovements (Image3d< GRAY8 > const &sub, const GRAY8 label, const VOI< PIXELS > *voi, Image3d< GRAY8 > const &mask, Image3d< GRAY8 > &movs, const int distance, const int file_no)
template int SelectPossibleMovementVector (Image3d< GRAY8 > const &movs, float &rx, float &ry, float &rz, const char equal)
template void PossibleMovementsInvolveDistance (Image3d< GRAY8 > &movs)
template void PossibleMovementsInvolveDirection (Image3d< GRAY8 > &movs, const float vx, const float vy, const float vz)
template int CreateSeparateFlowFields (Image3d< GRAY8 > const &mask, Image3d< GRAY8 > const &movs_mask, valarray< Image3d< float > * > const &res, const unsigned int SeqLength, const unsigned int Sigma, vector< Image3d< GRAY8 > * > &fg_masks, vector< Image3d< float > * > &X_FF, vector< Image3d< float > * > &Y_FF, vector< Image3d< float > * > &Z_FF, int &NumberOfComponents)
template void EnlargeMask (Image3d< GRAY8 > const &in, Image3d< GRAY8 > &out, int count)
template int EstimateThreshold (Image3d< GRAY8 > const &img, const int size)
template int EstimateThreshold (Image3d< float > const &img, const int size)
template void ApplyLODGaussianBlur (Image3d< float > *XI, Image3d< float > *YI, Image3d< float > *ZI, float sigma)
template float SumUpImage (Image3d< GRAY8 > const &i)
template float SumUpImage (Image3d< float > const &i)
template void EnhanceImage (Image3d< GRAY8 > &i)
template GRAY8 GenerateMoreBackground (Image3d< GRAY8 > &input, Image3d< GRAY8 > &mask, Image3d< GRAY8 > &Mask, size_t slice, char init)
template GRAY8 GenerateMoreBackground_nonPerSlices (Image3d< GRAY8 > &input, Image3d< GRAY8 > &mask, Image3d< GRAY8 > &Mask, char init)
template void FillInCell (Image3d< GRAY8 > &input, Image3d< float > &out, Image3d< GRAY8 > &mask, Image3d< GRAY8 > &Mask)
template void ExtractComponents (Image3d< GRAY8 > &input, Image3d< GRAY8 > &out, Image3d< GRAY8 > &mask)
template void ExtractComponents (Image3d< float > &input, Image3d< GRAY8 > &out, Image3d< GRAY8 > &mask)
template void ExtractComponents (Image3d< float > &input, Image3d< float > &out, Image3d< GRAY8 > &mask)
template void InsertComponents (Image3d< GRAY8 > &input, Image3d< float > &out, Image3d< GRAY8 > &mask, float alter)
template void InsertComponents (Image3d< float > &input, Image3d< float > &out, Image3d< GRAY8 > &mask, float alter)
template void InsertComponents_nonInterleaved (Image3d< GRAY8 > &input, Image3d< float > &out, Image3d< GRAY8 > &mask, float alter)
template void InsertComponents_nonInterleaved (Image3d< float > &input, Image3d< float > &out, Image3d< GRAY8 > &mask, float alter)
template void SaveResults (char *FName, Image3d< float > *XI, Image3d< float > *YI, Image3d< float > *ZI)
template void ApplyMask (Image3d< GRAY8 > *Mask, Image3d< float > *XI, Image3d< float > *YI, Image3d< float > *ZI, float val)

Variables

vector< GRAY8 > slice_means

Define Documentation

#define FILTER_RADIUS   4

Function Documentation

float VectorsAngle ( const float  x1,
const float  y1,
const float  z1,
const float  x2,
const float  y2,
const float  z2 
) [inline]
float AngleVariance ( const int  level  )  [inline]
int GetLevel ( const float  x,
const float  y,
const float  z 
) [inline]
template<class MT >
char DetectCollision ( struct V const &  shift,
list< struct V > const &  obj,
Image3d< MT > const &  mask 
)
template<class IT >
void ExportShiftList ( list< struct V > const &  s,
const int  dim_x,
const int  dim_y,
const int  dim_z,
Image3d< IT > &  img,
const IT  val = 200 
)
template void DoTranslation ( Image3d< float > &  XI,
Image3d< float > &  YI,
float  xc,
float  yc 
)
template void DoTranslation3d ( Image3d< float > &  XI,
Image3d< float > &  YI,
Image3d< float > &  ZI,
float  xc,
float  yc,
float  zc 
)
template void ComputeSimpleGT ( Image3d< float > &  XI,
Image3d< float > &  YI,
int  xc,
int  yc,
float  ra,
float  xt,
float  yt 
)
template void ComputeSimpleGT3d ( Image3d< float > &  XI,
Image3d< float > &  YI,
Image3d< float > &  ZI,
int  xc,
int  yc,
float  ra,
float  xt,
float  yt,
float  zt 
)
template int AddFlowField ( Image3d< float > &  fXI,
Image3d< float > &  fYI,
Image3d< float > &  fZI,
Image3d< float > const &  sXI,
Image3d< float > const &  sYI,
Image3d< float > const &  sZI 
)
template int AddFlowField ( Image3d< float > &  fXI,
Image3d< float > &  fYI,
Image3d< float > &  fZI,
const float  sXI,
const float  sYI,
const float  sZI 
)
template int ConcatenateFlowField ( Image3d< float > &  fXI,
Image3d< float > &  fYI,
Image3d< float > &  fZI,
Image3d< float > &  sXI,
Image3d< float > &  sYI,
Image3d< float > &  sZI 
)
template int FindPossibleMovements ( LabeledImage3d< size_t, GRAY8 > const &  sub,
const size_t  label,
Image3d< GRAY8 > const &  mask,
Image3d< GRAY8 > &  movs,
const int  distance,
const int  file_no 
)
template int FindPossibleMovements ( Image3d< size_t > const &  sub,
const size_t  label,
const VOI< PIXELS > *  voi,
Image3d< GRAY8 > const &  mask,
Image3d< GRAY8 > &  movs,
const int  distance,
const int  file_no 
)
template int FindPossibleMovements ( Image3d< GRAY8 > const &  sub,
const GRAY8  label,
const VOI< PIXELS > *  voi,
Image3d< GRAY8 > const &  mask,
Image3d< GRAY8 > &  movs,
const int  distance,
const int  file_no 
)
template int SelectPossibleMovementVector ( Image3d< GRAY8 > const &  movs,
float &  rx,
float &  ry,
float &  rz,
const char  equal 
)
template void PossibleMovementsInvolveDistance ( Image3d< GRAY8 > &  movs  ) 
template void PossibleMovementsInvolveDirection ( Image3d< GRAY8 > &  movs,
const float  vx,
const float  vy,
const float  vz 
)
template int CreateSeparateFlowFields ( Image3d< GRAY8 > const &  mask,
Image3d< GRAY8 > const &  movs_mask,
valarray< Image3d< float > * > const &  res,
const unsigned int  SeqLength,
const unsigned int  Sigma,
vector< Image3d< GRAY8 > * > &  fg_masks,
vector< Image3d< float > * > &  X_FF,
vector< Image3d< float > * > &  Y_FF,
vector< Image3d< float > * > &  Z_FF,
int &  NumberOfComponents 
)
template void EnlargeMask ( Image3d< GRAY8 > const &  in,
Image3d< GRAY8 > &  out,
int  count 
)
template int EstimateThreshold ( Image3d< GRAY8 > const &  img,
const int  size 
)
template int EstimateThreshold ( Image3d< float > const &  img,
const int  size 
)
template void ApplyLODGaussianBlur ( Image3d< float > *  XI,
Image3d< float > *  YI,
Image3d< float > *  ZI,
float  sigma 
)
template float SumUpImage ( Image3d< GRAY8 > const &  i  ) 
template float SumUpImage ( Image3d< float > const &  i  ) 
template void EnhanceImage ( Image3d< GRAY8 > &  i  ) 
template GRAY8 GenerateMoreBackground ( Image3d< GRAY8 > &  input,
Image3d< GRAY8 > &  mask,
Image3d< GRAY8 > &  Mask,
size_t  slice,
char  init 
)
template GRAY8 GenerateMoreBackground_nonPerSlices ( Image3d< GRAY8 > &  input,
Image3d< GRAY8 > &  mask,
Image3d< GRAY8 > &  Mask,
char  init 
)
template void FillInCell ( Image3d< GRAY8 > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask,
Image3d< GRAY8 > &  Mask 
)
template void ExtractComponents ( Image3d< GRAY8 > &  input,
Image3d< GRAY8 > &  out,
Image3d< GRAY8 > &  mask 
)
template void ExtractComponents ( Image3d< float > &  input,
Image3d< GRAY8 > &  out,
Image3d< GRAY8 > &  mask 
)
template void ExtractComponents ( Image3d< float > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask 
)
template void InsertComponents ( Image3d< GRAY8 > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask,
float  alter 
)
template void InsertComponents ( Image3d< float > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask,
float  alter 
)
template void InsertComponents_nonInterleaved ( Image3d< GRAY8 > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask,
float  alter 
)
template void InsertComponents_nonInterleaved ( Image3d< float > &  input,
Image3d< float > &  out,
Image3d< GRAY8 > &  mask,
float  alter 
)
template void SaveResults ( char *  FName,
Image3d< float > *  XI,
Image3d< float > *  YI,
Image3d< float > *  ZI 
)
template void ApplyMask ( Image3d< GRAY8 > *  Mask,
Image3d< float > *  XI,
Image3d< float > *  YI,
Image3d< float > *  ZI,
float  val 
)

Variable Documentation

vector<GRAY8> slice_means