Skip to content

Commit

Permalink
STYLE: Drop signed from signed short, signed int, signed long
Browse files Browse the repository at this point in the history
cd ~/git/ITK
find * -type f |
  egrep -i -e '\.[it]?(cc|hh|[ch](\+\+|pp?|xx)?)$' |
  fgrep -v ThirdParty |
  xargs sed -i -r -e \
    's#(^|[^"/A-Za-z_])signed (short|int|long)([^"/A-Za-z_]|$)#\1\2\3#g'
  • Loading branch information
Leengit committed Apr 6, 2022
1 parent e03a941 commit 8c2c654
Show file tree
Hide file tree
Showing 62 changed files with 252 additions and 254 deletions.
2 changes: 1 addition & 1 deletion Examples/Filtering/SpatialObjectToImage1.cxx
Expand Up @@ -97,7 +97,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Filtering/SpatialObjectToImage2.cxx
Expand Up @@ -95,7 +95,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/CovariantVectorImageWrite.cxx
Expand Up @@ -74,14 +74,14 @@ main(int argc, char ** argv)

// Software Guide : BeginLatex
//
// We read an image of \code{signed short} pixels and compute the
// We read an image of \code{short} pixels and compute the
// gradient to produce an image of CovariantVectors where each
// component is of type \code{float}.
//
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using InputPixelType = signed short;
using InputPixelType = short;
using ComponentType = float;
constexpr unsigned int Dimension = 2;

Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/DicomImageReadChangeHeaderWrite.cxx
Expand Up @@ -77,7 +77,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using InputPixelType = signed short;
using InputPixelType = short;
constexpr unsigned int Dimension = 2;
using InputImageType = itk::Image<InputPixelType, Dimension>;
// Software Guide : EndCodeSnippet
Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/DicomImageReadPrintTags.cxx
Expand Up @@ -74,7 +74,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 2;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/DicomImageReadWrite.cxx
Expand Up @@ -63,7 +63,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using InputPixelType = signed short;
using InputPixelType = short;
constexpr unsigned int InputDimension = 2;

using InputImageType = itk::Image<InputPixelType, InputDimension>;
Expand Down Expand Up @@ -187,7 +187,7 @@ main(int argc, char * argv[])
//
// We will now rescale the image using the RescaleIntensityImageFilter. For
// this purpose we use a better suited pixel type: \code{unsigned char}
// instead of \code{signed short}. The minimum and maximum values of the
// instead of \code{short}. The minimum and maximum values of the
// output image are explicitly defined in the rescaling filter.
//
// Software Guide : EndLatex
Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/DicomPrintPatientInformation.cxx
Expand Up @@ -50,7 +50,7 @@ main(int argc, char * argv[])
return EXIT_FAILURE;
}

using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 2;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/DicomSeriesReadGaussianImageWrite.cxx
Expand Up @@ -36,7 +36,7 @@ main(int argc, char * argv[])
}


using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/DicomSeriesReadImageWrite2.cxx
Expand Up @@ -66,7 +66,7 @@ main(int argc, char * argv[])
//
// We define the pixel type and dimension of the image to be read. In this
// particular case, the dimensionality of the image is 3, and we assume a
// \code{signed short} pixel type that is commonly used for X-Rays CT
// \code{short} pixel type that is commonly used for X-Rays CT
// scanners.
//
// The image orientation information contained in the direction cosines
Expand All @@ -76,7 +76,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
2 changes: 1 addition & 1 deletion Examples/IO/DicomSeriesReadPrintTags.cxx
Expand Up @@ -57,7 +57,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/DicomSeriesReadSeriesWrite.cxx
Expand Up @@ -99,7 +99,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down Expand Up @@ -232,7 +232,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using OutputPixelType = signed short;
using OutputPixelType = short;
constexpr unsigned int OutputDimension = 2;

using Image2DType = itk::Image<OutputPixelType, OutputDimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/ImageReadDicomSeriesWrite.cxx
Expand Up @@ -56,7 +56,7 @@ main(int argc, char * argv[])
}


using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 3;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down Expand Up @@ -87,7 +87,7 @@ main(int argc, char * argv[])
itksys::SystemTools::MakeDirectory(outputDirectory);


