ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFiniteDifferenceSparseImageFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkFiniteDifferenceSparseImageFunction_h
00019 #define __itkFiniteDifferenceSparseImageFunction_h
00020 
00021 #include "itkFiniteDifferenceFunction.h"
00022 
00023 namespace itk
00024 {
00046 template< class TSparseImageType >
00047 class ITK_EXPORT FiniteDifferenceSparseImageFunction:
00048   public FiniteDifferenceFunction< TSparseImageType >
00049 {
00050 public:
00051 
00053   typedef FiniteDifferenceSparseImageFunction          Self;
00054   typedef FiniteDifferenceFunction< TSparseImageType > Superclass;
00055   typedef SmartPointer< Self >                         Pointer;
00056   typedef SmartPointer< const Self >                   ConstPointer;
00057 
00059   itkTypeMacro(FiniteDifferenceSparseImageFunction, FiniteDifferenceFunction);
00060 
00062   itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
00063 
00065   typedef typename Superclass::PixelType        PixelType;
00066   typedef typename Superclass::TimeStepType     TimeStepType;
00067   typedef typename Superclass::RadiusType       RadiusType;
00068   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00069   typedef typename Superclass::FloatOffsetType  FloatOffsetType;
00070   typedef typename Superclass::ImageType        SparseImageType;
00071 
00073   typedef typename SparseImageType::IndexType IndexType;
00074 
00076   typedef typename SparseImageType::NodeType NodeType;
00077 
00079   typedef typename NodeType::NodeDataType NodeDataType;
00080 
00085   virtual PixelType ComputeUpdate(const NeighborhoodType &,
00086                                   void *,
00087                                   const FloatOffsetType &)
00088   {
00089     return static_cast< PixelType >( 0 );
00090   }
00091 
00094   virtual NodeDataType
00095   ComputeSparseUpdate( NeighborhoodType & neighborhood,
00096                        void *globalData,
00097                        const FloatOffsetType & offset = FloatOffsetType(0.0) )
00098   const = 0;
00099 
00109   virtual void PrecomputeSparseUpdate(NeighborhoodType &) const {}
00110 protected:
00111   FiniteDifferenceSparseImageFunction() {}
00112   ~FiniteDifferenceSparseImageFunction() {}
00113   void PrintSelf(std::ostream & os, Indent indent) const;
00115 
00116 private:
00117   FiniteDifferenceSparseImageFunction(const Self &); //purposely not implemented
00118   void operator=(const Self &);                      //purposely not implemented
00119 };
00120 } // end namespace itk
00121 
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkFiniteDifferenceSparseImageFunction.hxx"
00124 #endif
00125 
00126 #endif
00127