Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitkTransformationOperation.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include <mitkImage.h>
16 #include <mitkImageAccessByItk.h>
17 #include <mitkImageCast.h>
18 
19 #include <itkImage.h>
20 #include <itkRecursiveMultiResolutionPyramidImageFilter.h>
21 #include <itkLaplacianRecursiveGaussianImageFilter.h>
22 
23 // Wavelet
24 #include <itkWaveletFrequencyForward.h>
25 #include <itkWaveletFrequencyFilterBankGenerator.h>
26 #include <itkHeldIsotropicWavelet.h>
27 #include <itkVowIsotropicWavelet.h>
28 #include <itkSimoncelliIsotropicWavelet.h>
29 #include <itkShannonIsotropicWavelet.h>
30 #include <itkForwardFFTImageFilter.h>
31 #include <itkInverseFFTImageFilter.h>
32 #include <itkFFTPadPositiveIndexImageFilter.h>
33 #include "itkZeroFluxNeumannBoundaryCondition.h"
34 #include "itkPeriodicBoundaryCondition.h"
35 #include "itkConstantBoundaryCondition.h"
36 //#include <itkComplexToRealImageFilter.h>
37 #include "itkCastImageFilter.h"
38 
39 #include "itkUnaryFunctorImageFilter.h"
40 #include <mitkImageMappingHelper.h>
41 #include <mitkAlgorithmHelper.h>
42 #include <itkImageDuplicator.h>
43 
44 namespace mitk
45 {
46  namespace Functor
47  {
48  template< class TInput>
49  class ThresholdValue
50  {
51  public:
52  ThresholdValue() {};
53  ~ThresholdValue() {};
54  bool operator!=(const ThresholdValue &) const
55  {
56  return false;
57  }
58  bool operator==(const ThresholdValue & other) const
59  {
60  return !(*this != other);
61  }
62  inline unsigned short operator()(const TInput & A) const
63  {
64  if (A < value)
65  return 0;
66  else
67  return 1;
68  }
69  double value = 0.0;
70  };
71 
72  template< class TInput, class TOutput>
73  class RoundValue
74  {
75  public:
76  RoundValue() {};
77  ~RoundValue() {};
78  bool operator!=(const RoundValue &) const
79  {
80  return false;
81  }
82  bool operator==(const RoundValue & other) const
83  {
84  return !(*this != other);
85  }
86  inline TOutput operator()(const TInput & A) const
87  {
88  return std::round(A);
89  }
90  };
91  }
92 }
93 
94 template<typename TPixel, unsigned int VImageDimension>
95 static void ExecuteMultiResolution(itk::Image<TPixel, VImageDimension>* image, unsigned int numberOfLevels, bool outputAsDouble, std::vector<mitk::Image::Pointer> &resultImages)
96 {
97  typedef itk::Image<TPixel, VImageDimension> ImageType;
98  typedef itk::Image<double, VImageDimension> DoubleOutputType;
99  typedef itk::RecursiveMultiResolutionPyramidImageFilter<ImageType, ImageType> ImageTypeFilterType;
100  typedef itk::RecursiveMultiResolutionPyramidImageFilter<ImageType, DoubleOutputType> DoubleTypeFilterType;
101 
102  if (outputAsDouble)
103  {
104  typename DoubleTypeFilterType::Pointer recursiveMultiResolutionPyramidImageFilter = DoubleTypeFilterType::New();
105  recursiveMultiResolutionPyramidImageFilter->SetInput(image);
106  recursiveMultiResolutionPyramidImageFilter->SetNumberOfLevels(numberOfLevels);
107  recursiveMultiResolutionPyramidImageFilter->Update();
108 
109  // This outputs the levels (0 is the lowest resolution)
110  for (unsigned int i = 0; i < numberOfLevels; ++i)
111  {
112  mitk::Image::Pointer outputImage = mitk::Image::New();
113  CastToMitkImage(recursiveMultiResolutionPyramidImageFilter->GetOutput(i), outputImage);
114  resultImages.push_back(outputImage);
115  }
116  }
117  else {
118  typename ImageTypeFilterType::Pointer recursiveMultiResolutionPyramidImageFilter = ImageTypeFilterType::New();
119  recursiveMultiResolutionPyramidImageFilter->SetInput(image);
120  recursiveMultiResolutionPyramidImageFilter->SetNumberOfLevels(numberOfLevels);
121  recursiveMultiResolutionPyramidImageFilter->Update();
122 
123  // This outputs the levels (0 is the lowest resolution)
124  for (unsigned int i = 0; i < numberOfLevels; ++i)
125  {
126  mitk::Image::Pointer outputImage = mitk::Image::New();
127  CastToMitkImage(recursiveMultiResolutionPyramidImageFilter->GetOutput(i), outputImage);
128  resultImages.push_back(outputImage);
129  }
130  }
131 }
132 
133 std::vector<mitk::Image::Pointer> mitk::TransformationOperation::MultiResolution(Image::Pointer & image, unsigned int numberOfLevels, bool outputAsDouble)
134 {
135  std::vector<Image::Pointer> resultImages;
136  AccessByItk_n(image, ExecuteMultiResolution, (numberOfLevels, outputAsDouble, resultImages));
137  return resultImages;
138 }
139 
140 
141 
142 
143 template<typename TPixel, unsigned int VImageDimension>
144 static void ExecuteLaplacianOfGaussian(itk::Image<TPixel, VImageDimension>* image, double sigma, bool outputAsDouble, mitk::Image::Pointer &resultImage)
145 {
146  typedef itk::Image<TPixel, VImageDimension> ImageType;
147  typedef itk::Image<double, VImageDimension> DoubleOutputType;
148  typedef itk::LaplacianRecursiveGaussianImageFilter<ImageType, ImageType> ImageTypeFilterType;
149  typedef itk::LaplacianRecursiveGaussianImageFilter<ImageType, DoubleOutputType> DoubleTypeFilterType;
150 
151  if (outputAsDouble)
152  {
153  typename DoubleTypeFilterType::Pointer filter = DoubleTypeFilterType::New();
154  filter->SetInput(image);
155  filter->SetSigma(sigma);
156  filter->Update();
157 
158  CastToMitkImage(filter->GetOutput(), resultImage);
159  }
160  else {
161  typename ImageTypeFilterType::Pointer filter = ImageTypeFilterType::New();
162  filter->SetInput(image);
163  filter->SetSigma(sigma);
164  filter->Update();
165 
166  CastToMitkImage(filter->GetOutput(), resultImage);
167  }
168 }
169 
171 {
172  Image::Pointer resultImage;
173  AccessByItk_n(image, ExecuteLaplacianOfGaussian, (sigma, outputAsDouble, resultImage));
174  return resultImage;
175 }
176 
177 
178 
179 template<typename TInputPixel, typename TOutputPixel, unsigned int VImageDimension, typename TWaveletFunction >
180 static void ExecuteSpecificWaveletTransformation(itk::Image<TInputPixel, VImageDimension>* image, unsigned int numberOfLevels, unsigned int numberOfBands, mitk::BorderCondition condition, std::vector<mitk::Image::Pointer> &resultImages)
181 {
182  const unsigned int Dimension = VImageDimension;
183  typedef TInputPixel PixelType;
184  typedef TOutputPixel OutputPixelType;
185  typedef itk::Image< PixelType, Dimension > ImageType;
186  typedef itk::Image< double, Dimension > DoubleImageType;
187  typedef itk::Image< OutputPixelType, Dimension > OutputImageType;
188 
189  typedef itk::CastImageFilter< ImageType, DoubleImageType > CastFilterType;
190  typedef itk::FFTPadPositiveIndexImageFilter< DoubleImageType > FFTPadType;
191  typedef itk::ForwardFFTImageFilter< DoubleImageType, itk::Image< std::complex<double>, Dimension> > FFTFilterType;
192  typedef typename FFTFilterType::OutputImageType ComplexImageType;
193 
194  typedef TWaveletFunction WaveletFunctionType;
195  typedef itk::WaveletFrequencyFilterBankGenerator< ComplexImageType, WaveletFunctionType > WaveletFilterBankType;
196  typedef itk::WaveletFrequencyForward< ComplexImageType, ComplexImageType, WaveletFilterBankType > ForwardWaveletType;
197 
198  typedef itk::InverseFFTImageFilter< ComplexImageType, OutputImageType > InverseFFTFilterType;
199 
200  // Convert input parameter
201  unsigned int highSubBands = numberOfBands; //inputBands;
202  unsigned int levels = numberOfLevels;
203 
204 
205  // Perform FFT on input image
206  typename CastFilterType::Pointer castFilter = CastFilterType::New();
207  castFilter->SetInput(image);
208 
209  // Pad Image so it fits the expect
210  typename FFTPadType::Pointer fftpad = FFTPadType::New();
211  fftpad->SetSizeGreatestPrimeFactor(4);
212  itk::ConstantBoundaryCondition< DoubleImageType > constantBoundaryCondition;
213  itk::PeriodicBoundaryCondition< DoubleImageType > periodicBoundaryCondition;
214  itk::ZeroFluxNeumannBoundaryCondition< DoubleImageType > zeroFluxNeumannBoundaryCondition;
215  switch (condition)
216  {
218  fftpad->SetBoundaryCondition(&constantBoundaryCondition);
219  break;
221  fftpad->SetBoundaryCondition(&periodicBoundaryCondition);
222  break;
224  fftpad->SetBoundaryCondition(&zeroFluxNeumannBoundaryCondition);
225  break;
226  default:
227  break;
228  }
229  fftpad->SetInput(castFilter->GetOutput());
230 
231  typename FFTFilterType::Pointer fftFilter = FFTFilterType::New();
232  fftFilter->SetInput(fftpad->GetOutput());
233 
234  // Calculate forward transformation
235  typename ForwardWaveletType::Pointer forwardWavelet = ForwardWaveletType::New();
236 
237  forwardWavelet->SetHighPassSubBands(highSubBands);
238  forwardWavelet->SetLevels(levels);
239  forwardWavelet->SetInput(fftFilter->GetOutput());
240  forwardWavelet->Update();
241 
242  // Obtain target spacing, size and origin
243  typename ComplexImageType::SpacingType inputSpacing;
244  for (unsigned int i = 0; i < Dimension; ++i)
245  {
246  inputSpacing[i] = image->GetLargestPossibleRegion().GetSize()[i];
247  }
248  typename ComplexImageType::SpacingType expectedSpacing = inputSpacing;
249  typename ComplexImageType::PointType inputOrigin = image->GetOrigin();
250  typename ComplexImageType::PointType expectedOrigin = inputOrigin;
251  typename ComplexImageType::SizeType inputSize = fftFilter->GetOutput()->GetLargestPossibleRegion().GetSize();
252  typename ComplexImageType::SizeType expectedSize = inputSize;
253 
254  // Inverse FFT to obtain filtered images
255  typename InverseFFTFilterType::Pointer inverseFFT = InverseFFTFilterType::New();
256  for (unsigned int level = 0; level < numberOfLevels + 1; ++level)
257  {
258  double scaleFactorPerLevel = std::pow(static_cast< double >(forwardWavelet->GetScaleFactor()),static_cast< double >(level));
259  for (unsigned int i = 0; i < Dimension; ++i)
260  {
261  expectedSize[i] = inputSize[i] / scaleFactorPerLevel;
262  expectedOrigin[i] = inputOrigin[i];
263  expectedSpacing[i] = inputSpacing[i] * scaleFactorPerLevel;
264  }
265  for (unsigned int band = 0; band < highSubBands; ++band)
266  {
267  unsigned int nOutput = level * forwardWavelet->GetHighPassSubBands() + band;
268  // Do not compute bands in low-pass level.
269  if (level == numberOfLevels && band == 0)
270  {
271  nOutput = forwardWavelet->GetTotalOutputs() - 1;
272  }
273  else if (level == numberOfLevels && band != 0)
274  {
275  break;
276  }
277 
278  inverseFFT->SetInput(forwardWavelet->GetOutput(nOutput));
279  inverseFFT->Update();
280 
281  auto itkOutputImage = inverseFFT->GetOutput();
282  itkOutputImage->SetSpacing(expectedSpacing);
283  mitk::Image::Pointer outputImage = mitk::Image::New();
284  CastToMitkImage(itkOutputImage, outputImage);
285  resultImages.push_back(outputImage);
286  }
287  }
288 }
289 
290 template<typename TPixel, unsigned int VImageDimension>
291 static void ExecuteWaveletTransformation(itk::Image<TPixel, VImageDimension>* image, unsigned int numberOfLevels, unsigned int numberOfBands, mitk::BorderCondition condition, mitk::WaveletType waveletType, std::vector<mitk::Image::Pointer> &resultImages)
292 {
293  typedef itk::Point< double, VImageDimension > PointType;
294  typedef itk::HeldIsotropicWavelet< double, VImageDimension, PointType > HeldIsotropicWaveletType;
295  typedef itk::VowIsotropicWavelet< double, VImageDimension, PointType > VowIsotropicWaveletType;
296  typedef itk::SimoncelliIsotropicWavelet< double, VImageDimension, PointType > SimoncelliIsotropicWaveletType;
297  typedef itk::ShannonIsotropicWavelet< double, VImageDimension, PointType > ShannonIsotropicWaveletType;
298 
299  switch (waveletType)
300  {
302  ExecuteSpecificWaveletTransformation<TPixel, double, VImageDimension, HeldIsotropicWaveletType >(image, numberOfLevels, numberOfBands, condition, resultImages);
303  break;
305  ExecuteSpecificWaveletTransformation<TPixel, double, VImageDimension, ShannonIsotropicWaveletType >(image, numberOfLevels, numberOfBands, condition, resultImages);
306  break;
308  ExecuteSpecificWaveletTransformation<TPixel, double, VImageDimension, SimoncelliIsotropicWaveletType >(image, numberOfLevels, numberOfBands, condition, resultImages);
309  break;
311  ExecuteSpecificWaveletTransformation<TPixel, double, VImageDimension, VowIsotropicWaveletType >(image, numberOfLevels, numberOfBands, condition, resultImages);
312  break;
313  default:
314  ExecuteSpecificWaveletTransformation<TPixel, double, VImageDimension, ShannonIsotropicWaveletType >(image, numberOfLevels, numberOfBands, condition, resultImages);
315  break;
316  }
317 }
318 
319 std::vector<mitk::Image::Pointer> mitk::TransformationOperation::WaveletForward(Image::Pointer & image, unsigned int numberOfLevels, unsigned int numberOfBands, mitk::BorderCondition condition, mitk::WaveletType waveletType)
320 {
321  std::vector<Image::Pointer> resultImages;
322  AccessByItk_n(image, ExecuteWaveletTransformation, (numberOfLevels, numberOfBands, condition, waveletType, resultImages));
323  return resultImages;
324 }
325 
326 
327 template<typename TPixel, unsigned int VImageDimension>
328 static void ExecuteImageTypeToDouble(itk::Image<TPixel, VImageDimension>* image, mitk::Image::Pointer &outputImage)
329 {
330  typedef itk::Image< TPixel, VImageDimension > ImageType;
331  typedef itk::Image< double, VImageDimension > DoubleImageType;
332  typedef itk::CastImageFilter< ImageType, DoubleImageType > CastFilterType;
333  typedef itk::ImageDuplicator< DoubleImageType > DuplicatorType;
334 
335  // Perform FFT on input image
336  typename CastFilterType::Pointer castFilter = CastFilterType::New();
337  castFilter->SetInput(image);
338  castFilter->Update();
339  typename DuplicatorType::Pointer duplicator = DuplicatorType::New();
340  duplicator->SetInputImage(castFilter->GetOutput());
341  duplicator->Update();
342  CastToMitkImage(duplicator->GetOutput(), outputImage);
343 }
344 
345 template<typename TPixel, unsigned int VImageDimension>
346 static void ExecuteRoundImage(itk::Image<TPixel, VImageDimension>* /*image*/, mitk::Image::Pointer resampledImage, mitk::Image::Pointer &outputImage)
347 {
348  typedef itk::Image< TPixel, VImageDimension > ImageType;
349  typedef itk::Image< double, VImageDimension > DoubleImageType;
350  typedef itk::UnaryFunctorImageFilter< DoubleImageType, ImageType, mitk::Functor::RoundValue<double, TPixel> > DefaultFilterType;
351 
352  typename DoubleImageType::Pointer itkImage = DoubleImageType::New();
353  mitk::CastToItkImage(resampledImage, itkImage);
354 
355  typename DefaultFilterType::Pointer filter = DefaultFilterType::New();
356  filter->SetInput(itkImage);
357  filter->Update();
358 
359  CastToMitkImage(filter->GetOutput(), outputImage);
360 }
361 
363 {
364  // Convert image to double if required
365  mitk::Image::Pointer tmpImage = image;
366  if (returnAsDouble)
367  {
368  AccessByItk_n(image, ExecuteImageTypeToDouble, (tmpImage));
369  }
370 
371  auto newGeometry = image->GetGeometry()->Clone();
372  mitk::Vector3D spacing;
373  mitk::BaseGeometry::BoundsArrayType bounds = newGeometry->GetBounds();
374  for (int i = 0; i < 3; ++i)
375  {
376  spacing[i] = newGeometry->GetSpacing()[i];
377  //bounds[i*2+1] = newGeometry->GetBounds()[i * 2 + 1];
378  if (spacingVector[i] > 0)
379  {
380  spacing[i] = spacingVector[i];
382  {
383  unsigned int samples = image->GetDimensions()[i];
384  double currentSpacing = newGeometry->GetSpacing()[i];
385  double newFactor = std::floor(samples*currentSpacing / spacingVector[i]);
386  spacing[i] = samples * currentSpacing / newFactor;
387  }
388  }
389  bounds[i * 2] = 0;
390  bounds[i*2+1] = std::ceil(bounds[i*2+1] * newGeometry->GetSpacing()[i] *1.0 / spacing[i]);
391  }
392  mitk::Point3D origin = newGeometry->GetOrigin();
394  {
395  for (int i = 0; i < 3; ++i)
396  {
397  double oldLength = newGeometry->GetSpacing()[i] * newGeometry->GetBounds()[i*2+1];
398  double newLength = spacing[i] * bounds[i*2+1];
399  origin[i] = origin[i] - (newLength - oldLength) / 2;
400  }
401  }
402 
403  newGeometry->SetSpacing(spacing);
404  newGeometry->SetOrigin(origin);
405  newGeometry->SetBounds(bounds);
406 
408  tmpImage,
410  false,
411  0.0, //Padding Value
412  newGeometry.GetPointer(),
413  false,
414  0, //Error Value
415  interpolator
416  );
417 
419 
420  if (roundOutput)
421  {
422  AccessByItk_n(tmpImage, ExecuteRoundImage, (tmpResult, result));
423  }
424  else
425  {
426  result = tmpResult;
427  }
428 
429  return result;
430 }
431 
432 
433 template<typename TPixel, unsigned int VImageDimension>
434 static void ExecuteImageThresholding(itk::Image<TPixel, VImageDimension>* image, mitk::Image::Pointer &resultImage)
435 {
436  typedef itk::Image<TPixel, VImageDimension> ImageType;
437  typedef itk::Image<TPixel, VImageDimension> MaskType;
438  typedef itk::UnaryFunctorImageFilter< ImageType, MaskType, mitk::Functor::ThresholdValue<TPixel> > DefaultFilterType;
439 
440  typename DefaultFilterType::Pointer filter = DefaultFilterType::New();
441  filter->SetInput(image);
442  filter->GetFunctor().value = 0.5;
443  filter->Update();
444 
445  CastToMitkImage(filter->GetOutput(), resultImage);
446 
447 }
448 
450 {
451  mitk::Image::Pointer result;
453  {
454  result = TransformationOperation::ResampleImage(image, spacingVector, interpolator, position, false, false);
455  }
456  else
457  {
458  auto tmpResult = TransformationOperation::ResampleImage(image, spacingVector, interpolator, position, true, false);
459  AccessByItk_n(tmpResult, ExecuteImageThresholding, (result));
460  }
461  return result;
462 }
463 
464 namespace itk
465 {
466  namespace utils
467  {
468 
469  IndexPairType IndexToLevelBandSteerablePyramid(unsigned int linearIndex,
470  unsigned int levels, unsigned int bands)
471  {
472  unsigned int totalOutputs = 1 + levels * bands;
473  if (linearIndex > totalOutputs - 1)
474  {
475  itkGenericExceptionMacro(<< "Failed converting linearIndex " << linearIndex
476  << " with levels: " << levels << " bands: " << bands <<
477  " to Level,Band pair : out of bounds");
478  }
479 
480  // Low pass (band = 0).
481  if (linearIndex == totalOutputs - 1)
482  {
483  return std::make_pair(levels - 1, 0);
484  }
485 
486  unsigned int band = (linearIndex) % bands + 1;
487  // note integer division ahead.
488  unsigned int level = (linearIndex) / bands;
489  itkAssertInDebugAndIgnoreInReleaseMacro(level < levels);
490  return std::make_pair(level, band);
491  }
492 
493  // Instantiation
494  template
495  unsigned int ComputeMaxNumberOfLevels<3>(const Size< 3 >& inputSize, const unsigned int & scaleFactor);
496 
497  template
498  unsigned int ComputeMaxNumberOfLevels<2>(const Size< 2 >& inputSize, const unsigned int & scaleFactor);
499  } // end namespace utils
500 } // end namespace itk
static Image::Pointer ResampleMask(Image::Pointer &image, mitk::Vector3D spacing, mitk::ImageMappingInterpolator::Type interpolator, GridInterpolationPositionType position)
static std::vector< Image::Pointer > WaveletForward(Image::Pointer &image, unsigned int numberOfLevels, unsigned int numberOfBands, BorderCondition condition, WaveletType waveletType)
static void ExecuteMultiResolution(itk::Image< TPixel, VImageDimension > *image, unsigned int numberOfLevels, bool outputAsDouble, std::vector< mitk::Image::Pointer > &resultImages)
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
BoundingBoxType::BoundsArrayType BoundsArrayType
static Image::Pointer ResampleImage(Image::Pointer &image, mitk::Vector3D spacing, mitk::ImageMappingInterpolator::Type interpolator, GridInterpolationPositionType position, bool returnAsDouble, bool roundOutput)
itk::Image< unsigned char, 3 > ImageType
static std::vector< Image::Pointer > MultiResolution(Image::Pointer &image, unsigned int numberOfLevels, bool outputAsDouble=false)
static void ExecuteLaplacianOfGaussian(itk::Image< TPixel, VImageDimension > *image, double sigma, bool outputAsDouble, mitk::Image::Pointer &resultImage)
DataCollection - Class to facilitate loading/accessing structured data.
template unsigned int ComputeMaxNumberOfLevels< 3 >(const Size< 3 > &inputSize, const unsigned int &scaleFactor)
#define AccessByItk_n(mitkImage, itkImageTypeFunction, va_tuple)
Access a MITK image by an ITK image with one or more parameters.
static void ExecuteSpecificWaveletTransformation(itk::Image< TInputPixel, VImageDimension > *image, unsigned int numberOfLevels, unsigned int numberOfBands, mitk::BorderCondition condition, std::vector< mitk::Image::Pointer > &resultImages)
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
static void ExecuteImageTypeToDouble(itk::Image< TPixel, VImageDimension > *image, mitk::Image::Pointer &outputImage)
static void ExecuteRoundImage(itk::Image< TPixel, VImageDimension > *, mitk::Image::Pointer resampledImage, mitk::Image::Pointer &outputImage)
static void ExecuteImageThresholding(itk::Image< TPixel, VImageDimension > *image, mitk::Image::Pointer &resultImage)
mitk::Image::Pointer image
static Image::Pointer LaplacianOfGaussian(Image::Pointer &image, double sigma, bool outputAsDouble=false)
static Pointer New()
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map(const InputImageType *input, const RegistrationType *registration, bool throwOnOutOfInputAreaError=false, const double &paddingValue=0, const ResultImageGeometryType *resultGeometry=nullptr, bool throwOnMappingError=true, const double &errorValue=0, mitk::ImageMappingInterpolator::Type interpolatorType=mitk::ImageMappingInterpolator::Linear)
void CastToMitkImage(const itk::SmartPointer< ItkOutputImageType > &itkimage, itk::SmartPointer< mitk::Image > &mitkoutputimage)
Cast an itk::Image (with a specific type) to an mitk::Image.
Definition: mitkImageCast.h:74
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
IndexPairType IndexToLevelBandSteerablePyramid(unsigned int linearIndex, unsigned int levels, unsigned int bands)
mitk::MAPRegistrationWrapper::Pointer GenerateIdentityRegistration3D()
static void ExecuteWaveletTransformation(itk::Image< TPixel, VImageDimension > *image, unsigned int numberOfLevels, unsigned int numberOfBands, mitk::BorderCondition condition, mitk::WaveletType waveletType, std::vector< mitk::Image::Pointer > &resultImages)
template unsigned int ComputeMaxNumberOfLevels< 2 >(const Size< 2 > &inputSize, const unsigned int &scaleFactor)