1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkNeighborhoodOperatorImageFunction.txx,v $
Language: C++
Date: $Date: 2006-02-06 22:01:57 $
Version: $Revision: 1.5 $
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 __itkNeighborhoodOperatorImageFunction_txx
#define __itkNeighborhoodOperatorImageFunction_txx
#include "itkNeighborhoodOperatorImageFunction.h"
#include "itkNeighborhoodInnerProduct.h"
#include "itkConstNeighborhoodIterator.h"
namespace itk
{
/** Set the Input Image */
template <class TInputImage,class TOutput>
NeighborhoodOperatorImageFunction<TInputImage,TOutput>
::NeighborhoodOperatorImageFunction()
{
}
/** Print self method */
template <class TInputImage,class TOutput>
void
NeighborhoodOperatorImageFunction<TInputImage,TOutput>
::PrintSelf(std::ostream& os, Indent indent) const
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Applying Operator Function:" << std::endl;
}
/** Evaluate the function at the specifed point */
template <class TInputImage,class TOutput>
TOutput
NeighborhoodOperatorImageFunction<TInputImage,TOutput>
::EvaluateAtIndex(const IndexType& index) const
{
NeighborhoodInnerProduct<InputImageType,TOutput,TOutput> smartInnerProduct;
ConstNeighborhoodIterator<InputImageType> bit;
bit = ConstNeighborhoodIterator<InputImageType>(m_Operator.GetRadius(),this->GetInputImage(),this->GetInputImage()->GetRequestedRegion());
bit.SetLocation(index);
return smartInnerProduct(bit, m_Operator);
}
} // end namespace itk
#endif
|