VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMNITransformWriter.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*========================================================================= 00016 00017 Copyright (c) 2006 Atamai, Inc. 00018 00019 Use, modification and redistribution of the software, in source or 00020 binary forms, are permitted provided that the following terms and 00021 conditions are met: 00022 00023 1) Redistribution of the source code, in verbatim or modified 00024 form, must retain the above copyright notice, this license, 00025 the following disclaimer, and any notices that refer to this 00026 license and/or the following disclaimer. 00027 00028 2) Redistribution in binary form must include the above copyright 00029 notice, a copy of this license and the following disclaimer 00030 in the documentation or with other materials provided with the 00031 distribution. 00032 00033 3) Modified copies of the source code must be clearly marked as such, 00034 and must not be misrepresented as verbatim copies of the source code. 00035 00036 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" 00037 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO, 00038 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00039 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY 00040 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE 00041 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES 00042 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE 00043 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF 00044 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE 00045 POSSIBILITY OF SUCH DAMAGES. 00046 00047 =========================================================================*/ 00066 #ifndef vtkMNITransformWriter_h 00067 #define vtkMNITransformWriter_h 00068 00069 #include "vtkIOMINCModule.h" // For export macro 00070 #include "vtkAlgorithm.h" 00071 00072 class vtkAbstractTransform; 00073 class vtkHomogeneousTransform; 00074 class vtkThinPlateSplineTransform; 00075 class vtkGridTransform; 00076 class vtkCollection; 00077 00078 class VTKIOMINC_EXPORT vtkMNITransformWriter : public vtkAlgorithm 00079 { 00080 public: 00081 vtkTypeMacro(vtkMNITransformWriter,vtkAlgorithm); 00082 00083 static vtkMNITransformWriter *New(); 00084 virtual void PrintSelf(ostream& os, vtkIndent indent); 00085 00087 00088 vtkSetStringMacro(FileName); 00089 vtkGetStringMacro(FileName); 00091 00093 00094 virtual const char* GetFileExtensions() { 00095 return ".xfm"; } 00097 00099 00100 virtual const char* GetDescriptiveName() { 00101 return "MNI Transform"; } 00103 00105 00106 virtual void SetTransform(vtkAbstractTransform *transform); 00107 virtual vtkAbstractTransform *GetTransform() { 00108 return this->Transform; }; 00110 00113 virtual void AddTransform(vtkAbstractTransform *transform); 00114 00116 virtual int GetNumberOfTransforms(); 00117 00119 00120 vtkSetStringMacro(Comments); 00121 vtkGetStringMacro(Comments); 00123 00125 virtual void Write(); 00126 00127 protected: 00128 vtkMNITransformWriter(); 00129 ~vtkMNITransformWriter(); 00130 00131 char *FileName; 00132 vtkAbstractTransform *Transform; 00133 vtkCollection *Transforms; 00134 char *Comments; 00135 00136 int WriteLinearTransform(ostream &outfile, 00137 vtkHomogeneousTransform *transform); 00138 int WriteThinPlateSplineTransform(ostream &outfile, 00139 vtkThinPlateSplineTransform *transform); 00140 int WriteGridTransform(ostream &outfile, 00141 vtkGridTransform *transform); 00142 00143 virtual int WriteTransform(ostream &outfile, 00144 vtkAbstractTransform *transform); 00145 00146 virtual int WriteFile(); 00147 00148 virtual int ProcessRequest(vtkInformation* request, 00149 vtkInformationVector** inInfo, 00150 vtkInformationVector* outInfo); 00151 00152 private: 00153 vtkMNITransformWriter(const vtkMNITransformWriter&); // Not implemented 00154 void operator=(const vtkMNITransformWriter&); // Not implemented 00155 00156 }; 00157 00158 #endif