Commit f1b3fdef authored by Floris Berendsen's avatar Floris Berendsen
Browse files

ENH: added AddBlueprint() to SuperElastixFilter

parent 5d878eb6
......@@ -63,8 +63,11 @@ public:
typedef BlueprintType::Pointer BlueprintPointer;
typedef BlueprintType::ConstPointer BlueprintConstPointer;
// TODO: Make const-correct
itkSetObjectMacro( Blueprint, BlueprintType )
// Setting a Blueprint creates a pipeline such that when SuperElastixFilter is updated it checks if the blueprint has been modified and if so, SuperElastixFilter resets its internals and start building the blueprint from scratch
itkSetObjectMacro(Blueprint, BlueprintType);
// Adding a Blueprint composes SuperElastixFilter' internal blueprint (accessible by Set/Get Blueprint) with the otherBlueprint.
void AddBlueprint(BlueprintPointer otherBlueprint);
AnyFileReaderType::Pointer GetInputFileReader( const DataObjectIdentifierType & );
......
......@@ -52,7 +52,14 @@ m_AllUniqueComponents(false)
this->SetRequiredInputNames({});
} // end Constructor
void
SuperElastixFilter
::AddBlueprint(BlueprintPointer otherBlueprint)
{
auto blueprint_internals = this->m_Blueprint->Get();
blueprint_internals->ComposeWith(otherBlueprint->Get());
this->m_Blueprint->Set(blueprint_internals);
}
/**
* ********************* GenerateOutputInformation *********************
*/
......@@ -76,13 +83,20 @@ SuperElastixFilter
// are passed further down stream.
// Eventually configuration boils down to a while loop that repeatedly tries to narrow down
// the component selectors until no more unique components can be found.
if (!this->m_Blueprint)
{
itkExceptionMacro(<< "Setting a Blueprint is required first.")
}
if (!this->m_Blueprint)
{
itkExceptionMacro(<< "Setting a Blueprint is required first.")
}
if (this->m_Blueprint->Modified())
{
// Was m_Blueprint modified by Set() or by AddBlueprint?
}
this->m_NetworkBuilder->AddBlueprint(this->m_Blueprint->Get());
this->m_AllUniqueComponents = this->m_NetworkBuilder->Configure();
if (this->m_BlueprintConnectionModified == true)
{
//TODO:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment