cmtkAffineXformUniformVolume.h

Go to the documentation of this file.
00001 /*
00002 //
00003 //  Copyright 1997-2009 Torsten Rohlfing
00004 //
00005 //  Copyright 2004-2010 SRI International
00006 //
00007 //  This file is part of the Computational Morphometry Toolkit.
00008 //
00009 //  http://www.nitrc.org/projects/cmtk/
00010 //
00011 //  The Computational Morphometry Toolkit is free software: you can
00012 //  redistribute it and/or modify it under the terms of the GNU General Public
00013 //  License as published by the Free Software Foundation, either version 3 of
00014 //  the License, or (at your option) any later version.
00015 //
00016 //  The Computational Morphometry Toolkit is distributed in the hope that it
00017 //  will be useful, but WITHOUT ANY WARRANTY; without even the implied
00018 //  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 //  GNU General Public License for more details.
00020 //
00021 //  You should have received a copy of the GNU General Public License along
00022 //  with the Computational Morphometry Toolkit.  If not, see
00023 //  <http://www.gnu.org/licenses/>.
00024 //
00025 //  $Revision: 2453 $
00026 //
00027 //  $LastChangedDate: 2010-10-18 10:33:06 -0700 (Mon, 18 Oct 2010) $
00028 //
00029 //  $LastChangedBy: torstenrohlfing $
00030 //
00031 */
00032 
00033 #ifndef __cmtkAffineXformUniformVolume_h_included_
00034 #define __cmtkAffineXformUniformVolume_h_included_
00035 
00036 #include <cmtkconfig.h>
00037 
00038 #include <Base/cmtkXformUniformVolume.h>
00039 #include <Base/cmtkUniformVolume.h>
00040 
00041 namespace
00042 cmtk
00043 {
00044 
00047 
00050 class AffineXformUniformVolume :
00052   public XformUniformVolume
00053 {
00054 public:
00056   typedef AffineXformUniformVolume Self;
00057 
00059   typedef XformUniformVolume Superclass;
00060 
00062   typedef SmartPointer<Self> SmartPtr;
00063 
00065   typedef SmartConstPointer<Self> SmartConstPtr;
00066 
00068   AffineXformUniformVolume( const UniformVolume& volume, const AffineXform& xform );
00069   
00071   virtual ~AffineXformUniformVolume() {}
00072   
00075   virtual void GetTransformedGrid( Vector3D& v, const int idxX, const int idxY, const int idxZ ) const
00076   {
00077     ( (v = this->m_VolumeAxesX[idxX]) 
00078       += this->m_VolumeAxesY[idxY]) 
00079       += this->m_VolumeAxesZ[idxZ]; 
00080   }
00081   
00084   virtual void GetTransformedGridRow( Vector3D *const v, const size_t numPoints, const int idxX, const int idxY, const int idxZ ) const
00085   {
00086     Vector3D v0 = this->m_VolumeAxesY[idxY];
00087     v0 += this->m_VolumeAxesZ[idxZ];
00088     
00089     int idx = idxX;
00090     for ( size_t n=0; n < numPoints; ++n, ++idx ) 
00091       {
00092       (v[n] = v0) += this->m_VolumeAxesX[idx];
00093       }
00094   }
00095   
00096 private:
00098   std::vector<Vector3D> m_VolumeAxesX;
00099 
00100   std::vector<Vector3D> m_VolumeAxesY;
00101 
00102   std::vector<Vector3D> m_VolumeAxesZ;
00103 };
00104 
00106 
00107 } // namespace cmtk
00108 
00109 #endif // #ifdef __cmtkAffineXformUniformVolume_h_included_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines