go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkComputeJacobianTerms.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __itkComputeJacobianTerms_h
20 #define __itkComputeJacobianTerms_h
21 
22 #include "itkImageGridSampler.h"
26 
27 namespace itk
28 {
37 template< class TFixedImage, class TTransform >
39  public Object
40 {
41 public:
42 
45  typedef Object Superclass;
47  typedef SmartPointer< const Self > ConstPointer;
48 
50  itkNewMacro( Self );
51 
53  itkTypeMacro( ComputeJacobianTerms, Object );
54 
56  typedef TFixedImage FixedImageType;
57  typedef TTransform TransformType;
58  typedef typename TransformType::Pointer TransformPointer;
59  typedef typename FixedImageType::RegionType FixedImageRegionType;
60 
64  itkStaticConstMacro( FixedImageDimension, unsigned int,
65  TFixedImage::ImageDimension );
66  typedef SpatialObject< itkGetStaticConstMacro( FixedImageDimension ) > FixedImageMaskType;
67  typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
68  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer;
69 
74  typedef typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
75 
77  itkSetConstObjectMacro( FixedImage, FixedImageType );
78 
80  itkSetObjectMacro( Transform, TransformType );
81 
83  itkSetObjectMacro( FixedImageMask, FixedImageMaskType );
84  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
85  itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
86 
88  itkSetMacro( Scales, ScalesType );
89  itkSetMacro( UseScales, bool );
90  itkSetMacro( MaxBandCovSize, unsigned int );
91  itkSetMacro( NumberOfBandStructureSamples, unsigned int );
92  itkSetMacro( NumberOfJacobianMeasurements, SizeValueType );
93 
95  void SetFixedImageRegion( const FixedImageRegionType & region )
96  {
97  if( region != this->m_FixedImageRegion )
98  {
99  this->m_FixedImageRegion = region;
100  }
101  }
102 
103 
105  itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
106 
108  virtual void ComputeParameters( double & TrC, double & TrCC,
109  double & maxJJ, double & maxJCJ );
110 
111 protected:
112 
115 
116  typename FixedImageType::ConstPointer m_FixedImage;
117  FixedImageRegionType m_FixedImageRegion;
118  FixedImageMaskConstPointer m_FixedImageMask;
119  TransformPointer m_Transform;
120  ScalesType m_Scales;
122 
123  unsigned int m_MaxBandCovSize;
126 
127  typedef typename FixedImageType::IndexType FixedImageIndexType;
128  typedef typename FixedImageType::PointType FixedImagePointType;
129  typedef typename TransformType::JacobianType JacobianType;
130  typedef typename JacobianType::ValueType JacobianValueType;
131 
137 
140  typedef typename ImageGridSamplerType
143 
145  typedef JacobianType TransformJacobianType;
146  typedef typename TransformType::ScalarType CoordinateRepresentationType;
147  typedef typename TransformType::NumberOfParametersType NumberOfParametersType;
148 
150  // \todo: note that this is an exact copy of itk::ComputeDisplacementDistribution
151  // in the future it would be better to refactoring this part of the code.
153  ImageSampleContainerPointer & sampleContainer );
154 
155 private:
156 
157  ComputeJacobianTerms( const Self & ); // purposely not implemented
158  void operator=( const Self & ); // purposely not implemented
159 
160 };
161 
162 } // end namespace itk
163 
164 #ifndef ITK_MANUAL_INSTANTIATION
165 #include "itkComputeJacobianTerms.hxx"
166 #endif
167 
168 #endif // end #ifndef __itkComputeJacobianTerms_h
FixedImageMaskConstPointer m_FixedImageMask
void SetFixedImageRegion(const FixedImageRegionType &region)
ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
ScaledSingleValuedNonLinearOptimizerType::ScalesType ScalesType
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
ImageSampleContainerType::Pointer ImageSampleContainerPointer
FixedImageType::IndexType FixedImageIndexType
ImageGridSamplerType::Pointer ImageGridSamplerPointer
FixedImageType::ConstPointer m_FixedImage
FixedImageType::RegionType FixedImageRegionType
This class is a base class for any image sampler.
ImageSamplerBaseType::Pointer ImageSamplerBasePointer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SpatialObject< itkGetStaticConstMacro(FixedImageDimension) > FixedImageMaskType
ScaledSingleValuedNonLinearOptimizerType::ScaledCostFunctionPointer ScaledCostFunctionPointer
SmartPointer< const Self > ConstPointer
TransformType::JacobianType JacobianType
ImageSamplerBase< FixedImageType > ImageSamplerBaseType
FixedImageMaskType::Pointer FixedImageMaskPointer
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
virtual void ComputeParameters(double &TrC, double &TrCC, double &maxJJ, double &maxJCJ)
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
TransformType::ScalarType CoordinateRepresentationType
ImageGridSamplerType::ImageSampleContainerType ImageSampleContainerType
TransformType::Pointer TransformPointer
FixedImageType::PointType FixedImagePointType
FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
ScaledSingleValuedNonLinearOptimizer ScaledSingleValuedNonLinearOptimizerType
This class is a base class for any image sampler that randomly picks samples.
ImageRandomSamplerBase< FixedImageType > ImageRandomSamplerBaseType
FixedImageRegionType m_FixedImageRegion
TransformType::NumberOfParametersType NumberOfParametersType
JacobianType::ValueType JacobianValueType
virtual void SampleFixedImageForJacobianTerms(ImageSampleContainerPointer &sampleContainer)
Samples image voxels on a regular grid.
ImageGridSampler< FixedImageType > ImageGridSamplerType
void operator=(const Self &)


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo