Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
SuperElastix
Commits
53e80653
Commit
53e80653
authored
Jan 18, 2017
by
Floris Berendsen
Browse files
ENH: changed all unit test to use the
SuperElastixFilterCustomComponents<...>
parent
a0d63082
Changes
4
Hide whitespace changes
Inline
Side-by-side
Modules/Components/Niftyreg/test/selxNiftyregComponentTest.cxx
View file @
53e80653
...
...
@@ -17,9 +17,8 @@
*
*=========================================================================*/
#include
"selxSuperElastixFilter.h"
#include
"selxRegisterComponentFactoriesByTypeList.h"
#include
"selxDefaultComponents.h"
#include
"selxSuperElastixFilterCustomComponents.h"
#include
"selxRegistrationController.h"
#include
"selxNiftyregReadImageComponent.h"
...
...
@@ -47,10 +46,9 @@ public:
virtual
void
SetUp
()
{
// Instantiate SuperElastixFilter before each test
superElastixFilter
=
SuperElastixFilter
::
New
();
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
();
dataManager
=
DataManagerType
::
New
();
}
...
...
Modules/Components/itkImageRegistrationMethodv4/test/selxRegistrationItkv4Test.cxx
View file @
53e80653
...
...
@@ -17,8 +17,7 @@
*
*=========================================================================*/
#include
"selxSuperElastixFilter.h"
#include
"selxRegisterComponentFactoriesByTypeList.h"
#include
"selxSuperElastixFilterCustomComponents.h"
#include
"selxTransformComponent1.h"
#include
"selxMetricComponent1.h"
...
...
@@ -128,10 +127,9 @@ public:
virtual
void
SetUp
()
{
// Instantiate SuperElastixFilter before each test
superElastixFilter
=
SuperElastixFilter
::
New
();
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
();
dataManager
=
DataManagerType
::
New
();
}
...
...
Modules/Core/Filter/test/selxSuperElastixFilterTest.cxx
View file @
53e80653
...
...
@@ -17,8 +17,8 @@
*
*=========================================================================*/
#include
"selxSuperElastixFilter.h"
#include
"selxRegisterComponentFactoriesByTypeList.h"
#include
"selxSuperElastixFilter
CustomComponents
.h"
#include
"itkSharedPointerDataObjectDecorator.h"
#include
"selxItkSmoothingRecursiveGaussianImageFilterComponent.h"
...
...
@@ -86,6 +86,7 @@ public:
virtual
void
TearDown
()
{
// Unregister all components after each test
// TODO: when SuperElastix is refactored to not use the ITK object factory this UnRegisterAllFactories call must be removed
itk
::
ObjectFactoryBase
::
UnRegisterAllFactories
();
// Delete the SuperElastixFilter after each test
superElastixFilter
=
nullptr
;
...
...
@@ -113,10 +114,11 @@ TEST_F( SuperElastixFilterTest, ImageOnly )
blueprint
->
SetConnection
(
"InputImage"
,
"ImageFilter"
,
{
{}
}
);
//
blueprint
->
SetConnection
(
"ImageFilter"
,
"OutputImage"
,
{
{}
}
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixBlueprint
->
Set
(
blueprint
);
...
...
@@ -153,10 +155,9 @@ TEST_F( SuperElastixFilterTest, ImageAndMesh )
blueprint
->
SetComponent
(
"OutputMesh"
,
{
{
"NameOfClass"
,
{
"ItkMeshSinkComponent"
}
}
}
);
blueprint
->
SetConnection
(
"InputMesh"
,
"OutputMesh"
,
Blueprint
::
ParameterMapType
()
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixFilterBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixFilterBlueprint
->
Set
(
blueprint
);
...
...
@@ -184,10 +185,9 @@ TEST_F( SuperElastixFilterTest, TooManyInputs )
blueprint
->
SetComponent
(
"Source_A"
,
{
{
"NameOfClass"
,
{
"ItkImageSourceComponent"
}
}
}
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixFilterBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixFilterBlueprint
->
Set
(
blueprint
);
...
...
@@ -211,10 +211,9 @@ TEST_F( SuperElastixFilterTest, TooManySources )
blueprint
->
SetComponent
(
"Source_A"
,
{
{
"NameOfClass"
,
{
"ItkImageSourceComponent"
}
}
}
);
blueprint
->
SetComponent
(
"Source_B"
,
{
{
"NameOfClass"
,
{
"ItkImageSourceComponent"
}
}
}
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixFilterBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixFilterBlueprint
->
Set
(
blueprint
);
...
...
@@ -235,10 +234,9 @@ TEST_F( SuperElastixFilterTest, TooManyOutputs )
blueprint
->
SetComponent
(
"Sink_A"
,
{
{
"NameOfClass"
,
{
"ItkImageSinkComponent"
}
}
}
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixFilterBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixFilterBlueprint
->
Set
(
blueprint
);
...
...
@@ -259,10 +257,9 @@ TEST_F( SuperElastixFilterTest, TooManySinks )
blueprint
->
SetComponent
(
"Sink_A"
,
{
{
"NameOfClass"
,
{
"ItkImageSinkComponent"
}
}
}
);
blueprint
->
SetComponent
(
"Sink_B"
,
{
{
"NameOfClass"
,
{
"ItkImageSinkComponent"
}
}
}
);
// Instantiate SuperElastixFilter before each test
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilter
::
New
());
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
EXPECT_NO_THROW
(
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
());
SuperElastixFilterBlueprintPointer
superElastixFilterBlueprint
=
SuperElastixFilterBlueprintType
::
New
();
superElastixFilterBlueprint
->
Set
(
blueprint
);
...
...
Testing/Unit/selxitkImageFilterTest.cxx
View file @
53e80653
...
...
@@ -17,8 +17,7 @@
*
*=========================================================================*/
#include
"selxSuperElastixFilter.h"
#include
"selxRegisterComponentFactoriesByTypeList.h"
#include
"selxSuperElastixFilterCustomComponents.h"
#include
"selxItkSmoothingRecursiveGaussianImageFilterComponent.h"
#include
"selxItkImageSink.h"
...
...
@@ -70,10 +69,11 @@ public:
virtual
void
SetUp
()
{
// Instantiate SuperElastixFilter before each test
superElastixFilter
=
SuperElastixFilter
::
New
();
// Register the components we want to have available in SuperElastix
RegisterFactoriesByTypeList
<
RegisterComponents
>::
Register
();
// Instantiate SuperElastixFilter before each test and
// register the components we want to have available in SuperElastix
superElastixFilter
=
SuperElastixFilterCustomComponents
<
RegisterComponents
>::
New
();
dataManager
=
DataManagerType
::
New
();
/** make example blueprint configuration */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment