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"
3233
3334namespace
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-
5636template <typename T1, typename T2>
5737void
5838Expect_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