15 #ifndef __itkForegroundFromBackgroundImageThresholdCalculator_h
16 #define __itkForegroundFromBackgroundImageThresholdCalculator_h
19 #include <itkObject.h>
21 #include <itkImageToHistogramFilter.h>
53 template <
class TInputImage >
94 typedef typename ImageToHistogramFilterType::HistogramType
HistogramType;
96 itkSetConstObjectMacro(
Image, ImageType);
102 void Compute(
void ) throw (ExceptionObject);
105 itkGetConstMacro(Threshold, PixelType);
108 void SetRegion(const RegionType & region);
110 void SetVerbose(
bool flag ) { m_FlgVerbose = flag; }
129 void PrintSelf(std::ostream & os, Indent indent)
const override;
131 void WriteHistogramToTextFile(
std::string fileName,
132 HistogramType *histogram );
135 itk::Array< double > *
x,
136 itk::Array< double > *
y );
140 void ComputeVariances(
int iStart,
int iInc,
141 unsigned int nIntensities,
142 PixelType firstIntensity );
147 void operator=(
const Self &);
149 HistogramType *m_Histogram;
151 ArrayType *m_Intensities;
152 ArrayType *m_NumberOfPixelsCummulative;
155 ArrayType *m_Variances;
156 ArrayType *m_IntensityBias;
157 ArrayType *m_Thresholds;
159 void DeleteArrays(
void ) {
160 if ( m_Intensities )
delete m_Intensities;
161 if ( m_NumberOfPixelsCummulative )
delete m_NumberOfPixelsCummulative;
162 if ( m_Sums )
delete m_Sums;
163 if ( m_Means )
delete m_Means;
164 if ( m_Variances )
delete m_Variances;
165 if ( m_IntensityBias )
delete m_IntensityBias;
166 if ( m_Thresholds )
delete m_Thresholds;
169 m_NumberOfPixelsCummulative = 0;
177 void CreateArrays(
unsigned int n ) {
181 m_NumberOfPixelsCummulative =
new ArrayType( n );
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkForegroundFromBackgroundImageThresholdCalculator.txx"
bool m_RegionSetByUser
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:127
itk::Array< double > ArrayType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:96
ForegroundFromBackgroundImageThresholdCalculator Self
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:61
SmartPointer< Self > Pointer
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:63
itk::Array< double > ArrayType
Definition: EulerAffine3DJacobianTest.cxx:34
itk::Statistics::ImageToHistogramFilter< TInputImage > ImageToHistogramFilterType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:91
bool m_FlgVerbose
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:121
Object Superclass
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:62
void Normalise(mitk::Point3D &vector)
Given a vector, will normalise it to unit length.
Definition: niftkPointUtils.cxx:149
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1236
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
virtual ~ForegroundFromBackgroundImageThresholdCalculator()
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:117
void SetVerboseOff(void)
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:112
void SetVerboseOn(void)
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:111
SmartPointer< const Self > ConstPointer
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:64
TInputImage::Pointer ImagePointer
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:76
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageConstPointer m_Image
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:124
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
TInputImage::PixelType PixelType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:82
RegionType m_Region
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:126
GLint GLint GLint GLint GLint x
Definition: glew.h:1236
ImageToHistogramFilterType::HistogramType HistogramType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:94
TInputImage::ConstPointer ImageConstPointer
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:79
TInputImage::RegionType RegionType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:88
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
GLclampd n
Definition: glew.h:6789
TInputImage::IndexType IndexType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:85
Computes the threshold required to separate an object or patient in the foreground of an image from a...
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:54
PixelType m_Threshold
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:123
GLsizei const GLcharARB ** string
Definition: glew.h:5194
TInputImage ImageType
Definition: itkForegroundFromBackgroundImageThresholdCalculator.h:70