Defines | Functions

Common functions to ground-truth generator

Defines

#define SQR(a)   ((a)*(a))
#define HISTOGRAM_DIVIDER   1.0f
#define BACKGROUND_ORIG
#define SEARCH_RANGE_1   6
#define SEARCH_RANGE_2   15
#define SEARCH_RANGE_3   15
#define INTERLEAVED_INSERTION
#define MASK_EXTENSION   2
#define MASK_EXTENSION_2   3
#define BACKGROUND_PER_SLICES

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)
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 >
int SelectPossibleMovementVector (Image3d< MT > const &movs, float &rx, float &ry, float &rz, const char equal=1)
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 , 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 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)
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)
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=0, const GRAY8 gmax=250)
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=-1)
template<class T >
GenerateMoreBackground (Image3d< T > &input, Image3d< T > &mask, Image3d< T > &Mask, size_t slice=0, char init=0)
template<class T >
GenerateMoreBackground_nonPerSlices (Image3d< T > &input, Image3d< T > &mask, Image3d< T > &Mask, char init=0)
template<class IN , class OUT >
void FillInHoles (Image3d< IN > &input, Image3d< OUT > &out, Image3d< IN > &mask, OUT bg_value=0)
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=NULL, VT val=100)
template<class VOXEL >
void SaveResults (char *FName, Image3d< VOXEL > *XI, Image3d< VOXEL > *YI, Image3d< VOXEL > *ZI=NULL)
void ShowStats (Image3d< float > &orig, Image3d< float > &created, Image3d< GRAY8 > &Mask)
template<class FT >
int MoveVOI (valarray< Image3d< FT > * > const &res, const int SeqLength, VOI< i3d::PIXELS > const &inVOI, VOI< i3d::PIXELS > &outVOI)

Define Documentation

#define SQR (   a  )     ((a)*(a))
#define HISTOGRAM_DIVIDER   1.0f

this roughly simulates fading of the fluorescence, the higher number is the more fadeout occurs

#define BACKGROUND_ORIG

this disables saving the generated flow fields, only image data is stored

exactly one of the following three must be enabled BACKGROUND_ORIG //background tries to copy orig background BACKGROUND_MASK //background is "uniform" all over the cell mask BACKGROUND_MASK_FADE //as above with the fading effect at the mask edge

#define SEARCH_RANGE_1   6

mandatory parameter for forward registration/transformation function

#define SEARCH_RANGE_2   15
#define SEARCH_RANGE_3   15
#define INTERLEAVED_INSERTION

this controls whether seamless insertion of foreground into generated background should be used (weights are given from distance transform); if not defined, just foreground is simply overlaid

#define MASK_EXTENSION   2

explanation: MASK_EXTENSION controls the processing of foreground components: local drifts, extraction and insertion of components MASK_EXTENSION_2 controls the generation of artificial background: affects only the size of filled in black regions

in general, both macros are expected to hold the same value

#define MASK_EXTENSION_2   3
#define BACKGROUND_PER_SLICES

this controls background generation whether it should be per slices or not; this option is really usefull only for 3D images


Function Documentation

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,
rangle 
)
template<class T >
void DoRotationPseudo3d ( Image3d< T > &  XI,
Image3d< T > &  YI,
int  xc,
int  yc,
rangle 
)

rotation is performed in a slice-by-slice manner, each slice is rotated independently, the rotation is around axis parallel to z-axis, thus the z coordinate can be leaved untouched

template<class T >
void DoTranslation ( Image3d< T > &  XI,
Image3d< T > &  YI,
xc,
yc 
)
template<class T >
void DoTranslation3d ( Image3d< T > &  XI,
Image3d< T > &  YI,
Image3d< T > &  ZI,
xc,
yc,
zc 
)
template<class T >
void ComputeSimpleGT ( Image3d< T > &  XI,
Image3d< T > &  YI,
int  xc,
int  yc,
ra,
xt,
yt 
)

frontend to above functions

!!! input images must be of appropriate size and initialized !!! !!! just the content of input images will be modified !!!

frontend to above functions

!!! only the content of input images will be modified !!!

template<class T >
void ComputeSimpleGT3d ( Image3d< T > &  XI,
Image3d< T > &  YI,
Image3d< T > &  ZI,
int  xc,
int  yc,
ra,
xt,
yt,
zt 
)

!!! input images must be of appropriate size initialized !!!

!!! only the content of input images will be modified !!!

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 
)

This function adds vectors from the second argument flow fields into the first argument flow field.

The addition is processed voxel by voxel. The result is stored in the FIRST flow field.

This represents composition of two movements resulting in the common movement represented by the output flow field.

