15 #ifndef itkDeformableTransform_h
16 #define itkDeformableTransform_h
18 #include <itkTransform.h>
20 #include <itkVector.h>
21 #include <itkImageRegionIterator.h>
22 #include <itkDisplacementFieldJacobianDeterminantFilter.h>
67 unsigned int NDimensions,
68 class TDeformationScalar>
75 typedef Transform< TScalarType, NDimensions, NDimensions >
Superclass;
83 itkStaticConstMacro(SpaceDimension,
unsigned int, NDimensions);
137 typedef Transform<TScalarType,
138 itkGetStaticConstMacro(SpaceDimension),
143 typedef DisplacementFieldJacobianDeterminantFilter<
144 DeformationFieldType,
159 itkSetMacro(InverseSearchRadius,
double);
160 itkGetMacro(InverseSearchRadius,
double);
165 virtual const ParametersType&
GetParameters(
void)
const {
return this->m_Parameters; }
170 virtual void SetParameters(
const ParametersType& parameters) { this->m_Parameters = parameters; }
183 virtual void SetParametersFromField(
const VectorFieldImagePointer&
image,
bool force=
false);
188 virtual DeformationFieldType*
GetDeformationField()
const {
return this->m_DeformationField.GetPointer(); }
194 TScalarType ComputeMaxDeformation();
200 TScalarType ComputeMinDeformation();
203 TScalarType ComputeMaxJacobian();
206 TScalarType ComputeMinJacobian();
209 TScalarType GetSumLogJacobianDeterminant();
221 void WriteMidasStrImage(
std::string filename,
int origin[NDimensions],
typename TFixedImage::RegionType paddedDesiredRegion,
const typename JacobianDeterminantFilterType::OutputImageType* jacobianImage);
224 void ReadMidasStrImage(
std::string filename,
int origin[NDimensions],
typename TFixedImage::RegionType paddedDesiredRegion,
typename JacobianDeterminantFilterType::OutputImageType* jacobianImage);
237 virtual void SetIdentity();
244 void Initialize(FixedImagePointer
image);
247 virtual OutputPointType TransformPoint(
const InputPointType &point )
const;
252 itkExceptionMacro( <<
"Method not applicable for deformable transform." );
253 return OutputVectorType();
259 itkExceptionMacro(<<
"Method not applicable for deformable transform. ");
260 return OutputVnlVectorType();
266 itkExceptionMacro(<<
"Method not applicable for deformable transfrom. ");
267 return OutputCovariantVectorType();
279 virtual bool IsIdentity();
282 virtual const ParametersType& GetFixedParameters(
void)
const;
285 virtual void SetFixedParameters(
const ParametersType& parameters);
292 bool GetInverse(Self* inverse)
const;
296 void ConcatenateAfterGivenTransform(Self* givenTransform);
307 itkExceptionMacro( <<
"Method Regrid not implemented for deformable transform." );
316 this->m_JacobianFilter = FilterType::New();
317 this->m_JacobianFilter->SetInput(this->m_DeformationField);
318 this->m_JacobianFilter->SetUseImageSpacingOff();
323 void InitialiseGlobalTransformation();
328 typename JacobianDeterminantFilterType::OutputImageType*
GetJacobianImage()
const {
return m_JacobianFilter->GetOutput(); }
333 void ExtractComponents();
343 void InvertUsingIterativeFixedPoint(
typename Self::Pointer invertedTransform,
int maxIterations,
int maxOuterIterations,
double tol);
348 itkExceptionMacro( <<
"Not Implemented" );
357 void PrintSelf(std::ostream &os, Indent indent)
const;
360 unsigned long int GetNumberOfParametersImpliedByImage(
const VectorFieldImagePointer
image);
363 void ResizeParametersArray(
const VectorFieldImagePointer
image);
366 void MarshallParametersToImage(VectorFieldImagePointer
image);
369 void MarshallImageToParameters(
const VectorFieldImagePointer
image, ParametersType& parameters);
372 virtual typename JacobianDeterminantFilterType::OutputImageRegionType
GetValidJacobianRegion()
const {
return this->m_JacobianFilter->GetOutput()->GetLargestPossibleRegion(); }
398 typename DeformationFieldComponentImageType::Pointer m_DeformationFieldComponent[NDimensions];
403 void operator=(
const Self&);
406 mutable DeformationFieldIndexType m_TemporaryIndex;
409 void ForceJacobianUpdate();
415 #ifndef ITK_MANUAL_INSTANTIATION
416 #include "itkDeformableTransform.txx"
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
itk::Point< double, 2 > InputPointType
Definition: EulerAffine2DJacobianTest.cxx:34
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
Definition: itkForwardDifferenceDisplacementFieldJacobianDeterminantFilter.h:28
itk::AddImageFilter< ImageType, ImageType > FilterType
Definition: ReceptorMemberCommandTest.cxx:40
itk::Point< double, 2 > OutputPointType
Definition: EulerAffine2DJacobianTest.cxx:35
GLsizei const GLcharARB ** string
Definition: glew.h:5194
itk::Array2D< double > JacobianType
Definition: EulerAffine2DJacobianTest.cxx:28