using OutputPixelType = signed short;
using OutputPixelType = short;
constexpr unsigned int OutputDimension = 2;

using Image2DType = itk::Image<OutputPixelType, OutputDimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/ImageReadExtractWrite.cxx
Expand Up @@ -77,8 +77,8 @@ main(int argc, char ** argv)
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using InputPixelType = signed short;
using OutputPixelType = signed short;
using InputPixelType = short;
using OutputPixelType = short;

using InputImageType = itk::Image<InputPixelType, 3>;
using OutputImageType = itk::Image<OutputPixelType, 2>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/IO/ImageReadRegionOfInterestWrite.cxx
Expand Up @@ -71,8 +71,8 @@ main(int argc, char ** argv)
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using InputPixelType = signed short;
using OutputPixelType = signed short;
using InputPixelType = short;
using OutputPixelType = short;
constexpr unsigned int Dimension = 2;

using InputImageType = itk::Image<InputPixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration14.cxx
Expand Up @@ -116,7 +116,7 @@ main(int argc, char * argv[])
}

constexpr unsigned int ImageDimension = 3;
using PixelType = signed short;
using PixelType = short;

using FixedImageType = itk::Image<PixelType, ImageDimension>;
using MovingImageType = itk::Image<PixelType, ImageDimension>;
Expand Down Expand Up @@ -329,7 +329,7 @@ main(int argc, char * argv[])
// such as 100 or 128.
resample->SetDefaultPixelValue(0);

using OutputPixelType = signed short;
using OutputPixelType = short;

using OutputImageType = itk::Image<OutputPixelType, ImageDimension>;

Expand Down
4 changes: 2 additions & 2 deletions Examples/RegistrationITKv4/DeformableRegistration15.cxx
Expand Up @@ -127,7 +127,7 @@ main(int argc, char * argv[])
}

constexpr unsigned int ImageDimension = 3;
using PixelType = signed short;
using PixelType = short;

using FixedImageType = itk::Image<PixelType, ImageDimension>;
using MovingImageType = itk::Image<PixelType, ImageDimension>;
Expand Down Expand Up @@ -703,7 +703,7 @@ main(int argc, char * argv[])
// such as 100 or 128.
resample->SetDefaultPixelValue(0);

using OutputPixelType = signed short;
using OutputPixelType = short;

using OutputImageType = itk::Image<OutputPixelType, ImageDimension>;

Expand Down
2 changes: 1 addition & 1 deletion Examples/RegistrationITKv4/DeformableRegistration8.cxx
Expand Up @@ -340,7 +340,7 @@ main(int argc, char * argv[])
// such as 100 or 128.
resample->SetDefaultPixelValue(0);

using OutputPixelType = signed short;
using OutputPixelType = short;

using OutputImageType = itk::Image<OutputPixelType, ImageDimension>;

Expand Down
2 changes: 1 addition & 1 deletion Examples/RegistrationITKv4/ModelToImageRegistration2.cxx
Expand Up @@ -164,7 +164,7 @@ main(int argc, char * argv[])
itk::BinaryMaskToNarrowBandPointSetFilter<MaskImageType,
FixedPointSetType>;

using PixelType = signed short;
using PixelType = short;

using ImageType = itk::Image<PixelType, Dimension>;

Expand Down
2 changes: 1 addition & 1 deletion Examples/Statistics/ScalarImageKmeansClassifier.cxx
Expand Up @@ -68,7 +68,7 @@ main(int argc, char * argv[])
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 2;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Examples/Statistics/ScalarImageMarkovRandomField1.cxx
Expand Up @@ -108,13 +108,13 @@ main(int argc, char * argv[])
// to classify. With this image type we can also declare the
// \doxygen{ImageFileReader} needed for reading the input image, create one
// and set its input filename. In this particular case we choose to use
// \code{signed short} as pixel type, which is typical for MicroMRI and CT
// \code{short} as pixel type, which is typical for MicroMRI and CT
// data sets.
//
// Software Guide : EndLatex

// Software Guide : BeginCodeSnippet
using PixelType = signed short;
using PixelType = short;
constexpr unsigned int Dimension = 2;