template<class FT >
int AddFlowField ( Image3d< FT > &  fXI,
Image3d< FT > &  fYI,
Image3d< FT > &  fZI,
const FT  sXI,
const FT  sYI,
const FT  sZI 
)

This function adds the constant vector from the second argument into the flow field given by the first argument.

The addition is processed voxel by voxel. The result is stored in the FIRST flow field.

This represents composition of two movements resulting in the common movement represented by the output flow field.

template<class FT >
int ConcatenateFlowField ( Image3d< FT > &  fXI,
Image3d< FT > &  fYI,
Image3d< FT > &  fZI,
Image3d< FT > &  sXI,
Image3d< FT > &  sYI,
Image3d< FT > &  sZI 
)

This function concatenates the second argument flow field (FF) to the first argument flow field.

This means that a vector from the second argument FF found at a coordinate corresponding to the end of examined vector from the first argument FF is added to this examined vector. It results in a vector, stored in the second argument FF, showing the end of the movement given by the first argument FF and then by the second argument FF. The concatenation/addition is processed voxel by voxel. The result is stored in the SECOND FF.

This represents composition of movement after movement. That is stored in the output flow field.

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 
)

All possible translations of object given in given component of sub (non-zero value indicates voxel belonging to the object) within the region given by mask up to the distance of distance are outlined in the movs image.

The sub must be subset of mask, i.e. mask should allow the sub to perform some movement. Sub and mask must be of the same size. The selected component is given by parameter label.

The size of movs image will be changed to be at least twice the distance. Each non-zero voxel in the movs image indicates the shift vector which can be obtained from subtraction of given voxel's coordinate by coordinate of the image's centre voxel. The movs image will consist of exactly one component. This means that movs does not denote all possible positions within mask, it shows only reachable positions.

Returns 0 if everything went well.

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 
)

All possible translations of object given in given component of sub (non-zero value indicates voxel belonging to the object) within the region given by mask up to the distance of distance are outlined in the movs image.

The sub must be subset of mask, i.e. mask should allow the sub to perform some movement. Sub and mask must be of the same size. The selected component is given by parameter label. The voi parameter is optional, it can help localize the component inside the sub image. The full search for component under the label is conducted if voi is NULL.

The size of movs image will be changed to be at least twice the distance. Each non-zero voxel in the movs image indicates the shift vector which can be obtained from subtraction of given voxel's coordinate by coordinate of the image's centre voxel. The movs image will consist of exactly one component. This means that movs does not denote all possible positions within mask, it shows only reachable positions.

Returns 0 if everything went well.

template<class MT >
int SelectPossibleMovementVector ( Image3d< MT > const &  movs,
float &  rx,
float &  ry,
float &  rz,
const char  equal 
)

A mask of possible shift vectors is considered (the first parameter of this function).

A vector (rx,ry,rz) selected from the mask is returned. The selection is random. However, the distribution of this ``random'' differs according to the last parameter.

If equal == 1 then all possible shift vectors are equally likely to be selected. Random distribution is uniform. The mask values are considered as binary representing just the presence of associated shift vector.

If equal == 0 then the Random distribution is given by the mask image, some vectors can be more prefered to the others. Each shift vector probability is given by its voxel value (with respect to the sum of all values in the movs image in order to preserve basic rules of probability distribution function).

The number of considered shift vectors is returned.

template<class MT >
void PossibleMovementsInvolveDistance ( Image3d< MT > &  movs  ) 

This functions modifies the mask of possible shift vectors.

The presence of voxel (i.e. voxel value is strictly above zero) determines the possibility to use associated shift vector. This function modifies the values of possible shift vectors by multiplying each by a specific constant which is from interval <0,1>. The specificity reflects the length of associated shift vector, longer vectors are supported (the multiplicator is close to 1) and vice versa. Thus, another meaning to the values in the mask of possible shift vectors is added. The value expresses also the probability, besides just the possibility.

The function reads a movs image and changes its values. No return value is provided.

template<class MT >
void PossibleMovementsInvolveDirection ( Image3d< MT > &  movs,
const float  vx,
const float  vy,
const float  vz 
)

This functions modifies the mask of possible shift vectors.

The presence of voxel (i.e. voxel value is strictly above zero) determines the possibility to use associated shift vector. This function modifies the values of possible shift vectors by multiplying each by a specific constant which is from interval <0,1>. The specificity reflects the direction of associated shift vector, vectors with direction closer to (vx,vy,vz) are supported (the multiplicator is close to 1) and vice versa. The vector of zero length is omitted from the multiplication, its value remains untouched. Thus, another meaning to the values in the mask of possible shift vectors is added. The value expresses also the probability besides just the possibility.

