Skip to content

Commit

Permalink
Merge pull request #9 from jhlegarreta/PreferC++11TypeAliasOverTypedef
Browse files Browse the repository at this point in the history
STYLE: Prefer C++11 type alias over typedef
  • Loading branch information
thewtex authored Mar 31, 2019
2 parents 998f091 + 6299ffa commit a34bdac
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions include/itkScancoImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class IOScanco_EXPORT ScancoImageIO: public ImageIOBase
{
public:
/** Standard class typedefs. */
typedef ScancoImageIO Self;
typedef ImageIOBase Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
using Self = ScancoImageIO;
using Superclass = ImageIOBase;
using Pointer = SmartPointer< Self >;
using ConstPointer = SmartPointer< const Self >;

/** Method for creation through the object factory. */
itkNewMacro(Self);
Expand Down
8 changes: 4 additions & 4 deletions include/itkScancoImageIOFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class IOScanco_EXPORT ScancoImageIOFactory: public ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef ScancoImageIOFactory Self;
typedef ObjectFactoryBase Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
using Self = ScancoImageIOFactory;
using Superclass = ObjectFactoryBase;
using Pointer = SmartPointer< Self >;
using ConstPointer = SmartPointer< const Self >;

/** Class methods used to interface with the registered factories. */
virtual const char * GetITKSourceVersion() const ITK_OVERRIDE;
Expand Down
10 changes: 5 additions & 5 deletions test/itkScancoImageIOTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ int itkScancoImageIOTest(int argc, char* argv[])
// ATTENTION THIS IS THE PIXEL TYPE FOR
// THE RESULTING IMAGE
const unsigned int Dimension = 3;
typedef short PixelType;
typedef itk::Image< PixelType, Dimension > ImageType;
using PixelType = short;
using ImageType = itk::Image< PixelType, Dimension >;

typedef itk::ImageFileReader< ImageType > ReaderType;
using ReaderType = itk::ImageFileReader< ImageType >;
ReaderType::Pointer reader = ReaderType::New();

// force use of ScancoIO
typedef itk::ScancoImageIO IOType;
using IOType = itk::ScancoImageIO;
IOType::Pointer scancoIO = IOType::New();
reader->SetImageIO( scancoIO );

Expand Down Expand Up @@ -80,7 +80,7 @@ int itkScancoImageIOTest(int argc, char* argv[])
std::cout << "region " << region;

// Generate test image
typedef itk::ImageFileWriter< ImageType > WriterType;
using WriterType = itk::ImageFileWriter< ImageType >;
WriterType::Pointer writer = WriterType::New();
writer->SetInput( reader->GetOutput() );
writer->SetFileName( outputFileName );
Expand Down
10 changes: 5 additions & 5 deletions test/itkScancoImageIOTest2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ int itkScancoImageIOTest2(int argc, char* argv[])
// ATTENTION THIS IS THE PIXEL TYPE FOR
// THE RESULTING IMAGE
const unsigned int Dimension = 3;
typedef short PixelType;
typedef itk::Image< PixelType, Dimension > ImageType;
using PixelType = short;
using ImageType = itk::Image< PixelType, Dimension >;

typedef itk::ImageFileReader< ImageType > ReaderType;
using ReaderType = itk::ImageFileReader< ImageType >;
ReaderType::Pointer reader = ReaderType::New();

// force use of ScancoIO
typedef itk::ScancoImageIO IOType;
using IOType = itk::ScancoImageIO;
IOType::Pointer scancoIO = IOType::New();
reader->SetImageIO( scancoIO );

Expand Down Expand Up @@ -96,7 +96,7 @@ int itkScancoImageIOTest2(int argc, char* argv[])
TEST_EXPECT_TRUE( itk::Math::FloatAlmostEqual( scancoIO->GetIntensity(), 0.177, 6, 1e-3 ) );

// Generate test image
typedef itk::ImageFileWriter< ImageType > WriterType;
using WriterType = itk::ImageFileWriter< ImageType >;
WriterType::Pointer writer = WriterType::New();
if( argc > 3 )
{
Expand Down

0 comments on commit a34bdac

Please sign in to comment.