itksamplemeanshiftblurringfilter.txx

来自「InsightToolkit-1.4.0(有大量的优化算法程序)」· TXX 代码 · 共 90 行

TXX
90
字号
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkSampleMeanShiftBlurringFilter.txx,v $
  Language:  C++
  Date:      $Date: 2003/09/10 14:29:47 $
  Version:   $Revision: 1.2 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __itkSampleMeanShiftBlurringFilter_txx
#define __itkSampleMeanShiftBlurringFilter_txx

namespace itk{ 
namespace Statistics{

template< class TSample >
SampleMeanShiftBlurringFilter< TSample >
::SampleMeanShiftBlurringFilter()
{
  m_Output = OutputType::New() ;
  m_ModeSeeker = 0 ;
}

template< class TSample >
SampleMeanShiftBlurringFilter< TSample >
::~SampleMeanShiftBlurringFilter()
{
}

template< class TSample >
void
SampleMeanShiftBlurringFilter< TSample >
::PrintSelf(std::ostream& os, Indent indent) const
{
  Superclass::PrintSelf(os,indent);

  os << indent << "Output: " << m_Output << std::endl;
}

template< class TSample >
void
SampleMeanShiftBlurringFilter< TSample >
::SetMeanShiftModeSeeker(MeanShiftModeSeekerType* seeker)
{
  if ( m_ModeSeeker != seeker )
    {
    m_ModeSeeker = seeker ;
    this->Modified() ;
    }
}

template< class TSample >
typename SampleMeanShiftBlurringFilter< TSample >::OutputType*
SampleMeanShiftBlurringFilter< TSample >
::GetOutput()
{
  return m_Output.GetPointer() ;
} 

template< class TSample >
inline void
SampleMeanShiftBlurringFilter< TSample >
::GenerateData() 
{
  typename InputSampleType::Iterator iter = this->GetInputSample()->Begin() ;
  typename InputSampleType::Iterator end = this->GetInputSample()->End() ;

  m_Output->Clear() ;
  MeasurementVectorType finalPoint ;
  while ( iter != end )
    {
    finalPoint = m_ModeSeeker->Evolve( iter.GetMeasurementVector() ) ;
    m_Output->PushBack( finalPoint  ) ;
    ++iter ;
    }
}

} // end of namespace Statistics 
} // end of namespace itk

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?