The function reads a movs image and changes its values. No return value is provided.

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 
)

This function creates a list of flow fields which are neccessary for qualitatively better moved/transformed foreground regions.

The size of flow fields is the smallest possible to hold all possible local movements together with global movement of the entire image.

A foreground mask as well as possible movement mask is input to this function. The number of created flow fields is mainly driven by the number of components in the foreground mask. It may happen that given foreground component does not lie inside some movement mask, which denotes that there shall be no local movement of this component. In this case, no flow field is created what is indicated in the output parameter fg_masks by NULL value.

When maximum reachable region is established, it is further enlarged by sigma voxels to all directions.

The foreground components are numbered and stored in separate images in the vector fg_masks. The interconnection between numbers and fg components is given in this way.

The values of fg_masks for each fg component is either NULL (no local movement should be conducted, thus no FindPossibleMovements() need to be computed; local flow field is not created) or pointer to some image (local movements allowed, there exists appropriate movs_mask; local flow field is created).

The dimensionality (2D or 3D) is determined from mask. Z_flow_fields will be an empty vector in the case of 2D.

The function returns 0 when everything went well. Otherwise, non-zero value is returned indicating some error which is printed on stdout by the function itself.

Parameters:
[in] mask mask of foreground regions that are subjects to local movements
[in] movs_mask mask of possible movements of foreground regions
[in] res valarray of flow fields that characterize the global movement between two consecutive generated frames
[in] SeqLength the length of the artificial image sequence that is to be generated
[in] Sigma the maximum local movement distance (between two consecutive frames)
[out] fg_masks mask of each foreground component
[out] X_FF vector of images holding x component of every flow field
[out] Y_FF vector of images holding y component of every flow field
[out] Z_FF vector of images holding z component of every flow field
[out] NumberOfComponents returns the number of detected components, the length of all output vectors

The size of flow fields is the least possible to hold all possible local movements together with global movement of the entire 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 
)

Output debug images of fg component masks and their actuall overall flow fields.

This is just a debug function to spill out memory content. No integrity tests are performed. The flow fields etc. simply should be allright/consistent...

Parameters:
[in] fg_masks vector of foreground masks
[in] X_FF vector of individual overall flow fields, x-element
[in] Y_FF vector of individual overall flow fields, y-element
[in] Z_FF vector of individual overall flow fields, z-element
[in] basename basename to form the names of output image files
[in] SeqNo format of output filenames incorporates a variable int variable
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 
)

This function can display the movement history of all fg components when regularly called.

The actuall positions of all fg components stored in the vector fg_masks are inserted into the output debug_image. New positions get intensity val. A region occupied by any fg mask is determined from the voxel intensity. Voxels with values below 51 are considered not to belong to any present or earlier fg component and, thus, are removed from the debug_image. After that, movs_mask image is inserted into debug image but only into regions that are not occupied by any fg mask. The movs_mask voxels are inserted with intensity value of 50.

Parameters:
[in] fg_masks vector of pointers to the individual fg component masks
[in] thresholds oficial masks can be only determined by thresholding
[in] val voxel value that is used to shown fg masks
[in] movs_mask actuall allowed movement mask
[out] debug_image the output image, should be used the same all the time

History of movements can be captured by this function when regularly called after each iteration of artificial sequence generation. The actual movs_mask is always shown. The actual foreground regions are stored using values that increase as the number of iteration increases, or vice versa. The earlier position are shown with higher values and are always drawn over the previous ones.

template<class T >
void EnlargeMask ( Image3d< T > const &  in,
Image3d< T > &  out,
int  count 
)

This function dilates input count times.

The appropriate structuring element is choosen according to the dimensionality of input image. Only 2D and 3D inputs are considered. The result is stored in output image.

template<class VOXEL >
int EstimateThreshold ( Image3d< VOXEL > const &  img,
const int  size 
)

It returns a value closest to the threshold which would create a binary image with exactly the size (the 2nd parameter) number of true (non-zero) values.

The value is closest in the sense that it is exact or below the optimal threshold.

No matter what voxel type is used, this function always treats intensities as integers, i.e. it "floors" the float and double voxel values for the purpose of thresholding. The returned threshold is always integer.

void FloatToGray8Threshold ( const Image3d< float > &  fimg,
Image3d< GRAY8 > &  gimg,
float  thres,
const GRAY8  gmin = 0,
const GRAY8  gmax = 250 
)
template<class T >
void ApplyLODGaussianBlur ( Image3d< T > *  XI,
Image3d< T > *  YI,
Image3d< T > *  ZI,
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 
)

compute mean value if the cell interior, given by image input, within the Mask and outside the mask, image and masks must be of the same size

