Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkImageCaster.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkImageCaster.h"
18 #include "mitkImageAccessByItk.h"
19 
20 vtkRenderer *mitk::RendererAccess::m_3DRenderer = nullptr;
21 
22 void mitk::RendererAccess::Set3DRenderer(vtkRenderer *renwin4)
23 {
24  m_3DRenderer = renwin4;
25 }
26 
28 {
29  return m_3DRenderer;
30 }
31 
33 {
34 }
35 
37  itk::SmartPointer<mitk::Image> &mitkoutputimage)
38 {
39  try
40  {
41  mitkoutputimage = dynamic_cast<mitk::Image *>(mitkBaseData);
42  }
43  catch (...)
44  {
45  return;
46  }
47 }
48 
49 #define DefineMitkImageCasterMethods(r, data, type) \
50  void mitk::ImageCaster::CastToItkImage(const mitk::Image *mitkImage, \
51  itk::SmartPointer<itk::Image<MITK_PP_TUPLE_REM(2) type>> &itkOutputImage) \
52  { \
53  mitk::CastToItkImage(mitkImage, itkOutputImage); \
54  } \
55  void mitk::ImageCaster::CastToMitkImage(const itk::Image<MITK_PP_TUPLE_REM(2) type> *itkImage, \
56  itk::SmartPointer<mitk::Image> &mitkOutputImage) \
57  { \
58  mitk::CastToMitkImage<itk::Image<MITK_PP_TUPLE_REM(2) type>>(itkImage, mitkOutputImage); \
59  }
60 
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:32
#define DefineMitkImageCasterMethods(r, data, type)
static vtkRenderer * m_3DRenderer
Base of all data objects.
Definition: mitkBaseData.h:39
static vtkRenderer * Get3DRenderer()
static void CastBaseData(mitk::BaseData *const, itk::SmartPointer< mitk::Image > &)
Image class for storing images.
Definition: mitkImage.h:76
#define MITK_PP_SEQ_FOR_EACH(macro, data, seq)
static void Set3DRenderer(vtkRenderer *renderer)
static void Cast(BaseData *dat, Surface *surface)
#define MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dim)
Definition: mitkConfig.h:34