Medical Imaging Interaction Toolkit  2018.4.99-e1268d66
Medical Imaging Interaction Toolkit
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 (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 
16 {
17 }
18 
20 {
21 }
22 
24 {
25  // get each input and transfer the data
26  DataObjectPointerArray inputs = this->GetInputs(); //get all inputs
27  for ( unsigned int index = 0; index < inputs.size(); ++index )
28  {
29  // get the needed variables (input and output)
30  const mitk::NavigationData* nd = this->GetInput(index);
31  mitk::NavigationData* output = this->GetOutput(index);
32 
33  if ( ! nd || ! output )
34  {
35  MITK_ERROR("NavigationDataToNavigationDataFilter")("NavigationDataPassThroughFilter")
36  << "Input and output must not be null.";
37  mitkThrow() << "Input and output must not be null.";
38  }
39 
40  output->Graft(nd); // copy all information from input to output
41  output->SetDataValid(nd->IsDataValid());
42  }
43 }
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
#define MITK_ERROR
Definition: mitkLogMacros.h:20
Navigation Data.
virtual void SetDataValid(bool _arg)
sets the dataValid flag of the NavigationData object indicating if the object contains valid data ...
const NavigationData * GetInput(void) const
Get the input of this filter.
#define mitkThrow()
void GenerateData() override
Passes navigation data from all inputs to all outputs. If a subclass wants to implement its own versi...
void Graft(const DataObject *data) override
Graft the data and information from one NavigationData to another.
virtual bool IsDataValid() const
returns true if the object contains valid data