From e4d5507a7054ef7f883459799c1133e826278320 Mon Sep 17 00:00:00 2001 From: Nick Tustison Date: Mon, 22 May 2023 17:41:35 -0700 Subject: [PATCH] ENH: Address some compilation warnings. --- Tensor/TensorFunctions.h | 34 +++++++++++++++--------------- Utilities/ReadWriteData.h | 2 -- Utilities/itkDiReCTImageFilter.hxx | 2 -- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Tensor/TensorFunctions.h b/Tensor/TensorFunctions.h index e0fda4eab..d7764b581 100644 --- a/Tensor/TensorFunctions.h +++ b/Tensor/TensorFunctions.h @@ -705,23 +705,23 @@ GetTensorPrincipalEigenvector(TTensorType dtv) itk::RGBPixel rgb; - float xx = dtv[0]; - float xy = dtv[1]; - float xz = dtv[2]; - float yy = dtv[3]; - float yz = dtv[4]; - float zz = dtv[5]; - float isp = (xx * xx + yy * yy + zz * zz + 2.0f * (xy * xy + xz * xz + yz * yz)); - - float fa = 0.0; - if (isp > 0.0f) - { - float trace = dtv[0]; - trace += dtv[3]; - trace += dtv[5]; - float anisotropy = 3.0f * isp - trace * trace; - fa = (std::sqrt(anisotropy / (2.0f * isp))); - } + // float xx = dtv[0]; + // float xy = dtv[1]; + // float xz = dtv[2]; + // float yy = dtv[3]; + // float yz = dtv[4]; + // float zz = dtv[5]; + // float isp = (xx * xx + yy * yy + zz * zz + 2.0f * (xy * xy + xz * xz + yz * yz)); + + // float fa = 0.0; + // if (isp > 0.0f) + // { + // float trace = dtv[0]; + // trace += dtv[3]; + // trace += dtv[5]; + // float anisotropy = 3.0f * isp - trace * trace; + // fa = (std::sqrt(anisotropy / (2.0f * isp))); + // } // rgb[0]=eig.V(2,0)*fa*255;//+eig.V(1,0)*e2; // rgb[1]=eig.V(2,1)*fa*255;//+eig.V(1,1)*e2; diff --git a/Utilities/ReadWriteData.h b/Utilities/ReadWriteData.h index 234ea7116..5d39ba299 100644 --- a/Utilities/ReadWriteData.h +++ b/Utilities/ReadWriteData.h @@ -661,10 +661,8 @@ ReadWarpFromFile(std::string warpfn, std::string ext) // std::cout << " spacing xv " << xvec->GetSpacing()[0] // << " field " << field->GetSpacing()[0] << std::endl; - unsigned int ct = 0; for (it.GoToBegin(); !it.IsAtEnd(); ++it) { - ct++; typename ImageType::IndexType index = it.GetIndex(); VectorType disp; diff --git a/Utilities/itkDiReCTImageFilter.hxx b/Utilities/itkDiReCTImageFilter.hxx index 4ef160a5f..cdd9ee086 100644 --- a/Utilities/itkDiReCTImageFilter.hxx +++ b/Utilities/itkDiReCTImageFilter.hxx @@ -712,7 +712,6 @@ DiReCTImageFilter::MakeThicknessImage(RealImagePointe ItSmoothTotalImage.GoToBegin(); RealType meanThickness = 0; - unsigned long count = 0; while (!ItSegmentationImage.IsAtEnd()) { const typename InputImageType::PixelType grayMatterPixel = @@ -724,7 +723,6 @@ DiReCTImageFilter::MakeThicknessImage(RealImagePointe { thicknessValue = ItSmoothTotalImage.Get() / ItSmoothHitImage.Get(); meanThickness += thicknessValue; - count++; if (thicknessValue < NumericTraits::ZeroValue()) { thicknessValue = NumericTraits::ZeroValue();