18 #ifndef __itkCompositeTransform_h
19 #define __itkCompositeTransform_h
101 <
class TScalar = double,
unsigned int NDimensions = 3>
103 public Transform<TScalar, NDimensions, NDimensions>
123 typedef typename Superclass::InverseTransformBasePointer
148 typedef typename Superclass::InputCovariantVectorType
150 typedef typename Superclass::OutputCovariantVectorType
166 typedef typename Superclass::InputSymmetricSecondRankTensorType
168 typedef typename Superclass::OutputSymmetricSecondRankTensorType
181 itkStaticConstMacro( InputDimension,
unsigned int, NDimensions );
182 itkStaticConstMacro( OutputDimension,
unsigned int, NDimensions );
192 this->PushBackTransform( t );
195 void RemoveTransform()
197 this->PopBackTransform();
204 return this->m_TransformQueue.front();
210 return this->m_TransformQueue.back();
216 return this->m_TransformQueue[n];
221 void SetNthTransformToOptimize(
size_t i,
bool state )
223 this->m_TransformsToOptimizeFlags.at(i) = state;
227 void SetNthTransformToOptimizeOn(
size_t i )
229 this->SetNthTransformToOptimize( i,
true );
232 void SetNthTransformToOptimizeOff(
size_t i )
234 this->SetNthTransformToOptimize( i,
false );
237 void SetAllTransformsToOptimize(
bool state )
239 this->m_TransformsToOptimizeFlags.assign(
240 this->m_TransformsToOptimizeFlags.size(), state );
244 void SetAllTransformsToOptimizeOn()
246 this->SetAllTransformsToOptimize(
true );
249 void SetAllTransformsToOptimizeOff()
251 this->SetAllTransformsToOptimize(
false );
257 void SetOnlyMostRecentTransformToOptimizeOn()
259 this->SetAllTransformsToOptimize(
false );
260 this->SetNthTransformToOptimizeOn( this->GetNumberOfTransforms() - 1 );
267 bool GetNthTransformToOptimize(
size_t i )
const
269 return this->m_TransformsToOptimizeFlags.at(i);
275 return this->m_TransformQueue;
281 return this->m_TransformsToOptimizeFlags;
285 bool IsTransformQueueEmpty()
287 return this->m_TransformQueue.empty();
290 size_t GetNumberOfTransforms()
const
292 return this->m_TransformQueue.size();
295 void ClearTransformQueue()
297 this->m_TransformQueue.clear();
298 this->m_TransformsToOptimizeFlags.clear();
303 bool GetInverse( Self *inverse )
const;
305 virtual InverseTransformBasePointer GetInverseTransform()
const;
321 virtual OutputPointType TransformPoint(
const InputPointType & inputPoint )
const;
333 using Superclass::TransformVector;
334 virtual OutputVectorType TransformVector(
const InputVectorType &)
const;
336 virtual OutputVnlVectorType TransformVector(
const InputVnlVectorType & inputVector)
const;
338 virtual OutputVectorPixelType TransformVector(
const InputVectorPixelType & inputVector )
const;
340 virtual OutputVectorType TransformVector(
const InputVectorType & inputVector,
341 const InputPointType & inputPoint )
const;
343 virtual OutputVnlVectorType TransformVector(
const InputVnlVectorType & inputVector,
344 const InputPointType & inputPoint )
const;
346 virtual OutputVectorPixelType TransformVector(
const InputVectorPixelType & inputVector,
347 const InputPointType & inputPoint )
const;
350 using Superclass::TransformCovariantVector;
351 virtual OutputCovariantVectorType TransformCovariantVector(
const InputCovariantVectorType &)
const;
353 virtual OutputVectorPixelType TransformCovariantVector(
const InputVectorPixelType &)
const;
355 virtual OutputCovariantVectorType TransformCovariantVector(
const InputCovariantVectorType & inputVector,
356 const InputPointType & inputPoint )
const;
358 virtual OutputVectorPixelType TransformCovariantVector(
const InputVectorPixelType & inputVector,
359 const InputPointType & inputPoint )
const;
362 using Superclass::TransformDiffusionTensor3D;
363 virtual OutputDiffusionTensor3DType TransformDiffusionTensor3D(
364 const InputDiffusionTensor3DType & inputTensor)
const;
366 virtual OutputVectorPixelType TransformDiffusionTensor3D(
367 const InputVectorPixelType & inputTensor)
const;
369 virtual OutputDiffusionTensor3DType TransformDiffusionTensor3D(
370 const InputDiffusionTensor3DType & inputTensor,
371 const InputPointType & inputPoint )
const;
373 virtual OutputVectorPixelType TransformDiffusionTensor3D(
374 const InputVectorPixelType & inputTensor,
375 const InputPointType & inputPoint )
const;
378 using Superclass::TransformSymmetricSecondRankTensor;
379 virtual OutputSymmetricSecondRankTensorType TransformSymmetricSecondRankTensor(
380 const InputSymmetricSecondRankTensorType & inputTensor)
const;
382 virtual OutputVectorPixelType TransformSymmetricSecondRankTensor(
383 const InputVectorPixelType & inputTensor)
const;
385 virtual OutputSymmetricSecondRankTensorType TransformSymmetricSecondRankTensor(
386 const InputSymmetricSecondRankTensorType & inputTensor,
387 const InputPointType & inputPoint )
const;
389 virtual OutputVectorPixelType TransformSymmetricSecondRankTensor(
390 const InputVectorPixelType & inputTensor,
391 const InputPointType & inputPoint )
const;
393 virtual bool IsLinear()
const;
400 virtual const ParametersType & GetParameters(
void)
const;
403 virtual void SetParameters(
const ParametersType & p);
406 virtual const ParametersType & GetFixedParameters(
void)
const;
409 virtual void SetFixedParameters(
const ParametersType & fixedParameters);
413 virtual NumberOfParametersType GetNumberOfParameters(
void)
const;
417 virtual NumberOfParametersType GetNumberOfLocalParameters(
void)
const;
421 virtual NumberOfParametersType GetNumberOfFixedParameters(
void)
const;
437 virtual void UpdateTransformParameters(
const DerivativeType & update, ScalarType factor = 1.0 );
442 virtual void FlattenTransformQueue();
450 virtual bool HasLocalSupport()
const;
456 virtual void ComputeJacobianWithRespectToParameters(
const InputPointType & p, JacobianType & j)
const;
461 itkExceptionMacro(
"ComputeJacobianWithRespectToPosition not yet implemented "
462 "for " << this->GetNameOfClass() );
468 void PrintSelf( std::ostream& os,
Indent indent )
const;
475 this->m_TransformQueue.push_front( t );
477 this->m_TransformsToOptimizeFlags.push_front(
true );
483 this->m_TransformQueue.push_back( t );
485 this->m_TransformsToOptimizeFlags.push_back(
true );
489 void PopFrontTransform()
491 this->m_TransformQueue.pop_front();
492 this->m_TransformsToOptimizeFlags.pop_front();
496 void PopBackTransform()
498 this->m_TransformQueue.pop_back();
499 this->m_TransformsToOptimizeFlags.pop_back();
523 void operator=(
const Self & );
532 #if ITK_TEMPLATE_EXPLICIT
533 #include "Templates/itkCompositeTransform+-.h"
537 #include "itkCompositeTransform.hxx"
540 #endif // __itkCompositeTransform_h