X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolSegmentation.h;h=20f904d216d4248b01dfbd997b2b66caef1bd13b;hb=e34e0e0eb662c6c7fa3681f53aac959fef4b4f73;hp=7b8bb8c49ae297d73cb659d780f8079ffc4bfc45;hpb=25ef2fc32a7477c30ddfb5e51b3770458e738135;p=clitk.git diff --git a/vv/vvToolSegmentation.h b/vv/vvToolSegmentation.h index 7b8bb8c..20f904d 100644 --- a/vv/vvToolSegmentation.h +++ b/vv/vvToolSegmentation.h @@ -25,6 +25,8 @@ #include "vvROIActor.h" #include "ui_vvToolSegmentation.h" +#include "vtkLookupTable.h" + //------------------------------------------------------------------------------ class vvToolSegmentation: public vvToolWidgetBase, @@ -42,21 +44,38 @@ class vvToolSegmentation: void OpenBinaryImage(); void Erode(); void Dilate(); - void UpdateAndRender(); + void Labelize(); + void Merge(); + void RemoveLabel(); + void UpdateAndRenderNewMask(); //----------------------------------------------------- public slots: virtual void apply(); - virtual void keyPressEvent(QKeyEvent * event); + // 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; - vvImage::Pointer mMaskImage; + QSharedPointer mCurrentMaskActor; + std::vector > mCurrentCCLActors; + vvImage::Pointer mRefMaskImage; + vvImage::Pointer mCurrentMaskImage; + vvImage::Pointer mCurrentCCLImage; int mKernelValue; + vtkSmartPointer mDefaultLUTColor; + enum { State_Default, State_CCL}; + int mCurrentState; + + QSharedPointer CreateMaskActor(vvImage::Pointer image, int i, int colorID, bool BGMode=false); + + double mCurrentLabelUnderMousePointer; }; // end class vvToolSegmentation //------------------------------------------------------------------------------