00001 /*========================================================================= 00002 00003 Program: Realign Volumes 00004 Module: $HeadURL: http://svn.slicer.org/Slicer3/trunk/Applications/CLI/Realign/vtkPrincipalAxesAlign.h $ 00005 Language: C++ 00006 Date: $Date: 2008-11-24 16:40:29 -0500 (Mon, 24 Nov 2008) $ 00007 Version: $Revision: 7967 $ 00008 00009 Copyright (c) Brigham and Women's Hospital (BWH) All Rights Reserved. 00010 00011 See License.txt or http://www.slicer.org/copyright/copyright.txt for details. 00012 00013 ==========================================================================*/ 00014 #ifndef __vtk_principal_axes_align_h 00015 #define __vtk_principal_axes_align_h 00016 #include <vtkPolyDataToPolyDataFilter.h> 00017 #include <vtkSetGet.h> 00018 // --------------------------------------------------------- 00019 // Author: Axel Krauth 00020 // 00021 // This class computes the principal axes of the input. 00022 // The direction of the eigenvector for the largest eigenvalue is the XAxis, 00023 // the direction of the eigenvector for the smallest eigenvalue is the ZAxis, 00024 // and the YAxis the the eigenvector for the remaining eigenvalue. 00025 class vtkPrincipalAxesAlign : public vtkPolyDataToPolyDataFilter 00026 { 00027 public: 00028 static vtkPrincipalAxesAlign* New(); 00029 vtkTypeMacro(vtkPrincipalAxesAlign,vtkPolyDataToPolyDataFilter); 00030 00031 vtkGetVector3Macro(Center,vtkFloatingPointType); 00032 vtkGetVector3Macro(XAxis,vtkFloatingPointType); 00033 vtkGetVector3Macro(YAxis,vtkFloatingPointType); 00034 vtkGetVector3Macro(ZAxis,vtkFloatingPointType); 00035 void Execute(); 00036 void PrintSelf(ostream& os, vtkIndent indent); 00037 protected: 00038 vtkPrincipalAxesAlign(); 00039 ~vtkPrincipalAxesAlign(); 00040 00041 private: 00042 vtkPrincipalAxesAlign(vtkPrincipalAxesAlign&); 00043 void operator=(const vtkPrincipalAxesAlign&); 00044 00045 vtkFloatingPointType* Center; 00046 vtkFloatingPointType* XAxis; 00047 vtkFloatingPointType* YAxis; 00048 vtkFloatingPointType* ZAxis; 00049 00050 // a matrix of the eigenvalue problem 00051 double** eigenvalueProblem; 00052 // for efficiency reasons parts of the eigenvalue problem are computed separately 00053 double** eigenvalueProblemDiag; 00054 double** eigenvectors; 00055 double* eigenvalues; 00056 }; 00057 00058 #endif
1.6.1