00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkLogImageAdaptor_h
00018
#define __itkLogImageAdaptor_h
00019
00020
#include <itkImageAdaptor.h>
00021
#include "vnl/vnl_math.h"
00022
00023
namespace itk
00024 {
00025
00026
namespace Accessor {
00038
template <
class TInternalType,
class TExternalType >
00039 class ITK_EXPORT LogPixelAccessor
00040 {
00041
public:
00044 typedef TExternalType
ExternalType;
00045
00048 typedef TInternalType
InternalType;
00049
00050 static inline void Set(TInternalType & output,
const TExternalType & input)
00051 {output = (TInternalType)log((
double)input);}
00052
00053 static inline TExternalType Get(
const TInternalType & input )
00054 {
return (TExternalType)log((
double)input);}
00055
00056 };
00057
00058
00059 }
00060
00069
template <
class TImage,
class TOutputPixelType>
00070 class ITK_EXPORT LogImageAdaptor :
public
00071
ImageAdaptor<TImage,
00072 Accessor::LogPixelAccessor<
00073 typename TImage::PixelType,
00074 TOutputPixelType> >
00075 {
00076
public:
00078 typedef LogImageAdaptor
Self;
00079
typedef ImageAdaptor<TImage,
00080
Accessor::LogPixelAccessor<
00081
typename TImage::PixelType,
00082 TOutputPixelType> >
Superclass;
00083 typedef SmartPointer<Self> Pointer;
00084 typedef SmartPointer<const Self> ConstPointer;
00085
00087
itkTypeMacro( LogImageAdaptor,
ImageAdaptor );
00088
00090
itkNewMacro(
Self);
00091
00092
protected:
00093 LogImageAdaptor() {}
00094 virtual ~LogImageAdaptor() {}
00095
00096
private:
00097 LogImageAdaptor(
const Self&);
00098
void operator=(
const Self&);
00099 };
00100
00101 }
00102
00103
#endif