Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
Medical Imaging Interaction Toolkit
mitkArithmeticOperation.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 <itkArithmeticOpsFunctors.h>
20 #include <itkImage.h>
21 #include "itkUnaryFunctorImageFilter.h"
22 #include <itkBinaryFunctorImageFilter.h>
23 
24 #include <itkTanImageFilter.h>
25 #include <itkAtanImageFilter.h>
26 #include <itkCosImageFilter.h>
27 #include <itkAcosImageFilter.h>
28 #include <itkSinImageFilter.h>
29 #include <itkAsinImageFilter.h>
30 #include <itkRoundImageFilter.h>
31 #include <itkSquareImageFilter.h>
32 #include <itkSqrtImageFilter.h>
33 #include <itkAbsImageFilter.h>
34 #include <itkExpImageFilter.h>
35 #include <itkExpNegativeImageFilter.h>
36 #include <itkLog10ImageFilter.h>
37 
38 
39 namespace mitk
40 {
41  namespace Functor
42  {
43  template< class TInput, class TOutput>
44  class AddValue
45  {
46  public:
47  AddValue() {};
48  ~AddValue() {};
49  bool operator!=(const AddValue &) const
50  {
51  return false;
52  }
53  bool operator==(const AddValue & other) const
54  {
55  return !(*this != other);
56  }
57  inline TOutput operator()(const TInput & A) const
58  {
59  return A + value;
60  }
61 
62  bool valueLeft = false;
63  double value = 0.0;
64  };
65  template< class TInput, class TOutput>
66  class SubValue
67  {
68  public:
69  SubValue() {};
70  ~SubValue() {};
71  bool operator!=(const SubValue &) const
72  {
73  return false;
74  }
75  bool operator==(const SubValue & other) const
76  {
77  return !(*this != other);
78  }
79  inline TOutput operator()(const TInput & A) const
80  {
81  if (valueLeft)
82  return value - A;
83  else
84  return A - value;
85  }
86 
87  bool valueLeft = false;
88  double value = 0.0;
89  };
90  template< class TInput, class TOutput>
91  class MultValue
92  {
93  public:
94  MultValue() {};
95  ~MultValue() {};
96  bool operator!=(const MultValue &) const
97  {
98  return false;
99  }
100  bool operator==(const MultValue & other) const
101  {
102  return !(*this != other);
103  }
104  inline TOutput operator()(const TInput & A) const
105  {
106  return A * value;
107  }
108 
109  bool valueLeft = false;
110  double value = 0.0;
111  };
112  template< class TInput, class TOutput>
113  class DivValue
114  {
115  public:
116  DivValue() {};
117  ~DivValue() {};
118  bool operator!=(const DivValue &) const
119  {
120  return false;
121  }
122  bool operator==(const DivValue & other) const
123  {
124  return !(*this != other);
125  }
126  inline TOutput operator()(const TInput & A) const
127  {
128  if (valueLeft)
129  return value / A;
130  else
131  return A / value;
132  }
133 
134  bool valueLeft = false;
135  double value = 1.0;
136  };
137  template< class TInput, class TOutput>
138  class PowValue
139  {
140  public:
141  PowValue() {};
142  ~PowValue() {};
143  bool operator!=(const PowValue &) const
144  {
145  return false;
146  }
147  bool operator==(const PowValue & other) const
148  {
149  return !(*this != other);
150  }
151  inline TOutput operator()(const TInput & A) const
152  {
153  if (valueLeft)
154  return static_cast<TOutput>(std::pow(value, A));
155  else
156  return static_cast<TOutput>(std::pow(A, value));
157  }
158 
159  bool valueLeft = false;
160  double value = 1.0;
161  };
162  }
163 }
164 
165 
166 template<typename DefaultFunctorType, typename DoubleFunctorType, typename ImageType, typename DoubleImageType >
167 static void ExecuteOneImageFilterWithFunctor(ImageType* imageA, double value, bool returnDoubleImage, bool valueLeft, bool , mitk::Image::Pointer & outputImage)
168 {
169  typedef itk::UnaryFunctorImageFilter< ImageType, ImageType, DefaultFunctorType > DefaultFilterType;
170  typedef itk::UnaryFunctorImageFilter< ImageType, DoubleImageType, DoubleFunctorType > DoubleFilterType;
171 
172  if (returnDoubleImage)
173  {
174  typename DoubleFilterType::Pointer filter = DoubleFilterType::New();
175  filter->SetInput(imageA);
176  filter->GetFunctor().valueLeft = valueLeft;
177  filter->GetFunctor().value = value;
178  filter->Update();
179  CastToMitkImage(filter->GetOutput(), outputImage);
180  }
181  else
182  {
183  typename DefaultFilterType::Pointer filter = DefaultFilterType::New();
184  filter->SetInput(imageA);
185  filter->GetFunctor().valueLeft = valueLeft;
186  filter->GetFunctor().value = value;
187  filter->Update();
188  CastToMitkImage(filter->GetOutput(), outputImage);
189  }
190 }
191 
192 template<typename DefaultFunctorType, typename DoubleFunctorType, typename ImageType, typename DoubleImageType >
193 static void ExecuteOneImageFilterWithFunctorNonParameter(ImageType* imageA, double , bool returnDoubleImage, bool , bool , mitk::Image::Pointer & outputImage)
194 {
195  typedef itk::UnaryFunctorImageFilter< ImageType, ImageType, DefaultFunctorType > DefaultFilterType;
196  typedef itk::UnaryFunctorImageFilter< ImageType, DoubleImageType, DoubleFunctorType > DoubleFilterType;
197 
198  if (returnDoubleImage)
199  {
200  typename DoubleFilterType::Pointer filter = DoubleFilterType::New();
201  filter->SetInput(imageA);
202  filter->Update();
203  CastToMitkImage(filter->GetOutput(), outputImage);
204  }
205  else
206  {
207  typename DefaultFilterType::Pointer filter = DefaultFilterType::New();
208  filter->SetInput(imageA);
209  filter->Update();
210  CastToMitkImage(filter->GetOutput(), outputImage);
211  }
212 }
213 
214 template<typename TPixel, unsigned int VImageDimension>
215 static void ExecuteOneImageFilter(itk::Image<TPixel, VImageDimension>* imageA, double value, bool returnDoubleImage, bool valueLeft, bool parameterFree, mitk::NonStaticArithmeticOperation::OperationsEnum algorithm, mitk::Image::Pointer & outputImage)
216 {
217  typedef itk::Image<TPixel, VImageDimension> ImageType;
218  typedef itk::Image<double, VImageDimension> DoubleOutputType;
219 
220 
221  switch (algorithm) {
222  case mitk::NonStaticArithmeticOperation::OperationsEnum::AddValue:
223  ExecuteOneImageFilterWithFunctor<mitk::Functor::AddValue<TPixel, TPixel>,
224  mitk::Functor::AddValue<TPixel, double>,
225  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
226  break;
227  case mitk::NonStaticArithmeticOperation::OperationsEnum::SubValue:
228  ExecuteOneImageFilterWithFunctor<mitk::Functor::SubValue<TPixel, TPixel>,
229  mitk::Functor::SubValue<TPixel, double>,
230  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
231  break;
232  case mitk::NonStaticArithmeticOperation::OperationsEnum::MultValue:
233  ExecuteOneImageFilterWithFunctor<mitk::Functor::MultValue<TPixel, TPixel>,
234  mitk::Functor::MultValue<TPixel, double>,
235  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
236  break;
237  case mitk::NonStaticArithmeticOperation::OperationsEnum::DivValue:
238  ExecuteOneImageFilterWithFunctor<mitk::Functor::DivValue<TPixel, TPixel>,
239  mitk::Functor::DivValue<TPixel, double>,
240  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
241  break;
242  case mitk::NonStaticArithmeticOperation::OperationsEnum::PowValue:
243  ExecuteOneImageFilterWithFunctor<mitk::Functor::PowValue<TPixel, TPixel>,
244  mitk::Functor::PowValue<TPixel, double>,
245  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
246  break;
247 
248  case mitk::NonStaticArithmeticOperation::OperationsEnum::Tan:
249  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Tan<TPixel, TPixel>,
250  itk::Functor::Tan<TPixel, double>,
251  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
252  break;
253  case mitk::NonStaticArithmeticOperation::OperationsEnum::ATan:
254  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Atan<TPixel, TPixel>,
255  itk::Functor::Atan<TPixel, double>,
256  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
257  break;
258  case mitk::NonStaticArithmeticOperation::OperationsEnum::Cos:
259  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Cos<TPixel, TPixel>,
260  itk::Functor::Cos<TPixel, double>,
261  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
262  break;
263  case mitk::NonStaticArithmeticOperation::OperationsEnum::ACos:
264  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Acos<TPixel, TPixel>,
265  itk::Functor::Acos<TPixel, double>,
266  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
267  break;
268  case mitk::NonStaticArithmeticOperation::OperationsEnum::Sin:
269  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Sin<TPixel, TPixel>,
270  itk::Functor::Sin<TPixel, double>,
271  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
272  break;
273  case mitk::NonStaticArithmeticOperation::OperationsEnum::ASin:
274  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Asin<TPixel, TPixel>,
275  itk::Functor::Asin<TPixel, double>,
276  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
277  break;
278  case mitk::NonStaticArithmeticOperation::OperationsEnum::Square:
279  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Square<TPixel, TPixel>,
280  itk::Functor::Square<TPixel, double>,
281  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
282  break;
283  case mitk::NonStaticArithmeticOperation::OperationsEnum::Sqrt:
284  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Sqrt<TPixel, TPixel>,
285  itk::Functor::Sqrt<TPixel, double>,
286  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
287  break;
288  case mitk::NonStaticArithmeticOperation::OperationsEnum::Abs:
289  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Abs<TPixel, TPixel>,
290  itk::Functor::Abs<TPixel, double>,
291  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
292  break;
293  case mitk::NonStaticArithmeticOperation::OperationsEnum::Exp:
294  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Exp<TPixel, TPixel>,
295  itk::Functor::Exp<TPixel, double>,
296  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
297  break;
298  case mitk::NonStaticArithmeticOperation::OperationsEnum::ExpNeg:
299  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::ExpNegative<TPixel, TPixel>,
300  itk::Functor::ExpNegative<TPixel, double>,
301  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
302  break;
303  case mitk::NonStaticArithmeticOperation::OperationsEnum::Log10:
304  ExecuteOneImageFilterWithFunctorNonParameter<itk::Functor::Log10<TPixel, TPixel>,
305  itk::Functor::Log10<TPixel, double>,
306  ImageType, DoubleOutputType>(imageA, value, valueLeft, returnDoubleImage, parameterFree, outputImage);
307  break;
308  default:
309  break;
310  }
311 }
312 
314 {
316  helper.m_Algorithm = NonStaticArithmeticOperation::OperationsEnum::Add2;
317  helper.CallExecuteTwoImageFilter(imageA, imageB);
318  return helper.m_ResultImage;
319 }
320 
322 {
324  helper.m_Algorithm = NonStaticArithmeticOperation::OperationsEnum::Sub2;
325  helper.CallExecuteTwoImageFilter(imageA, imageB);
326  return helper.m_ResultImage;
327 }
328 
330 {
332  helper.m_Algorithm = NonStaticArithmeticOperation::OperationsEnum::Mult;
333  helper.CallExecuteTwoImageFilter(imageA, imageB);
334  return helper.m_ResultImage;
335 }
336 
338 {
340  helper.m_Algorithm = NonStaticArithmeticOperation::OperationsEnum::Div;
341  helper.CallExecuteTwoImageFilter(imageA, imageB);
342  return helper.m_ResultImage;
343 }
344 
345 mitk::Image::Pointer mitk::ArithmeticOperation::Add(Image::Pointer & imageA, double value, bool outputAsDouble)
346 {
347  mitk::Image::Pointer resultImage;
348  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, false, false, NonStaticArithmeticOperation::OperationsEnum::AddValue, resultImage));
349  return resultImage;
350 }
351 mitk::Image::Pointer mitk::ArithmeticOperation::Subtract(Image::Pointer & imageA, double value, bool outputAsDouble)
352 {
353  mitk::Image::Pointer resultImage;
354  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, false, false, NonStaticArithmeticOperation::OperationsEnum::SubValue, resultImage));
355  return resultImage;
356 }
357 mitk::Image::Pointer mitk::ArithmeticOperation::Multiply(Image::Pointer & imageA, double value, bool outputAsDouble)
358 {
359  mitk::Image::Pointer resultImage;
360  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, false, false, NonStaticArithmeticOperation::OperationsEnum::MultValue, resultImage));
361  return resultImage;
362 }
363 mitk::Image::Pointer mitk::ArithmeticOperation::Divide(Image::Pointer & imageA, double value, bool outputAsDouble)
364 {
365  mitk::Image::Pointer resultImage;
366  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, false, false, NonStaticArithmeticOperation::OperationsEnum::DivValue, resultImage));
367  return resultImage;
368 }
369 
370 mitk::Image::Pointer mitk::ArithmeticOperation::Add(double value, Image::Pointer & imageA, bool outputAsDouble)
371 {
372  mitk::Image::Pointer resultImage;
373  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, true, false, NonStaticArithmeticOperation::OperationsEnum::AddValue, resultImage));
374  return resultImage;
375 }
376 mitk::Image::Pointer mitk::ArithmeticOperation::Subtract(double value, Image::Pointer & imageA, bool outputAsDouble)
377 {
378  mitk::Image::Pointer resultImage;
379  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, true, false, NonStaticArithmeticOperation::OperationsEnum::SubValue, resultImage));
380  return resultImage;
381 }
382 mitk::Image::Pointer mitk::ArithmeticOperation::Multiply(double value, Image::Pointer & imageA, bool outputAsDouble)
383 {
384  mitk::Image::Pointer resultImage;
385  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, true, false, NonStaticArithmeticOperation::OperationsEnum::MultValue, resultImage));
386  return resultImage;
387 }
388 mitk::Image::Pointer mitk::ArithmeticOperation::Divide(double value, Image::Pointer & imageA, bool outputAsDouble)
389 {
390  mitk::Image::Pointer resultImage;
391  AccessByItk_n(imageA, ExecuteOneImageFilter, (value, outputAsDouble, true, false, NonStaticArithmeticOperation::OperationsEnum::DivValue, resultImage));
392  return resultImage;
393 }
394 
395 
397 {
398  mitk::Image::Pointer resultImage;
399  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Tan, resultImage));
400  return resultImage;
401 }
403 {
404  mitk::Image::Pointer resultImage;
405  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::ATan, resultImage));
406  return resultImage;
407 }
409 {
410  mitk::Image::Pointer resultImage;
411  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Sin, resultImage));
412  return resultImage;
413 }
415 {
416  mitk::Image::Pointer resultImage;
417  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::ASin, resultImage));
418  return resultImage;
419 }
421 {
422  mitk::Image::Pointer resultImage;
423  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Cos, resultImage));
424  return resultImage;
425 }
427 {
428  mitk::Image::Pointer resultImage;
429  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::ACos, resultImage));
430  return resultImage;
431 }
433 {
434  mitk::Image::Pointer resultImage;
435  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Square, resultImage));
436  return resultImage;
437 }
439 {
440  mitk::Image::Pointer resultImage;
441  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Sqrt, resultImage));
442  return resultImage;
443 }
445 {
446  mitk::Image::Pointer resultImage;
447  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Abs, resultImage));
448  return resultImage;
449 }
451 {
452  mitk::Image::Pointer resultImage;
453  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Exp, resultImage));
454  return resultImage;
455 }
457 {
458  mitk::Image::Pointer resultImage;
459  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::ExpNeg, resultImage));
460  return resultImage;
461 }
463 {
464  mitk::Image::Pointer resultImage;
465  AccessByItk_n(imageA, ExecuteOneImageFilter, (0.0, outputAsDouble, true, true, NonStaticArithmeticOperation::OperationsEnum::Log10, resultImage));
466  return resultImage;
467 }
468 
469 
471 {
472  if (imageA->GetDimension() != imageB->GetDimension())
473  {
474  mitkThrow() << "Image have different dimensions. This is not supported by mitk::ArithmeticOperation";
475  }
476 
477  switch (imageA->GetDimension())
478  {
479  case 1:
481  break;
482  case 2:
484  break;
485  case 3:
487  break;
488  case 4:
490  break;
491  default:
492  mitkThrow() << "Image Dimension of "<<imageA->GetDimension() << " is not supported";
493  break;
494  }
495 }
496 
497 
498 template<typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
499 void mitk::NonStaticArithmeticOperation::ExecuteTwoImageFilter(itk::Image<TPixel1, VImageDimension1>* imageA, itk::Image<TPixel2, VImageDimension2>* imageB)
500 {
501  typedef itk::Image<TPixel1, VImageDimension1> Image1Type;
502  typedef itk::Image<TPixel2, VImageDimension2> Image2Type;
503  typedef itk::Image<double, VImageDimension1> DoubleOutputType;
504 
505 
506  switch (m_Algorithm) {
507  case OperationsEnum::Add2:
508  ExecuteTwoImageFilterWithFunctor<itk::Functor::Add2<TPixel1, TPixel2, TPixel1>,
509  itk::Functor::Add2<TPixel1, TPixel2, double>,
510  Image1Type, Image2Type, DoubleOutputType>(imageA, imageB);
511  break;
512 
513  case OperationsEnum::Sub2:
514  ExecuteTwoImageFilterWithFunctor<itk::Functor::Sub2<TPixel1, TPixel2, TPixel1>,
515  itk::Functor::Add2<TPixel1, TPixel2, double>,
516  Image1Type, Image2Type, DoubleOutputType>(imageA, imageB);
517  break;
518 
519  case OperationsEnum::Mult:
520  ExecuteTwoImageFilterWithFunctor<itk::Functor::Mult<TPixel1, TPixel2, TPixel1>,
521  itk::Functor::Add2<TPixel1, TPixel2, double>,
522  Image1Type, Image2Type, DoubleOutputType>(imageA, imageB);
523  break;
524 
525  case OperationsEnum::Div:
526  ExecuteTwoImageFilterWithFunctor<itk::Functor::Div<TPixel1, TPixel2, TPixel1>,
527  itk::Functor::Add2<TPixel1, TPixel2, double>,
528  Image1Type, Image2Type, DoubleOutputType>(imageA, imageB);
529  break;
530  default:
531  break;
532  }
533 }
534 
535 template<typename DefaultFunctorType, typename DoubleFunctorType, typename Image1Type, typename Image2Type, typename DoubleImageType >
537 {
538  typedef itk::BinaryFunctorImageFilter< Image1Type, Image2Type, Image1Type,DefaultFunctorType > DefaultFilterType;
539  typedef itk::BinaryFunctorImageFilter< Image1Type, Image2Type, DoubleImageType, DoubleFunctorType > DoubleFilterType;
540 
541  if (m_GenerateDoubleOutput)
542  {
543  typename DoubleFilterType::Pointer filter = DoubleFilterType::New();
544  filter->SetInput1(imageA);
545  filter->SetInput2(imageB);
546  filter->Update();
547  CastToMitkImage(filter->GetOutput(), m_ResultImage);
548  }
549  else
550  {
551  typename DefaultFilterType::Pointer filter = DefaultFilterType::New();
552  filter->SetInput1(imageA);
553  filter->SetInput2(imageB);
554  filter->Update();
555  CastToMitkImage(filter->GetOutput(), m_ResultImage);
556  }
557 }
static Image::Pointer Subtract(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
static Image::Pointer Abs(Image::Pointer &imageA, bool outputAsDouble=true)
itk::Image< unsigned char, 3 > ImageType
static Image::Pointer Sin(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Asin(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Square(Image::Pointer &imageA, bool outputAsDouble=true)
DataCollection - Class to facilitate loading/accessing structured data.
#define AccessByItk_n(mitkImage, itkImageTypeFunction, va_tuple)
Access a MITK image by an ITK image with one or more parameters.
static Image::Pointer Sqrt(Image::Pointer &imageA, bool outputAsDouble=true)
static void ExecuteOneImageFilterWithFunctor(ImageType *imageA, double value, bool returnDoubleImage, bool valueLeft, bool, mitk::Image::Pointer &outputImage)
static Image::Pointer Log10(Image::Pointer &imageA, bool outputAsDouble=true)
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
static Image::Pointer Divide(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
static Image::Pointer Cos(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Acos(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Tan(Image::Pointer &imageA, bool outputAsDouble=true)
#define mitkThrow()
static void ExecuteOneImageFilter(itk::Image< TPixel, VImageDimension > *imageA, double value, bool returnDoubleImage, bool valueLeft, bool parameterFree, mitk::NonStaticArithmeticOperation::OperationsEnum algorithm, mitk::Image::Pointer &outputImage)
void CallExecuteTwoImageFilter(mitk::Image::Pointer imageA, mitk::Image::Pointer imageB)
static Image::Pointer ExpNeg(Image::Pointer &imageA, bool outputAsDouble=true)
static void ExecuteOneImageFilterWithFunctorNonParameter(ImageType *imageA, double, bool returnDoubleImage, bool, bool, mitk::Image::Pointer &outputImage)
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
#define AccessTwoImagesFixedDimensionByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension)
Access two mitk-images with known dimension by itk-images.
void ExecuteTwoImageFilterWithFunctor(Image1Type *imageA, Image2Type *imageB)
void ExecuteTwoImageFilter(itk::Image< TPixel1, VImageDimension1 > *imageA, itk::Image< TPixel2, VImageDimension2 > *imageB)
static Image::Pointer Add(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
static Image::Pointer Atan(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Exp(Image::Pointer &imageA, bool outputAsDouble=true)
static Image::Pointer Multiply(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)