Skip to content

Commit fa7aa08

Browse files
committed
COMP: Prefer ZeroValue() for RGB pixel types
External initialization of static const member functions is the same as through the ZeroValue function.
1 parent bce41b3 commit fa7aa08

File tree

3 files changed

+3
-3
lines changed
  • src
    • Compatibility/Deprecated/ResampleRGBImage
    • Core/Transform/TranslateAVectorImage
    • Filtering/ImageGrid/CropImageBySpecifyingRegion2

3 files changed

+3
-3
lines changed

src/Compatibility/Deprecated/ResampleRGBImage/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ CreateImage(ImageType::Pointer image)
120120
ImageType::RegionType region(start, size);
121121
image->SetRegions(region);
122122
image->Allocate();
123-
image->FillBuffer(itk::NumericTraits<ImageType::PixelType>::Zero);
123+
image->FillBuffer(itk::NumericTraits<ImageType::PixelType>::ZeroValue());
124124

125125
ImageType::PixelType pixel;
126126
pixel.SetRed(200);

src/Core/Transform/TranslateAVectorImage/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ main(int, char *[])
3838
itk::ImageRegion<2> region(start, size);
3939
image->SetRegions(region);
4040
image->Allocate();
41-
image->FillBuffer(itk::NumericTraits<VectorType>::Zero);
41+
image->FillBuffer(itk::NumericTraits<VectorType>::ZeroValue());
4242

4343
itk::TranslationTransform<double, 2>::Pointer transform = itk::TranslationTransform<double, 2>::New();
4444
itk::TranslationTransform<double, 2>::OutputVectorType translation;

src/Filtering/ImageGrid/CropImageBySpecifyingRegion2/Code.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ CreateImage(ImageType::Pointer image)
109109

110110
image->SetRegions(region);
111111
image->Allocate();
112-
image->FillBuffer(itk::NumericTraits<ImageType::PixelType>::Zero);
112+
image->FillBuffer(itk::NumericTraits<ImageType::PixelType>::ZeroValue());
113113

114114
// Make a rectangle, centered at (100,150) with sides 160 & 240
115115
// This provides a 20 x 30 border around the square for the crop filter to remove

0 commit comments

Comments
 (0)