3 #include <itkImageToImageFilter.h> 4 #include <itkVariableSizeMatrix.h> 16 template <
typename TInput,
typename TOutput>
18 public itk::ImageToImageFilter< TInput , TOutput >
23 typedef itk::ImageToImageFilter< TInput , TOutput >
Superclass;
37 typedef itk::Image <PixelTypeUC,3>
TMask;
51 void SetMask(
const TMask* mask);
61 void SetMatrix(doubleVariableSizeMatrixType mat){m_Matrix=mat;}
80 this->SetCoordinateTolerance(tol);
81 this->SetDirectionTolerance(tol);
85 itkSetMacro(Alpha,
double)
86 itkGetMacro(Alpha,
double)
88 itkSetMacro(MultiVarSources,
double)
89 itkGetMacro(MultiVarSources,
double)
91 itkSetMacro(MultiVarSinks,
double)
92 itkGetMacro(MultiVarSinks,
double)
94 itkSetMacro(Sigma,
double)
95 itkGetMacro(Sigma,
double)
97 itkSetMacro(UseSpectralGradient,
bool)
98 itkGetMacro(UseSpectralGradient,
bool)
100 itkSetMacro(Verbose,
bool)
101 itkGetMacro(Verbose,
bool)
116 m_MultiVarSources = 1;
119 m_UseSpectralGradient=
true;
124 m_IndexSourcesMask = m_NbMaxImages, m_IndexSourcesProba = m_NbMaxImages,m_IndexSinksMask = m_NbMaxImages, m_IndexSinksProba = m_NbMaxImages,m_IndexMask= m_NbMaxImages;
128 this->SetNumberOfRequiredOutputs(2);
129 this->SetNumberOfRequiredInputs(4);
134 m_Graph3DFilter->SetInputSeedProbaSources( m_TLinksFilter->GetOutputSources() );
135 m_Graph3DFilter->SetInputSeedProbaSinks( m_TLinksFilter->GetOutputSinks() );
144 itk::DataObject::Pointer
MakeOutput(
unsigned int idx);
154 doubleVariableSizeMatrixType
GetMatrix(
void){
return m_Matrix;}
164 bool m_UseSpectralGradient;
174 double m_MultiVarSources;
175 double m_MultiVarSinks;
179 std::string m_OutputFilename;
180 std::string m_OutputBackgroundFilename;
182 std::string m_MatrixGradFilename;
183 doubleVariableSizeMatrixType m_Matrix;
187 unsigned int m_NbInputs;
188 unsigned int m_NbModalities, m_NbMaxImages;
189 unsigned int m_IndexSourcesMask, m_IndexSourcesProba, m_IndexSinksMask, m_IndexSinksProba, m_IndexMask;
Graph3DFilterType::Pointer m_Graph3DFilter
virtual ~GraphCutFilter()
void SetInputImage(unsigned int i, const TInput *image)
OutputImagePointer GetOutputBackground()
itk::Image< PixelTypeD, 3 > TSeedProba
TLinksFilterType::Pointer m_TLinksFilter
TMask::ConstPointer GetInputSeedSourcesMask()
void SetMatrixGradFilename(std::string mat)
std::string GetOutputFilename()
Superclass::OutputImageRegionType OutputImageRegionType
itk::ImageToImageFilter< TInput, TOutput > Superclass
doubleVariableSizeMatrixType GetMatrix(void)
std::string GetMatrixGradFilename(void)
void GenerateData() ITK_OVERRIDE
TMask::ConstPointer GetInputSeedSinksMask()
Class allowing the decimation of the images if necessary (if 3D graph size causes memory problems)...
void SetInputSeedSinksProba(const TSeedProba *mask)
void SetMask(const TMask *mask)
Class computing the probability maps that are used to create the t-links.
void SetMatrix(doubleVariableSizeMatrixType mat)
itk::DataObject::Pointer MakeOutput(unsigned int idx)
itk::SmartPointer< Self > Pointer
itk::Image< PixelTypeUC, 3 > TMask
void SetOutputFilename(std::string filename)
itk::VariableSizeMatrix< NumericType > doubleVariableSizeMatrixType
OutputImagePointer GetOutput()
itk::SmartPointer< Self > Pointer
TOutput::Pointer OutputImagePointer
void SetInputSeedSourcesProba(const TSeedProba *mask)
TLinksFilter< TInput, TSeedProba > TLinksFilterType
unsigned char PixelTypeUC
void SetInputSeedSourcesMask(const TMask *mask)
Graph3DFilter< TInput, TOutput > Graph3DFilterType
itk::SmartPointer< const Self > ConstPointer
TMask::ConstPointer GetMask()
void SetTol(const double tol)
TMask::Pointer TMaskPointer
void SetInputSeedSinksMask(const TMask *mask)
Class performing grah cut segmentation. First the sources and sinks probabilities maps are computed u...
itk::SmartPointer< Self > Pointer
void SetTLinkMode(TLinkMode m)
TSeedProba::ConstPointer GetInputSeedSinksProba()
TSeedProba::ConstPointer GetInputSeedSourcesProba()