Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkGeometryData.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 
13 #include "mitkGeometryData.h"
14 #include "mitkBaseProcess.h"
15 #include "mitkTimeGeometry.h"
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
28 }
29 
31 {
32 }
33 
35 {
36  if (GetGeometry() != nullptr)
37  return true;
38 
39  return false;
40 }
41 
43 {
44  if (GetGeometry() == nullptr)
45  return false;
46 
47  return true;
48 }
49 
50 void mitk::GeometryData::SetRequestedRegion(const itk::DataObject *)
51 {
52 }
53 
54 void mitk::GeometryData::CopyInformation(const itk::DataObject *)
55 {
56 }
57 
58 bool mitk::Equal(const mitk::GeometryData &leftHandSide,
59  const mitk::GeometryData &rightHandSide,
61  bool verbose)
62 {
63  unsigned int timeStepsLeft = leftHandSide.GetTimeGeometry()->CountTimeSteps();
64  unsigned int timeStepsRight = rightHandSide.GetTimeGeometry()->CountTimeSteps();
65 
66  if (timeStepsLeft != timeStepsRight)
67  {
68  if (verbose)
69  {
70  MITK_INFO << "[( GeometryData::GetTimeGeometry )] number of time steps are not equal.";
71  MITK_INFO << "rightHandSide is " << timeStepsRight << " : leftHandSide is " << timeStepsLeft;
72  }
73  return false;
74  }
75 
76  bool allEqual = true;
77 
78  for (unsigned int t = 0; t < timeStepsLeft; ++t)
79  {
80  BaseGeometry *geomLeft = leftHandSide.GetGeometry(t);
81  BaseGeometry *geomRight = rightHandSide.GetGeometry(t);
82  allEqual &= mitk::Equal(*geomLeft, *geomRight, eps, verbose);
83  }
84 
85  return allEqual; // valid with initial true for timestep count == 0
86 }
void SetRequestedRegion(const itk::DataObject *data) override
Set the requested region from this data object to match the requested region of the data object passe...
void UpdateOutputInformation() override
#define MITK_INFO
Definition: mitkLogMacros.h:18
double ScalarType
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Determine whether the RequestedRegion is outside of the BufferedRegion.
void SetRequestedRegionToLargestPossibleRegion() override
Set the RequestedRegion to the LargestPossibleRegion.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
Definition: mitkBaseData.h:61
void CopyInformation(const itk::DataObject *data) override
bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
bool verbose(false)
Data class only having a BaseGeometry but not containing any specific data.
void UpdateOutputInformation() override
Update the information for this BaseData (the geometry in particular) so that it can be used as an ou...
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
MITKCORE_EXPORT const ScalarType eps
mitk::BaseGeometry * GetGeometry(int t=0) const
Return the geometry, which is a TimeGeometry, of the data as non-const pointer.
Definition: mitkBaseData.h:138
BaseGeometry Describes the geometry of a data object.