| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkOrthogonallyCorrected2DParametricPath.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:43 $ |
| 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 |
|
#ifndef __itkOrthogonallyCorrected2DParametricPath_h |
| 19 |
|
#define __itkOrthogonallyCorrected2DParametricPath_h |
| 20 |
|
|
| 21 |
|
#include "itkParametricPath.h" |
| 22 |
|
#include "itkVectorContainer.h" |
| 23 |
|
#include "itkContinuousIndex.h" |
| 24 |
|
#include "itkIndex.h" |
| 25 |
|
#include "itkOffset.h" |
| 26 |
|
#include "itkVector.h" |
| 27 |
|
|
| 28 |
|
namespace itk |
| 29 |
|
{ |
| 30 |
|
|
| 31 |
|
/** \class OrthogonallyCorrected2DParametricPath |
| 32 |
|
* \brief Represent an orthogonally corrected 2D parametric path |
| 33 |
|
* |
| 34 |
|
* Description |
| 35 |
|
* |
| 36 |
|
* \sa EllipseParametricPath |
| 37 |
|
* \sa PolyLineParametricPath |
| 38 |
|
* \sa ParametricPath |
| 39 |
|
* \sa Path |
| 40 |
|
* \sa ContinuousIndex |
| 41 |
|
* \sa Index |
| 42 |
|
* \sa Offset |
| 43 |
|
* \sa Vector |
| 44 |
|
* |
| 45 |
|
* \ingroup PathObjects |
| 46 |
|
*/ |
| 47 |
|
class ITKCommon_EXPORT OrthogonallyCorrected2DParametricPath : public |
| 48 |
|
ParametricPath<2> |
| 49 |
|
{ |
| 50 |
|
public: |
| 51 |
|
/** Standard class typedefs. */ |
| 52 |
|
typedef OrthogonallyCorrected2DParametricPath Self; |
| 53 |
|
typedef ParametricPath<2> Superclass; |
| 54 |
|
typedef SmartPointer<Self> Pointer; |
| 55 |
|
typedef SmartPointer<const Self> ConstPointer; |
| 56 |
|
|
| 57 |
|
/** Run-time type information (and related methods). */ |
| 58 |
|
itkTypeMacro(OrthogonallyCorrected2DParametricPath, ParametricPath); |
| 59 |
|
|
| 60 |
|
/** Input type */ |
| 61 |
|
typedef Superclass::InputType InputType; |
| 62 |
|
|
| 63 |
|
/** Output type */ |
| 64 |
|
typedef Superclass::OutputType OutputType; |
| 65 |
|
|
| 66 |
|
|
| 67 |
|
/** Basic data-structure types used */ |
| 68 |
|
typedef ContinuousIndex<double,2> ContinuousIndexType; |
| 69 |
|
typedef Index<2> IndexType; |
| 70 |
|
typedef Offset<2> OffsetType; |
| 71 |
|
typedef Superclass::VectorType VectorType; |
| 72 |
|
typedef ParametricPath<2> OriginalPathType; |
| 73 |
|
typedef OriginalPathType::ConstPointer OriginalPathConstPointer; |
| 74 |
|
typedef VectorContainer<unsigned, double> OrthogonalCorrectionTableType; |
| 75 |
LEN,TDA |
typedef OrthogonalCorrectionTableType::Pointer OrthogonalCorrectionTablePointer; |
| 76 |
|
|
| 77 |
|
|
| 78 |
|
/** Return the location of the parametric path at the specified location. */ |
| 79 |
|
virtual OutputType Evaluate( const InputType & input ) const; |
| 80 |
|
|
| 81 |
|
/** Set pointer to the original path. The path MUST be continuous in its |
| 82 |
|
* first derivative to prevent discontinuities in the corrected path. The |
| 83 |
|
* path should also be closed, since the first correction is applied to both |
| 84 |
|
* the beginnning and the end of the original path. */ |
| 85 |
|
// The usual itkSetObjectMacro can not be used here because |
| 86 |
|
// m_DefaultInputStepSize must also be copied over. |
| 87 |
|
void SetOriginalPath( const OriginalPathType *originalPath ); |
| 88 |
|
|
| 89 |
|
/** Set table of evenly-spaced orthogonal offsets for the original path. */ |
| 90 |
|
itkSetObjectMacro( OrthogonalCorrectionTable, OrthogonalCorrectionTableType ) |
| 91 |
|
|
| 92 |
|
/** New() method for dynamic construction */ |
| 93 |
|
itkNewMacro( Self ); |
| 94 |
|
|
| 95 |
|
/** Needed for Pipelining */ |
| 96 |
|
virtual void Initialize(void) |
| 97 |
|
{ |
| 98 |
|
this->m_OriginalPath = NULL; |
| 99 |
|
this->m_OrthogonalCorrectionTable = NULL; |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
/** These are determined by the original path */ |
| 103 |
|
virtual inline InputType StartOfInput() const |
| 104 |
|
{ |
| 105 |
|
return m_OriginalPath->StartOfInput(); |
| 106 |
|
} |
| 107 |
|
virtual inline InputType EndOfInput() const |
| 108 |
|
{ |
| 109 |
|
return m_OriginalPath->EndOfInput(); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
protected: |
| 114 |
|
OrthogonallyCorrected2DParametricPath(); |
| 115 |
|
~OrthogonallyCorrected2DParametricPath(){} |
| 116 |
|
void PrintSelf(std::ostream& os, Indent indent) const; |
| 117 |
|
|
| 118 |
|
private: |
| 119 |
LEN |
OrthogonallyCorrected2DParametricPath(const Self&); //purposely not implemented |
| 120 |
|
void operator=(const Self&); //purposely not implemented |
| 121 |
|
|
| 122 |
|
OriginalPathConstPointer m_OriginalPath; |
| 123 |
|
OrthogonalCorrectionTablePointer m_OrthogonalCorrectionTable; |
| 124 |
|
|
| 125 |
|
}; |
| 126 |
|
|
| 127 |
|
} // namespace itk |
| 128 |
|
|
| 129 |
|
#endif |
| 130 |
|
|