Skip to content

Commit

Permalink
COMP: Type ambiguity when argument is const
Browse files Browse the repository at this point in the history
Changing variable to const caused windows builds
to fail.

error C2666: 'MetaImage::SequenceID': 2 overloads have similar conversions

Filtering\ImageFeature\include\itkZeroCrossingImageFilter.hxx(64): error C2668: 'itk::ImageRegion<3>::PadByRadius': ambiguous call to overloaded function
Core\Common\include\itkImageRegion.h(333): note: could be 'void itk::ImageRegion<3>::PadByRadius(const __int64 [])'
Core\Common\include\itkImageRegion.h(330): note: or       'void itk::ImageRegion<3>::PadByRadius(__int64)'
Filtering\ImageFeature\include\itkZeroCrossingImageFilter.hxx(64): note: while trying to match the argument list '(const itk::SizeValueType)'
Filtering\ImageFeature\include\itkZeroCrossingImageFilter.hxx(43): note: while compiling class template member function 'void itk::ZeroCrossingImageFilter<itk::Image<float,3>,itk::Image<float,3>>::GenerateInputRequestedRegion(void)'
Segmentation\LevelSets\include\itkSparseFieldLevelSetImageFilter.hxx(470): note: see reference to class template instantiation 'itk::ZeroCrossingImageFilter<itk::Image<float,3>,itk::Image<float,3>>' being compiled
Segmentation\LevelSets\include\itkSparseFieldLevelSetImageFilter.hxx(454): note: while compiling class template member function 'void itk::SparseFieldLevelSetImageFilter<TInputImage,TOutputImage>::CopyInputToOutput(void)'
  • Loading branch information
hjmjohnson committed Dec 16, 2024
1 parent a34f696 commit 1a9bd4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ZeroCrossingImageFilter<TInputImage, TOutputImage>::GenerateInputRequestedRegion

// pad the input requested region by the operator radius
// Build an operator so that we can determine the kernel size
const SizeValueType radius{};
SizeValueType radius{}; // NOLINT(misc-const-correctness) Windows build fail if this is const
inputRequestedRegion.PadByRadius(radius);

// crop the input requested region at the input's largest possible region
Expand Down
2 changes: 1 addition & 1 deletion Modules/IO/Meta/test/testMetaImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ testMetaImage(int, char *[])

MetaImage tIm2("test.mha");

const int im2Zero = 0;
std::cout << "Header size = " << tIm2.HeaderSize() << std::endl;
tIm2.HeaderSize(tIm2.HeaderSize());
tIm2.Modality(MET_MOD_CT);
Expand All @@ -148,6 +147,7 @@ testMetaImage(int, char *[])
std::cout << "DimSize = " << tIm2.DimSize() << std::endl;
std::cout << "Quantity = " << tIm2.Quantity() << std::endl;
std::cout << "SubQuantity = " << tIm2.SubQuantity() << std::endl;
int im2Zero = 0; // NOLINT(misc-const-correctness) Windows build fail if im2Zero is const
std::cout << "SubQuantity(0) = " << tIm2.SubQuantity(im2Zero) << std::endl;
std::cout << "SequenceID = " << tIm2.SequenceID() << std::endl;
std::cout << "SequenceID[0] = " << tIm2.SequenceID(im2Zero) << std::endl;
Expand Down

0 comments on commit 1a9bd4a

Please sign in to comment.