Skip to content

Commit 5c4c6db

Browse files
authored
Merge pull request #5913 from N-Dekker/itkImageAdaptorGTest-use-DefaultPixelAccessor
STYLE: Use DefaultPixelAccessor in itkImageAdaptorGTest
2 parents 26a0767 + da37ccc commit 5c4c6db

1 file changed

Lines changed: 4 additions & 24 deletions

File tree

Modules/Core/ImageAdaptors/test/itkImageAdaptorGTest.cxx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "itkImageAdaptor.h"
2121

2222
#include "itkCovariantVector.h"
23+
#include "itkDefaultPixelAccessor.h"
2324
#include "itkImage.h"
2425
#include "itkImageBase.h"
2526
#include "itkImageRegionIterator.h"
@@ -32,27 +33,6 @@
3233

3334
namespace
3435
{
35-
template <typename TPixelType>
36-
class DummyPixelAccessor
37-
{
38-
public:
39-
using ExternalType = TPixelType;
40-
using InternalType = TPixelType;
41-
42-
static void
43-
Set(TPixelType & output, const TPixelType & input)
44-
{
45-
output = input;
46-
}
47-
48-
static TPixelType
49-
Get(const TPixelType & input)
50-
{
51-
return input;
52-
}
53-
};
54-
55-
5636
template <typename T1, typename T2>
5737
void
5838
Expect_same_type_and_equal_value(T1 && value1, T2 && value2)
@@ -127,7 +107,7 @@ Expect_Transform_member_functions_return_the_same_for_an_ImageAdaptor_as_for_its
127107
const auto ImageDimension = TImage::ImageDimension;
128108
using IndexType = itk::Index<ImageDimension>;
129109

130-
const auto imageAdaptor = itk::ImageAdaptor<TImage, DummyPixelAccessor<typename TImage::PixelType>>::New();
110+
const auto imageAdaptor = itk::ImageAdaptor<TImage, itk::DefaultPixelAccessor<typename TImage::PixelType>>::New();
131111
imageAdaptor->SetImage(&image);
132112

133113
for (const auto & point :
@@ -197,7 +177,7 @@ TEST(ImageAdaptor, ComputeOffset)
197177
using ImageType = itk::Image<PixelType, dimension>;
198178

199179
const auto image = ImageType::New();
200-
const auto adaptor = itk::ImageAdaptor<ImageType, DummyPixelAccessor<PixelType>>::New();
180+
const auto adaptor = itk::ImageAdaptor<ImageType, itk::DefaultPixelAccessor<PixelType>>::New();
201181

202182
// Use a very small image region, to speed up the unit test.
203183
const itk::ImageRegion imageRegion{ itk::Index<dimension>::Filled(1), itk::Size<dimension>::Filled(2) };
@@ -221,7 +201,7 @@ TEST(ImageAdaptor, SupportsRegionIterator)
221201
using ImageType = itk::Image<PixelType, dimension>;
222202

223203
const auto image = ImageType::New();
224-
const auto adaptor = itk::ImageAdaptor<ImageType, DummyPixelAccessor<PixelType>>::New();
204+
const auto adaptor = itk::ImageAdaptor<ImageType, itk::DefaultPixelAccessor<PixelType>>::New();
225205

226206
adaptor->SetImage(image);
227207
adaptor->SetRegions(itk::Size<dimension>::Filled(4));

0 commit comments

Comments
 (0)