Skip to content

Commit

Permalink
Merge pull request #2756 from jhlegarreta/FixMissingInitializationBra…
Browse files Browse the repository at this point in the history
…cesWarning

COMP: Fix missing initialization braces warning
  • Loading branch information
jhlegarreta authored Sep 24, 2021
2 parents b301e5b + 33d1d0d commit 9def6b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ itkLaplacianImageFilterTest(int argc, char * argv[])
ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update());

// Assign a spacing other than [1,1] for testing
itk::Vector<float, 2> spacing{ { 0.5, 5.0 } };
itk::Vector<float, 2> spacing{ { { 0.5, 5.0 } } };
reader->GetOutput()->SetSpacing(spacing);

// Set up filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ void
zeroSizeCase()
{
// test filter with zero sized image
auto p_filter = itk::LabelImageToLabelMapFilter<itk::Image<unsigned char, 3>>::New();
auto p_image = itk::Image<unsigned char, 3>::New();
p_image->SetRegions(itk::Size<3>{ 0, 0, 0 });
constexpr unsigned int ImageDimension = 3;
using PixelType = unsigned char;
using ImageType = itk::Image<PixelType, ImageDimension>;
auto p_filter = itk::LabelImageToLabelMapFilter<ImageType>::New();
auto p_image = ImageType::New();

// The image region is empty by default: do not set any region to it and allocate memory
p_image->Allocate(true);

p_filter->SetInput(p_image);
Expand Down

0 comments on commit 9def6b7

Please sign in to comment.