1 #ifndef __bbSlicerOtsuThreshold_h_INCLUDED__
2 #define __bbSlicerOtsuThreshold_h_INCLUDED__
4 #include "bbSlicer_EXPORT.h"
5 #include "bbtkAtomicBlackBox.h"
14 #include <ModuleDescriptionUtilities.h>
15 #include <ModuleDescriptionParser.h>
16 #include <ModuleParameterGroup.h>
17 #include <ModuleDescription.h>
18 #include <ModuleParameter.h>
20 #include "CreationTool.h"
24 class bbSlicer_EXPORT OtsuThreshold
26 public bbtk::AtomicBlackBox {
27 BBTK_BLACK_BOX_INTERFACE ( OtsuThreshold , bbtk::AtomicBlackBox ) ;
31 BBTK_DECLARE_INPUT ( insideValue , int );
32 BBTK_DECLARE_INPUT ( outsideValue , int );
33 BBTK_DECLARE_INPUT ( numberOfBins , int );
34 BBTK_DECLARE_INPUT ( inputVolume , std::string );
35 BBTK_DECLARE_INPUT ( outputVolume , std::string );
39 BBTK_PROCESS ( Process ) ;
42 void execute ( std::string lib , int _argc , char * _argv[] ) ;
45 BBTK_BEGIN_DESCRIBE_BLACK_BOX ( OtsuThreshold , bbtk::AtomicBlackBox ) ;
46 BBTK_NAME ( "OtsuThreshold" ) ;
47 BBTK_AUTHOR ( "Bill Lorensen" ) ;
48 BBTK_DESCRIPTION ( "This filter creates a binary thresholded image that separates an image into foreground and background components. The filter calculates the optimum threshold separating those two classes so that their combined spread intra-class variance is minimal see http://en.wikipedia.org/wiki/Otsu%27s_method. Then the filter applies that threshold to the input image using the itkBinaryThresholdImageFilter. The numberOfHistogram bins can be set for the Otsu Calculator. The insideValue and outsideValue can be set for the BinaryThresholdImageFilter. The filter produces a labeled volume.The original reference is: N.Otsu, ‘‘A threshold selection method from gray level histograms,’’ IEEE Trans.Syst.ManCybern.SMC-9,62–66 1979." ) ;
49 BBTK_CATEGORY ( "Legacy.Filtering" ) ;
51 // GENERATED DESCRPTION
53 BBTK_INPUT(OtsuThreshold , insideValue , "insideValue" , int, "");
54 BBTK_INPUT(OtsuThreshold , outsideValue , "outsideValue" , int, "");
55 BBTK_INPUT(OtsuThreshold , numberOfBins , "numberOfBins" , int, "");
56 BBTK_INPUT(OtsuThreshold , inputVolume , "inputVolume" , std::string, "");
57 BBTK_INPUT(OtsuThreshold , outputVolume , "outputVolume" , std::string, "");
59 // EO GENERATED DESCRIPTION
61 BBTK_END_DESCRIBE_BLACK_BOX ( OtsuThreshold ) ;
64 #endif // __bbSlicerOtsuThreshold_h_INCLUDED__