itksubsample.txx

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

TXX
101
字号
/*=========================================================================

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

  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 __itkSubsample_txx
#define __itkSubsample_txx

#include "itkObject.h"

namespace itk{ 
namespace Statistics{

template< class TSample >
Subsample< TSample >
::Subsample()
{
  m_Sample = 0 ;
  m_TotalFrequency = NumericTraits< FrequencyType >::Zero ;
  m_ActiveDimension = 0 ;
}

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

  os << indent << "Sample: " ;
  if ( m_Sample != 0 )
    {
    os << m_Sample << std::endl ;
    }
  else
    {
    os << "not set." << std::endl ;
    }

  os << indent << "TotalFrequency: " << m_TotalFrequency << std::endl ;
  os << indent << "ActiveDimension: " << m_ActiveDimension << std::endl ;
  os << indent << "InstanceIdentifierHolder : " << &m_IdHolder << std::endl ;
}

template< class TSample >
inline typename Subsample< TSample >::MeasurementVectorType
Subsample< TSample >
::GetMeasurementVectorByIndex(int index)
{
  return m_Sample->GetMeasurementVector(m_IdHolder[index]) ;
}

template< class TSample >
inline typename Subsample< TSample >::FrequencyType
Subsample< TSample >
::GetFrequencyByIndex(int index)
{
  return m_Sample->GetFrequency(m_IdHolder[index]) ;
}

template< class TSample >
inline typename Subsample< TSample >::InstanceIdentifier
Subsample< TSample >
::GetInstanceIdentifier(int index)
{
  return m_IdHolder[index] ;
}

template< class TSample >
inline void
Subsample< TSample >
::Swap(int index1, int index2)
{
  InstanceIdentifier temp = m_IdHolder[index1] ;
  m_IdHolder[index1] = m_IdHolder[index2] ;
  m_IdHolder[index2] = temp ;
}

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

#endif







⌨️ 快捷键说明

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