34 #ifndef __QGoFilterWatershed_h
35 #define __QGoFilterWatershed_h
41 #include "QGoGUILibConfigure.h"
69 template<
typename TPixel >
71 typename itk::Image< TPixel, 3 >::Pointer iITKInput,
74 const double& iCorrTresh,
78 const unsigned int Dimension = 3;
79 typedef itk::Image< TPixel, Dimension > FeatureImageType;
80 typedef typename FeatureImageType::Pointer FeatureImagePointer;
81 typedef itk::Image< double, Dimension > InputImageType;
82 typedef typename InputImageType::IndexType InputImageIndexType;
83 typedef typename InputImageType::Pointer InputImagePointer;
84 typedef itk::Image< int, Dimension > SegmentImageType;
85 typedef typename SegmentImageType::Pointer SegmentImagePointer;
90 typedef itk::Image< TPixel, 3 > FeatureImageType;
92 <FeatureImageType, InputImageType,SegmentImageType>
93 SegmentationFilterType;
94 typedef typename SegmentationFilterType::Pointer SegmentationFilterPointer;
97 SegmentationFilterPointer filter = SegmentationFilterType::New();
98 filter->SetInput(iITKInput);
99 filter->SetNucleusThresholdMin(iThresMin);
100 filter->SetNucleusThresholdMax(iThresMax);
101 filter->SetCorrelationThreshold1(iCorrTresh);
102 filter->SetAlpha(iAlpha);
103 filter->SetBeta(iBeta);
106 typename Output3DType::Pointer resulting_image = filter->GetOutput();
108 if( resulting_image.IsNotNull() )
110 m_Image3D->Graft( resulting_image );
114 itkGenericExceptionMacro(
115 <<
"WaterShedSegmentationFilter's output is NULL" );
120 template<
typename TPixel >
122 typename itk::Image< TPixel, 2 >::Pointer iITKInput,
123 const int& iThresMin,
124 const int& iThresMax,
125 const double& iCorrTresh,
126 const double& iAlpha,
129 const unsigned int Dimension = 2;
130 typedef itk::Image< TPixel, Dimension > FeatureImageType;
131 typedef typename FeatureImageType::Pointer FeatureImagePointer;
132 typedef itk::Image< double, Dimension > InputImageType;
133 typedef typename InputImageType::IndexType InputImageIndexType;
134 typedef typename InputImageType::Pointer InputImagePointer;
135 typedef itk::Image< int, Dimension > SegmentImageType;
136 typedef typename SegmentImageType::Pointer SegmentImagePointer;
141 typedef itk::Image< TPixel, 2 > FeatureImageType;
143 <FeatureImageType, InputImageType,SegmentImageType>
144 SegmentationFilterType;
145 typedef typename SegmentationFilterType::Pointer SegmentationFilterPointer;
148 SegmentationFilterPointer filter = SegmentationFilterType::New();
149 filter->SetInput(iITKInput);
150 filter->SetNucleusThresholdMin(iThresMin);
151 filter->SetNucleusThresholdMax(iThresMax);
152 filter->SetCorrelationThreshold1(iCorrTresh);
153 filter->SetAlpha(iAlpha);
154 filter->SetBeta(iBeta);
157 typename Output2DType::Pointer resulting_image = filter->GetOutput();
159 if( resulting_image.IsNotNull() )
161 m_Image2D->Graft( resulting_image );
165 itkGenericExceptionMacro(
166 <<
"WaterShedSegmentationFilter's output is NULL" );
170 std::vector<std::vector<vtkPolyData*> > ApplyFilterSetOf2D(
double iRadius,
171 int iThresMin,
int iThresMax,
double iCorrTresh,
double iAlpha,
172 double iBeta,
int iSampling,
173 std::vector< vtkPoints* >* iPoints,
187 void Filter2D(
double *iCenter,
const int & iOrientation);
Output3DType::Pointer Output3DPointer
Output3DType::Pointer GetOutput3D()
itk::Image< int, 2 > Output2DType
itk::Image< int, 3 > Output3DType
Output3DType::Pointer m_Image3D
Output2DType::Pointer m_Image2D
void Apply2DFilter(typename itk::Image< TPixel, 2 >::Pointer iITKInput, const int &iThresMin, const int &iThresMax, const double &iCorrTresh, const double &iAlpha, const double &iBeta)
Output2DType::Pointer Output2DPointer
Watershed segmentation algorithm implementation. Can generate contours and meshes. Will generate 2D objects if m_Dimension<2, 3D objects in the other case.
Output2DType::Pointer GetOutput2D()
Connects the common signals regarding the seeds segmentation Provides methods to convert images from ...
Interface between image reader and vtkImageData.
void Apply3DFilter(typename itk::Image< TPixel, 3 >::Pointer iITKInput, const int &iThresMin, const int &iThresMax, const double &iCorrTresh, const double &iAlpha, const double &iBeta)