| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkTransform.txx.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:48 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
|
| 18 |
DEF |
#ifndef _itkTransform_txx |
| 19 |
DEF |
#define _itkTransform_txx |
| 20 |
|
|
| 21 |
|
#include "itkTransform.h" |
| 22 |
|
|
| 23 |
|
namespace itk |
| 24 |
|
{ |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
/** |
| 28 |
|
* Constructor |
| 29 |
|
*/ |
| 30 |
|
template < class TScalarType, |
| 31 |
|
unsigned int NInputDimensions, |
| 32 |
|
unsigned int NOutputDimensions > |
| 33 |
|
Transform< TScalarType,NInputDimensions,NOutputDimensions> |
| 34 |
|
::Transform(): |
| 35 |
IND |
**m_Parameters(1), |
| 36 |
IND |
**m_FixedParameters(1), |
| 37 |
IND |
**m_Jacobian(NOutputDimensions,1) |
| 38 |
|
{ |
| 39 |
LEN |
itkWarningMacro(<< "Using default transform constructor. Should specify NOutputDims and NParameters as args to constructor."); |
| 40 |
|
} |
| 41 |
|
|
| 42 |
|
|
| 43 |
EML |
|
| 44 |
|
/** |
| 45 |
|
* Constructor |
| 46 |
|
*/ |
| 47 |
|
template < class TScalarType, |
| 48 |
|
unsigned int NInputDimensions, |
| 49 |
|
unsigned int NOutputDimensions > |
| 50 |
|
Transform< TScalarType,NInputDimensions,NOutputDimensions> |
| 51 |
|
::Transform(unsigned int dimension,unsigned int numberOfParameters): |
| 52 |
IND |
**m_Parameters(numberOfParameters), |
| 53 |
IND |
**m_FixedParameters(numberOfParameters), |
| 54 |
IND |
**m_Jacobian(dimension,numberOfParameters) |
| 55 |
|
{ |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
|
| 59 |
|
/** |
| 60 |
|
* GenerateName |
| 61 |
|
*/ |
| 62 |
|
template < class TScalarType, |
| 63 |
|
unsigned int NInputDimensions, |
| 64 |
|
unsigned int NOutputDimensions > |
| 65 |
|
std::string Transform< TScalarType,NInputDimensions,NOutputDimensions> |
| 66 |
|
::GetTransformTypeAsString () const |
| 67 |
|
{ |
| 68 |
|
OStringStream n; |
| 69 |
|
n << GetNameOfClass(); |
| 70 |
|
n << "_"; |
| 71 |
|
if ( typeid ( TScalarType ) == typeid ( float ) ) |
| 72 |
|
{ |
| 73 |
|
n << "float"; |
| 74 |
|
} |
| 75 |
|
else if ( typeid ( TScalarType ) == typeid ( double ) ) |
| 76 |
|
{ |
| 77 |
IND |
******n << "double"; |
| 78 |
|
} |
| 79 |
|
else |
| 80 |
|
{ |
| 81 |
IND |
******n << "other"; |
| 82 |
|
} |
| 83 |
|
n << "_" << InputSpaceDimension << "_" << OutputSpaceDimension; |
| 84 |
|
return n.str(); |
| 85 |
|
} |
| 86 |
|
|
| 87 |
|
|
| 88 |
|
} // end namespace itk |
| 89 |
|
|
| 90 |
|
|
| 91 |
|
#endif |
| 92 |
|
|
| 93 |
EOF |
|