Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SFLSRobustStatSegmentor3DLabelMap_single.h
Go to the documentation of this file.
1#ifndef SFLSRobustStatSegmentor3DLabelMap_single_h_
2#define SFLSRobustStatSegmentor3DLabelMap_single_h_
3
4#include "SFLSSegmentor3D.h"
5
6#include <list>
7#include <vector>
8
9
10template <typename TPixel>
12{
13 /*----------------------------------------------------------------------
14 just copy, not logic change */
15public:
17
19
22
23 /*================================================================================
24 ctor */
29
30 /* New */
31 // static Pointer New() { return Pointer(new Self); }
32
33 void basicInit();
34
35 /* just copy, not logic change
36 ----------------------------------------------------------------------
37 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
39 ---------------------------------------------------------------------- */
40
42 typedef typename TLabelImage::Pointer TLabelImagePointer;
43
45 typedef typename TFloatImage::Pointer TFloatImagePointer;
46
47 // typedef typename SuperClassType::TDoubleImage TDoubleImage;
48 // typedef typename TDoubleImage::Pointer TDoubleImagePointer;
49
51
53 typedef typename SuperClassType::TSize TSize;
55
56 /* ============================================================
57 * functions
58 * ============================================================*/
59
61
62 void doSegmenation() override;
63
64 void computeForce() override;
65
66 void setKernelWidthFactor(double f);
67
69
70protected:
71 /* data */
73 std::vector<std::vector<long> > m_seeds; // in IJK
74
75 std::vector<std::vector<double> > m_featureAtTheSeeds;
76
80
81 const static long m_numberOfFeature = 3;
82 /* Store the robust stat as the feature at each point
83 0: median
84 1: interquartile range (IRQ)
85 2. median absolute deviation (MAD)
86 */
87 TLabelImagePointer m_featureComputed; // if feature at this point is computed, then is 1
88 std::vector<TFloatImagePointer> m_featureImageList;
89
90 double m_kernelWidthFactor; // kernel_width = empirical_std/m_kernelWidthFactor, Eric has it at 10.0
91
92 /* fn */
94
96
97 // void computeFeature();
98 void computeFeatureAt(TIndex idx, std::vector<double>& f);
99
100 void getRobustStatistics(std::vector<double>& samples, std::vector<double>& robustStat);
101
103
105
107
109
111
115
116 std::vector<std::vector<double> > m_PDFlearnedFromSeeds; // each feature corresponds to a inner std::vector<double>
118
119 // void getFeatureAt(TDoubleImage::IndexType idx, std::vector<double>& f);
120
122
123 // kernel
124 std::vector<double> m_kernelStddev;
125 double kernelEvaluation(const std::vector<double>& newFeature);
126
127 double kernelEvaluationUsingPDF(const std::vector<double>& newFeature);
128
129};
130
131#include "SFLSRobustStatSegmentor3DLabelMap_single.txx"
132
133#endif
void computeFeatureAt(TIndex idx, std::vector< double > &f)
void setInputLabelImage(TLabelImagePointer l)
std::vector< std::vector< double > > m_featureAtTheSeeds
void getRobustStatistics(std::vector< double > &samples, std::vector< double > &robustStat)
double kernelEvaluation(const std::vector< double > &newFeature)
std::vector< std::vector< double > > m_PDFlearnedFromSeeds
double kernelEvaluationUsingPDF(const std::vector< double > &newFeature)
CSFLSRobustStatSegmentor3DLabelMap< TPixel > Self
itk::Image< float, 3 > TFloatImage
TImage::RegionType TRegion
SuperClassType::CSFLSLayer CSFLSLayer
TImage::IndexType TIndex
TImage::SizeType TSize
SuperClassType::NodeType NodeType
TUCharImage MaskImageType
itk::Image< short, 3 > TShortImage