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