Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkNavigationDataPassThroughFilter.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 {
21 }
22 
24 {
25 }
26 
28 {
29  // get each input and transfer the data
30  DataObjectPointerArray inputs = this->GetInputs(); //get all inputs
31  for ( unsigned int index = 0; index < inputs.size(); ++index )
32  {
33  // get the needed variables (input and output)
34  const mitk::NavigationData* nd = this->GetInput(index);
35  mitk::NavigationData* output = this->GetOutput(index);
36 
37  if ( ! nd || ! output )
38  {
39  MITK_ERROR("NavigationDataToNavigationDataFilter")("NavigationDataPassThroughFilter")
40  << "Input and output must not be null.";
41  mitkThrow() << "Input and output must not be null.";
42  }
43 
44  output->Graft(nd); // copy all information from input to output
45  output->SetDataValid(nd->IsDataValid());
46  }
47 }
#define MITK_ERROR
Definition: mitkLogMacros.h:24
Navigation Data.
virtual void SetDataValid(bool _arg)
sets the dataValid flag of the NavigationData object indicating if the object contains valid data ...
#define mitkThrow()
virtual void GenerateData() override
Passes navigation data from all inputs to all outputs. If a subclass wants to implement its own versi...
virtual bool IsDataValid() const
returns true if the object contains valid data
virtual void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.