24 this->SetNumberOfRequiredOutputs(1);
25 this->SetNthOutput(0, output.GetPointer());
36 this->SetInput(0, nd);
43 this->RemoveInput(idx);
45 this->ProcessObject::SetNthInput(idx, const_cast<NavigationData*>(nd));
46 this->CreateOutputsForAllInputs();
52 if (this->GetNumberOfInputs() < 1)
55 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(0));
61 if (this->GetNumberOfInputs() < 1)
64 return static_cast<const NavigationData*
>(this->ProcessObject::GetInput(idx));
70 const DataObjectPointerArray& inputs =
const_cast<Self*
>(
this)->GetInputs();
71 for (DataObjectPointerArray::const_iterator it = inputs.begin(); it != inputs.end(); ++it)
72 if (std::string(navDataName) == (
static_cast<NavigationData*
>(it->GetPointer()))->GetName())
73 return static_cast<NavigationData*>(it->GetPointer());
80 DataObjectPointerArray outputs = this->GetInputs();
81 for (DataObjectPointerArray::size_type i = 0; i < outputs.size(); ++i)
82 if (navDataName == (static_cast<NavigationData*>(outputs.at(i).GetPointer()))->GetName())
84 throw std::invalid_argument(
"output name does not exist");
89 for (DataObjectPointerArraySizeType i = 0; i < UpstreamFilter->GetNumberOfOutputs(); i++)
91 this->SetInput(i, UpstreamFilter->
GetOutput(i));
98 this->SetNumberOfIndexedOutputs(this->GetNumberOfIndexedInputs());
99 bool isModified =
false;
100 for (
unsigned int idx = 0; idx < this->GetNumberOfIndexedOutputs(); ++idx){
101 if (this->GetOutput(idx) == NULL)
104 this->SetNthOutput(idx, newOutput);
DataObjectPointerArraySizeType GetInputIndex(std::string navDataName)
return the index of the input with name navDataName, throw std::invalid_argument exception if that na...
itk::SmartPointer< Self > Pointer
NavigationData * GetOutput(void)
return the output (output with id 0) of the filter
DataCollection - Class to facilitate loading/accessing structured data.
virtual ~NavigationDataToNavigationDataFilter()
virtual void SetInput(const NavigationData *nd)
Set the input of this filter.
NavigationDataToNavigationDataFilter()
virtual void ConnectTo(mitk::NavigationDataSource *UpstreamFilter)
Connects the input of this filter to the outputs of the given NavigationDataSource.
const NavigationData * GetInput(void) const
Get the input of this filter.
void CreateOutputsForAllInputs()
Create an output for each input.