Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkBaseDataSource.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 "mitkBaseDataSource.h"
18 #include "mitkBaseData.h"
19 
21 {
22 }
23 
25 {
26 }
27 
29 {
30  this->GraftNthOutput(0, graft);
31 }
32 
34 {
35  if (!graft)
36  {
37  itkExceptionMacro(<< "Requested to graft output that is a NULL pointer");
38  }
39 
40  // we use the process object method since all our output may not be
41  // of the same type
42  itk::DataObject *output = this->ProcessObject::GetOutput(key);
43 
44  // Call GraftImage to copy meta-information, regions, and the pixel container
45  output->Graft(graft);
46 }
47 
48 void mitk::BaseDataSource::GraftNthOutput(unsigned int idx, OutputType *graft)
49 {
50  if (idx >= this->GetNumberOfIndexedOutputs())
51  {
52  itkExceptionMacro(<< "Requested to graft output " << idx << " but this filter only has "
53  << this->GetNumberOfIndexedOutputs()
54  << " indexed Outputs.");
55  }
56  this->GraftOutput(this->MakeNameFromOutputIndex(idx), graft);
57 }
58 
60 {
61  return this->m_Updating;
62 }
63 
itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
Base of all data objects.
Definition: mitkBaseData.h:39
virtual void GraftNthOutput(unsigned int idx, OutputType *output)
Graft the specified base data object onto this BaseDataSource's idx'th output.
bool Updating() const
Access itk::ProcessObject::m_Updating.
Superclass of all classes generating some kind of mitk::BaseData.
virtual void GraftOutput(OutputType *output)
Graft the specified BaseData onto this BaseDataSource's output.
#define mitkBaseDataSourceGetOutputDefinitions(className)