00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : FEI (oct 2014) 00022 **=======================================================================*/ 00023 #ifndef _SO_ITERATIVE_MORPHO_LUT_PROCESSING_2D_H_ 00024 #define _SO_ITERATIVE_MORPHO_LUT_PROCESSING_2D_H_ 00025 #include <ImageViz/SoImageViz.h> 00026 #include <ImageViz/Engines/SoSubImageVizEngine.h> 00027 #include <ImageViz/Engines/SoImageVizEngineOutput.h> 00028 #include <ImageViz/Engines/SoImageVizEngine.h> 00029 00030 #include <Inventor/fields/SoSFEnum.h> 00031 #include <Inventor/fields/SoSFInt32.h> 00032 #include <ImageViz/Fields/SoSFImageDataAdapter.h> 00033 #include <ImageViz/Fields/SoSFKernel2i32.h> 00034 00035 #include <ImageViz/Nodes/Luts/SoMorphoLut2D.h> 00036 00037 class SoIterativeMorphoLutProcessing2d : public SoEngine 00038 { 00039 SO_IMAGEVIZ_ENGINE_HEADER( SoIterativeMorphoLutProcessing2d ); 00040 00041 public: 00043 SoIterativeMorphoLutProcessing2d(); 00044 00046 SoSFImageDataAdapter inBinaryImage; 00047 00048 enum OperationMode 00049 { 00050 THINNING = 0, 00051 THICKENING = 1, 00052 HIT_OR_MISS = 2, 00053 }; 00054 00055 enum RotationMode 00056 { 00057 NO_ROTATION = 0, // 0 rotation (1 kernel configuration) 00058 ROTATE_EDGES = 1, // 3 rotations (4 kernel configurations) 00059 ROTATE_VERTICES = 2 // 7 rotations (8 kernel configurations) 00060 }; 00061 00065 SoSFEnum inOperationMode; 00066 00070 SoSFEnum inRotationMode; 00071 00076 SoSFKernel2i32 inKernel2D; 00077 00083 SoSFInt32 inIterations; 00084 00086 SoImageVizEngineOutput<SoSFImageDataAdapter, SoImageDataAdapter*> outBinaryImage; 00087 00088 private: 00090 virtual ~SoIterativeMorphoLutProcessing2d(); 00091 00093 virtual void inputChanged( SoField* ); 00094 00096 virtual void evaluate(); 00097 00098 private: 00099 SoMorphoLut2D* buildInternalMorphoLut(); 00100 00102 bool m_inputsAreChanged; 00103 }; 00104 00105 #endif