Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "cmtkAffineXformUniformVolume.h"
00034
00035 cmtk::AffineXformUniformVolume::AffineXformUniformVolume( const UniformVolume& volume, const AffineXform& xform )
00036 : m_VolumeAxesX( volume.m_Dims[0] ),
00037 m_VolumeAxesY( volume.m_Dims[1] ),
00038 m_VolumeAxesZ( volume.m_Dims[2] )
00039 {
00040
00041 UniformVolume::CoordinateVectorType dX = FixedVectorStaticInitializer<3,Types::Coordinate>::Init(1,0,0);
00042 UniformVolume::CoordinateVectorType dY = FixedVectorStaticInitializer<3,Types::Coordinate>::Init(0,1,0);
00043 UniformVolume::CoordinateVectorType dZ = FixedVectorStaticInitializer<3,Types::Coordinate>::Init(0,0,1);
00044 UniformVolume::CoordinateVectorType V = FixedVectorStaticInitializer<3,Types::Coordinate>::Init(0,0,0);
00045
00046 xform.ApplyInPlace(V);
00047 xform.ApplyInPlace(dX);
00048 dX -= V;
00049 xform.ApplyInPlace(dY);
00050 dY -= V;
00051 xform.ApplyInPlace(dZ);
00052 dZ -= V;
00053
00054 const Types::Coordinate deltaX = volume.m_Delta[0];
00055 const Types::Coordinate deltaY = volume.m_Delta[1];
00056 const Types::Coordinate deltaZ = volume.m_Delta[2];
00057
00058 for ( size_t idx = 0; idx < static_cast<size_t>( volume.m_Dims[0] ); ++idx )
00059 this->m_VolumeAxesX[idx] = deltaX*idx*dX;
00060 for ( size_t idx = 0; idx < static_cast<size_t>( volume.m_Dims[1] ); ++idx )
00061 this->m_VolumeAxesY[idx] = deltaY*idx*dY;
00062 for ( size_t idx = 0; idx < static_cast<size_t>( volume.m_Dims[2] ); ++idx )
00063 (this->m_VolumeAxesZ[idx] = deltaZ*idx*dZ) += V;
00064 }
00065