X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=vv%2FvvToolSegmentation.h;h=93b9f3f0162f7877452607cdeaaf27169ee3afb1;hb=e502d745ac4c73037ef615931db2dcbf36a94341;hp=20f904d216d4248b01dfbd997b2b66caef1bd13b;hpb=e34e0e0eb662c6c7fa3681f53aac959fef4b4f73;p=clitk.git diff --git a/vv/vvToolSegmentation.h b/vv/vvToolSegmentation.h index 20f904d..93b9f3f 100644 --- a/vv/vvToolSegmentation.h +++ b/vv/vvToolSegmentation.h @@ -18,7 +18,7 @@ #ifndef VVTOOLSEGMENTATION_H #define VVTOOLSEGMENTATION_H -#include +#include #include "vvToolBase.h" #include "vvToolWidgetBase.h" @@ -42,6 +42,7 @@ class vvToolSegmentation: static void Initialize(); virtual void InputIsSelected(vvSlicerManager * m); void OpenBinaryImage(); + void RegionGrowing(); void Erode(); void Dilate(); void Labelize(); @@ -52,15 +53,11 @@ class vvToolSegmentation: //----------------------------------------------------- public slots: virtual void apply(); - // bool eventFilter(QObject *object, QEvent *event); void KeyPressed(std::string KeyPress); virtual bool close(); virtual void MousePositionChanged(int slicer); - // virtual void keyPressEvent(QKeyEvent * event); - // virtual void reject(); protected: - // virtual void closeEvent(QCloseEvent *event); Ui::vvToolSegmentation ui; QSharedPointer mRefMaskActor; QSharedPointer mCurrentMaskActor; @@ -76,6 +73,19 @@ class vvToolSegmentation: QSharedPointer CreateMaskActor(vvImage::Pointer image, int i, int colorID, bool BGMode=false); double mCurrentLabelUnderMousePointer; + std::vector mCurrentMousePositionInMM; + //std::vector mCurrentMousePositionInPixel; + double GetBackgroundValue() { return 0; } + double GetForegroundValue() { return 1; } + long ComputeNumberOfPixels(vvImage::Pointer image, double value); + + // Compute and store sizes of mask Foreground + void UpdateMaskSize(vvImage::Pointer image, long & pix, double & cc); + void UpdateMaskSizeLabels(); + long mRefMaskSizeInPixels; + double mRefMaskSizeInCC; + long mCurrentMaskSizeInPixels; + double mCurrentMaskSizeInCC; }; // end class vvToolSegmentation //------------------------------------------------------------------------------