T must be float or double, nothing else is permitted MT may be input image, i.e. GRAY8, BINARY, whatever

if slice is -1, then mean from entire cell is computed; else only mean from given slice is computed

template<class T >
T GenerateMoreBackground ( Image3d< T > &  input,
Image3d< T > &  mask,
Image3d< T > &  Mask,
size_t  slice,
char  init 
)

this function tries to estimate the statistical nature of background area voxel intensities; the randomly generated voxel intensities should be similar to intensities within Mask and outside mask; the statistics of each slice is sligthly changing in 3D image, thus the slice parameter is mandatory (except for init phase in which it is ignored)

since the process requires an initialization step, the last parameter determines whether the function should first init its internal data before returning some random value

template<class T >
T GenerateMoreBackground_nonPerSlices ( Image3d< T > &  input,
Image3d< T > &  mask,
Image3d< T > &  Mask,
char  init = 0 
)
template<class IN , class OUT >
void FillInHoles ( Image3d< IN > &  input,
Image3d< OUT > &  out,
Image3d< IN > &  mask,
OUT  bg_value = 0 
)

This function remove patches, given by parameter mask, from image input and fills in holes with lineary interpolated values from nearest values outside the mask; the result is stored in image out which is initialized beforehand.

template<class IN , class OUT >
void FillInCell ( Image3d< IN > &  input,
Image3d< OUT > &  out,
Image3d< IN > &  mask,
Image3d< IN > &  Mask 
)

This function removes patch, given by parameter Mask, from image input and fills it with randomly generated content (it is generated by GenerateMoreBackground()), the result is stored in image out which is initialized beforehand.

template<class IN , class OUT , class MT >
void ExtractComponents ( Image3d< IN > &  input,
Image3d< OUT > &  out,
Image3d< MT > &  mask 
)

This function extract patches, given by parameter mask, in input and stores it in out, the input and out images must be of the same size.

template<class IN , class OUT , class MT >
void InsertComponents ( Image3d< IN > &  input,
Image3d< OUT > &  out,
Image3d< MT > &  mask,
float  alter 
)

This function overwrites patches, given by parameter mask, in out by data found in input, the input and out images must be of the same size.

the last parameter alter changes the absolute value of input voxel intensity by adding its value

the input data is overlayed accroding to thresholded weights computed from distance transform

the input data is overlayed accroding to thresholded weights computed from distance transform

the last parameter alter changes the absolute value of input voxel intensity by adding its value

template<class IN , class OUT , class MT >
void InsertComponents_nonInterleaved ( Image3d< IN > &  input,
Image3d< OUT > &  out,
Image3d< MT > &  mask,
float  alter 
)

This function overwrites patches, given by parameter mask, in out by data found in input, the input and out images must be of the same size.

the input data is simply overlayed over background (out)

the last parameter alter changes the absolute value of input voxel intensity by adding its value

template<class MT , class VT >
void ApplyMask ( Image3d< MT > *  Mask,
Image3d< VT > *  XI,
Image3d< VT > *  YI,
Image3d< VT > *  ZI = NULL,
VT  val = 100 
)

Narrows the flow field to contain valid values only within the Mask.

template<class VOXEL >
void SaveResults ( char *  FName,
Image3d< VOXEL > *  XI,
Image3d< VOXEL > *  YI,
Image3d< VOXEL > *  ZI = NULL 
)
void ShowStats ( Image3d< float > &  orig,
Image3d< float > &  created,
Image3d< GRAY8 > &  Mask 
)
template<class FT >
int MoveVOI ( valarray< Image3d< FT > * > const &  res,
const int  SeqLength,
VOI< i3d::PIXELS > const &  inVOI,
VOI< i3d::PIXELS > &  outVOI 
)

Iteratively move the VOI according to the given flow field.

The result is returned. The number of iteration conducted is provided in the SeqLength parameter.

All 4 or 8 corners of a cube given by the input VOI are iteratively moved. Depending on the smoothness of given flow field, the final VOI should outline the target region. All points from the input VOI are expected, after performing SeqLength movements according to the static input flow field, to end up in this target region/VOI.

It is expected that the size of flow field is the same as the size of original image from which the VOI was selected. The dimensionality of the task (2D or 3D) is suggested from the flow field too. Note that x- and y-element flow fields must be present in the structure of the first parameter.

It is also expected that the flow field remains constant all the time. In other words, that global motion is the same in the whole generated sequence.

Parameters:
[in] res the flow field according to which move the input VOI
[in] SeqLength the number of iterations
[in] inVOI the input VOI
[out] outVOI the output VOI

The function returns zero when no problem occured. Otherwise some non-zero is returned.