using ImageType = itk::Image<PixelType, Dimension>;
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkIntTypes.h
Expand Up @@ -87,11 +87,11 @@ using SizeValueType = unsigned long;
using IdentifierType = SizeValueType;

/** The components of the Index array (they are signed) */
using IndexValueType = signed long;
using IndexValueType = long;

/** Differences between components of indexes, distance from one pointer
* to the origin of a buffer (it is signed) */
using OffsetValueType = signed long;
using OffsetValueType = long;

#endif

Expand Down
8 changes: 4 additions & 4 deletions Modules/Core/Common/include/itkIsNumber.h
Expand Up @@ -48,22 +48,22 @@ template <>
struct IsNumber<unsigned short> : TrueType
{};
template <>
struct IsNumber<signed short> : TrueType
struct IsNumber<short> : TrueType
{};
template <>
struct IsNumber<signed int> : TrueType
struct IsNumber<int> : TrueType
{};
template <>
struct IsNumber<unsigned int> : TrueType
{};
template <>
struct IsNumber<signed long> : TrueType
struct IsNumber<long> : TrueType
{};
template <>
struct IsNumber<unsigned long> : TrueType
{};
template <>
struct IsNumber<signed long long> : TrueType
struct IsNumber<long long> : TrueType
{};
template <>
struct IsNumber<unsigned long long> : TrueType
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkMath.h
Expand Up @@ -456,7 +456,7 @@ struct AlmostEqualsFunctionSelector<false, true, false, true>

template <>
struct AlmostEqualsFunctionSelector<false, true, true, true>
// float vs signed int
// float vs int
{
using SelectedVersion = AlmostEqualsFloatVsInteger;
};
Expand All @@ -477,7 +477,7 @@ struct AlmostEqualsFunctionSelector<true, false, false, true>

template <>
struct AlmostEqualsFunctionSelector<true, true, false, true>
// signed int vs float
// int vs float
{
using SelectedVersion = AlmostEqualsIntegerVsFloat;
};
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkVariableLengthVector.h
Expand Up @@ -1375,10 +1375,10 @@ std::ostream &
operator<<(std::ostream & os, const VariableLengthVector<TValue> & arr)
{
const unsigned int length = arr.Size();
const signed int last = static_cast<unsigned int>(length) - 1;
const int last = static_cast<unsigned int>(length) - 1;

os << "[";
for (signed int i = 0; i < last; ++i)
for (int i = 0; i < last; ++i)
{
os << arr[i] << ", ";
}
Expand Down
Expand Up @@ -43,12 +43,12 @@ itkAtanRegularizedHeavisideStepFunctionTest1(int, char *[])
constexpr double epsilon2 = 0.5;
functionBase0->SetEpsilon(epsilon2);

const signed int minValue = -20;
constexpr signed int maxValue = 20;
const int minValue = -20;
constexpr int maxValue = 20;

constexpr InputType incValue = 0.1;

for (signed int x = minValue; x < maxValue; ++x)
for (int x = minValue; x < maxValue; ++x)
{
const InputType ix = x * incValue;
OutputType f = functionBase0->Evaluate(ix);
Expand Down
6 changes: 3 additions & 3 deletions Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx
Expand Up @@ -31,12 +31,12 @@ itkHeavisideStepFunctionTest1(int, char *[])
std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl;
functionBase0->Print(std::cout);

const signed int minValue = -20;
constexpr signed int maxValue = 20;
const int minValue = -20;
constexpr int maxValue = 20;

constexpr InputType incValue = 0.1;

for (signed int x = minValue; x < maxValue; ++x)
for (int x = minValue; x < maxValue; ++x)
{
const InputType ix = x * incValue;
OutputType f = functionBase0->Evaluate(ix);
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx
Expand Up @@ -87,7 +87,7 @@ itkImageRandomIteratorTest2(int argc, char * argv[])

if (argc > 4)
{
using DifferencePixelType = signed long;
using DifferencePixelType = long;
using DifferenceImageType = itk::Image<DifferencePixelType, ImageDimension>;

using DifferenceFilterType = itk::Testing::ComparisonImageFilter<ImageType, DifferenceImageType>;
Expand Down

0 comments on commit 8c2c654

Please sign in to comment.