ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVectorThresholdSegmentationLevelSetImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkVectorThresholdSegmentationLevelSetImageFilter_h
00019 #define __itkVectorThresholdSegmentationLevelSetImageFilter_h
00020 
00021 #include "itkSegmentationLevelSetImageFilter.h"
00022 #include "itkVectorThresholdSegmentationLevelSetFunction.h"
00023 
00024 namespace itk
00025 {
00088 template< class TInputImage,
00089           class TFeatureImage,
00090           class TOutputPixelType = float >
00091 class ITK_EXPORT VectorThresholdSegmentationLevelSetImageFilter:
00092   public SegmentationLevelSetImageFilter< TInputImage, TFeatureImage, TOutputPixelType >
00093 {
00094 public:
00096   typedef VectorThresholdSegmentationLevelSetImageFilter                                   Self;
00097   typedef  SegmentationLevelSetImageFilter< TInputImage, TFeatureImage, TOutputPixelType > Superclass;
00098   typedef SmartPointer< Self >                                                             Pointer;
00099   typedef SmartPointer< const Self >                                                       ConstPointer;
00100 
00102   typedef typename Superclass::ValueType        ValueType;
00103   typedef typename Superclass::OutputImageType  OutputImageType;
00104   typedef typename Superclass::FeatureImageType FeatureImageType;
00105 
00107   typedef VectorThresholdSegmentationLevelSetFunction< OutputImageType, FeatureImageType > ThresholdFunctionType;
00108   typedef typename ThresholdFunctionType::Pointer                                          ThresholdFunctionPointer;
00109   typedef typename ThresholdFunctionType::MeanVectorType                                   MeanVectorType;
00110   typedef typename ThresholdFunctionType::CovarianceMatrixType                             CovarianceMatrixType;
00111   typedef typename ThresholdFunctionType::ScalarValueType                                  ScalarValueType;
00112 
00114   itkTypeMacro(VectorThresholdSegmentationLevelSetImageFilter, SegmentationLevelSetImageFilter);
00115 
00117   itkNewMacro(Self);
00118 
00121   void SetMean(const MeanVectorType & mean)
00122   {
00123     m_ThresholdFunction->SetMean(mean);
00124     this->Modified();
00125   }
00127 
00128   const MeanVectorType & GetMean() const
00129   {
00130     return m_ThresholdFunction->GetMean();
00131   }
00132 
00133   void SetCovariance(const CovarianceMatrixType & cov)
00134   {
00135     m_ThresholdFunction->SetCovariance(cov);
00136     this->Modified();
00137   }
00138 
00139   const CovarianceMatrixType & GetCovariance() const
00140   {
00141     return m_ThresholdFunction->GetCovariance();
00142   }
00143 
00145   void SetThreshold(ScalarValueType thr)
00146   {
00147     m_ThresholdFunction->SetThreshold(thr);
00148     this->Modified();
00149   }
00151 
00152   ScalarValueType GetThreshold()
00153   {
00154     return m_ThresholdFunction->GetThreshold();
00155   }
00156 
00157 protected:
00158   ~VectorThresholdSegmentationLevelSetImageFilter() {}
00159   VectorThresholdSegmentationLevelSetImageFilter();
00160 
00161   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00162 
00163   VectorThresholdSegmentationLevelSetImageFilter(const Self &); // purposely not
00164                                                                 // impl.
00165   void operator=(const Self &);                                 //purposely not
00166 
00167   // implemented
00168 private:
00169   ThresholdFunctionPointer m_ThresholdFunction;
00170 };
00171 } // end namespace itk
00172 
00173 #ifndef ITK_MANUAL_INSTANTIATION
00174 #include "itkVectorThresholdSegmentationLevelSetImageFilter.hxx"
00175 #endif
00176 
00177 #endif
00178