#ifndef __bbUtilitiesMetzRegionGrowing_h_INCLUDED__ #define __bbUtilitiesMetzRegionGrowing_h_INCLUDED__ #include "bbtkAtomicBlackBox.h" //INCLUDES #include "iostream" #include "vtkImageData.h" #include "MetzData.h" namespace bbUtilities { class /*BBTK_EXPORT*/ MetzRegionGrowing : public bbtk::AtomicBlackBox { BBTK_USER_BLACK_BOX_INTERFACE(MetzRegionGrowing,bbtk::AtomicBlackBox); //================================================================== /// User callback called in the box contructor virtual void bbUserConstructor(); /// User callback called in the box copy constructor virtual void bbUserCopyConstructor(); /// User callback called in the box destructor virtual void bbUserDestructor(); //================================================================== //--------------------------------------------- //Declaration //---------------------------------------------- //INPUTS BBTK_DECLARE_INPUT(InImage,vtkImageData*); BBTK_DECLARE_INPUT(SeedPoint,std::vector); BBTK_DECLARE_INPUT(Upper, double) BBTK_DECLARE_INPUT(Lower, double) //OUTPUT BBTK_DECLARE_OUTPUT(OutImage,vtkImageData*); BBTK_PROCESS(Process); void Process(); //--------------------------------------------- //Methods //---------------------------------------------- //add neighboors to the stack //void addNeighbors(int x, int y, int z); //conectivity //int connectivity (int x, int y, int z); //initiaize the algorithm //void init (); //void markVisited(int x,int y,int z, bool visited); //bool isMarked(int x,int y,int z); protected: //--------------------------------------------- //ATRIBUTTES //---------------------------------------------- //Pointers to (x,y,z,number of voxels) //std::vector stack; //std::vector pointsStack; //initial image vtkImageData* initialImage; //filtered image vtkImageData* filteredImage; //seed point std::vector seedPoint; //upper int upper; //lower int lower; //image size int ext[6]; //first iteration std::vector* firstIteration; //second iteration std::vector * secondIteration; //third iteration std::vector * thirdIteration; void connectivity (int x, int y, int z, int iteration); void cleanVector(std::vector* v); void mark(int x,int y,int z, int mark); bool isMarked(int x,int y,int z); }; //-------------------------------------------------------------------- //Documentation //-------------------------------------------------------------------- BBTK_BEGIN_DESCRIBE_BLACK_BOX(MetzRegionGrowing,bbtk::AtomicBlackBox); BBTK_NAME("MetzRegionGrowing"); BBTK_AUTHOR("Monica lozano (mo-lozan@uniandes.edu.co)"); BBTK_DESCRIPTION("Region growing propose by Metz paper"); BBTK_CATEGORY("__CATEGORY__"); //INPUTS BBTK_INPUT(MetzRegionGrowing,InImage,"Image to segment",vtkImageData*); BBTK_INPUT(MetzRegionGrowing,SeedPoint,"Seed point to star the algorithm",std::vector); BBTK_INPUT(MetzRegionGrowing,Upper,"Upper threshold value",double); BBTK_INPUT(MetzRegionGrowing,Lower,"Lower threshold value",double); //OUTPUTS BBTK_OUTPUT(MetzRegionGrowing,OutImage,"Image segmented",vtkImageData*); BBTK_END_DESCRIBE_BLACK_BOX(MetzRegionGrowing); } // EO namespace bbUtilities #endif // __bbUtilitiesMetzRegionGrowing_h_INCLUDED__