Permalink
Browse files

COMP: Address CPPCHECK warnings

Several cppcheck warnings were addressed.  Removed redundant typedefs
and redundant shadow variables.  Also added testing of previously
unused functions.
  • Loading branch information...
1 parent a57242c commit d0200599c0dd50202bc60ddcbdaf714f1cc46c7b @hjmjohnson hjmjohnson committed Apr 19, 2016
@@ -317,7 +317,6 @@ DoCenteredInitialization( typename FixedImageType::Pointer & orientedFixedVolume
bestEulerAngles3D->SetCenter(rotationCenter);
bestEulerAngles3D->SetTranslation(translationVector);
- typedef itk::Euler3DTransform<double> EulerAngle3DTransformType;
typename EulerAngle3DTransformType::Pointer currentEulerAngles3D = EulerAngle3DTransformType::New();
currentEulerAngles3D->SetCenter(rotationCenter);
@@ -128,6 +128,7 @@ ExtractSingleLargestRegionFromMask(itk::Image<unsigned char, 3>::Pointer Mask,
return myMult2->GetOutput();
}
+#if 0
itk::Image<unsigned char, 3>::Pointer
ExtractSingleLargestRegion(const unsigned char threshold_low, const unsigned char threshold_high,
const int openingSize, const int closingSize, const int safetySize,
@@ -146,3 +147,4 @@ ExtractSingleLargestRegion(const unsigned char threshold_low, const unsigned cha
return ExtractSingleLargestRegionFromMask(
threshold->GetOutput(), openingSize, closingSize, safetySize, inputLabelImage);
}
+#endif
@@ -27,11 +27,13 @@ itk::Image<unsigned char, 3>::Pointer ExtractSingleLargestRegionFromMask(itk::Im
const int safetySize, itk::Image<unsigned char,
3>::Pointer inputLabelImage);
+#if 0
extern
itk::Image<unsigned char, 3>::Pointer ExtractSingleLargestRegion(const unsigned char threshold_low,
const unsigned char threshold_high,
const int openingSize, const int closingSize,
const int safetySize, itk::Image<unsigned char,
3>::Pointer inputLabelImage);
+#endif
#endif // ExtractSingleLargestRegion_h
@@ -18,47 +18,42 @@
*=========================================================================*/
#include <iostream>
#include "PrettyPrintTable.h"
+#include "BRAINSToolsVersion.h"
int main(int, char * *)
{
PrettyPrintTable p;
p.setTablePad(5);
p.add(0, 0, "String");
-
p.add(0, 1, "SecondColumn");
-
p.add(0, 2, "4C");
-
p.add(0, 3, "5C");
-
p.add(1, 0, "Integers");
-
p.add(1, 1, 1, "%d"); // Similar to %d
-
p.add(1, 2, 2, "%d");
-
p.add(1, 3, 3, "%d");
-
p.add(1, 0, "ZeroPadInt");
-
p.add(1, 1, 1, "%02d"); // Similar to %02d in printf
-
p.add(1, 2, 2, "%02d");
-
p.add(1, 3, 3, "%02d");
-
p.add(2, 0, "FloatingPoint");
-
p.add(2, 1, 1.0F, "%+5.2f"); // Similar to %5.2f in printf
-
p.add(2, 2, 2.0F, "%+5.2f");
-
p.add(2, 3, 3.0F, "%+5.2f");
-
p.Print(std::cout);
-
p.rightJustify();
-
p.Print(std::cout);
+
+ std::cout << "MajorVersion: " << BRAINSTools::Version::MajorVersion() << std::endl;
+ std::cout << "MinorVersion: " << BRAINSTools::Version::MinorVersion() << std::endl;
+ std::cout << "PatchVersion: " << BRAINSTools::Version::PatchVersion() << std::endl;
+ std::cout << "TweakVersion: " << BRAINSTools::Version::TweakVersion() << std::endl;
+ std::cout << "VersionString: " << BRAINSTools::Version::VersionString() << std::endl;
+ std::cout << "BuildDate: " << BRAINSTools::Version::BuildDate() << std::endl;
+
+ std::cout << "ExtendedVersionString: " << BRAINSTools::Version::ExtendedVersionString() << std::endl;
+ std::cout << "ToString: " << BRAINSTools::Version::ToString() << std::endl;
+
+ return EXIT_SUCCESS;
}
@@ -58,11 +58,6 @@ class LargestForegroundFilledMaskImageFilter :
public ImageToImageFilter<TInputImage, TOutputImage>
{
public:
- /** Extract dimension from input and output image. */
- itkStaticConstMacro(InputImageDimension, unsigned int,
- TInputImage::ImageDimension);
- itkStaticConstMacro(OutputImageDimension, unsigned int,
- TOutputImage::ImageDimension);
/** Convenient typedefs for simplifying declarations. */
typedef TInputImage InputImageType;
@@ -138,7 +133,7 @@ class LargestForegroundFilledMaskImageFilter :
* Low and High are set to the ?????? */
unsigned int SetLowHigh(InputPixelType & low, InputPixelType & high);
- void ImageMinMax(InputPixelType & min, InputPixelType & max);
+ void ImageMinMax(InputPixelType & min, InputPixelType & max) const;
// No longer used double m_OtsuPercentileThreshold;
double m_OtsuPercentileLowerThreshold;
@@ -55,10 +55,6 @@ LargestForegroundFilledMaskImageFilter<TInputImage, TOutputImage>
m_InsideValue(NumericTraits<typename IntegerImageType::PixelType>::OneValue()),
m_OutsideValue(NumericTraits<typename IntegerImageType::PixelType>::ZeroValue())
{
- // this->m_InsideValue =
- // NumericTraits<typename IntegerImageType::PixelType>::OneValue();
- // this->m_OutsideValue =
- // NumericTraits<typename IntegerImageType::PixelType>::ZeroValue();
}
template <class TInputImage, class TOutputImage>
@@ -90,7 +86,7 @@ template <class TInputImage, class TOutputImage>
void
LargestForegroundFilledMaskImageFilter<TInputImage, TOutputImage>
::ImageMinMax(typename TInputImage::PixelType & imageMin,
- typename TInputImage::PixelType & imageMax)
+ typename TInputImage::PixelType & imageMax) const
{
typename MinimumMaximumImageFilter<TInputImage>::Pointer minmaxFilter =
MinimumMaximumImageFilter<TInputImage>::New();
@@ -194,11 +194,11 @@ ProcessArgs(int argc, char * *argv,
template <typename PixelType, unsigned dim>
int MakeImage(const std::string & filename,
- unsigned xdim,
- unsigned ydim,
- unsigned zdim,
- unsigned tdim,
- PixelType value)
+ const unsigned xdim,
+ const unsigned ydim,
+ const unsigned zdim,
+ const unsigned tdim,
+ const PixelType value)
{
typedef typename itk::Image<PixelType, dim> ImageType;
typedef typename ImageType::Pointer ImagePointerType;

0 comments on commit d020059

Please sign in to comment.