Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperElastix
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Mirrors
SuperElastix
Commits
bbe1d54b
Commit
bbe1d54b
authored
Jan 26, 2018
by
Floris Berendsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: added optional masks for AntsCorrelationMetric
parent
b27a78b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
4 deletions
+40
-4
Modules/Components/itkImageRegistrationMethodv4/include/selxItkANTSNeighborhoodCorrelationImageToImageMetricv4Component.h
...NTSNeighborhoodCorrelationImageToImageMetricv4Component.h
+15
-4
Modules/Components/itkImageRegistrationMethodv4/include/selxItkANTSNeighborhoodCorrelationImageToImageMetricv4Component.hxx
...SNeighborhoodCorrelationImageToImageMetricv4Component.hxx
+25
-0
No files found.
Modules/Components/itkImageRegistrationMethodv4/include/selxItkANTSNeighborhoodCorrelationImageToImageMetricv4Component.h
View file @
bbe1d54b
...
...
@@ -32,7 +32,8 @@ namespace selx
template
<
int
Dimensionality
,
class
TPixel
>
class
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component
:
public
SuperElastixComponent
<
Accepting
<
>
,
Accepting
<
itkImageFixedMaskInterface
<
Dimensionality
,
unsigned
char
>
,
itkImageMovingMaskInterface
<
Dimensionality
,
unsigned
char
>
>
,
Providing
<
itkMetricv4Interface
<
Dimensionality
,
TPixel
,
double
>>
>
{
...
...
@@ -43,7 +44,8 @@ public:
Dimensionality
,
TPixel
>
Self
;
typedef
SuperElastixComponent
<
Accepting
<
>
,
Accepting
<
itkImageFixedMaskInterface
<
Dimensionality
,
unsigned
char
>
,
itkImageMovingMaskInterface
<
Dimensionality
,
unsigned
char
>
>
,
Providing
<
itkMetricv4Interface
<
Dimensionality
,
TPixel
,
double
>>
>
Superclass
;
typedef
std
::
shared_ptr
<
Self
>
Pointer
;
...
...
@@ -59,16 +61,25 @@ public:
typedef
itk
::
Image
<
PixelType
,
Dimensionality
>
MovingImageType
;
typedef
typename
itk
::
ImageToImageMetricv4
<
FixedImageType
,
MovingImageType
>
ImageToImageMetricv4Type
;
//typedef typename ItkMetricv4Interface<Dimensionality, TPixel>::ImageToImageMetricv4Type ImageToImageMetricv4Type;
//typedef ItkMetricv4Interface<Dimensionality, TPixel>::ImageToImageMetricv4Type ItkMetricv4Pointer
typedef
typename
ImageToImageMetricv4Type
::
Pointer
ItkMetricv4Pointer
;
typedef
typename
itk
::
ANTSNeighborhoodCorrelationImageToImageMetricv4
<
FixedImageType
,
MovingImageType
>
TheItkFilterType
;
// accepting Interfaces:
virtual
int
Accept
(
typename
itkImageFixedMaskInterface
<
Dimensionality
,
unsigned
char
>::
Pointer
)
override
;
virtual
int
Accept
(
typename
itkImageMovingMaskInterface
<
Dimensionality
,
unsigned
char
>::
Pointer
)
override
;
// providing Interfaces:
virtual
ItkMetricv4Pointer
GetItkMetricv4
()
override
;
// Base class methods:
virtual
bool
MeetsCriterion
(
const
ComponentBase
::
CriterionType
&
criterion
)
override
;
virtual
bool
ConnectionsSatisfied
()
override
{
return
true
;}
// all of the accepting interfaces are optional
static
const
char
*
GetDescription
()
{
return
"ItkANTSNeighborhoodCorrelationImageToImageMetricv4 Component"
;
}
private:
...
...
Modules/Components/itkImageRegistrationMethodv4/include/selxItkANTSNeighborhoodCorrelationImageToImageMetricv4Component.hxx
View file @
bbe1d54b
...
...
@@ -19,6 +19,7 @@
#include "selxItkANTSNeighborhoodCorrelationImageToImageMetricv4Component.h"
#include "selxCheckTemplateProperties.h"
#include "itkImageMaskSpatialObject.h"
namespace
selx
{
...
...
@@ -38,6 +39,30 @@ ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component< Dimensionality, TPi
{
}
template
<
int
Dimensionality
,
class
TPixel
>
int
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component
<
Dimensionality
,
TPixel
>::
Accept
(
typename
itkImageFixedMaskInterface
<
Dimensionality
,
unsigned
char
>::
Pointer
component
)
{
auto
fixedMaskImage
=
component
->
GetItkImageFixedMask
();
// connect the itk pipeline
auto
fixedMaskSpatialObject
=
itk
::
ImageMaskSpatialObject
<
Dimensionality
>::
New
();
fixedMaskSpatialObject
->
SetImage
(
fixedMaskImage
);
this
->
m_theItkFilter
->
SetFixedImageMask
(
fixedMaskSpatialObject
);
return
0
;
}
template
<
int
Dimensionality
,
class
TPixel
>
int
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component
<
Dimensionality
,
TPixel
>::
Accept
(
typename
itkImageMovingMaskInterface
<
Dimensionality
,
unsigned
char
>::
Pointer
component
)
{
auto
movingMaskImage
=
component
->
GetItkImageMovingMask
();
// connect the itk pipeline
auto
movingMaskSpatialObject
=
itk
::
ImageMaskSpatialObject
<
Dimensionality
>::
New
();
movingMaskSpatialObject
->
SetImage
(
movingMaskImage
);
this
->
m_theItkFilter
->
SetMovingImageMask
(
movingMaskSpatialObject
);
return
0
;
}
template
<
int
Dimensionality
,
class
TPixel
>
typename
ItkANTSNeighborhoodCorrelationImageToImageMetricv4Component
<
Dimensionality
,
TPixel
>::
ItkMetricv4Pointer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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