Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkOdfScaleByProperty.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 "mitkOdfScaleByProperty.h"
18 
19 // ODFN_NONE, ODFN_GFA, ODFN_PC
20 
22 {
23  this->AddInterpolationTypes();
24  this->SetValue( static_cast<IdType>( ODFSB_NONE ) );
25 }
26 
27 
29 {
30  this->AddInterpolationTypes();
31  if ( IsValidEnumerationValue( value ) )
32  {
33  this->SetValue( value ) ;
34  }
35  else
36  {
37  this->SetValue( static_cast<IdType>( ODFSB_NONE ) );
38  }
39 }
40 
42 {
43  this->AddInterpolationTypes();
44  if ( IsValidEnumerationValue( value ) )
45  {
46  this->SetValue( value );
47  }
48  else
49  {
50  this->SetValue( static_cast<IdType>( ODFSB_NONE ) );
51  }
52 }
53 
54 
56 {
57  return static_cast<int>( this->GetValueAsId() );
58 }
59 
61 {
62  AddEnum( "None", static_cast<IdType>( ODFSB_NONE ) );
63  AddEnum( "GFA", static_cast<IdType>( ODFSB_GFA ) );
64  AddEnum( "Principal Curvature", static_cast<IdType>( ODFSB_PC ) );
65 }
66 
68 {
69  SetValue(ODFSB_NONE);
70 }
71 
73 {
74  SetValue(ODFSB_GFA);
75 }
76 
78 {
79  SetValue(ODFSB_PC);
80 }
81 
82 bool mitk::OdfScaleByProperty::AddEnum( const std::string& name, const IdType& id )
83 {
84  return Superclass::AddEnum( name, id );
85 }
86 
virtual bool SetValue(const std::string &name)
#define MITK_REGISTER_SERIALIZER(classname)
virtual bool AddEnum(const std::string &name, const IdType &id) override