Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
Medical Imaging Interaction Toolkit
mitkTransferFunctionInitializer.h
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 
13 #ifndef MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
14 #define MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
15 
16 #include <vtkColorTransferFunction.h>
17 #include <vtkPiecewiseFunction.h>
18 #include <vtkSmartPointer.h>
19 
20 #include "mitkTransferFunction.h"
21 
22 #include <itkObject.h>
23 #include <itkObjectFactory.h>
24 
25 #include <MitkCoreExports.h>
26 
27 namespace mitk
28 {
42  class MITKCORE_EXPORT TransferFunctionInitializer : public itk::Object
43  {
44  public:
46 
47  itkFactorylessNewMacro(Self);
48 
49  itkCloneMacro(Self)
51 
52  static void GetPresetNames(std::vector<std::string> &presetNames);
53 
54  void SetTransferFunction(TransferFunction::Pointer transferFunction);
55  mitk::TransferFunction::Pointer GetTransferFunction();
56  void SetTransferFunctionMode(int mode);
57 
58  void InitTransferFunctionMode();
59 
60  protected:
61  TransferFunctionInitializer(TransferFunction::Pointer transferFunction = nullptr);
62  ~TransferFunctionInitializer() override;
63 
64  private:
65  int m_Mode;
66  mitk::TransferFunction::Pointer m_transferFunction;
67 
68  // Define Transfer Function
69  enum TransferFunctionMode
70  {
71  TF_CT_DEFAULT,
72  TF_CT_BLACK_WHITE,
73  TF_CT_THORAX_LARGE,
74  TF_CT_THORAX_SMALL,
75  TF_CT_BONE,
76  TF_CT_BONE_GRADIENT,
77  TF_CT_CARDIAC,
78  TF_MR_GENERIC
79  };
80 
81  // remove all old points
82  void RemoveAllPoints();
83  void SetModified();
84  void SetCtDefaultMode();
85  void SetCtBlackWhiteMode();
86  void SetCtThoraxLargeMode();
87  void SetCtThoraxSmallMode();
88  void SetCtBoneMode();
89  void SetCtBoneGradientMode();
90  void SetCtCardiacMode();
91  void SetMrGenericMode();
92  };
93 }
94 
95 #endif /* MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED */
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
STL namespace.
The TransferFunction class A wrapper class for VTK scalar opacity, gradient opacity, and color transfer functions.Holds a copy of each of the three standard VTK transfer functions (scalar opacity, gradient opacity, color) and provides an interface for manipulating their control points. Each original function can be retrieved by a Get() method.
DataCollection - Class to facilitate loading/accessing structured data.
Wrapper class for VTK scalar opacity, gradient opacity, and color transfer functions.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45