go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxBSplineTransformWithDiffusion.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 elxBSplineTransformWithDiffusion_h
19#define elxBSplineTransformWithDiffusion_h
20
21/* For easy changing the BSplineOrder: */
22#define __VSplineOrder 3
23
24#include "elxIncludes.h" // include first to avoid MSVS warning
27//#include "itkBSplineCombinationTransform.h"
28#include "itkBSplineResampleImageFilterBase.h"
29#include "itkBSplineUpsampleImageFilter.h"
30
31#include "itkImageRegionConstIterator.h"
32
36#include "itkImageFileReader.h"
37#include "itkImageFileWriter.h"
38#include "itkResampleImageFilter.h"
39#include "itkCastImageFilter.h"
40#include "itkMaximumImageFilter.h"
41#include "itkImageRegionIterator.h"
42#include "itkBSplineInterpolateImageFunction.h"
43
44namespace elastix
45{
46
158template <class TElastix>
159class ITK_TEMPLATE_EXPORT BSplineTransformWithDiffusion
160 : public itk::DeformationFieldRegulizer<itk::AdvancedCombinationTransform<
161 // BSplineCombinationTransform<
162 typename elx::TransformBase<TElastix>::CoordRepType,
163 elx::TransformBase<TElastix>::FixedImageDimension>>
164 ,
165 // elx::TransformBase<TElastix>::FixedImageDimension, __VSplineOrder > >,
166 public TransformBase<TElastix>
167{
168public:
170
177
184 3>;
185
186 using Pointer = itk::SmartPointer<Self>;
187 using ConstPointer = itk::SmartPointer<const Self>;
188
190 itkNewMacro(Self);
191
194
199 elxClassNameMacro("BSplineTransformWithDiffusion");
200
202 itkStaticConstMacro(SpaceDimension, unsigned int, Superclass2::FixedImageDimension);
203
205 itkStaticConstMacro(SplineOrder, unsigned int, __VSplineOrder);
206
208 using typename Superclass1::ScalarType;
209 using typename Superclass1::ParametersType;
210 using typename Superclass1::JacobianType;
211 using typename Superclass1::InputVectorType;
212 using typename Superclass1::OutputVectorType;
213 using typename Superclass1::InputCovariantVectorType;
214 using typename Superclass1::OutputCovariantVectorType;
215 using typename Superclass1::InputVnlVectorType;
216 using typename Superclass1::OutputVnlVectorType;
217 using typename Superclass1::InputPointType;
218 using typename Superclass1::OutputPointType;
219
221 using PixelType = typename BSplineTransformType::PixelType;
233
235 using typename Superclass2::ElastixType;
236 using typename Superclass2::ParameterMapType;
237 using typename Superclass2::RegistrationType;
238 using typename Superclass2::CoordRepType;
239 using typename Superclass2::FixedImageType;
240 using typename Superclass2::MovingImageType;
243
246 using typename Superclass1::VectorImageType;
247 using VectorImagePointer = typename VectorImageType::Pointer;
248
250 using FixedImageELXType = typename ElastixType::FixedImageType;
251 using MovingImageELXType = typename ElastixType::MovingImageType;
252
254 using DummyImageType = itk::Image<short, Self::SpaceDimension>;
255 using DummyIteratorType = itk::ImageRegionConstIterator<DummyImageType>;
258
260 using VectorReaderType = itk::ImageFileReader<VectorImageType>;
261 using VectorType = typename VectorImageType::PixelType;
262 using VectorImageIteratorType = itk::ImageRegionIterator<VectorImageType>;
264 using GrayValueImagePointer = typename GrayValueImageType::Pointer;
265 using GrayValuePixelType = typename GrayValueImageType::PixelType;
266 using GrayValueImageIteratorType = itk::ImageRegionIterator<GrayValueImageType>;
267 using MaximumImageFilterType = itk::MaximumImageFilter<GrayValueImageType, GrayValueImageType, GrayValueImageType>;
270 using RadiusType = typename VectorImageType::SizeType;
271 using ResamplerType1 = itk::ResampleImageFilter<MovingImageELXType, GrayValueImageType, CoordRepType>;
272 using ResamplerPointer1 = typename ResamplerType1::Pointer;
273 using ResamplerType2 = itk::ResampleImageFilter<GrayValueImageType, GrayValueImageType, CoordRepType>;
274 using ResamplerPointer2 = typename ResamplerType2::Pointer;
275 using InterpolatorType = itk::BSplineInterpolateImageFunction<GrayValueImageType>;
276 using InterpolatorPointer = typename InterpolatorType::Pointer;
277 using GrayValueImageReaderType = itk::ImageFileReader<GrayValueImageType>;
278 using GrayValueImageReaderPointer = typename GrayValueImageReaderType::Pointer;
279
285 void
287
291 void
293
297 void
299
303 void
305
307 virtual void
308 SetInitialGrid(bool upsampleGridOption);
309
311 virtual void
313
315 void
316 ReadFromFile() override;
317
319 void
321
333 TransformPoint(const InputPointType & point) const override;
334
346protected:
350 ~BSplineTransformWithDiffusion() override = default;
351
354
355private:
357
361
363 void
365
384
392
395
400};
401
402} // end namespace elastix
403
404#ifndef ITK_MANUAL_INSTANTIATION
405# include "elxBSplineTransformWithDiffusion.hxx"
406#endif
407
408#endif // end #ifndef elxBSplineTransformWithDiffusion_h
This class combines a B-spline transform with the diffusion/filtering of the deformation field.
itkStaticConstMacro(SplineOrder, unsigned int, __VSplineOrder)
itk::ResampleImageFilter< GrayValueImageType, GrayValueImageType, CoordRepType > ResamplerType2
ITK_DISALLOW_COPY_AND_MOVE(BSplineTransformWithDiffusion)
itkStaticConstMacro(SpaceDimension, unsigned int, Superclass2::FixedImageDimension)
typename Superclass1::Superclass GenericDeformationFieldRegulizer
typename Superclass2::CombinationTransformType CombinationTransformType
typename BSplineTransformType::SpacingType SpacingType
itk::ImageFileReader< VectorImageType > VectorReaderType
typename BSplineTransformType::IndexType IndexType
itk::MaximumImageFilter< GrayValueImageType, GrayValueImageType, GrayValueImageType > MaximumImageFilterType
typename BSplineTransformType::RegionType RegionType
typename BSplineTransformType::Pointer BSplineTransformPointer
typename GrayValueImageType::PixelType GrayValuePixelType
OutputPointType TransformPoint(const InputPointType &point) const override
typename GrayValueImageReaderType::Pointer GrayValueImageReaderPointer
typename BSplineTransformType::WeightsFunctionType WeightsFunctionType
virtual void SetInitialGrid(bool upsampleGridOption)
ParameterMapType CreateDerivedTransformParametersMap() const override
typename ElastixType::MovingImageType MovingImageELXType
itk::Image< short, Self::SpaceDimension > DummyImageType
typename BSplineTransformType::SizeType SizeType
typename TElastix::ParameterMapType ParameterMapType
elxClassNameMacro("BSplineTransformWithDiffusion")
typename BSplineTransformType::WeightsType WeightsType
typename GrayValueImageType::Pointer GrayValueImagePointer
itk::ResampleImageFilter< MovingImageELXType, GrayValueImageType, CoordRepType > ResamplerType1
itk::BSplineInterpolateImageFunction< GrayValueImageType > InterpolatorType
typename BSplineTransformType::OriginType OriginType
itk::ImageFileReader< GrayValueImageType > GrayValueImageReaderType
typename BSplineTransformType::ParameterIndexArrayType ParameterIndexArrayType
typename BSplineTransformType::ImageType ImageType
typename DiffusionFilterType::Pointer DiffusionFilterPointer
typename InterpolatorType::Pointer InterpolatorPointer
~BSplineTransformWithDiffusion() override=default
typename VectorImageType::Pointer VectorImagePointer
typename BSplineTransformType::ContinuousIndexType ContinuousIndexType
typename ElastixType::FixedImageType FixedImageELXType
itk::ImageRegionConstIterator< DummyImageType > DummyIteratorType
typename BSplineTransformType::ImagePointer ImagePointer
void WriteDerivedTransformDataToFile() const override
itk::ImageRegionIterator< GrayValueImageType > GrayValueImageIteratorType
itk::ImageRegionIterator< VectorImageType > VectorImageIteratorType
This class is the elastix base class for all Transforms.
typename TElastix::FixedImageType FixedImageType
typename ITKBaseType::OutputPointType OutputPointType
typename TElastix::ParameterMapType ParameterMapType
typename TElastix::MovingImageType MovingImageType
typename ElastixType::RegistrationBaseType RegistrationType
typename ITKBaseType::InputPointType InputPointType
itk::OptimizerParameters< ValueType > ParametersType
Deformable transform using a B-spline representation.
typename WeightsFunctionType::WeightsType WeightsType
typename WeightsFunctionType::ContinuousIndexType ContinuousIndexType
This class combines two transforms: an 'initial transform' with a 'current transform'.
Returns the weights over the support region used for B-spline interpolation/reconstruction.
This class combines any itk transform with the DeformationFieldTransform.
typename IntermediaryDFTransformType ::CoefficientVectorImageType VectorImageType
An itk transform based on a DeformationVectorField.
Applies an averaging filter to an image.
#define __VSplineOrder


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo