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 #ifndef __cmtkPlane_h_included_
00034 #define __cmtkPlane_h_included_
00035
00036 #include <cmtkconfig.h>
00037
00038 #include <Pipeline/cmtkPipelineObject.h>
00039
00040 #include <Base/cmtkMacros.h>
00041 #include <Base/cmtkTypes.h>
00042 #include <Base/cmtkVector3D.h>
00043
00044 namespace
00045 cmtk
00046 {
00047
00050
00053 class Plane :
00054 public PipelineObject
00055 {
00056 public:
00058 static Plane* New() { return new Plane; }
00059
00061 igsClassParameter2Array(unsigned int,Dims);
00062
00064 igsClassParameter2Array(Types::Coordinate,Spacing);
00065
00067 igsClassParameter3Array(Types::Coordinate,Origin);
00068
00070 igsClassParameter3Array(Types::Coordinate,DirectionX);
00071
00073 igsClassParameter3Array(Types::Coordinate,DirectionY);
00074
00079 void CopyStructure( const Plane *plane );
00080
00082 virtual unsigned int GetNumPixels() const { return Dims[0]*Dims[1]; }
00083
00085 void GetPixelLocation( Vector3D& v, const unsigned int x, const unsigned int y ) const
00086 {
00087 for ( int dim = 0; dim<3; ++dim )
00088 v[dim] = Origin[dim] + x * DirectionX[dim] * Spacing[0] + y * DirectionY[dim] * Spacing[1];
00089 }
00090
00095 void Project( Vector3D& p, const Vector3D& q ) const;
00096
00102 void ProjectPixel( const Vector3D& v, unsigned int& i, unsigned int& j ) const;
00103
00104 protected:
00108 Plane();
00109
00111 virtual ~Plane() {};
00112 };
00113
00115
00116 }
00117
00118 #endif // #ifndef __cmtkPlane_h_included_