| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkVectorNeighborhoodInnerProduct.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:49 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
#ifndef __itkVectorNeighborhoodInnerProduct_h |
| 18 |
|
#define __itkVectorNeighborhoodInnerProduct_h |
| 19 |
|
|
| 20 |
|
#include "itkNeighborhoodIterator.h" |
| 21 |
|
#include "itkVector.h" |
| 22 |
|
#include "itkNeighborhood.h" |
| 23 |
|
#include "itkConstSliceIterator.h" |
| 24 |
|
#include "itkImageBoundaryCondition.h" |
| 25 |
|
|
| 26 |
|
namespace itk { |
| 27 |
|
|
| 28 |
|
/** \class VectorNeighborhoodInnerProduct |
| 29 |
|
* |
| 30 |
|
* This is an explicit implementation of what should really be a partial |
| 31 |
|
* template specialization of NeighborhoodInnerProduct for itkVector. |
| 32 |
|
* |
| 33 |
|
* This class defines the inner product operation between an itk::Neighborhood |
| 34 |
WCM |
* and and itk::NeighborhoodOperator. The operator() method is overloaded |
| 35 |
|
* to support various types of neighborhoods as well as inner products with |
| 36 |
|
* slices of neighborhoods. |
| 37 |
|
* |
| 38 |
|
* \ingroup Operators |
| 39 |
|
* |
| 40 |
|
*/ |
| 41 |
|
template<class TImage> |
| 42 |
|
class ITK_EXPORT VectorNeighborhoodInnerProduct |
| 43 |
|
{ |
| 44 |
|
public: |
| 45 |
|
/** Standard typedefs */ |
| 46 |
|
typedef VectorNeighborhoodInnerProduct Self; |
| 47 |
|
|
| 48 |
|
itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension); |
| 49 |
|
|
| 50 |
LEN |
/** Extract the pixel type and scalar type from the image template parameter. */ |
| 51 |
|
typedef typename TImage::PixelType PixelType; |
| 52 |
TDA |
typedef typename PixelType::ValueType ScalarValueType; |
| 53 |
|
typedef Neighborhood<PixelType, |
| 54 |
TDA |
itkGetStaticConstMacro(ImageDimension)> NeighborhoodType; |
| 55 |
|
|
| 56 |
LEN |
/** Extract the image and vector dimension from the image template parameter. */ |
| 57 |
|
itkStaticConstMacro(VectorDimension, unsigned int, |
| 58 |
|
PixelType::Dimension); |
| 59 |
|
|
| 60 |
|
/** Operator typedef */ |
| 61 |
|
typedef Neighborhood<ScalarValueType, |
| 62 |
|
itkGetStaticConstMacro(ImageDimension)> OperatorType; |
| 63 |
|
|
| 64 |
|
/** Conversion operator. */ |
| 65 |
|
PixelType operator()(const std::slice &s, |
| 66 |
|
const ConstNeighborhoodIterator<TImage> &it, |
| 67 |
|
const OperatorType &op) const; |
| 68 |
|
|
| 69 |
|
/** Conversion operator. */ |
| 70 |
|
PixelType operator()(const ConstNeighborhoodIterator<TImage> &it, |
| 71 |
|
const OperatorType &op) const |
| 72 |
|
{ |
| 73 |
IND |
******return this->operator()(std::slice(0, it.Size(), 1), it, op); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
PixelType operator()(const std::slice &s, const NeighborhoodType &N, |
| 77 |
|
const OperatorType &op) const; |
| 78 |
|
|
| 79 |
|
}; |
| 80 |
|
|
| 81 |
|
} // end namespace itk |
| 82 |
|
|
| 83 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 84 |
|
#include "itkVectorNeighborhoodInnerProduct.txx" |
| 85 |
|
#endif |
| 86 |
|
|
| 87 |
|
#endif |
| 88 |
|
|