Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkVtkResliceInterpolationProperty.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 #include <vtkProperty.h>
15 
17 {
18  this->AddInterpolationTypes();
19  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
20 }
21 
23 {
24  this->AddInterpolationTypes();
25  if (IsValidEnumerationValue(value))
26  {
27  this->SetValue(value);
28  }
29  else
30  {
31  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
32  }
33 }
34 
36 {
37  this->AddInterpolationTypes();
38  if (IsValidEnumerationValue(value))
39  {
40  this->SetValue(value);
41  }
42  else
43  {
44  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
45  }
46 }
47 
49 {
50  return static_cast<int>(this->GetValueAsId());
51 }
52 
54 {
55  this->SetValue(static_cast<IdType>(VTK_RESLICE_NEAREST));
56 }
57 
59 {
60  this->SetValue(static_cast<IdType>(VTK_RESLICE_LINEAR));
61 }
62 
64 {
65  this->SetValue(static_cast<IdType>(VTK_RESLICE_CUBIC));
66 }
67 
69 {
70  AddEnum("Nearest", static_cast<IdType>(VTK_RESLICE_NEAREST));
71  AddEnum("Linear", static_cast<IdType>(VTK_RESLICE_LINEAR));
72  AddEnum("Cubic", static_cast<IdType>(VTK_RESLICE_CUBIC));
73 }
74 
75 bool mitk::VtkResliceInterpolationProperty::AddEnum(const std::string &name, const IdType &id)
76 {
77  return Superclass::AddEnum(name, id);
78 }
79 
80 itk::LightObject::Pointer mitk::VtkResliceInterpolationProperty::InternalClone() const
81 {
82  itk::LightObject::Pointer result(new Self(*this));
83  result->UnRegister();
84  return result;
85 }
virtual IdType GetValueAsId() const
virtual bool SetValue(const std::string &name)
bool AddEnum(const std::string &name, const IdType &id) override
virtual bool AddEnum(const std::string &name, const IdType &id)
virtual bool IsValidEnumerationValue(const IdType &id) const