19 #ifndef _MIRTKMEANSHIFT_H    21 #define _MIRTKMEANSHIFT_H    24 #include "mirtk/GenericImage.h"    25 #include "mirtk/Image.h"    26 #include "mirtk/Dilation.h"    27 #include "mirtk/Erosion.h"    28 #include "mirtk/Point.h"    29 #include "mirtk/GaussianBlurring.h"    43     GreyImage _map, _orig_image;
    46     GreyPixel _imin, _imax;
    47     double _limit1, _limit2, _limit, _treshold;
    52     double _bg,_wm,_gm,_split1,_split2;
    57     MeanShift(GreyImage& image, 
int padding = -1, 
int nBins = 256);
    59     void SetOutput( GreyImage *_output);
    60     double ValueToBin(
double value);
    61     double BinToValue(
int bin);
    62     void AddPoint(
int x, 
int y, 
int z);
    63     void AddPoint(
int x, 
int y, 
int z, 
int label);
    64     double msh(
double y, 
double h);
    65     double findMax(
double tr1, 
double tr2);
    66     double findMin(
double tr1, 
double tr2);
    68     double split(
double pos1, 
double pos2, 
double bw, 
double h1, 
double h2);
    69     double GenerateDensity(
double cut_off=0.02);
    70     void Grow(
int x, 
int y, 
int z, 
int label);
    71     int Lcc(
int label, 
bool add_second = 
false);
    72     int LccS(
int label, 
double treshold = 0.5);
    73     void RemoveBackground();
    76     void Write(
char *output_name);
    77     void WriteMap(
char *output_name);
    79     void SetTreshold(
double treshold);
    81     RealImage ReturnMask();