diff --git a/include/itkBSplineApproximationGradientImageFilter.h b/include/itkBSplineApproximationGradientImageFilter.h index ab23979..9a447fa 100644 --- a/include/itkBSplineApproximationGradientImageFilter.h +++ b/include/itkBSplineApproximationGradientImageFilter.h @@ -55,37 +55,36 @@ class ITK_TEMPLATE_EXPORT BSplineApproximationGradientImageFilter: itkStaticConstMacro( ImageDimension, unsigned int, TInputImage::ImageDimension ); - typedef BSplineApproximationGradientImageFilter Self; + using Self = BSplineApproximationGradientImageFilter; - typedef TInputImage InputImageType; - typedef Image< CovariantVector< TOutputValueType, ImageDimension >, ImageDimension > OutputImageType; - typedef typename OutputImageType::Pointer OutputImagePointer; + using InputImageType = TInputImage; + using OutputImageType = Image< CovariantVector< TOutputValueType, ImageDimension >, ImageDimension >; + using OutputImagePointer = typename OutputImageType::Pointer; - typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + using Superclass = ImageToImageFilter< InputImageType, OutputImageType >; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; itkNewMacro( Self ); itkTypeMacro( BSplineApproximationGradientImageFilter, ImageToImageFilter ); - typedef TOutputValueType OutputValueType; - typedef typename InputImageType::PixelType InputPixelType; - typedef PointSet< InputPixelType, itkGetStaticConstMacro(ImageDimension) > PointSetType; + using OutputValueType = TOutputValueType; + using InputPixelType = typename InputImageType::PixelType; + using PointSetType = PointSet< InputPixelType, itkGetStaticConstMacro(ImageDimension) >; itkStaticConstMacro( InputVectorDimension, unsigned int, InputPixelType::Dimension ); /** Internal filter type */ /** Internal filter type */ - typedef BSplineScatteredDataPointSetToGradientImageFilter< PointSetType, OutputValueType > - PointSetToGradientFilterType; - typedef typename PointSetToGradientFilterType::Pointer PointSetToGradientFilterPointerType; - typedef typename PointSetToGradientFilterType::ArrayType ArrayType; - typedef Mesh< InputPixelType, ImageDimension > MeshType; - typedef ImageToPointSetFilter< InputImageType, MeshType > ImageToPointSetFilterType; - typedef typename ImageToPointSetFilterType::Pointer ImageToPointSetFilterPointerType; - - typedef FixedArray< double, itkGetStaticConstMacro(ImageDimension) > ControlPointSpacingRatioType; + using PointSetToGradientFilterType = BSplineScatteredDataPointSetToGradientImageFilter< PointSetType, OutputValueType >; + using PointSetToGradientFilterPointerType = typename PointSetToGradientFilterType::Pointer; + using ArrayType = typename PointSetToGradientFilterType::ArrayType; + using MeshType = Mesh< InputPixelType, ImageDimension >; + using ImageToPointSetFilterType = ImageToPointSetFilter< InputImageType, MeshType >; + using ImageToPointSetFilterPointerType = typename ImageToPointSetFilterType::Pointer; + + using ControlPointSpacingRatioType = FixedArray< double, itkGetStaticConstMacro(ImageDimension) >; /** Set/Get number of levels. This is the number of levels used in the * BSplineScatteredDataPointSetToImageFilter for calculating the BSpline grid. diff --git a/include/itkBSplineGradientImageFilter.h b/include/itkBSplineGradientImageFilter.h index ea9aaef..800d204 100644 --- a/include/itkBSplineGradientImageFilter.h +++ b/include/itkBSplineGradientImageFilter.h @@ -50,21 +50,20 @@ class ITK_TEMPLATE_EXPORT BSplineGradientImageFilter : /** Extract dimension from input image. */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); - /** Standard class typedefs. */ - typedef BSplineGradientImageFilter Self; + /** Standard class type alias. */ + using Self = BSplineGradientImageFilter; - /** Convenient typedefs for simplifying declarations. */ - typedef TInputImage InputImageType; - typedef typename InputImageType::Pointer InputImagePointer; - typedef Image< CovariantVector< + /** Convenient type alias for simplifying declarations. */ + using InputImageType = TInputImage; + using InputImagePointer = typename InputImageType::Pointer; + using OutputImageType = Image< CovariantVector< TOutputValueType, ImageDimension >, - ImageDimension > - OutputImageType; + ImageDimension >; - /** Standard class typedefs. */ - typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + /** Standard class type alias. */ + using Superclass = ImageToImageFilter< InputImageType, OutputImageType >; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; /** Method for creation through the object factory. */ itkNewMacro(Self); @@ -72,13 +71,12 @@ class ITK_TEMPLATE_EXPORT BSplineGradientImageFilter : /** Run-time type information (and related methods). */ itkTypeMacro(BSplineGradientImageFilter, ImageToImageFilter); - /** Image typedef support. */ - typedef typename InputImageType::PixelType InputPixelType; - typedef TOutputValueType OutputValueType; - typedef CovariantVector< - OutputValueType, itkGetStaticConstMacro(OutputImageDimension) > - OutputPixelType; - typedef typename OutputImageType::RegionType OutputImageRegionType; + /** Image type alias support. */ + using InputPixelType = typename InputImageType::PixelType; + using OutputValueType = TOutputValueType; + using OutputPixelType = CovariantVector< + OutputValueType, itkGetStaticConstMacro(OutputImageDimension) >; + using OutputImageRegionType = typename OutputImageType::RegionType; #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ @@ -90,11 +88,10 @@ class ITK_TEMPLATE_EXPORT BSplineGradientImageFilter : #endif /** Typedefs for the interpolator. */ - typedef TCoordRep CoordRepType; - typedef TCoefficientType CoefficientType; - typedef itk::BSplineInterpolateImageFunction< InputImageType, CoordRepType, CoefficientType > - InterpolatorType; - typedef typename InterpolatorType::Pointer InterpolatorPointerType; + using CoordRepType = TCoordRep; + using CoefficientType = TCoefficientType; + using InterpolatorType = itk::BSplineInterpolateImageFunction< InputImageType, CoordRepType, CoefficientType >; + using InterpolatorPointerType = typename InterpolatorType::Pointer; protected: BSplineGradientImageFilter(); diff --git a/include/itkBSplineGradientImageFilter.hxx b/include/itkBSplineGradientImageFilter.hxx index 019a2f1..ca735ec 100644 --- a/include/itkBSplineGradientImageFilter.hxx +++ b/include/itkBSplineGradientImageFilter.hxx @@ -92,7 +92,7 @@ BSplineGradientImageFilter< TInputImage, TOutputValueType, // This will calculate the coefficients. interpolator->SetInputImage( inputPtr ); - typedef typename itk::ImageRegionIteratorWithIndex< OutputImageType > IteratorType; + using IteratorType = typename itk::ImageRegionIteratorWithIndex< OutputImageType >; typename OutputImageType::IndexType index; typename InterpolatorType::ContinuousIndexType contIndex; unsigned int i; diff --git a/include/itkBSplineScatteredDataPointSetToGradientImageFilter.h b/include/itkBSplineScatteredDataPointSetToGradientImageFilter.h index 7f06d71..8d2e418 100644 --- a/include/itkBSplineScatteredDataPointSetToGradientImageFilter.h +++ b/include/itkBSplineScatteredDataPointSetToGradientImageFilter.h @@ -62,21 +62,20 @@ class BSplineScatteredDataPointSetToGradientImageFilter : itkStaticConstMacro( PointSetDimension, unsigned int, TInputPointSet::PointDimension ); itkStaticConstMacro( ImageDimension, unsigned int, TInputPointSet::PointDimension ); - /** Standard class typedefs. */ - typedef BSplineScatteredDataPointSetToGradientImageFilter Self; - - /** Convenient typedefs for simplifying declarations. */ - typedef TInputPointSet InputPointSetType; - typedef typename InputPointSetType::Pointer InputPointSetPointer; - typedef Image< CovariantVector< TOutputValueType, itkGetStaticConstMacro(ImageDimension) >, - itkGetStaticConstMacro(ImageDimension) > - OutputImageType; - typedef typename OutputImageType::Pointer OutputImagePointer; - - /** Standard class typedefs. */ - typedef PointSetToImageFilter< InputPointSetType, OutputImageType > Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + /** Standard class type alias. */ + using Self = BSplineScatteredDataPointSetToGradientImageFilter; + + /** Convenient type alias for simplifying declarations. */ + using InputPointSetType = TInputPointSet; + using InputPointSetPointer = typename InputPointSetType::Pointer; + using OutputImageType = Image< CovariantVector< TOutputValueType, itkGetStaticConstMacro(ImageDimension) >, + itkGetStaticConstMacro(ImageDimension) >; + using OutputImagePointer = typename OutputImageType::Pointer; + + /** Standard class type alias. */ + using Superclass = PointSetToImageFilter< InputPointSetType, OutputImageType >; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; /** Method for creation through the object factory. */ itkNewMacro(Self); @@ -84,24 +83,24 @@ class BSplineScatteredDataPointSetToGradientImageFilter : /** Run-time type information (and related methods). */ itkTypeMacro( BSplineScatteredDataPointSetToGradientImageFilter, PointSetToImageFilter ); - /** Image typedef support. */ - typedef typename InputPointSetType::PixelType InputPixelType; + /** Image type alias support. */ + using InputPixelType = typename InputPointSetType::PixelType; itkStaticConstMacro( InputVectorDimension, unsigned int, InputPixelType::Dimension ); - typedef typename InputPointSetType::PointType InputPointType; - typedef TOutputValueType OutputValueType; - typedef CovariantVector< OutputValueType, ImageDimension > OutputPixelType; - typedef typename OutputImageType::RegionType OutputImageRegionType; - typedef typename itk::Image< InputPixelType, ImageDimension > InternalImageType; + using InputPointType = typename InputPointSetType::PointType; + using OutputValueType = TOutputValueType; + using OutputPixelType = CovariantVector< OutputValueType, ImageDimension >; + using OutputImageRegionType = typename OutputImageType::RegionType; + using InternalImageType = typename itk::Image< InputPixelType, ImageDimension >; /** Internal filter type. */ - typedef typename itk::BSplineScatteredDataPointSetToImageFilter< InputPointSetType, - InternalImageType > BSplineScatteredDataFilterType; - typedef typename BSplineScatteredDataFilterType::Pointer BSplineScatteredDataFilterPointerType; + using BSplineScatteredDataFilterType = + typename itk::BSplineScatteredDataPointSetToImageFilter< InputPointSetType, InternalImageType >; + using BSplineScatteredDataFilterPointerType = typename BSplineScatteredDataFilterType::Pointer; - typedef typename BSplineScatteredDataFilterType::ArrayType ArrayType; + using ArrayType = typename BSplineScatteredDataFilterType::ArrayType; - typedef BSplineControlPointImageFunction< InternalImageType > BSplineControlPointImageFunctionType; + using BSplineControlPointImageFunctionType = BSplineControlPointImageFunction< InternalImageType >; void SetNumberOfLevels( unsigned int levels ) { @@ -130,13 +129,13 @@ class BSplineScatteredDataPointSetToGradientImageFilter : /** Type of the outputs. */ - typedef ProcessObject::DataObjectPointerArray DataObjectPointerArray; + using DataObjectPointerArray = ProcessObject::DataObjectPointerArray; protected: /** This is not a CovariantVector, but a VariableSizeMatrix where every row * corresponds to components of the input data vector, and every column * corresponds to the gradient component in each direction. */ - typedef typename BSplineControlPointImageFunctionType::GradientType InternalGradientType; + using InternalGradientType = typename BSplineControlPointImageFunctionType::GradientType; BSplineScatteredDataPointSetToGradientImageFilter(); virtual ~BSplineScatteredDataPointSetToGradientImageFilter() {} diff --git a/include/itkBSplineScatteredDataPointSetToGradientImageFilter.hxx b/include/itkBSplineScatteredDataPointSetToGradientImageFilter.hxx index e0e552f..eb61532 100644 --- a/include/itkBSplineScatteredDataPointSetToGradientImageFilter.hxx +++ b/include/itkBSplineScatteredDataPointSetToGradientImageFilter.hxx @@ -122,8 +122,7 @@ BSplineScatteredDataPointSetToGradientImageFilter< TInputPointSet, TOutputValueT bspliner->SetOrigin( this->m_BSplineScatteredDataFilter->GetOrigin() ); bspliner->SetInputImage( this->m_BSplineScatteredDataFilter->GetPhiLattice() ); - typedef typename itk::ImageRegionIteratorWithIndex< OutputImageType > - OutputIteratorType; + using OutputIteratorType = typename itk::ImageRegionIteratorWithIndex< OutputImageType >; InternalGradientType gradient; OutputPixelType gradientPixel; typename OutputImageType::PointType point; @@ -147,8 +146,8 @@ BSplineScatteredDataPointSetToGradientImageFilter< TInputPointSet, TOutputValueT // We check to make sure we not ad the boundary of the image, because we get // weird edge effects and sometime we try to evaluate outside the BSpline // grid. - typedef typename NeighborhoodAlgorithm:: - ImageBoundaryFacesCalculator< OutputImageType > FaceCalculatorType; + using FaceCalculatorType = typename NeighborhoodAlgorithm:: + ImageBoundaryFacesCalculator< OutputImageType >; FaceCalculatorType faceCalculator; typename FaceCalculatorType::RadiusType radius; radius.Fill( 1 ); diff --git a/include/itkImageToImageOfVectorsFilter.h b/include/itkImageToImageOfVectorsFilter.h index 7ef3fb6..d25a316 100644 --- a/include/itkImageToImageOfVectorsFilter.h +++ b/include/itkImageToImageOfVectorsFilter.h @@ -57,25 +57,25 @@ class ITK_TEMPLATE_EXPORT ImageToImageOfVectorsFilter : public: ITK_DISALLOW_COPY_AND_ASSIGN(ImageToImageOfVectorsFilter); - typedef ImageToImageFilter< TInputImage, + using Superclass = ImageToImageFilter< TInputImage, Image< Vector< typename TInputImage::InternalPixelType, - NComponents >, TInputImage::ImageDimension > > Superclass; - typedef ImageToImageOfVectorsFilter Self; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + NComponents >, TInputImage::ImageDimension > >; + using Self = ImageToImageOfVectorsFilter; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; itkNewMacro( Self ); itkTypeMacro( ImageToImageOfVectorsFilter, ImageToImageFilter ); - typedef TInputImage InputImageType; + using InputImageType = TInputImage; itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); - typedef typename InputImageType::InternalPixelType InputPixelType; + using InputPixelType = typename InputImageType::InternalPixelType; - typedef Vector< InputPixelType, NComponents > OutputPixelType; - typedef Image< OutputPixelType, ImageDimension > OutputImageType; - typedef typename OutputImageType::RegionType RegionType; + using OutputPixelType = Vector< InputPixelType, NComponents >; + using OutputImageType = Image< OutputPixelType, ImageDimension >; + using RegionType = typename OutputImageType::RegionType; - typedef typename Superclass::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; + using DataObjectPointerArraySizeType = typename Superclass::DataObjectPointerArraySizeType; virtual void SetNthInput(DataObjectPointerArraySizeType idx, const InputImageType *inputImage) { this->SetInput(idx, inputImage); } diff --git a/include/itkImageToImageOfVectorsFilter.hxx b/include/itkImageToImageOfVectorsFilter.hxx index 27bbd48..256bf60 100644 --- a/include/itkImageToImageOfVectorsFilter.hxx +++ b/include/itkImageToImageOfVectorsFilter.hxx @@ -70,7 +70,7 @@ ImageToImageOfVectorsFilter< TInputImage, NComponents > ImageRegionIterator< OutputImageType > oit( outputImage, outputRegionForThread ); oit.GoToBegin(); - typedef ImageRegionConstIterator< InputImageType > InputIteratorType; + using InputIteratorType = ImageRegionConstIterator< InputImageType >; std::vector< InputIteratorType * > inputItContainer; for ( unsigned int i = 0; i < NComponents; i++ ) diff --git a/include/itkImageToPointSetFilter.h b/include/itkImageToPointSetFilter.h index ce084e5..4abcb37 100644 --- a/include/itkImageToPointSetFilter.h +++ b/include/itkImageToPointSetFilter.h @@ -40,11 +40,11 @@ class ITK_TEMPLATE_EXPORT ImageToPointSetFilter: public ImageToMeshFilter< TInpu public: ITK_DISALLOW_COPY_AND_ASSIGN(ImageToPointSetFilter); - /** Standard class typedefs. */ - typedef ImageToPointSetFilter Self; - typedef ImageToMeshFilter< TInputImage, TOutputMesh > Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + /** Standard class type alias. */ + using Self = ImageToPointSetFilter; + using Superclass = ImageToMeshFilter< TInputImage, TOutputMesh >; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; /** Method for creation through the object factory. */ itkNewMacro(Self); @@ -52,23 +52,23 @@ class ITK_TEMPLATE_EXPORT ImageToPointSetFilter: public ImageToMeshFilter< TInpu /** Run-time type information (and related methods). */ itkTypeMacro(ImageToPointSetFilter, ImageToMeshFilter); - /** Some convenient typedefs. */ - typedef TInputImage InputImageType; - typedef typename InputImageType::ConstPointer InputImageConstPointer; - typedef typename InputImageType::RegionType InputImageRegionType; - typedef typename InputImageType::PixelType InputImagePixelType; + /** Some convenient type alias. */ + using InputImageType = TInputImage; + using InputImageConstPointer = typename InputImageType::ConstPointer; + using InputImageRegionType = typename InputImageType::RegionType; + using InputImagePixelType = typename InputImageType::PixelType; - /** Some typedefs associated with the output mesh. */ - typedef TOutputMesh OutputMeshType; - typedef typename OutputMeshType::PointType PointType; - typedef typename OutputMeshType::Pointer OutputMeshPointer; - typedef typename OutputMeshType::PointsContainer PointsContainer; - typedef typename OutputMeshType::PointIdentifier PointIdentifier; - typedef typename PointsContainer::Pointer PointsContainerPointer; - typedef typename PointsContainer::Iterator PointsContainerIterator; - typedef typename OutputMeshType::PointDataContainer PointDataContainer; - typedef typename PointDataContainer::Pointer PointDataContainerPointer; - typedef typename PointDataContainer::Iterator PointDataContainerIterator; + /** Some type alias associated with the output mesh. */ + using OutputMeshType = TOutputMesh; + using PointType = typename OutputMeshType::PointType; + using OutputMeshPointer = typename OutputMeshType::Pointer; + using PointsContainer = typename OutputMeshType::PointsContainer; + using PointIdentifier = typename OutputMeshType::PointIdentifier; + using PointsContainerPointer = typename PointsContainer::Pointer; + using PointsContainerIterator = typename PointsContainer::Iterator; + using PointDataContainer = typename OutputMeshType::PointDataContainer; + using PointDataContainerPointer = typename PointDataContainer::Pointer; + using PointDataContainerIterator = typename PointDataContainer::Iterator; /** The dimension of the output mesh. */ itkStaticConstMacro(PointDimension, unsigned int, TOutputMesh::PointDimension); diff --git a/test/itkBSplineApproximationGradientImageFilterTest.cxx b/test/itkBSplineApproximationGradientImageFilterTest.cxx index a698b05..41d795b 100644 --- a/test/itkBSplineApproximationGradientImageFilterTest.cxx +++ b/test/itkBSplineApproximationGradientImageFilterTest.cxx @@ -33,18 +33,18 @@ int itkBSplineApproximationGradientImageFilterTest( int argc, char* argv[] ) } const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > InputImageType; - typedef InputImageType OutputImageType; + using PixelType = float; + using InputImageType = itk::Image< PixelType, Dimension >; + using OutputImageType = InputImageType; - typedef itk::ImageFileReader< InputImageType > ReaderType; + using ReaderType = itk::ImageFileReader< InputImageType >; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); - typedef itk::ImageToImageOfVectorsFilter< InputImageType, 1 > ImageToVectorImageFilterType; + using ImageToVectorImageFilterType = itk::ImageToImageOfVectorsFilter< InputImageType, 1 >; ImageToVectorImageFilterType::Pointer imageToVI = ImageToVectorImageFilterType::New(); imageToVI->SetInput( 0, reader->GetOutput() ); - typedef ImageToVectorImageFilterType::OutputImageType VectorImageType; + using VectorImageType = ImageToVectorImageFilterType::OutputImageType; try { reader->UpdateOutputInformation(); @@ -56,24 +56,23 @@ int itkBSplineApproximationGradientImageFilterTest( int argc, char* argv[] ) return EXIT_FAILURE; } - typedef itk::BSplineApproximationGradientImageFilter< VectorImageType, float > - GradientImageFilterType; + using GradientImageFilterType = itk::BSplineApproximationGradientImageFilter< VectorImageType, float >; GradientImageFilterType::Pointer gradientImageFilter = GradientImageFilterType::New(); gradientImageFilter->SetInput( imageToVI->GetOutput() ); gradientImageFilter->SetNumberOfLevels( 1 ); gradientImageFilter->SetControlPointSpacingRatio( 2.0 ); - typedef itk::VectorMagnitudeImageFilter< GradientImageFilterType::OutputImageType, - OutputImageType > GradientMagnitudeFilterType; + using GradientMagnitudeFilterType = itk::VectorMagnitudeImageFilter< + GradientImageFilterType::OutputImageType, OutputImageType >; GradientMagnitudeFilterType::Pointer gradientMagnitude = GradientMagnitudeFilterType::New(); gradientMagnitude->SetInput( gradientImageFilter->GetOutput() ); - typedef itk::ImageFileWriter< OutputImageType > WriterType; + using WriterType = itk::ImageFileWriter< OutputImageType >; WriterType::Pointer writer = WriterType::New(); writer->SetInput( gradientMagnitude->GetOutput() ); writer->SetFileName( std::string( argv[2] ) + "GradientMagnitudeOutput.mha" ); - typedef itk::ImageFileWriter< GradientImageFilterType::OutputImageType > FullWriterType; + using FullWriterType = itk::ImageFileWriter< GradientImageFilterType::OutputImageType >; FullWriterType::Pointer fullWriter = FullWriterType::New(); fullWriter->SetInput( gradientImageFilter->GetOutput() ); fullWriter->SetFileName( std::string( argv[2] ) + "GradientOutput.mha" ); diff --git a/test/itkBSplineGradientImageFilterTest.cxx b/test/itkBSplineGradientImageFilterTest.cxx index 9b4a25e..092c72b 100644 --- a/test/itkBSplineGradientImageFilterTest.cxx +++ b/test/itkBSplineGradientImageFilterTest.cxx @@ -32,24 +32,23 @@ int itkBSplineGradientImageFilterTest(int argc, char *argv[]) } const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > InputImageType; + using PixelType = float; + using InputImageType = itk::Image< PixelType, Dimension >; - typedef itk::ImageFileReader< InputImageType > ReaderType; + using ReaderType = itk::ImageFileReader< InputImageType >; ReaderType::Pointer reader = ReaderType::New(); - typedef itk::BSplineGradientImageFilter< InputImageType, PixelType > FilterType; + using FilterType = itk::BSplineGradientImageFilter< InputImageType, PixelType >; FilterType::Pointer filter = FilterType::New(); filter->SetInput( reader->GetOutput() ); reader->SetFileName( argv[1] ); - typedef FilterType::OutputImageType GradientImageType; - typedef itk::VectorMagnitudeImageFilter< GradientImageType, InputImageType > - GradientMagnitudeFilterType; + using GradientImageType = FilterType::OutputImageType; + using GradientMagnitudeFilterType = itk::VectorMagnitudeImageFilter< GradientImageType, InputImageType >; GradientMagnitudeFilterType::Pointer gradientMagnitude = GradientMagnitudeFilterType::New(); gradientMagnitude->SetInput( filter->GetOutput() ); - typedef itk::ImageFileWriter< InputImageType > WriterType; + using WriterType = itk::ImageFileWriter< InputImageType >; WriterType::Pointer writer = WriterType::New(); writer->SetInput( gradientMagnitude->GetOutput() ); writer->SetFileName( argv[2] ); diff --git a/test/itkBSplineScatteredDataPointSetToGradientImageFilterTest.cxx b/test/itkBSplineScatteredDataPointSetToGradientImageFilterTest.cxx index 159fa7e..4a3ab59 100644 --- a/test/itkBSplineScatteredDataPointSetToGradientImageFilterTest.cxx +++ b/test/itkBSplineScatteredDataPointSetToGradientImageFilterTest.cxx @@ -35,17 +35,17 @@ int itkBSplineScatteredDataPointSetToGradientImageFilterTest( int argc, char *ar } const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > InputImageType; + using PixelType = float; + using InputImageType = itk::Image< PixelType, Dimension >; - typedef itk::ImageFileReader< InputImageType > ReaderType; + using ReaderType = itk::ImageFileReader< InputImageType >; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); - typedef itk::ImageToImageOfVectorsFilter< InputImageType, 1 > ImageToVectorImageFilterType; + using ImageToVectorImageFilterType = itk::ImageToImageOfVectorsFilter< InputImageType, 1 >; ImageToVectorImageFilterType::Pointer imageToVI = ImageToVectorImageFilterType::New(); imageToVI->SetInput( 0, reader->GetOutput() ); - typedef ImageToVectorImageFilterType::OutputImageType VectorImageType; + using VectorImageType = ImageToVectorImageFilterType::OutputImageType; try { reader->UpdateOutputInformation(); @@ -58,16 +58,15 @@ int itkBSplineScatteredDataPointSetToGradientImageFilterTest( int argc, char *ar } - typedef itk::Mesh< VectorImageType::PixelType, Dimension > MeshType; - typedef InputImageType OutputImageType; + using MeshType = itk::Mesh< VectorImageType::PixelType, Dimension >; + using OutputImageType = InputImageType; - typedef itk::ImageToPointSetFilter< VectorImageType, MeshType > - ImageToPointSetType; + using ImageToPointSetType = itk::ImageToPointSetFilter< VectorImageType, MeshType >; ImageToPointSetType::Pointer imageToPointSet = ImageToPointSetType::New(); imageToPointSet->SetInput( 0, imageToVI->GetOutput() ); - typedef itk::BSplineScatteredDataPointSetToGradientImageFilter< MeshType, - PixelType > PointSetToGradientFilterType; + using PointSetToGradientFilterType = + itk::BSplineScatteredDataPointSetToGradientImageFilter< MeshType, PixelType >; PointSetToGradientFilterType::Pointer pointSetToGradient = PointSetToGradientFilterType::New(); pointSetToGradient->SetInput( imageToPointSet->GetOutput() ); pointSetToGradient->SetOrigin( reader->GetOutput()->GetOrigin() ); @@ -78,12 +77,12 @@ int itkBSplineScatteredDataPointSetToGradientImageFilterTest( int argc, char *ar pointSetToGradient->SetNumberOfControlPoints( ncps ); pointSetToGradient->SetNumberOfLevels( 3 ); - typedef itk::VectorMagnitudeImageFilter< PointSetToGradientFilterType::OutputImageType, - OutputImageType > GradientMagnitudeFilterType; + using GradientMagnitudeFilterType = itk::VectorMagnitudeImageFilter< + PointSetToGradientFilterType::OutputImageType, OutputImageType >; GradientMagnitudeFilterType::Pointer gradientMagnitude = GradientMagnitudeFilterType::New(); gradientMagnitude->SetInput( pointSetToGradient->GetOutput() ); - typedef itk::ImageFileWriter< OutputImageType > WriterType; + using WriterType = itk::ImageFileWriter< OutputImageType >; WriterType::Pointer writer = WriterType::New(); writer->SetInput( gradientMagnitude->GetOutput() ); writer->SetFileName( argv[2] ); diff --git a/test/itkImageToImageOfVectorsFilterTest.cxx b/test/itkImageToImageOfVectorsFilterTest.cxx index 2128da2..8989947 100644 --- a/test/itkImageToImageOfVectorsFilterTest.cxx +++ b/test/itkImageToImageOfVectorsFilterTest.cxx @@ -31,20 +31,19 @@ int itkImageToImageOfVectorsFilterTest( int argc, char *argv[] ) } const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > InputImageType; + using PixelType = float; + using InputImageType = itk::Image< PixelType, Dimension >; - typedef itk::ImageFileReader< InputImageType > ReaderType; + using ReaderType = itk::ImageFileReader< InputImageType >; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); - typedef itk::ImageToImageOfVectorsFilter< InputImageType, 2 > - FilterType; + using FilterType = itk::ImageToImageOfVectorsFilter< InputImageType, 2 >; FilterType::Pointer filter = FilterType::New(); filter->SetInput( 0, reader->GetOutput() ); filter->SetInput( 1, reader->GetOutput() ); - typedef itk::ImageFileWriter< FilterType::OutputImageType > WriterType; + using WriterType = itk::ImageFileWriter< FilterType::OutputImageType >; WriterType::Pointer writer = WriterType::New(); writer->SetInput( filter->GetOutput() ); writer->SetFileName( argv[2] ); diff --git a/test/itkImageToPointSetFilterTest.cxx b/test/itkImageToPointSetFilterTest.cxx index 9c7e125..325655f 100644 --- a/test/itkImageToPointSetFilterTest.cxx +++ b/test/itkImageToPointSetFilterTest.cxx @@ -32,20 +32,19 @@ int itkImageToPointSetFilterTest( int argc, char *argv[] ) } const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > InputImageType; - typedef itk::Mesh< PixelType, Dimension > OutputMeshType; + using PixelType = float; + using InputImageType = itk::Image< PixelType, Dimension >; + using OutputMeshType = itk::Mesh< PixelType, Dimension >; - typedef itk::ImageFileReader< InputImageType > ReaderType; + using ReaderType = itk::ImageFileReader< InputImageType >; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); - typedef itk::ImageToPointSetFilter< InputImageType, OutputMeshType > - FilterType; + using FilterType = itk::ImageToPointSetFilter< InputImageType, OutputMeshType >; FilterType::Pointer filter = FilterType::New(); filter->SetInput(0, reader->GetOutput() ); - typedef itk::MeshFileWriter< OutputMeshType > WriterType; + using WriterType = itk::MeshFileWriter< OutputMeshType >; WriterType::Pointer writer = WriterType::New(); writer->SetInput( filter->GetOutput() ); writer->SetFileName( argv[2] );