dox/Imaging/vtkImageLinearFit.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   vtkCNMRRLibrary
00004   Module:    $RCSfile: vtkImageLinearFit.h,v $
00005 
00006   Copyright  2006  The Pennsylvania State University
00007   
00008           Notice
00009  
00010   The contents of this file are subject to The Pennsylvania State University 
00011   Open Source License (the "License"); you may not use this file except in 
00012   compliance with the License. You may obtain a copy of the License at H066 
00013   Radiology, NMR Building, 500 University Drive, Hershey, PA, 
00014   tel. (717) 531-6069 or via email at dcb210@psu.edu.
00015  
00016   Software distributed under the License is distributed on an "AS IS" basis, 
00017   WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
00018   for the specific language governing rights and limitations under the 
00019   License.
00020  
00021   The Original Code is listed under Exhibit A of the license.
00022  
00023   The Initial Developer of the Original Code is Don Bigler.
00024  
00025   Contributor(s):
00026 
00027 =========================================================================*/
00066 #ifndef __vtkImageLinearFit_h
00067 #define __vtkImageLinearFit_h
00068 
00069 // Fitting options.
00070 #define VTK_FIT_LINEAR      0
00071 #define VTK_FIT_QUADRATIC   1
00072 #define VTK_FIT_CUBIC       2
00073 #define VTK_FIT_EXPONENTIAL 3
00074 #define VTK_FIT_LOGARITHMIC 4
00075 #define VTK_FIT_POWER       5
00076 
00077 #include "vtkImageMultipleInputFilter.h"
00078 #include "vtkDoubleArray.h"
00079 #include "vtkCNMRRImagingWin32Header.h"
00080 
00081 class VTK_CNMRR_IMAGING_EXPORT vtkImageLinearFit : public vtkImageMultipleInputFilter
00082 {
00083    public:
00084       static vtkImageLinearFit *New();
00085       vtkTypeRevisionMacro(vtkImageLinearFit,vtkImageMultipleInputFilter);
00086       void PrintSelf(ostream& os, vtkIndent indent);
00087          
00089 
00090       void SetFitModel(int model);
00091       vtkGetMacro(FitModel,int);
00092       void SetFitModelToLinear() {this->SetFitModel(VTK_FIT_LINEAR);};
00093       void SetFitModelToQuadratic() {this->SetFitModel(VTK_FIT_QUADRATIC);};
00094       void SetFitModelToCubic() {this->SetFitModel(VTK_FIT_CUBIC);};
00095       void SetFitModelToExponential() {this->SetFitModel(VTK_FIT_EXPONENTIAL);};
00096       void SetFitModelToLogarithmic() {this->SetFitModel(VTK_FIT_LOGARITHMIC);};
00097       void SetFitModelToPower() {this->SetFitModel(VTK_FIT_POWER);};
00099   
00102       void SetInputVariables(vtkDoubleArray *_arg);
00103    
00105       vtkDoubleArray *GetInputVariables();
00106    
00108 
00110       vtkSetMacro(StopAtFirstZero,int);
00111       vtkGetMacro(StopAtFirstZero,int);
00112       vtkBooleanMacro(StopAtFirstZero, int);
00114       
00116 
00117       static void CalculateLinearFit(double *X, double *Y, unsigned int num, 
00118                double &c3, double &c2, double &rSquared);
00120       
00122 
00123       static void CalculateQuadraticFit(double *X, double *Y, unsigned int num, 
00124                double &c4, double &c3, double &c2, double &rSquared);
00126                
00128 
00129       static void CalculateCubicFit(double *X, double *Y, unsigned int num, 
00130                double &c5, double &c4, double &c3, double &c2, double &rSquared);
00132                
00134 
00135       static void CalculateExponentialFit(double *X, double *Y, unsigned int num, 
00136                double &c3, double &c2, double &rSquared);
00138                
00140 
00141       static void CalculateLogarithmicFit(double *X, double *Y, unsigned int num, 
00142                double &c3, double &c2, double &rSquared);
00144                
00146 
00147       static void CalculatePowerFit(double *X, double *Y, unsigned int num, 
00148                double &c3, double &c2, double &rSquared);
00150    
00151    protected:
00152 
00153       vtkImageLinearFit();
00154       ~vtkImageLinearFit();
00155 
00156       void ExecuteInformation(vtkImageData **inputs, vtkImageData *output);
00157    
00158       void ExecuteInformation(){this->vtkImageMultipleInputFilter::ExecuteInformation();};
00159       
00160       void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
00161                      int extent[6], int id);
00162       
00163       void InitOutput(int outExt[6], vtkImageData *outData);
00164       
00165       vtkDoubleArray *InputVariables;
00166       
00167       int StopAtFirstZero;
00168       
00169       int FitModel;
00170          
00171    private:
00172       vtkImageLinearFit(const vtkImageLinearFit&);  // Not implemented.
00173       void operator=(const vtkImageLinearFit&);  // Not implemented.
00174 };
00175 
00176 #endif

Generated on Tue May 12 14:53:03 2009 for vtkCNMRRLibrary by  doxygen 1.4.7