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 #ifndef __itkComputeJacobianTerms_h
19 #define __itkComputeJacobianTerms_h
20 
21 #include "itkImageGridSampler.h"
25 
26 namespace itk
27 {
36 template< class TFixedImage, class TTransform >
38  public Object
39 {
40 public:
41 
44  typedef Object Superclass;
45  typedef SmartPointer< Self > Pointer;
46  typedef SmartPointer< const Self > ConstPointer;
47 
49  itkNewMacro( Self );
50 
52  itkTypeMacro( ComputeJacobianTerms, Object );
53 
55  typedef TFixedImage FixedImageType;
56  typedef TTransform TransformType;
57  typedef typename TransformType::Pointer TransformPointer;
58  typedef typename FixedImageType::RegionType FixedImageRegionType;
59 
63  itkStaticConstMacro( FixedImageDimension, unsigned int,
64  TFixedImage::ImageDimension );
65  typedef SpatialObject< itkGetStaticConstMacro( FixedImageDimension ) > FixedImageMaskType;
66  typedef typename FixedImageMaskType::Pointer FixedImageMaskPointer;
67  typedef typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer;
68 
73  typedef typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
74 
76  itkSetConstObjectMacro( FixedImage, FixedImageType );
77 
79  itkSetObjectMacro( Transform, TransformType );
80 
82  itkSetObjectMacro( FixedImageMask, FixedImageMaskType );
83  itkSetConstObjectMacro( FixedImageMask, FixedImageMaskType );
84  itkGetConstObjectMacro( FixedImageMask, FixedImageMaskType );
85 
87  itkSetMacro( Scales, ScalesType );
88  itkSetMacro( UseScales, bool );
89  itkSetMacro( MaxBandCovSize, unsigned int );
90  itkSetMacro( NumberOfBandStructureSamples, unsigned int );
91  itkSetMacro( NumberOfJacobianMeasurements, SizeValueType );
92 
95  {
96  if( region != this->m_FixedImageRegion )
97  {
98  this->m_FixedImageRegion = region;
99  }
100  }
101 
102 
104  itkGetConstReferenceMacro( FixedImageRegion, FixedImageRegionType );
105 
107  virtual void Compute( double & TrC, double & TrCC,
108  double & maxJJ, double & maxJCJ );
109 
110 protected:
111 
113  ~ComputeJacobianTerms() override {}
114 
115  typename FixedImageType::ConstPointer m_FixedImage;
121 
122  unsigned int m_MaxBandCovSize;
125 
126  typedef typename FixedImageType::IndexType FixedImageIndexType;
127  typedef typename FixedImageType::PointType FixedImagePointType;
128  typedef typename TransformType::JacobianType JacobianType;
129  typedef typename JacobianType::ValueType JacobianValueType;
130 
136 
139  typedef typename ImageGridSamplerType
141  typedef typename ImageSampleContainerType::Pointer ImageSampleContainerPointer;
142 
145  typedef typename TransformType::ScalarType CoordinateRepresentationType;
146  typedef typename TransformType::NumberOfParametersType NumberOfParametersType;
147 
149  // \todo: note that this is an exact copy of itk::ComputeDisplacementDistribution
150  // in the future it would be better to refactoring this part of the code.
152  ImageSampleContainerPointer & sampleContainer );
153 
154 private:
155 
156  ComputeJacobianTerms( const Self & ); // purposely not implemented
157  void operator=( const Self & ); // purposely not implemented
158 
159 };
160 
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkComputeJacobianTerms.hxx"
165 #endif
166 
167 #endif // end #ifndef __itkComputeJacobianTerms_h
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
SmartPointer< const Self > ConstPointer
FixedImageType::ConstPointer m_FixedImage
FixedImageType::IndexType FixedImageIndexType
ScaledSingleValuedNonLinearOptimizer ScaledSingleValuedNonLinearOptimizerType
FixedImageType::PointType FixedImagePointType
FixedImageMaskType::Pointer FixedImageMaskPointer
FixedImageType::RegionType FixedImageRegionType
ImageSampleContainerType::Pointer ImageSampleContainerPointer
FixedImageMaskConstPointer m_FixedImageMask
virtual void SampleFixedImageForJacobianTerms(ImageSampleContainerPointer &sampleContainer)
ImageGridSampler< FixedImageType > ImageGridSamplerType
FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
SpatialObject< itkGetStaticConstMacro(FixedImageDimension) > FixedImageMaskType
TransformType::NumberOfParametersType NumberOfParametersType
ImageSamplerBaseType::Pointer ImageSamplerBasePointer
FixedImageRegionType m_FixedImageRegion
ScaledSingleValuedNonLinearOptimizerType::ScalesType ScalesType
ComputeJacobianTerms(const Self &)
TransformType::JacobianType JacobianType
void SetFixedImageRegion(const FixedImageRegionType &region)
ImageRandomSamplerBase< FixedImageType > ImageRandomSamplerBaseType
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
ScaledSingleValuedNonLinearOptimizerType ::ScaledCostFunctionPointer ScaledCostFunctionPointer
ImageGridSamplerType::Pointer ImageGridSamplerPointer
TransformType::Pointer TransformPointer
virtual void Compute(double &TrC, double &TrCC, double &maxJJ, double &maxJCJ)
TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
JacobianType::ValueType JacobianValueType
TransformType::ScalarType CoordinateRepresentationType
ImageSamplerBase< FixedImageType > ImageSamplerBaseType
ImageGridSamplerType ::ImageSampleContainerType ImageSampleContainerType
void operator=(const Self &)
ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
Samples image voxels on a regular grid.
Superclass::ImageSampleContainerType ImageSampleContainerType
SmartPointer< Self > Pointer
This class is a base class for any image sampler that randomly picks samples.
This class is a base class for any image sampler.
SmartPointer< Self > Pointer


Generated on 1641078589 for elastix by doxygen 1.9.1 elastix logo