Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkGradientDirectionsProperty.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 
18 
20 {
22 }
23 
25  : mitk::BaseProperty(other)
26 {
28 }
29 
31 {
32  m_GradientDirectionsContainer = gradientDirectionsContainer;
33 }
34 
36 {
38  for(unsigned int index(0); index < gradientDirectionsContainer.size(); index++)
39  {
40  GradientDirectionType newDirection = gradientDirectionsContainer.at(index).GetVnlVector();
41  m_GradientDirectionsContainer->InsertElement( index, newDirection);
42  }
43 }
44 
46 {
47 }
48 
50 {
51  return m_GradientDirectionsContainer;
52 }
53 
55 {
56 
57  GradientDirectionsContainerType::Pointer lhs = this->m_GradientDirectionsContainer;
58  GradientDirectionsContainerType::Pointer rhs = static_cast<const Self&>(property).m_GradientDirectionsContainer;
59 
60  if(lhs->Size() != rhs->Size()) return false;
61 
62  GradientDirectionsContainerType::Iterator lhsit = lhs->Begin();
63  GradientDirectionsContainerType::Iterator rhsit = rhs->Begin();
64 
65  bool equal = true;
66  for(unsigned int i = 0 ; i < lhs->Size(); i++, ++lhsit, ++rhsit)
67  equal |= lhsit.Value() == rhsit.Value();
68 
69  return equal;
70 }
71 
73 {
74  this->m_GradientDirectionsContainer = static_cast<const Self&>(property).m_GradientDirectionsContainer;
75  return true;
76 }
77 
79 {
80  itk::LightObject::Pointer result(new Self(*this));
81  result->UnRegister();
82  return result;
83 }
virtual itk::LightObject::Pointer InternalClone() const override
itk::SmartPointer< Self > Pointer
virtual bool Assign(const BaseProperty &property) override
DataCollection - Class to facilitate loading/accessing structured data.
virtual bool IsEqual(const BaseProperty &property) const override
Abstract base class for properties.
std::vector< itk::Vector< double, 3 > > AlternativeGradientDirectionsContainerType
GradientDirectionsContainerType::Pointer m_GradientDirectionsContainer
const GradientDirectionsContainerType::Pointer GetGradientDirectionsContainer() const
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.