diff --git a/Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.cxx b/Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.cxx index 0d4bd74267a..dbc5d44b824 100644 --- a/Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.cxx +++ b/Examples/IO/XML/itkParticleSwarmOptimizerDOMReader.cxx @@ -36,7 +36,7 @@ ParticleSwarmOptimizerDOMReader::GenerateData(const DOMNodeType * inputdom, if (output == nullptr) { logger->Info("creating the output PSO object ...\n"); - OutputType::Pointer object = OutputType::New(); + auto object = OutputType::New(); output = (OutputType *)object; this->SetOutput(output); } diff --git a/Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.cxx b/Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.cxx index 71c155abafc..1e0814872e8 100644 --- a/Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.cxx +++ b/Examples/IO/XML/itkParticleSwarmOptimizerDOMWriter.cxx @@ -78,21 +78,21 @@ ParticleSwarmOptimizerDOMWriter::GenerateData(DOMNodeType * outputdom, } // generate and insert the DOM node for the lower bound of the parameters logger->Info("writing LowerBound ...\n"); - DOMNode::Pointer nodelb = DOMNode::New(); + auto nodelb = DOMNode::New(); nodelb->SetName("bound"); nodelb->SetAttribute("id", "lower"); nodelb->SetAttribute("value", s << ClearContent << lbound); outputdom->AddChildAtEnd(nodelb); // generate and insert the DOM node for the upper bound of the parameters logger->Info("writing UpperBound ...\n"); - DOMNode::Pointer nodeub = DOMNode::New(); + auto nodeub = DOMNode::New(); nodeub->SetName("bound"); nodeub->SetAttribute("id", "upper"); nodeub->SetAttribute("value", s << ClearContent << ubound); outputdom->AddChildAtEnd(nodeub); logger->Info("writing ParametersConvergenceTolerance ...\n"); - DOMNode::Pointer nodeptols = DOMNode::New(); + auto nodeptols = DOMNode::New(); nodeptols->SetName("ParametersConvergenceTolerance"); outputdom->AddChildAtEnd(nodeptols); s << ClearContent diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index 7ed80529bca..89bc0b25492 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -158,9 +158,9 @@ PyBuffer::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj using InternalPixelType = typename TImage::InternalPixelType; using ImporterType = ImportImageContainer; - typename ImporterType::Pointer importer = ImporterType::New(); - constexpr bool importImageFilterWillOwnTheBuffer = false; - InternalPixelType * data = (InternalPixelType *)buffer; + auto importer = ImporterType::New(); + constexpr bool importImageFilterWillOwnTheBuffer = false; + InternalPixelType * data = (InternalPixelType *)buffer; importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer); OutputImagePointer output = TImage::New(); diff --git a/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx b/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx index 2fbd9029fb7..0cb9835a383 100644 --- a/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx @@ -105,8 +105,8 @@ PyVectorContainer::_vector_container_from_array(Py PyBuffer_Release(&pyBuffer); return nullptr; } - DataType * data = (DataType *)buffer; - typename VectorContainerType::Pointer output = VectorContainerType::New(); + DataType * data = (DataType *)buffer; + auto output = VectorContainerType::New(); output->resize(numberOfElements); for (size_t ii = 0; ii < numberOfElements; ++ii) { diff --git a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx index 6aa9505db3e..22bffabaad2 100644 --- a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterRGBTest.cxx @@ -41,11 +41,11 @@ itkImageToVTKImageFilterRGBTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); using ConnectorType = itk::ImageToVTKImageFilter; - ConnectorType::Pointer connector = ConnectorType::New(); + auto connector = ConnectorType::New(); connector->SetInput(reader->GetOutput()); connector->UpdateLargestPossibleRegion(); diff --git a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx index 380d6097e5f..52a6b2f0ee4 100644 --- a/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkImageToVTKImageFilterTest.cxx @@ -37,7 +37,7 @@ itkImageToVTKImageFilterTest(int, char *[]) size[0] = 40; size[1] = 10; size[2] = 20; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); source->SetSize(size); SpacingType spacing; @@ -61,7 +61,7 @@ itkImageToVTKImageFilterTest(int, char *[]) auto input = source->GetOutput(); input->Print(std::cout); - ConnectorType::Pointer connector = ConnectorType::New(); + auto connector = ConnectorType::New(); connector->SetInput(input); connector->UpdateLargestPossibleRegion(); connector->Update(); diff --git a/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx index ba1d06f6870..fa1919e8f76 100644 --- a/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkVTKImageToImageFilterTest.cxx @@ -44,7 +44,7 @@ itkVTKImageToImageFilterTest(int, char *[]) #endif input->Print(std::cout); - ConnectorType::Pointer connector = ConnectorType::New(); + auto connector = ConnectorType::New(); connector->SetInput(input); connector->Update(); diff --git a/Modules/Bridge/VtkGlue/test/itkVtkConnectedComponentImageFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkVtkConnectedComponentImageFilterTest.cxx index 271b85ae672..9c5fd775287 100644 --- a/Modules/Bridge/VtkGlue/test/itkVtkConnectedComponentImageFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkVtkConnectedComponentImageFilterTest.cxx @@ -76,7 +76,7 @@ itkVtkConnectedComponentImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); QuickView viewer; @@ -111,10 +111,10 @@ itkVtkConnectedComponentImageFilterTest(int argc, char * argv[]) (*it).second->SetInput(reader->GetOutput()); (*it).second->Update(); - ConnectedComponentImageFilterType::Pointer connected = ConnectedComponentImageFilterType::New(); + auto connected = ConnectedComponentImageFilterType::New(); connected->SetInput((*it).second->GetOutput()); - RGBFilterType::Pointer rgbFilter = RGBFilterType::New(); + auto rgbFilter = RGBFilterType::New(); rgbFilter->SetInput(connected->GetOutput()); std::stringstream desc; desc << (*it).first << " threshold = " << (*it).second->GetThreshold(); diff --git a/Modules/Bridge/VtkGlue/test/itkVtkMedianFilterTest.cxx b/Modules/Bridge/VtkGlue/test/itkVtkMedianFilterTest.cxx index 654f9ee559b..69a03556f69 100644 --- a/Modules/Bridge/VtkGlue/test/itkVtkMedianFilterTest.cxx +++ b/Modules/Bridge/VtkGlue/test/itkVtkMedianFilterTest.cxx @@ -45,11 +45,11 @@ itkVtkMedianFilterTest(int argc, char * argv[]) using SubtractType = itk::SubtractImageFilter; // Create and setup a reader - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFilename); // Create and setup a median filter - FilterType::Pointer medianFilter = FilterType::New(); + auto medianFilter = FilterType::New(); FilterType::InputSizeType radius; radius.Fill(2); if (argc > 2) @@ -60,7 +60,7 @@ itkVtkMedianFilterTest(int argc, char * argv[]) medianFilter->SetRadius(radius); medianFilter->SetInput(reader->GetOutput()); - SubtractType::Pointer diff = SubtractType::New(); + auto diff = SubtractType::New(); diff->SetInput1(reader->GetOutput()); diff->SetInput2(medianFilter->GetOutput()); diff --git a/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.hxx b/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.hxx index e62be08bc1f..0948ee1457e 100644 --- a/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.hxx +++ b/Modules/Compatibility/Deprecated/include/itkTreeIteratorBase.hxx @@ -111,7 +111,7 @@ TreeIteratorBase::Add(ValueType element) return false; } - typename TreeNodeType::Pointer node = TreeNodeType::New(); + auto node = TreeNodeType::New(); node->Set(element); m_Position->AddChild(node); m_Tree->Modified(); @@ -133,7 +133,7 @@ TreeIteratorBase::Add(int itkNotUsed(childPosition), ValueType elemen { if (m_Position) { - typename TreeNodeType::Pointer node = TreeNodeType::New(); + auto node = TreeNodeType::New(); node->Set(element); m_Position->AddChild(node); m_Tree->Modified(); @@ -210,7 +210,7 @@ template TTreeType * TreeIteratorBase::GetSubTree() const { - typename TTreeType::Pointer tree = TTreeType::New(); + auto tree = TTreeType::New(); tree->SetRoot(m_Position); tree->SetSubtree(true); return tree; diff --git a/Modules/Compatibility/Deprecated/test/itkTreeContainerTest.cxx b/Modules/Compatibility/Deprecated/test/itkTreeContainerTest.cxx index 3b4f4b10461..3098025251e 100644 --- a/Modules/Compatibility/Deprecated/test/itkTreeContainerTest.cxx +++ b/Modules/Compatibility/Deprecated/test/itkTreeContainerTest.cxx @@ -34,7 +34,7 @@ itkTreeContainerTest(int, char *[]) { using NodeType = int; using TreeType = itk::TreeContainer; - TreeType::Pointer tree = TreeType::New(); + auto tree = TreeType::New(); tree->SetRoot(0); tree->Add(1, 0); tree->Add(2, 0); diff --git a/Modules/Compatibility/Deprecated/test/itkTreeContainerTest2.cxx b/Modules/Compatibility/Deprecated/test/itkTreeContainerTest2.cxx index c9662d53fb3..ca016a568be 100644 --- a/Modules/Compatibility/Deprecated/test/itkTreeContainerTest2.cxx +++ b/Modules/Compatibility/Deprecated/test/itkTreeContainerTest2.cxx @@ -192,10 +192,10 @@ CreateTree_1(NodeListType & internalList) { std::cout << "create tree" << std::endl; - TreeType::Pointer tree = TreeType::New(); + auto tree = TreeType::New(); - TreeChangeListener::Pointer treeChangeListener = TreeChangeListener::New(); + auto treeChangeListener = TreeChangeListener::New(); itk::TreeAddEvent ev; unsigned long tag = tree->AddObserver(ev, treeChangeListener); @@ -265,8 +265,8 @@ CreateTree_2(NodeListType & internalList) { std::cout << "create tree 2" << std::endl; - TreeType::Pointer tree = TreeType::New(); - auto * newNode = new TestData(9); + auto tree = TreeType::New(); + auto * newNode = new TestData(9); internalList.push_back(newNode); tree->SetRoot(newNode); itk::PostOrderTreeIterator it(tree); @@ -399,7 +399,7 @@ itkTreeContainerTest2(int, char *[]) result = IteratorTest(preOrderIt_Tree_1_2); testCounter += PrintResult(result, 3761); - TreeChangeListener::Pointer treeChangeListener = TreeChangeListener::New(); + auto treeChangeListener = TreeChangeListener::New(); itk::TreeChangeEvent ev; unsigned long tag = tree->AddObserver(ev, treeChangeListener); tree->Clear(); diff --git a/Modules/Compatibility/Deprecated/test/itkVectorCentralDifferenceImageFunctionTest.cxx b/Modules/Compatibility/Deprecated/test/itkVectorCentralDifferenceImageFunctionTest.cxx index 965d22126ef..a5f9b2c9aef 100644 --- a/Modules/Compatibility/Deprecated/test/itkVectorCentralDifferenceImageFunctionTest.cxx +++ b/Modules/Compatibility/Deprecated/test/itkVectorCentralDifferenceImageFunctionTest.cxx @@ -27,7 +27,7 @@ itkVectorCentralDifferenceImageFunctionTest(int, char *[]) using PixelType = itk::Vector; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(16); ImageType::RegionType region(size); @@ -50,7 +50,7 @@ itkVectorCentralDifferenceImageFunctionTest(int, char *[]) // set up central difference calculator using CoordRepType = float; using FunctionType = itk::VectorCentralDifferenceImageFunction; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Compatibility/Deprecated/test/itkVectorResampleImageFilterTest.cxx b/Modules/Compatibility/Deprecated/test/itkVectorResampleImageFilterTest.cxx index 23220a503a3..cd5f323c30a 100644 --- a/Modules/Compatibility/Deprecated/test/itkVectorResampleImageFilterTest.cxx +++ b/Modules/Compatibility/Deprecated/test/itkVectorResampleImageFilterTest.cxx @@ -41,7 +41,7 @@ itkVectorResampleImageFilterTest(int argc, char * argv[]) using FilterType = itk::VectorResampleImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, VectorResampleImageFilter, ImageToImageFilter); @@ -49,13 +49,13 @@ itkVectorResampleImageFilterTest(int argc, char * argv[]) using InterpolatorType = itk::VectorLinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); filter->SetInterpolator(interpolator); ITK_TEST_SET_GET_VALUE(interpolator, filter->GetInterpolator()); using TransformType = itk::IdentityTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); filter->SetTransform(transform); ITK_TEST_SET_GET_VALUE(transform, filter->GetTransform()); @@ -79,7 +79,7 @@ itkVectorResampleImageFilterTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(start); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetOrigin(origin); image->SetSpacing(spacing); @@ -145,7 +145,7 @@ itkVectorResampleImageFilterTest(int argc, char * argv[]) // Write an image for regression testing using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[1]); diff --git a/Modules/Core/Common/include/itkAnnulusOperator.hxx b/Modules/Core/Common/include/itkAnnulusOperator.hxx index c2d77b62865..8d7179b6e02 100644 --- a/Modules/Core/Common/include/itkAnnulusOperator.hxx +++ b/Modules/Core/Common/include/itkAnnulusOperator.hxx @@ -92,8 +92,8 @@ AnnulusOperator::GenerateCoefficients() -> Coeff // Use a couple of sphere spatial functions... using SphereType = SphereSpatialFunction; - typename SphereType::Pointer innerS = SphereType::New(); - typename SphereType::Pointer outerS = SphereType::New(); + auto innerS = SphereType::New(); + auto outerS = SphereType::New(); innerS->SetRadius(m_InnerRadius); outerS->SetRadius(m_InnerRadius + m_Thickness); diff --git a/Modules/Core/Common/include/itkImageDuplicator.h b/Modules/Core/Common/include/itkImageDuplicator.h index 77f30a1e3a8..53da886acf0 100644 --- a/Modules/Core/Common/include/itkImageDuplicator.h +++ b/Modules/Core/Common/include/itkImageDuplicator.h @@ -34,7 +34,7 @@ namespace itk medianFilter->Update(); ImageType::Pointer image = medianFilter->GetOutput(); using DuplicatorType = itk::ImageDuplicator< ImageType >; - DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(image); duplicator->Update(); ImageType::Pointer clonedImage = duplicator->GetOutput(); diff --git a/Modules/Core/Common/include/itkImageSource.h b/Modules/Core/Common/include/itkImageSource.h index 1b619192c18..e4d710f2587 100644 --- a/Modules/Core/Common/include/itkImageSource.h +++ b/Modules/Core/Common/include/itkImageSource.h @@ -164,7 +164,7 @@ class ITK_TEMPLATE_EXPORT ImageSource \code // Setup the mini-pipeline to process the input to this filter // The input is not connected to the pipeline. - typename InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->Graft( const_cast< InputImageType * >( this->GetInput() ); firstFilterInMiniPipeline->SetInput( input ); diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 9cc9bd4dbc9..7d2072af48b 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -857,7 +857,7 @@ compilers. return; \ } \ CLANG_PRAGMA_POP \ - typename DecoratorType::Pointer newInput = DecoratorType::New(); \ + auto newInput = DecoratorType::New(); \ newInput->Set(_arg); \ this->Set##name##Input(newInput); \ } \ @@ -915,7 +915,7 @@ compilers. { \ return; \ } \ - typename DecoratorType::Pointer newInput = DecoratorType::New(); \ + auto newInput = DecoratorType::New(); \ newInput->Set(_arg); \ this->Set##name##Input(newInput); \ } \ @@ -1280,7 +1280,7 @@ compilers. } \ else \ { \ - typename DecoratorType::Pointer newOutput = DecoratorType::New(); \ + auto newOutput = DecoratorType::New(); \ newOutput->Set(_arg); \ this->Set##name##Output(newOutput); \ } \ diff --git a/Modules/Core/Common/include/itkOctree.hxx b/Modules/Core/Common/include/itkOctree.hxx index 4296b8cb55e..c99e2ca574e 100644 --- a/Modules/Core/Common/include/itkOctree.hxx +++ b/Modules/Core/Common/include/itkOctree.hxx @@ -270,7 +270,7 @@ Octree::GetImage() -> ImageTypePoin typename ImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - typename ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); img->SetLargestPossibleRegion(region); img->SetBufferedRegion(region); img->SetRequestedRegion(region); diff --git a/Modules/Core/Common/include/itkPointSetToImageFilter.hxx b/Modules/Core/Common/include/itkPointSetToImageFilter.hxx index 06d5956e75b..5278e1b060d 100644 --- a/Modules/Core/Common/include/itkPointSetToImageFilter.hxx +++ b/Modules/Core/Common/include/itkPointSetToImageFilter.hxx @@ -124,7 +124,7 @@ PointSetToImageFilter::GenerateData() InputPointSetDimension, typename InputPointSetType::CoordRepType, typename InputPointSetType::PointsContainer>; - typename BoundingBoxType::Pointer bb = BoundingBoxType::New(); + auto bb = BoundingBoxType::New(); bb->SetPoints(InputPointSet->GetPoints()); bb->ComputeBoundingBox(); diff --git a/Modules/Core/Common/include/itkSimpleFilterWatcher.h b/Modules/Core/Common/include/itkSimpleFilterWatcher.h index 182cc826004..78166a06bb9 100644 --- a/Modules/Core/Common/include/itkSimpleFilterWatcher.h +++ b/Modules/Core/Common/include/itkSimpleFilterWatcher.h @@ -47,7 +47,7 @@ namespace itk * Example of use: * * using FilterType = itk::BinaryThresholdImageFilter; - * FilterType::Pointer thresholdFilter = FilterType::New(); + * auto thresholdFilter = FilterType::New(); * * SimpleFilterWatcher watcher(thresholdFilter, "Threshold"); * diff --git a/Modules/Core/Common/src/itkLoggerManager.cxx b/Modules/Core/Common/src/itkLoggerManager.cxx index 0920ca345c8..1d55c138862 100644 --- a/Modules/Core/Common/src/itkLoggerManager.cxx +++ b/Modules/Core/Common/src/itkLoggerManager.cxx @@ -23,7 +23,7 @@ namespace itk LoggerManager::LoggerPointer LoggerManager::CreateLogger(const NameType & name, PriorityLevelEnum level, PriorityLevelEnum levelForFlushing) { - Logger::Pointer logger = Logger::New(); + auto logger = Logger::New(); logger->SetName(name.c_str()); logger->SetPriorityLevel(level); @@ -36,7 +36,7 @@ LoggerManager::CreateLogger(const NameType & name, PriorityLevelEnum level, Prio LoggerManager::ThreadLoggerPointer LoggerManager::CreateThreadLogger(const NameType & name, PriorityLevelEnum level, PriorityLevelEnum levelForFlushing) { - ThreadLogger::Pointer logger = ThreadLogger::New(); + auto logger = ThreadLogger::New(); logger->SetName(name.c_str()); logger->SetPriorityLevel(level); diff --git a/Modules/Core/Common/src/itkObjectFactoryBase.cxx b/Modules/Core/Common/src/itkObjectFactoryBase.cxx index cd6bd894414..fe4d8c74cff 100644 --- a/Modules/Core/Common/src/itkObjectFactoryBase.cxx +++ b/Modules/Core/Common/src/itkObjectFactoryBase.cxx @@ -425,7 +425,7 @@ NameIsSharedLibrary(const char * name) void ObjectFactoryBase::LoadLibrariesInPath(const char * path) { - Directory::Pointer dir = Directory::New(); + auto dir = Directory::New(); if (!dir->Load(path)) { diff --git a/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx b/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx index 39c367e81c2..62b98ca5469 100644 --- a/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx +++ b/Modules/Core/Common/test/itkAbortProcessObjectTest.cxx @@ -61,7 +61,7 @@ itkAbortProcessObjectTest(int, char *[]) { // type alias to simplify the syntax using ShortImage = itk::Image; - ShortImage::Pointer img = ShortImage::New(); + auto img = ShortImage::New(); // fill in an image const ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx index e5741f0b69e..bafbdfcdb25 100644 --- a/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx +++ b/Modules/Core/Common/test/itkAdaptorComparisonTest.cxx @@ -187,8 +187,8 @@ itkAdaptorComparisonTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ScalarImageType::Pointer scalar_image = ScalarImageType::New(); - VectorImageType::Pointer vector_image = VectorImageType::New(); + auto scalar_image = ScalarImageType::New(); + auto vector_image = VectorImageType::New(); scalar_image->SetLargestPossibleRegion(region); scalar_image->SetBufferedRegion(region); diff --git a/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx index 4024e183d9d..94c5a5b8075 100644 --- a/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkAtanRegularizedHeavisideStepFunctionTest1.cxx @@ -27,7 +27,7 @@ itkAtanRegularizedHeavisideStepFunctionTest1(int, char *[]) using HeavisideFunctionBaseType = itk::AtanRegularizedHeavisideStepFunction; - HeavisideFunctionBaseType::Pointer functionBase0 = HeavisideFunctionBaseType::New(); + auto functionBase0 = HeavisideFunctionBaseType::New(); std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); diff --git a/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx b/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx index 635bfe23ffb..a42db6ad9a5 100644 --- a/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx +++ b/Modules/Core/Common/test/itkBSplineInterpolationWeightFunctionTest.cxx @@ -56,7 +56,7 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) using IndexType = FunctionType::IndexType; using WeightsType = FunctionType::WeightsType; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); WeightsType weights1; WeightsType weights2; @@ -143,7 +143,7 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) using IndexType = FunctionType::IndexType; using WeightsType = FunctionType::WeightsType; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); WeightsType weights1; WeightsType weights2; @@ -231,7 +231,7 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) using WeightsType = FunctionType::WeightsType; using SizeType = FunctionType::SizeType; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->Print(std::cout); SizeType size = FunctionType::SupportSize; @@ -257,10 +257,10 @@ itkBSplineInterpolationWeightFunctionTest(int, char *[]) // Check for accuracy using KernelType = itk::BSplineKernelFunction; - KernelType::Pointer kernel = KernelType::New(); + auto kernel = KernelType::New(); using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetIndex(startIndex); region.SetSize(size); diff --git a/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx b/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx index 1de0f5029e6..c1a42a5b3f9 100644 --- a/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx +++ b/Modules/Core/Common/test/itkBSplineKernelFunctionTest.cxx @@ -64,7 +64,7 @@ itkBSplineKernelFunctionTest(int, char *[]) #define TEST_BSPLINE_KERNEL(ORDERNUM) \ { \ using FunctionType = itk::BSplineKernelFunction; \ - FunctionType::Pointer function = FunctionType::New(); \ + auto function = FunctionType::New(); \ \ function->Print(std::cout); \ for (unsigned j = 0; j < npoints; ++j) \ @@ -92,7 +92,7 @@ itkBSplineKernelFunctionTest(int, char *[]) { constexpr unsigned int SplineOrder = 0; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; - DerivativeFunctionType::Pointer derivFunction = DerivativeFunctionType::New(); + auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); double xx = -0.25; @@ -113,10 +113,10 @@ itkBSplineKernelFunctionTest(int, char *[]) { constexpr unsigned int SplineOrder = 1; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; - DerivativeFunctionType::Pointer derivFunction = DerivativeFunctionType::New(); + auto derivFunction = DerivativeFunctionType::New(); using FunctionType = itk::BSplineKernelFunction; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); for (double xx = -3.0; xx <= 3.0; xx += 0.1) { @@ -138,11 +138,11 @@ itkBSplineKernelFunctionTest(int, char *[]) { constexpr unsigned int SplineOrder = 2; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; - DerivativeFunctionType::Pointer derivFunction = DerivativeFunctionType::New(); + auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); using FunctionType = itk::BSplineKernelFunction; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); for (double xx = -3.0; xx <= 3.0; xx += 0.1) { @@ -164,11 +164,11 @@ itkBSplineKernelFunctionTest(int, char *[]) { constexpr unsigned int SplineOrder = 3; using DerivativeFunctionType = itk::BSplineDerivativeKernelFunction; - DerivativeFunctionType::Pointer derivFunction = DerivativeFunctionType::New(); + auto derivFunction = DerivativeFunctionType::New(); derivFunction->Print(std::cout); using FunctionType = itk::BSplineKernelFunction; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); for (double xx = -3.0; xx <= 3.0; xx += 0.1) { @@ -190,7 +190,7 @@ itkBSplineKernelFunctionTest(int, char *[]) { using FunctionType = itk::BSplineKernelFunction<7>; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); bool pass = false; try @@ -216,7 +216,7 @@ itkBSplineKernelFunctionTest(int, char *[]) { using FunctionType = itk::BSplineDerivativeKernelFunction<5>; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); bool pass = false; try diff --git a/Modules/Core/Common/test/itkBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkBoundaryConditionTest.cxx index e5cfe7b25b7..fe3d331c192 100644 --- a/Modules/Core/Common/test/itkBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkBoundaryConditionTest.cxx @@ -116,9 +116,9 @@ itkBoundaryConditionTest(int, char *[]) Region3D.SetIndex(orig3D); RegionND.SetIndex(origND); - ImageType2D::Pointer image2D = ImageType2D::New(); - ImageType3D::Pointer image3D = ImageType3D::New(); - ImageTypeND::Pointer imageND = ImageTypeND::New(); + auto image2D = ImageType2D::New(); + auto image3D = ImageType3D::New(); + auto imageND = ImageTypeND::New(); image2D->SetLargestPossibleRegion(Region2D); image3D->SetLargestPossibleRegion(Region3D); diff --git a/Modules/Core/Common/test/itkBoundingBoxTest.cxx b/Modules/Core/Common/test/itkBoundingBoxTest.cxx index 0ee2f4c8997..c4ba1163b08 100644 --- a/Modules/Core/Common/test/itkBoundingBoxTest.cxx +++ b/Modules/Core/Common/test/itkBoundingBoxTest.cxx @@ -27,7 +27,7 @@ itkBoundingBoxTest(int, char *[]) // Test out the bounding box code using BB = itk::BoundingBox; - BB::Pointer myBox = BB::New(); + auto myBox = BB::New(); BB::PointsContainerPointer Points = BB::PointsContainer::New(); @@ -133,7 +133,7 @@ itkBoundingBoxTest(int, char *[]) std::cout << " Some Testing in 3D " << std::endl; using CC = itk::BoundingBox; - CC::Pointer my3DBox = CC::New(); + auto my3DBox = CC::New(); CC::PointsContainerPointer Points3D = CC::PointsContainer::New(); diff --git a/Modules/Core/Common/test/itkColorTableTest.cxx b/Modules/Core/Common/test/itkColorTableTest.cxx index b6666fcc199..13093a57619 100644 --- a/Modules/Core/Common/test/itkColorTableTest.cxx +++ b/Modules/Core/Common/test/itkColorTableTest.cxx @@ -138,7 +138,7 @@ ColorTableTestHelper(const char * name, unsigned int numberOfColors) int testStatus = EXIT_SUCCESS; using ColorTableType = itk::ColorTable; - typename ColorTableType::Pointer colors = ColorTableType::New(); + auto colors = ColorTableType::New(); std::cout << "Testing for type: " << name << std::endl; @@ -184,7 +184,7 @@ itkColorTableTest(int argc, char * argv[]) // Done outside the helper function in the test because GCC is limited // when calling overloaded base class functions. using ColorTableType = itk::ColorTable; - ColorTableType::Pointer colors = ColorTableType::New(); + auto colors = ColorTableType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(colors, ColorTable, Object); diff --git a/Modules/Core/Common/test/itkCompensatedSummationTest.cxx b/Modules/Core/Common/test/itkCompensatedSummationTest.cxx index c21d2b6b6a6..dd56a6f0178 100644 --- a/Modules/Core/Common/test/itkCompensatedSummationTest.cxx +++ b/Modules/Core/Common/test/itkCompensatedSummationTest.cxx @@ -37,7 +37,7 @@ itkCompensatedSummationTest(int, char *[]) constexpr itk::SizeValueType accumSize = 50000000; using GeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator; - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); generator->Initialize(seedValue); FloatType vanillaSum = 0.0; diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx index c10f75ece3f..bf0d8d4f6e9 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorTest.cxx @@ -41,7 +41,7 @@ GetTestImage(int d1, int d2, int d3, int d4) RegionND.SetSize(sizeND); RegionND.SetIndex(origND); - TestImageType::Pointer imageND = TestImageType::New(); + auto imageND = TestImageType::New(); imageND->SetLargestPossibleRegion(RegionND); imageND->SetBufferedRegion(RegionND); imageND->SetRequestedRegion(RegionND); @@ -330,7 +330,7 @@ itkConstNeighborhoodIteratorTest(int, char *[]) ChangeRegionTestImageType::RegionType imageRegion(imageCorner, imageSize); - ChangeRegionTestImageType::Pointer image = ChangeRegionTestImageType::New(); + auto image = ChangeRegionTestImageType::New(); image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx index c04d6de97a3..2ef956a7211 100644 --- a/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx +++ b/Modules/Core/Common/test/itkConstNeighborhoodIteratorWithOnlyIndexTest.cxx @@ -36,7 +36,7 @@ itkConstNeighborhoodIteratorWithOnlyIndexTestGetTestImage(int d1, int d2, int d3 RegionND.SetSize(sizeND); RegionND.SetIndex(origND); - typename TImage::Pointer imageND = TImage::New(); + auto imageND = TImage::New(); imageND->SetLargestPossibleRegion(RegionND); imageND->SetBufferedRegion(RegionND); imageND->SetRequestedRegion(RegionND); diff --git a/Modules/Core/Common/test/itkConstShapedNeighborhoodIteratorTest.cxx b/Modules/Core/Common/test/itkConstShapedNeighborhoodIteratorTest.cxx index 5e9d5206428..c3a815ec35c 100644 --- a/Modules/Core/Common/test/itkConstShapedNeighborhoodIteratorTest.cxx +++ b/Modules/Core/Common/test/itkConstShapedNeighborhoodIteratorTest.cxx @@ -425,7 +425,7 @@ itkConstShapedNeighborhoodIteratorTest(int, char *[]) ChangeRegionTestImageType::RegionType imageRegion(imageCorner, imageSize); - ChangeRegionTestImageType::Pointer image = ChangeRegionTestImageType::New(); + auto image = ChangeRegionTestImageType::New(); image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx index 7da0c937d54..e84a4db8047 100644 --- a/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx @@ -123,17 +123,17 @@ int itkConstantBoundaryConditionTest(int, char *[]) { // Test an image to cover one operator() method. - ImageType::Pointer image = ImageType::New(); - RegionType imageRegion; - SizeType imageSize = { { 5, 5 } }; - IndexType imageIndex = { { 0, 0 } }; + auto image = ImageType::New(); + RegionType imageRegion; + SizeType imageSize = { { 5, 5 } }; + IndexType imageIndex = { { 0, 0 } }; imageRegion.SetSize(imageSize); imageRegion.SetIndex(imageIndex); image->SetRegions(imageRegion); image->Allocate(); // Test a vector image to cover the other operator() method. - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); vectorImage->SetRegions(imageRegion); vectorImage->SetNumberOfComponentsPerPixel(1); vectorImage->Allocate(); diff --git a/Modules/Core/Common/test/itkDecoratorTest.cxx b/Modules/Core/Common/test/itkDecoratorTest.cxx index 5a8ea398ec0..ee643a4d404 100644 --- a/Modules/Core/Common/test/itkDecoratorTest.cxx +++ b/Modules/Core/Common/test/itkDecoratorTest.cxx @@ -43,7 +43,7 @@ itkDecoratorTest(int, char *[]) using FloatObjectType = itk::SimpleDataObjectDecorator; - FloatObjectType::Pointer f = FloatObjectType::New(); + auto f = FloatObjectType::New(); f->Set(5.0); std::cout << "Value of f: " << f->Get() << std::endl; @@ -54,9 +54,9 @@ itkDecoratorTest(int, char *[]) using TransformType = itk::AffineTransform; using TransformObjectType = itk::DataObjectDecorator; - TransformObjectType::Pointer decoratedTransform = TransformObjectType::New(); - TransformType::Pointer transformObject = TransformType::New(); - const TransformType * constTransformObject = transformObject; + auto decoratedTransform = TransformObjectType::New(); + auto transformObject = TransformType::New(); + const TransformType * constTransformObject = transformObject; transformObject->Scale(5.0); @@ -66,7 +66,7 @@ itkDecoratorTest(int, char *[]) transformObject->Modified(); ITK_TEST_EXPECT_TRUE(t1 < decoratedTransform->GetMTime()); - TransformObjectType::Pointer decoratedTransform2 = TransformObjectType::New(); + auto decoratedTransform2 = TransformObjectType::New(); decoratedTransform2->Graft(decoratedTransform); ITK_TEST_EXPECT_EQUAL(decoratedTransform2->Get(), decoratedTransform->Get()); @@ -83,7 +83,7 @@ itkDecoratorTest(int, char *[]) using TransformBaseType = itk::Transform; using TransformBaseObjectType = itk::DataObjectDecorator; - TransformBaseObjectType::Pointer decoratedBaseTransform = TransformBaseObjectType::New(); + auto decoratedBaseTransform = TransformBaseObjectType::New(); // NOTE: GetPointer is needed to force selection of the correct overloaded function signature. decoratedBaseTransform->Graft(decoratedTransform.GetPointer()); ITK_TEST_EXPECT_TRUE(decoratedBaseTransform->Get() != nullptr); @@ -116,7 +116,7 @@ itkDecoratorTest(int, char *[]) VectorType v; v.resize(5); std::cout << v << std::endl; - VectorObjectType::Pointer vo = VectorObjectType::New(); + auto vo = VectorObjectType::New(); vo->Set(v); std::cout << vo; std::cout << "----------------------------------------------------" << std::endl; @@ -130,7 +130,7 @@ itkDecoratorTest(int, char *[]) vp->resize(3); std::cout << *vp << std::endl; - VectorPointerObjectType::Pointer vop = VectorPointerObjectType::New(); + auto vop = VectorPointerObjectType::New(); vop->Set(vp); std::cout << vop; @@ -148,7 +148,7 @@ itkDecoratorTest(int, char *[]) // vp2->resize(4); // std::cout << *vp2 << std::endl; - // VectorPointerObjectType2::Pointer vop2 = VectorPointerObjectType2::New(); + // auto vop2 = VectorPointerObjectType2::New(); // vop2->Set(vp2); // std::cout << vop2; diff --git a/Modules/Core/Common/test/itkEllipsoidInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkEllipsoidInteriorExteriorSpatialFunctionTest.cxx index aaa275be27f..f030b18316a 100644 --- a/Modules/Core/Common/test/itkEllipsoidInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkEllipsoidInteriorExteriorSpatialFunctionTest.cxx @@ -33,7 +33,7 @@ itkEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) using TEllipsoidFunctionVectorType = TEllipsoidFunctionType::InputType; // Create an ellipsoid spatial function for the source image - TEllipsoidFunctionType::Pointer spatialFunc = TEllipsoidFunctionType::New(); + auto spatialFunc = TEllipsoidFunctionType::New(); // Define and set the axes lengths for the ellipsoid TEllipsoidFunctionVectorType axes; axes[0] = 40; diff --git a/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx b/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx index 7545312ed3f..244b144405f 100644 --- a/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx +++ b/Modules/Core/Common/test/itkExtractImage3Dto2DTest.cxx @@ -29,7 +29,7 @@ itkExtractImage3Dto2DTest(int, char *[]) using ExtractType = itk::ExtractImageFilter; using RandomImageSourceType = itk::RandomImageSource; - RandomImageSourceType::Pointer src = RandomImageSourceType::New(); + auto src = RandomImageSourceType::New(); src->SetMin(0); src->SetMax(255); Image3DType::SizeType size = { { 16, 16, 16 } }; @@ -48,7 +48,7 @@ itkExtractImage3Dto2DTest(int, char *[]) im3d->SetDirection(dir); - ExtractType::Pointer extract = ExtractType::New(); + auto extract = ExtractType::New(); extract->SetDirectionCollapseToIdentity(); Image3DType::RegionType extractRegion = im3d->GetLargestPossibleRegion(); Image3DType::SizeType extractSize = extractRegion.GetSize(); diff --git a/Modules/Core/Common/test/itkExtractImageTest.cxx b/Modules/Core/Common/test/itkExtractImageTest.cxx index 3cb18c9d2a0..5bfd2a9f864 100644 --- a/Modules/Core/Common/test/itkExtractImageTest.cxx +++ b/Modules/Core/Common/test/itkExtractImageTest.cxx @@ -33,7 +33,7 @@ ExtractImageInPlaceTest() using ImageType = itk::Image; using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ImageType::SizeType size = { { 32, 32, 32 } }; source->SetSize(size); @@ -45,7 +45,7 @@ ExtractImageInPlaceTest() ImageType::SizeType zeroSize = { { 0, 0, 0 } }; using ExtractFilterType = itk::ExtractImageFilter; - ExtractFilterType::Pointer extract = ExtractFilterType::New(); + auto extract = ExtractFilterType::New(); extract->SetDirectionCollapseToSubmatrix(); extract->SetExtractionRegion(ImageType::RegionType(extractIndex, extractSize)); extract->InPlaceOn(); @@ -58,7 +58,7 @@ ExtractImageInPlaceTest() // add a filter between which will produce the requested region, and // enable in-place operation using SomeStreamableFitlerType = itk::CastImageFilter; - SomeStreamableFitlerType::Pointer filter = SomeStreamableFitlerType::New(); + auto filter = SomeStreamableFitlerType::New(); filter->SetInput(source->GetOutput()); filter->InPlaceOff(); // ensure a copy is performed @@ -95,7 +95,7 @@ itkExtractImageTest(int, char *[]) // type alias to simplify the syntax using SimpleImage = itk::Image; - SimpleImage::Pointer simpleImage = SimpleImage::New(); + auto simpleImage = SimpleImage::New(); std::cout << "Simple image spacing: " << simpleImage->GetSpacing()[0] << ", " << simpleImage->GetSpacing()[1] << std::endl; @@ -104,7 +104,7 @@ itkExtractImageTest(int, char *[]) using LineImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer if2 = ShortImage::New(); + auto if2 = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Core/Common/test/itkFactoryTestLib.cxx b/Modules/Core/Common/test/itkFactoryTestLib.cxx index 31f25f25b24..565f8358127 100644 --- a/Modules/Core/Common/test/itkFactoryTestLib.cxx +++ b/Modules/Core/Common/test/itkFactoryTestLib.cxx @@ -166,7 +166,7 @@ class ImportImageContainerFactory : public itk::ObjectFactoryBase static void RegisterOneFactory() { - ImportImageContainerFactory::Pointer factory = ImportImageContainerFactory::New(); + auto factory = ImportImageContainerFactory::New(); itk::ObjectFactoryBase::RegisterFactory(factory); } diff --git a/Modules/Core/Common/test/itkFileOutputWindowTest.cxx b/Modules/Core/Common/test/itkFileOutputWindowTest.cxx index 4c21791a602..88fa70a2c12 100644 --- a/Modules/Core/Common/test/itkFileOutputWindowTest.cxx +++ b/Modules/Core/Common/test/itkFileOutputWindowTest.cxx @@ -29,7 +29,7 @@ itkFileOutputWindowTest(int, char *[]) using myFileOutputWindow = itk::FileOutputWindow; // Create the filter - myFileOutputWindow::Pointer window = myFileOutputWindow::New(); + auto window = myFileOutputWindow::New(); // Test itkSetStringMacro const char * fileName = ""; diff --git a/Modules/Core/Common/test/itkFilterDispatchTest.cxx b/Modules/Core/Common/test/itkFilterDispatchTest.cxx index 6d741cc26b9..297ffc73b53 100644 --- a/Modules/Core/Common/test/itkFilterDispatchTest.cxx +++ b/Modules/Core/Common/test/itkFilterDispatchTest.cxx @@ -219,10 +219,10 @@ itkFilterDispatchTest(int, char *[]) using Filter5d = ExampleImageFilter; // Instantiate a filter of each dimension. - Filter2d::Pointer filter2d = Filter2d::New(); - Filter3d::Pointer filter3d = Filter3d::New(); - Filter4d::Pointer filter4d = Filter4d::New(); - Filter5d::Pointer filter5d = Filter5d::New(); + auto filter2d = Filter2d::New(); + auto filter3d = Filter3d::New(); + auto filter4d = Filter4d::New(); + auto filter5d = Filter5d::New(); // Try running each of the filters. If the wrong Execute() method is // invoked by one of these calls, a std::string() exception will be diff --git a/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx index 62e776d6a8c..f6d696d1b7f 100644 --- a/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFiniteCylinderSpatialFunctionTest.cxx @@ -31,7 +31,7 @@ itkFiniteCylinderSpatialFunctionTest(int, char *[]) using TCylinderFunctionVectorType = TCylinderFunctionType::InputType; // cylinder - TCylinderFunctionType::Pointer spatialFunc = TCylinderFunctionType::New(); + auto spatialFunc = TCylinderFunctionType::New(); double axis = 40.0; spatialFunc->SetAxisLength(axis); diff --git a/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx b/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx index 94f842901b7..0b2643e6b79 100644 --- a/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx +++ b/Modules/Core/Common/test/itkFloodFillIteratorTest.cxx @@ -40,7 +40,7 @@ itkFloodFillIteratorTest(int, char *[]) TImageType::PointValueType sourceImageOrigin[] = { 0, 0, 0 }; // Creates the sourceImage (but doesn't set the size or allocate memory) - TImageType::Pointer sourceImage = TImageType::New(); + auto sourceImage = TImageType::New(); sourceImage->SetOrigin(sourceImageOrigin); sourceImage->SetSpacing(sourceImageSpacing); @@ -82,7 +82,7 @@ itkFloodFillIteratorTest(int, char *[]) // Create and initialize a new sphere function - TFunctionType::Pointer spatialFunc = TFunctionType::New(); + auto spatialFunc = TFunctionType::New(); spatialFunc->SetRadius(5); TFunctionPositionType center; diff --git a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx index 140c3678e9c..d08453b695a 100644 --- a/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFloodFilledSpatialFunctionTest.cxx @@ -44,7 +44,7 @@ itkFloodFilledSpatialFunctionTest(int, char *[]) PointValueType sourceImageOrigin[] = { 0, 0 }; // Creates the sourceImage (but doesn't set the size or allocate memory) - ImageType::Pointer sourceImage = ImageType::New(); + auto sourceImage = ImageType::New(); sourceImage->SetOrigin(sourceImageOrigin); sourceImage->SetSpacing(sourceImageSpacing); @@ -87,7 +87,7 @@ itkFloodFilledSpatialFunctionTest(int, char *[]) using FunctionType = itk::SphereSpatialFunction; using FunctionPositionType = FunctionType::InputType; - FunctionType::Pointer spatialFunc = FunctionType::New(); + auto spatialFunc = FunctionType::New(); spatialFunc->SetRadius(1.0); FunctionPositionType center; diff --git a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx index 4b3ee35cd0f..21681c5dce4 100644 --- a/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkFrustumSpatialFunctionTest.cxx @@ -37,7 +37,7 @@ itkFrustumSpatialFunctionTest(int, char *[]) using FrustumSpatialFunctionType = itk::FrustumSpatialFunction; // Create the frustum spatial function - FrustumSpatialFunctionType::Pointer frustrumSpatialFunction = FrustumSpatialFunctionType::New(); + auto frustrumSpatialFunction = FrustumSpatialFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(frustrumSpatialFunction, FrustumSpatialFunction, InteriorExteriorSpatialFunction); diff --git a/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx index 2917112ebc3..62dc96607b1 100644 --- a/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkGaussianSpatialFunctionTest.cxx @@ -39,7 +39,7 @@ itkGaussianSpatialFunctionTest(int argc, char * argv[]) // Create and initialize the Spatial function - GaussianSpatialFunctionType::Pointer gaussianSpatialFunction = GaussianSpatialFunctionType::New(); + auto gaussianSpatialFunction = GaussianSpatialFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(gaussianSpatialFunction, GaussianSpatialFunction, SpatialFunction); diff --git a/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx index 8ef411232b3..b28332c8b87 100644 --- a/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkHeavisideStepFunctionTest1.cxx @@ -26,7 +26,7 @@ itkHeavisideStepFunctionTest1(int, char *[]) using HeavisideFunctionBaseType = itk::HeavisideStepFunction; - HeavisideFunctionBaseType::Pointer functionBase0 = HeavisideFunctionBaseType::New(); + auto functionBase0 = HeavisideFunctionBaseType::New(); std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); diff --git a/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx b/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx index 7f7bd13cc95..547e19852f3 100644 --- a/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx +++ b/Modules/Core/Common/test/itkImageAdaptorPipeLineTest.cxx @@ -90,7 +90,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) // Create and Initialize the RGBPixel image //------------------------------------------------------------- - myRGBPixelImageType::Pointer myRGBPixelImage = myRGBPixelImageType::New(); + auto myRGBPixelImage = myRGBPixelImageType::New(); myRGBPixelImage->SetLargestPossibleRegion(region); myRGBPixelImage->SetBufferedRegion(region); @@ -139,7 +139,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) // Create and Initialize the Float image //------------------------------------------------------------- - myFloatImageType::Pointer myFloatImage = myFloatImageType::New(); + auto myFloatImage = myFloatImageType::New(); myFloatImage->SetLargestPossibleRegion(region); myFloatImage->SetBufferedRegion(region); @@ -181,7 +181,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) // Create the adaptor and connect the image //------------------------------------------------------------- - myAdaptorType::Pointer myAdaptor = myAdaptorType::New(); + auto myAdaptor = myAdaptorType::New(); myAdaptor->SetImage(myRGBPixelImage); @@ -189,7 +189,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) // Create the filter and connect the inputs //------------------------------------------------------------- - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); filter->SetInput1(myAdaptor); filter->SetInput2(myFloatImage); @@ -243,7 +243,7 @@ itkImageAdaptorPipeLineTest(int, char *[]) //------------------------------------------------------------- // Test Graft() method //------------------------------------------------------------- - myAdaptorType::Pointer myGraftedAdaptor = myAdaptorType::New(); + auto myGraftedAdaptor = myAdaptorType::New(); myGraftedAdaptor->Graft(myAdaptor); if (myGraftedAdaptor->GetPixelContainer() != myAdaptor->GetPixelContainer()) { diff --git a/Modules/Core/Common/test/itkImageAlgorithmCopyTest.cxx b/Modules/Core/Common/test/itkImageAlgorithmCopyTest.cxx index c255b603fa4..44d9d28ef27 100644 --- a/Modules/Core/Common/test/itkImageAlgorithmCopyTest.cxx +++ b/Modules/Core/Common/test/itkImageAlgorithmCopyTest.cxx @@ -37,12 +37,12 @@ AverageTestCopy(typename TImage::SizeType & size) region.SetSize(size); region.SetIndex(index); - typename ImageType::Pointer inImage = ImageType::New(); + auto inImage = ImageType::New(); inImage->SetRegions(region); inImage->Allocate(); inImage->FillBuffer(12); - typename ImageType::Pointer outImage = ImageType::New(); + auto outImage = ImageType::New(); outImage->SetRegions(region); outImage->Allocate(); outImage->FillBuffer(12); diff --git a/Modules/Core/Common/test/itkImageAlgorithmCopyTest2.cxx b/Modules/Core/Common/test/itkImageAlgorithmCopyTest2.cxx index c9c5b3a5ab4..e590ca299d8 100644 --- a/Modules/Core/Common/test/itkImageAlgorithmCopyTest2.cxx +++ b/Modules/Core/Common/test/itkImageAlgorithmCopyTest2.cxx @@ -72,17 +72,17 @@ itkImageAlgorithmCopyTest2(int, char *[]) region.SetIndex(index); - Short3DImageType::Pointer image1 = Short3DImageType::New(); + auto image1 = Short3DImageType::New(); image1->SetRegions(region); image1->Allocate(); image1->FillBuffer(13); - Short3DImageType::Pointer image2 = Short3DImageType::New(); + auto image2 = Short3DImageType::New(); image2->SetRegions(region); image2->Allocate(true); // initialize buffer to zero - Float3DImageType::Pointer image3 = Float3DImageType::New(); + auto image3 = Float3DImageType::New(); image3->SetRegions(region); image3->Allocate(true); // initialize buffer to zero @@ -103,7 +103,7 @@ itkImageAlgorithmCopyTest2(int, char *[]) ITK_TEST_EXPECT_TRUE(CheckBuffer(image1.GetPointer(), 13)); - AbsImageType::Pointer absimage = AbsImageType::New(); + auto absimage = AbsImageType::New(); absimage->SetImage(image3); image2->FillBuffer(0); @@ -113,12 +113,12 @@ itkImageAlgorithmCopyTest2(int, char *[]) ITK_TEST_EXPECT_TRUE(CheckBuffer(image2.GetPointer(), 13)); - STDVectorImageType::Pointer image4 = STDVectorImageType::New(); + auto image4 = STDVectorImageType::New(); image4->SetRegions(region); image4->Allocate(); image4->FillBuffer(std::vector(10, 3.14)); - STDVectorImageType::Pointer image5 = STDVectorImageType::New(); + auto image5 = STDVectorImageType::New(); image5->SetRegions(region); image5->Allocate(); diff --git a/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx b/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx index e22366fe55e..3c872fa5ea7 100644 --- a/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageComputeOffsetAndIndexTest.cxx @@ -117,7 +117,7 @@ itkImageComputeOffsetAndIndexTest(int, char *[]) { \ using PixelType = char; \ using ImageType = itk::Image; \ - ImageType::Pointer myImage = ImageType::New(); \ + auto myImage = ImageType::New(); \ ImageType::SizeType size; \ ImageType::IndexType index; \ ImageType::RegionType region; \ @@ -149,7 +149,7 @@ itkImageComputeOffsetAndIndexTest(int, char *[]) { \ using PixelType = char; \ using ImageType = itk::Image; \ - ImageType::Pointer myImage = ImageType::New(); \ + auto myImage = ImageType::New(); \ ImageType::SizeType size; \ ImageType::IndexType index; \ ImageType::RegionType region; \ @@ -181,7 +181,7 @@ itkImageComputeOffsetAndIndexTest(int, char *[]) { \ using PixelType = char; \ using ImageType = itk::Image; \ - ImageType::Pointer myImage = ImageType::New(); \ + auto myImage = ImageType::New(); \ ImageType::SizeType size; \ ImageType::IndexType index; \ ImageType::RegionType region; \ @@ -208,7 +208,7 @@ itkImageComputeOffsetAndIndexTest(int, char *[]) { \ using PixelType = char; \ using ImageType = itk::Image; \ - ImageType::Pointer myImage = ImageType::New(); \ + auto myImage = ImageType::New(); \ ImageType::SizeType size; \ ImageType::IndexType index; \ ImageType::RegionType region; \ diff --git a/Modules/Core/Common/test/itkImageDuplicatorTest.cxx b/Modules/Core/Common/test/itkImageDuplicatorTest.cxx index b6f673673ac..80032a7a515 100644 --- a/Modules/Core/Common/test/itkImageDuplicatorTest.cxx +++ b/Modules/Core/Common/test/itkImageDuplicatorTest.cxx @@ -41,7 +41,7 @@ itkImageDuplicatorTest(int, char *[]) { /** Create an image image */ std::cout << "Creating simulated image: "; - ImageType::Pointer m_Image = ImageType::New(); + auto m_Image = ImageType::New(); m_Image->SetRegions(region); m_Image->Allocate(true); // initialize buffer to zero @@ -57,7 +57,7 @@ itkImageDuplicatorTest(int, char *[]) } using ShiftType = itk::ShiftScaleImageFilter; - ShiftType::Pointer shift = ShiftType::New(); + auto shift = ShiftType::New(); shift->SetInput(m_Image); shift->SetShift(0.0); shift->SetScale(1.0); @@ -68,7 +68,7 @@ itkImageDuplicatorTest(int, char *[]) // Test the duplicator std::cout << "Testing duplicator with float images: "; using DuplicatorType = itk::ImageDuplicator; - DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(duplicator, ImageDuplicator, Object); @@ -145,7 +145,7 @@ itkImageDuplicatorTest(int, char *[]) /** Create an RGB image image */ using RGBImageType = itk::Image, 3>; std::cout << "Creating simulated image: "; - RGBImageType::Pointer m_RGBImage = RGBImageType::New(); + auto m_RGBImage = RGBImageType::New(); m_RGBImage->SetRegions(region); m_RGBImage->Allocate(); @@ -188,7 +188,7 @@ itkImageDuplicatorTest(int, char *[]) std::cout << "Testing duplicator with RGB images: "; using RGBDuplicatorType = itk::ImageDuplicator; - RGBDuplicatorType::Pointer RGBduplicator = RGBDuplicatorType::New(); + auto RGBduplicator = RGBDuplicatorType::New(); RGBduplicator->SetInputImage(m_RGBImage); RGBduplicator->Update(); @@ -249,7 +249,7 @@ itkImageDuplicatorTest(int, char *[]) using PixelType = float; using VectorImageType = itk::VectorImage; - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); itk::VariableLengthVector f(VectorLength); for (unsigned int i = 0; i < VectorLength; ++i) { @@ -263,7 +263,7 @@ itkImageDuplicatorTest(int, char *[]) // Test the duplicator std::cout << "Testing duplicator with Vector images: "; using VectorDuplicatorType = itk::ImageDuplicator; - VectorDuplicatorType::Pointer Vectorduplicator = VectorDuplicatorType::New(); + auto Vectorduplicator = VectorDuplicatorType::New(); Vectorduplicator->SetInputImage(vectorImage); Vectorduplicator->Update(); diff --git a/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx b/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx index 7ee3df27876..680fd62dd30 100644 --- a/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx +++ b/Modules/Core/Common/test/itkImageDuplicatorTest2.cxx @@ -39,9 +39,9 @@ itkImageDuplicatorTest2(int argc, char * argv[]) using ImageType = itk::Image; using DuplicatorType = itk::ImageDuplicator; - DuplicatorType::Pointer dup = DuplicatorType::New(); + auto dup = DuplicatorType::New(); using AbsType = itk::AbsImageFilter; - AbsType::Pointer absF = AbsType::New(); + auto absF = AbsType::New(); try { diff --git a/Modules/Core/Common/test/itkImageFillBufferTest.cxx b/Modules/Core/Common/test/itkImageFillBufferTest.cxx index 9f097fda37c..d1e1b4f91bf 100644 --- a/Modules/Core/Common/test/itkImageFillBufferTest.cxx +++ b/Modules/Core/Common/test/itkImageFillBufferTest.cxx @@ -32,7 +32,7 @@ itkImageFillBufferTest(int argc, char * argv[]) } using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size[0] = (ImageType::SizeValueType)(std::stod(argv[1]) * 1024); diff --git a/Modules/Core/Common/test/itkImageIteratorsForwardBackwardTest.cxx b/Modules/Core/Common/test/itkImageIteratorsForwardBackwardTest.cxx index a82bde5cfe8..37243a6aabe 100644 --- a/Modules/Core/Common/test/itkImageIteratorsForwardBackwardTest.cxx +++ b/Modules/Core/Common/test/itkImageIteratorsForwardBackwardTest.cxx @@ -27,7 +27,7 @@ itkImageIteratorsForwardBackwardTest(int, char *[]) std::cout << "Creating an image" << std::endl; using ImageType = itk::Image; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::SizeType size; diff --git a/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx b/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx index c9301219902..4e545f6ce3c 100644 --- a/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageLinearIteratorTest.cxx @@ -31,7 +31,7 @@ itkImageLinearIteratorTest(int, char *[]) using ImageType = itk::Image; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::ConstPointer myConstImage = myImage; ImageType::SizeType size0; diff --git a/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx b/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx index 38589e99ead..eeb74a329ba 100644 --- a/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomConstIteratorWithOnlyIndexTest.cxx @@ -32,7 +32,7 @@ itkImageRandomConstIteratorWithOnlyIndexTest(int, char *[]) using ImageType = itk::Image; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::ConstPointer myConstImage = myImage; ImageType::SizeType size0; @@ -127,7 +127,7 @@ itkImageRandomConstIteratorWithOnlyIndexTest(int, char *[]) using ImageBaseType = itk::ImageBase; using ImageBaseRandomConstIteratorType = itk::ImageRandomConstIteratorWithOnlyIndex; - ImageBaseType::Pointer myImageBase = ImageBaseType::New(); + auto myImageBase = ImageBaseType::New(); myImageBase->CopyInformation(myImage); ImageBaseRandomConstIteratorType dor(myImageBase, region0); dor.SetNumberOfSamples(numberOfSamples); // 0=x, 1=y, 2=z diff --git a/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx b/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx index 1cce16ac8a9..5532a1c79a0 100644 --- a/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomIteratorTest.cxx @@ -32,7 +32,7 @@ itkImageRandomIteratorTest(int, char *[]) using ImageType = itk::Image; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::ConstPointer myConstImage = myImage; ImageType::SizeType size0; diff --git a/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx b/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx index f374a3fbc4f..eb565db2491 100644 --- a/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx +++ b/Modules/Core/Common/test/itkImageRandomIteratorTest2.cxx @@ -43,7 +43,7 @@ itkImageRandomIteratorTest2(int argc, char * argv[]) using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; @@ -92,7 +92,7 @@ itkImageRandomIteratorTest2(int argc, char * argv[]) using DifferenceFilterType = itk::Testing::ComparisonImageFilter; - DifferenceFilterType::Pointer difference = DifferenceFilterType::New(); + auto difference = DifferenceFilterType::New(); difference->SetValidInput(image); difference->SetTestInput(itk::ReadImage(argv[2])); @@ -100,7 +100,7 @@ itkImageRandomIteratorTest2(int argc, char * argv[]) difference->SetDifferenceThreshold(0); using DifferenceWriterType = itk::ImageFileWriter; - DifferenceWriterType::Pointer writer2 = DifferenceWriterType::New(); + auto writer2 = DifferenceWriterType::New(); writer2->SetInput(difference->GetOutput()); diff --git a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx index ea4be0290fa..b565dc2f19f 100644 --- a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest.cxx @@ -40,7 +40,7 @@ itkImageRandomNonRepeatingIteratorWithIndexTest(int, char *[]) using RandomConstIteratorType = itk::ImageRandomNonRepeatingConstIteratorWithIndex; std::cout << "Creating images" << std::endl; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::ConstPointer myConstImage = myImage; ImageType::SizeType size0; size0[0] = 50; @@ -57,7 +57,7 @@ itkImageRandomNonRepeatingIteratorWithIndexTest(int, char *[]) myImage->SetRequestedRegion(region0); myImage->Allocate(); // Make the priority image - PriorityImageType::Pointer priorityImage = PriorityImageType::New(); + auto priorityImage = PriorityImageType::New(); PriorityImageType::SizeType prioritySize; prioritySize[0] = 50; prioritySize[1] = 50; diff --git a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx index bd4b6904ea7..ddba306cde6 100644 --- a/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx +++ b/Modules/Core/Common/test/itkImageRandomNonRepeatingIteratorWithIndexTest2.cxx @@ -43,7 +43,7 @@ itkImageRandomNonRepeatingIteratorWithIndexTest2(int, char *[]) ImageType::RegionType region; region.SetIndex(start); region.SetSize(size); - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); myImage->SetLargestPossibleRegion(region); myImage->SetBufferedRegion(region); myImage->SetRequestedRegion(region); diff --git a/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx b/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx index 5f1c2832769..0aff9565f11 100644 --- a/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx +++ b/Modules/Core/Common/test/itkImageRegionExclusionIteratorWithIndexTest.cxx @@ -34,14 +34,14 @@ RunTest(const TRegion & region, const TRegion & exclusionRegion) using IndexImageType = itk::Image; using ValueImageType = itk::Image; - typename IndexImageType::Pointer myIndexImage = IndexImageType::New(); + auto myIndexImage = IndexImageType::New(); myIndexImage->SetLargestPossibleRegion(region); myIndexImage->SetBufferedRegion(region); myIndexImage->SetRequestedRegion(region); myIndexImage->Allocate(); - typename ValueImageType::Pointer myValueImage = ValueImageType::New(); + auto myValueImage = ValueImageType::New(); myValueImage->SetLargestPossibleRegion(region); myValueImage->SetBufferedRegion(region); diff --git a/Modules/Core/Common/test/itkImageRegionIteratorTest.cxx b/Modules/Core/Common/test/itkImageRegionIteratorTest.cxx index 79f315b9526..5893864c5cf 100644 --- a/Modules/Core/Common/test/itkImageRegionIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageRegionIteratorTest.cxx @@ -148,7 +148,7 @@ itkImageRegionIteratorTest(int, char *[]) TestImageType::RegionType imageRegion(imageCorner, imageSize); - TestImageType::Pointer image = TestImageType::New(); + auto image = TestImageType::New(); image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx b/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx index 383b3963de1..6e0707ecab5 100644 --- a/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageReverseIteratorTest.cxx @@ -54,7 +54,7 @@ itkImageReverseIteratorTest(int, char *[]) using ImageType = itk::Image; std::cout << "Creating an image" << std::endl; - ImageType::Pointer o3 = ImageType::New(); + auto o3 = ImageType::New(); float origin3D[3] = { 5.0f, 2.1f, 8.1f }; float spacing3D[3] = { 1.5f, 2.1f, 1.0f }; diff --git a/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx b/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx index 3c7c26c1988..b6a2ec20df4 100644 --- a/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx +++ b/Modules/Core/Common/test/itkImageScanlineIteratorTest1.cxx @@ -158,7 +158,7 @@ itkImageScanlineIteratorTest1(int, char *[]) TestImageType::RegionType imageRegion(imageCorner, imageSize); - TestImageType::Pointer image = TestImageType::New(); + auto image = TestImageType::New(); image->SetRegions(imageRegion); image->Allocate(); diff --git a/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx b/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx index e198490059a..0daa2f36e2a 100644 --- a/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx +++ b/Modules/Core/Common/test/itkImageSliceIteratorTest.cxx @@ -32,7 +32,7 @@ itkImageSliceIteratorTest(int, char *[]) using ImageType = itk::Image; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::SizeType size; diff --git a/Modules/Core/Common/test/itkImageTest.cxx b/Modules/Core/Common/test/itkImageTest.cxx index 19ca90525c4..3e9ccf65e87 100644 --- a/Modules/Core/Common/test/itkImageTest.cxx +++ b/Modules/Core/Common/test/itkImageTest.cxx @@ -49,7 +49,7 @@ itkImageTest(int, char *[]) { using Image = itk::Image; - Image::Pointer image = Image::New(); + auto image = Image::New(); Image::ConstPointer myconstptr = image; image->DebugOn(); const char * const knownStringName = "My First Image For Testing."; @@ -129,7 +129,7 @@ itkImageTest(int, char *[]) region.SetSize(size); image->SetRegions(region); - Image::Pointer imageRef = Image::New(); + auto imageRef = Image::New(); Image::SpacingType spacingRef; spacingRef.Fill(2); Image::PointType originRef; @@ -166,7 +166,7 @@ itkImageTest(int, char *[]) } using Image3D = itk::Image; - Image3D::Pointer volume = Image3D::New(); + auto volume = Image3D::New(); Image3D::SpacingType spacingVol; spacingVol.Fill(1); Image3D::PointType originVol; diff --git a/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx b/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx index 1e42f534798..e9d2294032b 100644 --- a/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx +++ b/Modules/Core/Common/test/itkImageToImageToleranceTest.cxx @@ -24,8 +24,8 @@ itkImageToImageToleranceTest(int, char *[]) { using ImageType = itk::Image; - ImageType::Pointer image1 = ImageType::New(); - ImageType::Pointer image2 = ImageType::New(); + auto image1 = ImageType::New(); + auto image2 = ImageType::New(); ImageType::SizeType size = { { 3, 3, 3 } }; image1->SetRegions(size); @@ -47,7 +47,7 @@ itkImageToImageToleranceTest(int, char *[]) using AddImageFilterType = itk::AddImageFilter; - AddImageFilterType::Pointer addImageFilter = AddImageFilterType::New(); + auto addImageFilter = AddImageFilterType::New(); addImageFilter->SetInput1(image1); addImageFilter->SetInput2(image2); bool exceptCaught = false; diff --git a/Modules/Core/Common/test/itkImageTransformTest.cxx b/Modules/Core/Common/test/itkImageTransformTest.cxx index 09390afba33..fe13cc12915 100644 --- a/Modules/Core/Common/test/itkImageTransformTest.cxx +++ b/Modules/Core/Common/test/itkImageTransformTest.cxx @@ -27,8 +27,8 @@ TestTransform() { using ImageType = itk::Image; - typename ImageType::Pointer image = ImageType::New(); - typename ImageType::Pointer orientedImage = ImageType::New(); + auto image = ImageType::New(); + auto orientedImage = ImageType::New(); typename ImageType::PointType origin; diff --git a/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx b/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx index c49f0ec4d13..21554dcc7ac 100644 --- a/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx +++ b/Modules/Core/Common/test/itkImageVectorOptimizerParametersHelperTest.cxx @@ -156,7 +156,7 @@ itkImageVectorOptimizerParametersHelperTest(int, char *[]) // Test setting an image of wrong type using BadImageType = itk::Image; - BadImageType::Pointer badImage = BadImageType::New(); + auto badImage = BadImageType::New(); ITK_TRY_EXPECT_EXCEPTION(params.SetParametersObject(badImage)); return result; diff --git a/Modules/Core/Common/test/itkImportContainerTest.cxx b/Modules/Core/Common/test/itkImportContainerTest.cxx index 44cfadf7b28..fd84d62949f 100644 --- a/Modules/Core/Common/test/itkImportContainerTest.cxx +++ b/Modules/Core/Common/test/itkImportContainerTest.cxx @@ -33,7 +33,7 @@ itkImportContainerTest(int, char *[]) PixelType * ptr1; { // Test 1: Create an empty container and print it - ContainerType::Pointer container1 = ContainerType::New(); + auto container1 = ContainerType::New(); container1->Print(std::cout); std::cout << "After New(), size is " << container1->Size() << ", capacity is " << container1->Capacity() << " and import pointer is " << container1->GetImportPointer() << std::endl; @@ -69,7 +69,7 @@ itkImportContainerTest(int, char *[]) auto * myPtr = new float[2000]; { // Test 1: Create an empty container and print it - ContainerType::Pointer container1 = ContainerType::New(); + auto container1 = ContainerType::New(); container1->Print(std::cout); std::cout << "After New(), size is " << container1->Size() << ", capacity is " << container1->Capacity() << " and import pointer is " << container1->GetImportPointer() << std::endl; @@ -122,7 +122,7 @@ itkImportContainerTest(int, char *[]) // Now repeat tests with ContainerManagesMemory true { // Test 1: Create an empty container and print it - ContainerType::Pointer container1 = ContainerType::New(); + auto container1 = ContainerType::New(); container1->Print(std::cout); std::cout << "After New(), size is " << container1->Size() << ", capacity is " << container1->Capacity() << " and import pointer is " << container1->GetImportPointer() << std::endl; @@ -159,7 +159,7 @@ itkImportContainerTest(int, char *[]) bool caughtException = false; try { - ContainerType::Pointer container1 = ContainerType::New(); + auto container1 = ContainerType::New(); container1->Reserve(itk::NumericTraits::max() / sizeof(PixelType)); } catch (const itk::ExceptionObject & err) diff --git a/Modules/Core/Common/test/itkImportImageTest.cxx b/Modules/Core/Common/test/itkImportImageTest.cxx index 84f5ac27532..e58f6779ac8 100644 --- a/Modules/Core/Common/test/itkImportImageTest.cxx +++ b/Modules/Core/Common/test/itkImportImageTest.cxx @@ -39,7 +39,7 @@ itkImportImageTest(int, char *[]) using ShortImage = itk::Image; // Create an ImportImageFilter filter - ImportImageFilter::Pointer basicImport = ImportImageFilter::New(); + auto basicImport = ImportImageFilter::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(basicImport, ImportImageFilter, ImageSource); diff --git a/Modules/Core/Common/test/itkIteratorTests.cxx b/Modules/Core/Common/test/itkIteratorTests.cxx index 06b3f0c9cbc..c9828c2070e 100644 --- a/Modules/Core/Common/test/itkIteratorTests.cxx +++ b/Modules/Core/Common/test/itkIteratorTests.cxx @@ -29,7 +29,7 @@ itkIteratorTests(int, char *[]) { std::cout << "Creating an image" << std::endl; using ScalarImage = itk::Image; - ScalarImage::Pointer o3 = ScalarImage::New(); + auto o3 = ScalarImage::New(); double origin3D[3] = { 5, 2.1, 8.1 }; double spacing3D[3] = { 1.5, 2.1, 1 }; diff --git a/Modules/Core/Common/test/itkLightObjectTest.cxx b/Modules/Core/Common/test/itkLightObjectTest.cxx index 895fa0ddc39..6ee9c6bf813 100644 --- a/Modules/Core/Common/test/itkLightObjectTest.cxx +++ b/Modules/Core/Common/test/itkLightObjectTest.cxx @@ -26,7 +26,7 @@ itkLightObjectTest(int, char *[]) using ObjectType = itk::LightObject; - ObjectType::Pointer light = ObjectType::New(); + auto light = ObjectType::New(); std::cout << "Light Object class name = "; std::cout << light->GetNameOfClass() << std::endl; diff --git a/Modules/Core/Common/test/itkLineIteratorTest.cxx b/Modules/Core/Common/test/itkLineIteratorTest.cxx index 368e8d18f46..fe08578b074 100644 --- a/Modules/Core/Common/test/itkLineIteratorTest.cxx +++ b/Modules/Core/Common/test/itkLineIteratorTest.cxx @@ -52,7 +52,7 @@ itkLineIteratorTest(int argc, char * argv[]) region.SetIndex(index); region.SetSize(size); - ImageType::Pointer output = ImageType::New(); + auto output = ImageType::New(); output->SetRegions(region); output->Allocate(true); // initialize buffer to zero diff --git a/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx b/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx index 612c8d6e2e1..50a5fa504ed 100644 --- a/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx +++ b/Modules/Core/Common/test/itkMersenneTwisterRandomVariateGeneratorTest.cxx @@ -35,7 +35,7 @@ itkMersenneTwisterRandomVariateGeneratorTest(int, char *[]) Twister::GetInstance()->SetSeed(seed); ITK_TEST_SET_GET_VALUE(seed, Twister::GetInstance()->GetSeed()); - Twister::Pointer twister = Twister::New(); + auto twister = Twister::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(twister, MersenneTwisterRandomVariateGenerator, RandomVariateGeneratorBase); diff --git a/Modules/Core/Common/test/itkMetaDataObjectTest.cxx b/Modules/Core/Common/test/itkMetaDataObjectTest.cxx index b42872da599..c95c0681c84 100644 --- a/Modules/Core/Common/test/itkMetaDataObjectTest.cxx +++ b/Modules/Core/Common/test/itkMetaDataObjectTest.cxx @@ -28,7 +28,7 @@ testMetaData(const TMetaData & value) using MetaDataObjectType = itk::MetaDataObject; - typename MetaDataObjectType::Pointer metaDataObject = MetaDataObjectType::New(); + auto metaDataObject = MetaDataObjectType::New(); metaDataObject->SetMetaDataObjectValue(value); if (itk::Math::NotExactlyEquals(metaDataObject->GetMetaDataObjectValue(), value)) diff --git a/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx b/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx index 7767c1d8629..4acc81ec409 100644 --- a/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx +++ b/Modules/Core/Common/test/itkMinimumMaximumImageCalculatorTest.cxx @@ -37,7 +37,7 @@ itkMinimumMaximumImageCalculatorTest(int, char *[]) std::cout << "Testing Minimum and Maximum Image Calulator:\n"; // Allocate a simple test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); image->SetLargestPossibleRegion(region); @@ -83,7 +83,7 @@ itkMinimumMaximumImageCalculatorTest(int, char *[]) image->SetPixel(maxIntensityValueIndex, maximum); // Create and initialize the calculator - MinMaxCalculatorType::Pointer calculator = MinMaxCalculatorType::New(); + auto calculator = MinMaxCalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, MinimumMaximumImageCalculator, Object); diff --git a/Modules/Core/Common/test/itkModifiedTimeTest.cxx b/Modules/Core/Common/test/itkModifiedTimeTest.cxx index 1de6d39c340..5004a442526 100644 --- a/Modules/Core/Common/test/itkModifiedTimeTest.cxx +++ b/Modules/Core/Common/test/itkModifiedTimeTest.cxx @@ -33,9 +33,9 @@ itkModifiedTimeTest(int, char *[]) q.Fill(0); r.Fill(0); - BoundingBox::Pointer bb = BoundingBox::New(); + auto bb = BoundingBox::New(); - PointsContainer::Pointer pc = PointsContainer::New(); + auto pc = PointsContainer::New(); pc->InsertElement(0, p); pc->InsertElement(1, q); diff --git a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx index 7a242b29558..26c4ea7e2c5 100644 --- a/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx +++ b/Modules/Core/Common/test/itkMultiThreaderParallelizeArrayTest.cxx @@ -67,8 +67,8 @@ itkMultiThreaderParallelizeArrayTest(int argc, char * argv[]) std::vector vec(size); using SomeProcessObject = itk::AbsImageFilter, itk::Image>; - SomeProcessObject::Pointer progressPO = SomeProcessObject::New(); - ShowProgress::Pointer showProgress = ShowProgress::New(); + auto progressPO = SomeProcessObject::New(); + auto showProgress = ShowProgress::New(); progressPO->AddObserver(itk::ProgressEvent(), showProgress); mt->ParallelizeArray( 1, size, [&vec](int i) { vec[i] = i; }, progressPO); diff --git a/Modules/Core/Common/test/itkMultiThreaderTypeFromEnvironmentTest.cxx b/Modules/Core/Common/test/itkMultiThreaderTypeFromEnvironmentTest.cxx index dcceabf97b9..57ce8d4089c 100644 --- a/Modules/Core/Common/test/itkMultiThreaderTypeFromEnvironmentTest.cxx +++ b/Modules/Core/Common/test/itkMultiThreaderTypeFromEnvironmentTest.cxx @@ -29,7 +29,7 @@ checkThreaderByName(ThreaderEnum expectedThreaderType) using ImageType = itk::Image; // any filter type which does not manually specify threader type will do using FilterType = itk::AbsImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::string realThreaderName = filter->GetMultiThreader()->GetNameOfClass(); std::string expectedThreaderName = diff --git a/Modules/Core/Common/test/itkNeighborhoodAlgorithmTest.cxx b/Modules/Core/Common/test/itkNeighborhoodAlgorithmTest.cxx index a965a0146f8..673a274c14a 100644 --- a/Modules/Core/Common/test/itkNeighborhoodAlgorithmTest.cxx +++ b/Modules/Core/Common/test/itkNeighborhoodAlgorithmTest.cxx @@ -106,7 +106,7 @@ NeighborhoodAlgorithmTest() RegionType region(ind, size); - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); diff --git a/Modules/Core/Common/test/itkObjectFactoryTest.cxx b/Modules/Core/Common/test/itkObjectFactoryTest.cxx index dfaf8da7cda..dbb94925bd2 100644 --- a/Modules/Core/Common/test/itkObjectFactoryTest.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryTest.cxx @@ -108,7 +108,7 @@ class TestFactory : public itk::ObjectFactoryBase static void RegisterOneFactory() { - TestFactory::Pointer factory = TestFactory::New(); + auto factory = TestFactory::New(); itk::ObjectFactoryBase::RegisterFactory(factory); } @@ -146,7 +146,7 @@ TestNewImage(myPointer v, const char * expectedClassName) int itkObjectFactoryTest(int, char *[]) { - TestFactory::Pointer factory = TestFactory::New(); + auto factory = TestFactory::New(); itk::ObjectFactoryBase::RegisterFactory(factory); // List all registered factories diff --git a/Modules/Core/Common/test/itkObjectFactoryTest2.cxx b/Modules/Core/Common/test/itkObjectFactoryTest2.cxx index d1c402f2fa1..c942bceb1ad 100644 --- a/Modules/Core/Common/test/itkObjectFactoryTest2.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryTest2.cxx @@ -46,7 +46,7 @@ MakeImage(const int count, T pixel) using RegionType = typename ImageType::RegionType; using SizeType = typename ImageType::SizeType; - typename ImageType::Pointer testImage = ImageType::New(); + auto testImage = ImageType::New(); IndexType index; index[0] = 0; @@ -72,7 +72,7 @@ ReallocateImage() using ImageType = itk::Image; using SizeType = ImageType::SizeType; - ImageType::Pointer testImage = ImageType::New(); + auto testImage = ImageType::New(); SizeType size = { { 5, 3 } }; diff --git a/Modules/Core/Common/test/itkObjectFactoryTest3.cxx b/Modules/Core/Common/test/itkObjectFactoryTest3.cxx index f2992978dfc..06058def64d 100644 --- a/Modules/Core/Common/test/itkObjectFactoryTest3.cxx +++ b/Modules/Core/Common/test/itkObjectFactoryTest3.cxx @@ -63,7 +63,7 @@ class TestFactory3 : public itk::ObjectFactoryBase static void RegisterOneFactory() { - TestFactory3::Pointer factory = TestFactory3::New(); + auto factory = TestFactory3::New(); itk::ObjectFactoryBase::RegisterFactory(factory); } @@ -127,13 +127,13 @@ ListRegisteredFactories(const std::string & TestName, const DescriptionListType int itkObjectFactoryTest3(int, char *[]) { - TestFactory3::Pointer factory1 = TestFactory3::New(); - TestFactory3::Pointer factory2 = TestFactory3::New(); - TestFactory3::Pointer factory3 = TestFactory3::New(); - TestFactory3::Pointer factory4 = TestFactory3::New(); - TestFactory3::Pointer factory5 = TestFactory3::New(); - TestFactory3::Pointer factory6 = TestFactory3::New(); - TestFactory3::Pointer factory7 = TestFactory3::New(); + auto factory1 = TestFactory3::New(); + auto factory2 = TestFactory3::New(); + auto factory3 = TestFactory3::New(); + auto factory4 = TestFactory3::New(); + auto factory5 = TestFactory3::New(); + auto factory6 = TestFactory3::New(); + auto factory7 = TestFactory3::New(); factory1->SetDescription("factory1"); factory2->SetDescription("factory2"); diff --git a/Modules/Core/Common/test/itkOctreeTest.cxx b/Modules/Core/Common/test/itkOctreeTest.cxx index e9d9a824724..19edc025613 100644 --- a/Modules/Core/Common/test/itkOctreeTest.cxx +++ b/Modules/Core/Common/test/itkOctreeTest.cxx @@ -44,7 +44,7 @@ itkOctreeTest(int, char *[]) ImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); img->SetLargestPossibleRegion(region); img->SetBufferedRegion(region); img->SetRequestedRegion(region); @@ -73,7 +73,7 @@ itkOctreeTest(int, char *[]) } using OctreeType = itk::Octree>; - OctreeType::Pointer octree = OctreeType::New(); + auto octree = OctreeType::New(); octree->BuildFromImage(img); ImageType::Pointer output = octree->GetImage(); itk::ImageRegionIterator ri2(output, region); diff --git a/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx index b0072bca1f4..44e6df5df5f 100644 --- a/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx @@ -121,17 +121,17 @@ int itkPeriodicBoundaryConditionTest(int, char *[]) { // Test an image to cover one operator() method. - ImageType::Pointer image = ImageType::New(); - RegionType imageRegion; - SizeType imageSize = { { 5, 5 } }; - IndexType imageIndex = { { 0, 0 } }; + auto image = ImageType::New(); + RegionType imageRegion; + SizeType imageSize = { { 5, 5 } }; + IndexType imageIndex = { { 0, 0 } }; imageRegion.SetSize(imageSize); imageRegion.SetIndex(imageIndex); image->SetRegions(imageRegion); image->Allocate(); // Test a vector image to cover the other operator() method. - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); vectorImage->SetRegions(imageRegion); vectorImage->SetNumberOfComponentsPerPixel(1); vectorImage->Allocate(); diff --git a/Modules/Core/Common/test/itkPhasedArray3DSpecialCoordinatesImageTest.cxx b/Modules/Core/Common/test/itkPhasedArray3DSpecialCoordinatesImageTest.cxx index 357db0bdf2c..dc1899e5dbf 100644 --- a/Modules/Core/Common/test/itkPhasedArray3DSpecialCoordinatesImageTest.cxx +++ b/Modules/Core/Common/test/itkPhasedArray3DSpecialCoordinatesImageTest.cxx @@ -32,7 +32,7 @@ itkPhasedArray3DSpecialCoordinatesImageTest(int, char *[]) using IndexType = Image::IndexType; using ContinuousIndexType = itk::ContinuousIndex; - Image::Pointer image = Image::New(); + auto image = Image::New(); // image->DebugOn(); // image->GetSource(); SizeType size; @@ -93,7 +93,7 @@ itkPhasedArray3DSpecialCoordinatesImageTest(int, char *[]) } using WindowedSincInterpolatorType = itk::WindowedSincInterpolateImageFunction; - WindowedSincInterpolatorType::Pointer interpolator = WindowedSincInterpolatorType::New(); + auto interpolator = WindowedSincInterpolatorType::New(); interpolator->SetInputImage(image); std::cout << std::endl; diff --git a/Modules/Core/Common/test/itkPointGeometryTest.cxx b/Modules/Core/Common/test/itkPointGeometryTest.cxx index d80320d3c44..0fa699d621a 100644 --- a/Modules/Core/Common/test/itkPointGeometryTest.cxx +++ b/Modules/Core/Common/test/itkPointGeometryTest.cxx @@ -266,7 +266,7 @@ itkPointGeometryTest(int, char *[]) PointType combination; constexpr unsigned int NP = 3; using VectorOfPoints = itk::VectorContainer; - VectorOfPoints::Pointer points = VectorOfPoints::New(); + auto points = VectorOfPoints::New(); points->Reserve(NP); constexpr double K = 12.0; diff --git a/Modules/Core/Common/test/itkPriorityQueueTest.cxx b/Modules/Core/Common/test/itkPriorityQueueTest.cxx index bf2917543ae..7a316675ec5 100644 --- a/Modules/Core/Common/test/itkPriorityQueueTest.cxx +++ b/Modules/Core/Common/test/itkPriorityQueueTest.cxx @@ -28,12 +28,12 @@ itkPriorityQueueTest(int, char *[]) using MaxPQElementType = itk::MaxPriorityQueueElementWrapper; using MinPQType = itk::PriorityQueueContainer; - MinPQType::Pointer min_priority_queue = MinPQType::New(); + auto min_priority_queue = MinPQType::New(); std::cout << min_priority_queue->GetNameOfClass() << std::endl; using MaxPQType = itk::PriorityQueueContainer; - MaxPQType::Pointer max_priority_queue = MaxPQType::New(); + auto max_priority_queue = MaxPQType::New(); std::list sequence; sequence.push_back(-0.1); diff --git a/Modules/Core/Common/test/itkSTLContainerAdaptorTest.cxx b/Modules/Core/Common/test/itkSTLContainerAdaptorTest.cxx index 442936a2121..87b4366a1f4 100644 --- a/Modules/Core/Common/test/itkSTLContainerAdaptorTest.cxx +++ b/Modules/Core/Common/test/itkSTLContainerAdaptorTest.cxx @@ -39,7 +39,7 @@ itkSTLContainerAdaptorTest(int, char *[]) using VectorContainerType = itk::VectorContainer; - VectorContainerType::Pointer vectorContainer = VectorContainerType::New(); + auto vectorContainer = VectorContainerType::New(); using STLVectorType = std::vector; @@ -162,7 +162,7 @@ itkSTLContainerAdaptorTest(int, char *[]) std::cout << "Testing the MapContainer " << std::endl; - MapContainerType::Pointer mapContainer = MapContainerType::New(); + auto mapContainer = MapContainerType::New(); using STLMapType = std::map; STLMapType mapSource; diff --git a/Modules/Core/Common/test/itkSimpleFilterWatcherTest.cxx b/Modules/Core/Common/test/itkSimpleFilterWatcherTest.cxx index 97585cced68..de15947676e 100644 --- a/Modules/Core/Common/test/itkSimpleFilterWatcherTest.cxx +++ b/Modules/Core/Common/test/itkSimpleFilterWatcherTest.cxx @@ -92,8 +92,8 @@ itkSimpleFilterWatcherTest(int, char *[]) using WatcherType = itk::SimpleFilterWatcher; using ImageType = itk::Image; using FilterType = itk::TanHelperImageFilter; - FilterType::Pointer filter = FilterType::New(); - const char * comment = "comment"; + auto filter = FilterType::New(); + const char * comment = "comment"; // Test constructor that takes a ProcessObject. WatcherType watcher1(filter, comment); diff --git a/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx b/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx index 963bcad61ee..cfc89317cd1 100644 --- a/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx +++ b/Modules/Core/Common/test/itkSinRegularizedHeavisideStepFunctionTest1.cxx @@ -27,7 +27,7 @@ itkSinRegularizedHeavisideStepFunctionTest1(int, char *[]) using HeavisideFunctionBaseType = itk::SinRegularizedHeavisideStepFunction; - HeavisideFunctionBaseType::Pointer functionBase0 = HeavisideFunctionBaseType::New(); + auto functionBase0 = HeavisideFunctionBaseType::New(); std::cout << "GetNameOfClass() = " << functionBase0->GetNameOfClass() << std::endl; functionBase0->Print(std::cout); diff --git a/Modules/Core/Common/test/itkSmartPointerGTest.cxx b/Modules/Core/Common/test/itkSmartPointerGTest.cxx index 1e66d72ab45..6a14f0914dd 100644 --- a/Modules/Core/Common/test/itkSmartPointerGTest.cxx +++ b/Modules/Core/Common/test/itkSmartPointerGTest.cxx @@ -144,7 +144,7 @@ TEST(SmartPointer, EmptyAndNull) // EXPECT_TRUE( 0 == ptr ); // Excercise pointer assignment - Derived2::Pointer p1 = Derived2::New(); + auto p1 = Derived2::New(); Derived2::Pointer p2 = p1; Derived2::ConstPointer cp1 = p1; Derived2::ConstPointer cp2(p1); diff --git a/Modules/Core/Common/test/itkSmartPointerTest.cxx b/Modules/Core/Common/test/itkSmartPointerTest.cxx index f47ca4948b1..e3db43c4477 100644 --- a/Modules/Core/Common/test/itkSmartPointerTest.cxx +++ b/Modules/Core/Common/test/itkSmartPointerTest.cxx @@ -127,13 +127,13 @@ itkSmartPointerTest(int, char *[]) std::cout << "second test" << std::endl; { - itkTestObject::Pointer o1 = itkTestObject::New(); + auto o1 = itkTestObject::New(); std::cout << "o1 " << &o1 << std::endl; - itkTestObject::Pointer o2 = itkTestObject::New(); + auto o2 = itkTestObject::New(); std::cout << "o2 " << &o2 << std::endl; - itkTestObject::Pointer o3 = itkTestObject::New(); + auto o3 = itkTestObject::New(); std::cout << "o3 " << &o3 << std::endl; - itkTestObject::Pointer o4 = itkTestObject::New(); + auto o4 = itkTestObject::New(); std::cout << "o4 " << &o4 << std::endl; o1 = o2; @@ -157,7 +157,7 @@ itkSmartPointerTest(int, char *[]) std::cout << "first test" << std::endl; { - itkTestObject::Pointer o1 = itkTestObject::New(); + auto o1 = itkTestObject::New(); if (o1.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Core/Common/test/itkSparseImageTest.cxx b/Modules/Core/Common/test/itkSparseImageTest.cxx index 3c137c915ea..38220452bf8 100644 --- a/Modules/Core/Common/test/itkSparseImageTest.cxx +++ b/Modules/Core/Common/test/itkSparseImageTest.cxx @@ -46,10 +46,10 @@ itkSparseImageTest(int, char *[]) using SparseImageType = itk::SparseImage; using ImageType = SparseImageType::Superclass; - SparseImageType::Pointer im = SparseImageType::New(); - ImageType::RegionType r; - ImageType::SizeType sz = { { 24, 24 } }; - ImageType::IndexType idx = { { 0, 0 } }; + auto im = SparseImageType::New(); + ImageType::RegionType r; + ImageType::SizeType sz = { { 24, 24 } }; + ImageType::IndexType idx = { { 0, 0 } }; r.SetSize(sz); r.SetIndex(idx); diff --git a/Modules/Core/Common/test/itkSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkSpatialFunctionTest.cxx index b510b755507..cac87636e9f 100644 --- a/Modules/Core/Common/test/itkSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkSpatialFunctionTest.cxx @@ -34,7 +34,7 @@ itkSpatialFunctionTest(int, char *[]) // Create and initialize a new sphere function - TFunctionType::Pointer spatialFunc = TFunctionType::New(); + auto spatialFunc = TFunctionType::New(); spatialFunc->SetRadius(5); TFunctionPositionType center; diff --git a/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx b/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx index 98a3d05bb87..a83a135622c 100644 --- a/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx +++ b/Modules/Core/Common/test/itkStreamingImageFilterTest.cxx @@ -31,7 +31,7 @@ itkStreamingImageFilterTest(int, char *[]) using ShortImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer if2 = ShortImage::New(); + auto if2 = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx b/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx index 0e5f50b3896..59a58837a1d 100644 --- a/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx +++ b/Modules/Core/Common/test/itkStreamingImageFilterTest2.cxx @@ -36,7 +36,7 @@ itkStreamingImageFilterTest2(int, char *[]) using ShortImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer if2 = ShortImage::New(); + auto if2 = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Core/Common/test/itkStreamingImageFilterTest3.cxx b/Modules/Core/Common/test/itkStreamingImageFilterTest3.cxx index c19b84487ef..a5f2876e03f 100644 --- a/Modules/Core/Common/test/itkStreamingImageFilterTest3.cxx +++ b/Modules/Core/Common/test/itkStreamingImageFilterTest3.cxx @@ -45,11 +45,11 @@ itkStreamingImageFilterTest3(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFilename); using SomeFilter = itk::ShiftScaleImageFilter; - SomeFilter::Pointer filter = SomeFilter::New(); + auto filter = SomeFilter::New(); filter->SetInput(reader->GetOutput()); // monitor what's going on diff --git a/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx b/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx index 83e28338139..45e299e1a95 100644 --- a/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest.cxx @@ -33,7 +33,7 @@ itkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest(int, char *[]) using TSymEllipsoidFunctionVectorType = TSymEllipsoidFunctionType::InputType; // Create an ellipsoid spatial function for the source image - TSymEllipsoidFunctionType::Pointer spatialFunc = TSymEllipsoidFunctionType::New(); + auto spatialFunc = TSymEllipsoidFunctionType::New(); // Define function doitkSymmetricEllipsoidInteriorExteriorSpatialFunctionTest, which encapsulates ellipsoid. int xExtent = 50; diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx index e6bc4be7051..7d128b14d8c 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageReadTest.cxx @@ -36,7 +36,7 @@ itkSymmetricSecondRankTensorImageReadTest(int ac, char * av[]) using MatrixPixelType = itk::Matrix; using MatrixImageType = itk::Image; - MatrixImageType::Pointer matrixImage = MatrixImageType::New(); + auto matrixImage = MatrixImageType::New(); MatrixImageType::SizeType size; size.Fill(10); diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx index 69036516b15..818f16fe857 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorImageWriteReadTest.cxx @@ -34,7 +34,7 @@ itkSymmetricSecondRankTensorImageWriteReadTest(int ac, char * av[]) using TensorPixelType = itk::SymmetricSecondRankTensor; using TensorImageType = itk::Image; - TensorImageType::Pointer tensorImageInput = TensorImageType::New(); + auto tensorImageInput = TensorImageType::New(); TensorImageType::SizeType size; size.Fill(10); diff --git a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx index 3713262cde9..e64c1ac39bc 100644 --- a/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx +++ b/Modules/Core/Common/test/itkSymmetricSecondRankTensorTest.cxx @@ -140,7 +140,7 @@ itkSymmetricSecondRankTensorTest(int, char *[]) using PixelType = Float3DTensorType; using ImageType = itk::Image; - ImageType::Pointer dti = ImageType::New(); + auto dti = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; diff --git a/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest2.cxx b/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest2.cxx index 1bef96d7b1c..a719d5ab1fd 100644 --- a/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest2.cxx +++ b/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest2.cxx @@ -267,7 +267,7 @@ itkThreadedIteratorRangePartitionerTest2(int, char *[]) using DomainType = IteratorRangeDomainThreaderAssociate::TestDomainThreader::DomainType; using DomainContainerType = IteratorRangeDomainThreaderAssociate::DomainContainerType; - DomainContainerType::Pointer container = DomainContainerType::New(); + auto container = DomainContainerType::New(); container->Reserve(ITK_DEFAULT_MAX_THREADS + 110); for (unsigned int i = 0; i < ITK_DEFAULT_MAX_THREADS + 110; ++i) diff --git a/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest3.cxx b/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest3.cxx index e5b739fc2be..494f1e1b48f 100644 --- a/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest3.cxx +++ b/Modules/Core/Common/test/itkThreadedIteratorRangePartitionerTest3.cxx @@ -267,7 +267,7 @@ itkThreadedIteratorRangePartitionerTest3(int, char *[]) using DomainType = IteratorRangeDomainThreaderAssociate::TestDomainThreader::DomainType; using DomainContainerType = IteratorRangeDomainThreaderAssociate::DomainContainerType; - DomainContainerType::Pointer container = DomainContainerType::New(); + auto container = DomainContainerType::New(); for (unsigned int i = 0; i < ITK_DEFAULT_MAX_THREADS + 10; ++i) { diff --git a/Modules/Core/Common/test/itkTimeProbesTest.cxx b/Modules/Core/Common/test/itkTimeProbesTest.cxx index a302e21bf44..301ca3b71a7 100644 --- a/Modules/Core/Common/test/itkTimeProbesTest.cxx +++ b/Modules/Core/Common/test/itkTimeProbesTest.cxx @@ -121,8 +121,8 @@ itkTimeProbesTest(int, char *[]) using Image3DType = itk::Image; - Image3DType::Pointer image3D = Image3DType::New(); - Image3DType::Pointer orientedImage3D = Image3DType::New(); + auto image3D = Image3DType::New(); + auto orientedImage3D = Image3DType::New(); using Region3DType = itk::ImageRegion<3>; using Size3DType = Region3DType::SizeType; diff --git a/Modules/Core/Common/test/itkVectorMultiplyTest.cxx b/Modules/Core/Common/test/itkVectorMultiplyTest.cxx index 4f128f18a90..3d565120a6d 100644 --- a/Modules/Core/Common/test/itkVectorMultiplyTest.cxx +++ b/Modules/Core/Common/test/itkVectorMultiplyTest.cxx @@ -27,8 +27,8 @@ itkVectorMultiplyTest(int, char *[]) VecImageType::SizeType size; size[0] = size[1] = size[2] = 2; - VecImageType::Pointer images[2]; - MultFilterType::Pointer mult = MultFilterType::New(); + VecImageType::Pointer images[2]; + auto mult = MultFilterType::New(); for (unsigned int i = 0; i < 2; ++i) { images[i] = VecImageType::New(); diff --git a/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx b/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx index 9caea4b4d07..f21563bbdbf 100644 --- a/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx +++ b/Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx @@ -122,17 +122,17 @@ int itkZeroFluxBoundaryConditionTest(int, char *[]) { // Test an image to cover one operator() method. - ImageType::Pointer image = ImageType::New(); - RegionType imageRegion; - SizeType imageSize = { { 5, 5 } }; - IndexType imageIndex = { { 0, 0 } }; + auto image = ImageType::New(); + RegionType imageRegion; + SizeType imageSize = { { 5, 5 } }; + IndexType imageIndex = { { 0, 0 } }; imageRegion.SetSize(imageSize); imageRegion.SetIndex(imageIndex); image->SetRegions(imageRegion); image->Allocate(); // Test a vector image to cover the other operator() method. - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); vectorImage->SetRegions(imageRegion); vectorImage->SetNumberOfComponentsPerPixel(1); vectorImage->Allocate(); diff --git a/Modules/Core/GPUCommon/include/itkGPUImage.h b/Modules/Core/GPUCommon/include/itkGPUImage.h index c6fc265424f..7559cb91399 100644 --- a/Modules/Core/GPUCommon/include/itkGPUImage.h +++ b/Modules/Core/GPUCommon/include/itkGPUImage.h @@ -244,7 +244,7 @@ class ITK_TEMPLATE_EXPORT GPUImageFactory : public itk::ObjectFactoryBase static void RegisterOneFactory() { - GPUImageFactory::Pointer factory = GPUImageFactory::New(); + auto factory = GPUImageFactory::New(); itk::ObjectFactoryBase::RegisterFactory(factory); } diff --git a/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx index 66b4f4632c5..cee76116188 100644 --- a/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkComplexConjugateImageAdaptorTest.cxx @@ -28,7 +28,7 @@ int itkComplexConjugateImageAdaptorTest(int, char *[]) { // Create a test image. - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size = { { 10, 10 } }; image->SetRegions(size); image->Allocate(); @@ -47,7 +47,7 @@ itkComplexConjugateImageAdaptorTest(int, char *[]) image->FillBuffer(PixelType(2.0, -3.7)); // Create adaptor. - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetImage(image); // Iterate over the pixels and check the functioning of the adaptor. diff --git a/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx index 5810c628f3b..0f1ba2f499c 100644 --- a/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkImageAdaptorTest.cxx @@ -69,7 +69,7 @@ itkImageAdaptorTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - myImageType::Pointer myImage = myImageType::New(); + auto myImage = myImageType::New(); myImage->SetLargestPossibleRegion(region); @@ -103,7 +103,7 @@ itkImageAdaptorTest(int, char *[]) ++it1; } - myRedAdaptorType::Pointer myAdaptor = myRedAdaptorType::New(); + auto myAdaptor = myRedAdaptorType::New(); myAdaptor->SetImage(myImage); diff --git a/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx b/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx index d3009a86f39..8f3ca0f636f 100644 --- a/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkNthElementPixelAccessorTest.cxx @@ -67,7 +67,7 @@ itkNthElementPixelAccessorTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - myImageType::Pointer myImage = myImageType::New(); + auto myImage = myImageType::New(); myImage->SetLargestPossibleRegion(region); myImage->SetBufferedRegion(region); @@ -99,7 +99,7 @@ itkNthElementPixelAccessorTest(int, char *[]) ++it1; } - myNthAdaptorType::Pointer myAdaptor = myNthAdaptorType::New(); + auto myAdaptor = myNthAdaptorType::New(); myAdaptor->SetImage(myImage); myNthAccessorType myNthAccessor; diff --git a/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx index 6263a54f8c5..1c7f15c014d 100644 --- a/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkRGBToVectorImageAdaptorTest.cxx @@ -68,7 +68,7 @@ itkRGBToVectorImageAdaptorTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetLargestPossibleRegion(region); @@ -104,7 +104,7 @@ itkRGBToVectorImageAdaptorTest(int, char *[]) ++it1; } - ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); + auto adaptor = ImageAdaptorType::New(); adaptor->SetImage(image); diff --git a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx index a2c096123de..cd2e6d2c794 100644 --- a/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkVectorImageTest.cxx @@ -157,7 +157,7 @@ testVectorImageBasicMethods() std::cout << "Testing Get/SetPixel methods." << std::endl; - typename VectorImageType::Pointer image = VectorImageType::New(); + auto image = VectorImageType::New(); typename VectorImageType::SizeType size = { { 11, 9, 7 } }; typename VectorImageType::RegionType region; region.SetSize(size); @@ -252,7 +252,7 @@ testVectorImageBasicMethods() std::cout << "Testing Get/SetPixel methods [PASSED]" << std::endl; // test Graft method - typename VectorImageType::Pointer imageGraft = VectorImageType::New(); + auto imageGraft = VectorImageType::New(); imageGraft->Graft(image); ITK_TEST_EXPECT_EQUAL(image->GetPixelContainer(), imageGraft->GetPixelContainer()); @@ -294,7 +294,7 @@ itkVectorImageTest(int, char * argv[]) itk::TimeProbe clock; clock.Start(); - VariableLengthVectorImageType::Pointer image = VariableLengthVectorImageType::New(); + auto image = VariableLengthVectorImageType::New(); VariableLengthVectorImageType::IndexType start; InternalPixelType f(VectorLength); VariableLengthVectorImageType::SizeType size; @@ -340,7 +340,7 @@ itkVectorImageTest(int, char * argv[]) using InternalPixelType = itk::FixedArray; - FixedArrayImageType::Pointer image = FixedArrayImageType::New(); + auto image = FixedArrayImageType::New(); FixedArrayImageType::IndexType start; InternalPixelType f; FixedArrayImageType::SizeType size; @@ -399,7 +399,7 @@ itkVectorImageTest(int, char * argv[]) itk::TimeProbe clock; clock.Start(); - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); VectorImageType::IndexType start; itk::VariableLengthVector f(VectorLength); VectorImageType::SizeType size; @@ -442,7 +442,7 @@ itkVectorImageTest(int, char * argv[]) const unsigned int componentToExtract = 2 * (Dimension - 1); using VectorImageToImageAdaptorType = itk::VectorImageToImageAdaptor; - VectorImageToImageAdaptorType::Pointer vectorImageToImageAdaptor = VectorImageToImageAdaptorType::New(); + auto vectorImageToImageAdaptor = VectorImageToImageAdaptorType::New(); vectorImageToImageAdaptor->SetExtractComponentIndex(componentToExtract); if (vectorImageToImageAdaptor->GetExtractComponentIndex() != componentToExtract) { @@ -457,7 +457,7 @@ itkVectorImageTest(int, char * argv[]) failed = true; } using NthElementImageAdaptorType = itk::NthElementImageAdaptor; - NthElementImageAdaptorType::Pointer nthElementImageAdaptor = NthElementImageAdaptorType::New(); + auto nthElementImageAdaptor = NthElementImageAdaptorType::New(); nthElementImageAdaptor->SelectNthElement(componentToExtract); adaptorTestResult = testVectorImageAdaptor( nthElementImageAdaptor, vectorImage, region, componentToExtract); @@ -470,7 +470,7 @@ itkVectorImageTest(int, char * argv[]) // Test with Region and Linear iterators... { // Create a small image - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); VectorImageType::IndexType start; itk::VariableLengthVector f(VectorLength); itk::VariableLengthVector ZeroPixel(VectorLength); @@ -592,7 +592,7 @@ itkVectorImageTest(int, char * argv[]) // Create an image using itk::Vector using VectorPixelType = itk::Vector; using VectorImageType = itk::Image, Dimension>; - VectorImageType::Pointer image = VectorImageType::New(); + auto image = VectorImageType::New(); VectorImageType::IndexType start; start.Fill(0); VectorImageType::SizeType size; @@ -618,7 +618,7 @@ itkVectorImageTest(int, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(argv[2]); writer->Update(); @@ -631,7 +631,7 @@ itkVectorImageTest(int, char * argv[]) // Now read it as a itk::VectorImage. using VectorImageType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -675,7 +675,7 @@ itkVectorImageTest(int, char * argv[]) // Now read it as a itk::VectorImage. using VectorImageType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); diff --git a/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx b/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx index a8e8c475560..04c2d39b871 100644 --- a/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx +++ b/Modules/Core/ImageAdaptors/test/itkVectorImageToImageAdaptorTest.cxx @@ -40,7 +40,7 @@ itkVectorImageToImageAdaptorTest(int, char *[]) using VectorImageToImageAdaptorType = itk::VectorImageToImageAdaptor; // initialize a vector image - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); VectorImageType::IndexType start; itk::VariableLengthVector f(VectorLength); VectorImageType::SizeType size; @@ -61,7 +61,7 @@ itkVectorImageToImageAdaptorTest(int, char *[]) // run the adaptor - VectorImageToImageAdaptorType::Pointer vectorImageToImageAdaptor = VectorImageToImageAdaptorType::New(); + auto vectorImageToImageAdaptor = VectorImageToImageAdaptorType::New(); vectorImageToImageAdaptor->SetExtractComponentIndex(componentToExtract); vectorImageToImageAdaptor->SetImage(vectorImage); diff --git a/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx index 131bb1968e4..b7caf725c6b 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineDecompositionImageFilterTest.cxx @@ -96,7 +96,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) ImageType::ConstPointer randImage = interpolator->GetInputImage(); using FilterType = itk::BSplineDecompositionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineDecompositionImageFilter, ImageToImageFilter); @@ -146,7 +146,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) // Set up a BSplineResampleImageFunction. using ResampleFunctionType = itk::BSplineResampleImageFunction; - ResampleFunctionType::Pointer resample = ResampleFunctionType::New(); + auto resample = ResampleFunctionType::New(); resample->SetSplineOrder(interpolator->GetSplineOrder()); resample->SetInputImage(filter->GetOutput()); @@ -191,7 +191,7 @@ itkBSplineDecompositionImageFilterTest(int argc, char * argv[]) using ComplexPixelType = std::complex; using ComplexImageType = itk::Image; using ComplexFilterType = itk::BSplineDecompositionImageFilter; - ComplexFilterType::Pointer complexFilter = ComplexFilterType::New(); + auto complexFilter = ComplexFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineDecompositionImageFilter, ImageToImageFilter); diff --git a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx index 38e8a6b5b17..ff0677eecfd 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineInterpolateImageFunctionTest.cxx @@ -262,7 +262,7 @@ test1DCubicSpline() image->SetSpacing(spacing); // Create and initialize the interpolator - InterpolatorType1D::Pointer interp = InterpolatorType1D::New(); + auto interp = InterpolatorType1D::New(); interp->SetInputImage(image); interp->Print(std::cout); @@ -324,7 +324,7 @@ test2DSpline() /* Create and initialize the interpolator */ for (unsigned int splineOrder = 0; splineOrder <= 5; ++splineOrder) { - InterpolatorType2D::Pointer interp = InterpolatorType2D::New(); + auto interp = InterpolatorType2D::New(); interp->SetSplineOrder(splineOrder); std::cout << "SplineOrder: " << interp->GetSplineOrder() << std::endl; @@ -396,7 +396,7 @@ test3DSpline() /* Create and initialize the interpolator */ for (int splineOrder = 2; splineOrder <= 5; ++splineOrder) { - InterpolatorType3D::Pointer interp = InterpolatorType3D::New(); + auto interp = InterpolatorType3D::New(); interp->SetSplineOrder(splineOrder); interp->SetInputImage(image); interp->Print(std::cout); @@ -467,7 +467,7 @@ test3DSplineDerivative() /* Create and initialize the interpolator */ for (int splineOrder = 1; splineOrder <= 5; ++splineOrder) { - InterpolatorType3D::Pointer interp = InterpolatorType3D::New(); + auto interp = InterpolatorType3D::New(); interp->SetSplineOrder(splineOrder); interp->SetInputImage(image); interp->Print(std::cout); @@ -521,7 +521,7 @@ testInteger3DSpline() int flag = 0; /* Allocate a simple test image */ - ImageIntegerType3D::Pointer image = ImageIntegerType3D::New(); + auto image = ImageIntegerType3D::New(); set3DInterpData(image); @@ -534,7 +534,7 @@ testInteger3DSpline() /* Create and initialize the interpolator */ for (int splineOrder = 2; splineOrder <= 5; ++splineOrder) { - InterpolatorIntegerType3D::Pointer interp = InterpolatorIntegerType3D::New(); + auto interp = InterpolatorIntegerType3D::New(); interp->SetSplineOrder(splineOrder); interp->SetInputImage(image); interp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx index e48503f2b2c..e85da96f88f 100644 --- a/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBSplineResampleImageFunctionTest.cxx @@ -48,7 +48,7 @@ itkBSplineResampleImageFunctionTest(int, char *[]) ImageType::ConstPointer randImage = interpolator->GetInputImage(); using FilterType = itk::BSplineDecompositionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); filter->SetSplineOrder(interpolator->GetSplineOrder()); @@ -59,7 +59,7 @@ itkBSplineResampleImageFunctionTest(int, char *[]) /** Set up a BSplineResampleImageFunction. */ using ResampleFunctionType = itk::BSplineResampleImageFunction; - ResampleFunctionType::Pointer resample = ResampleFunctionType::New(); + auto resample = ResampleFunctionType::New(); resample->SetSplineOrder(interpolator->GetSplineOrder()); resample->SetInputImage(filter->GetOutput()); diff --git a/Modules/Core/ImageFunction/test/itkBinaryThresholdImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkBinaryThresholdImageFunctionTest.cxx index 15698e9a722..400e1975816 100644 --- a/Modules/Core/ImageFunction/test/itkBinaryThresholdImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkBinaryThresholdImageFunctionTest.cxx @@ -29,7 +29,7 @@ itkBinaryThresholdImageFunctionTest(int, char *[]) using FloatImage = itk::Image; - FloatImage::Pointer image = FloatImage::New(); + auto image = FloatImage::New(); FloatImage::RegionType region; FloatImage::SizeType size; size.Fill(64); @@ -59,7 +59,7 @@ itkBinaryThresholdImageFunctionTest(int, char *[]) // Try the function inside and outside the region using ImageFunction = itk::BinaryThresholdImageFunction; - ImageFunction::Pointer threshold = ImageFunction::New(); + auto threshold = ImageFunction::New(); ImageFunction::PointType point; ImageFunction::ContinuousIndexType continuousIndex; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx index 7c261f74273..25a69af9d23 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorSpeedTest.cxx @@ -37,7 +37,7 @@ itkCentralDifferenceImageFunctionOnVectorSpeedTestRun(char * argv[]) using PixelType = itk::Vector; using ImageType = itk::Image; - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType size; size.Fill(imageSize); typename ImageType::RegionType region(size); @@ -70,7 +70,7 @@ itkCentralDifferenceImageFunctionOnVectorSpeedTestRun(char * argv[]) using FunctionType = itk::CentralDifferenceImageFunction; using OutputType = typename FunctionType::OutputType; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx index 65a40f42357..6741c453734 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionOnVectorTest.cxx @@ -52,7 +52,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() using PixelType = itk::Vector; using ImageType = itk::Image; - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType size; size.Fill(16); typename ImageType::RegionType region(size); @@ -87,7 +87,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() using OutputType = typename FunctionType::OutputType; using OutputValueType = typename FunctionType::OutputValueType; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); @@ -357,7 +357,7 @@ itkCentralDifferenceImageFunctionOnVectorTestRun() using BadFunctionType = itk::CentralDifferenceImageFunction; - typename BadFunctionType::Pointer badFunction = BadFunctionType::New(); + auto badFunction = BadFunctionType::New(); ITK_TRY_EXPECT_EXCEPTION(badFunction->SetInputImage(image)); return result; diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx index 0ec65e552ae..926b5f5b5bf 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionSpeedTest.cxx @@ -41,7 +41,7 @@ itkCentralDifferenceImageFunctionSpeedTest(int argc, char * argv[]) using PixelType = unsigned int; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(imageSize); ImageType::RegionType region(size); @@ -67,7 +67,7 @@ itkCentralDifferenceImageFunctionSpeedTest(int argc, char * argv[]) using FunctionType = itk::CentralDifferenceImageFunction; using OutputType = FunctionType::OutputType; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx index 6652d3fa751..9ef36b2d72d 100644 --- a/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCentralDifferenceImageFunctionTest.cxx @@ -29,7 +29,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) using PixelType = unsigned int; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(16); ImageType::RegionType region(size); @@ -56,7 +56,7 @@ itkCentralDifferenceImageFunctionTest(int, char *[]) using OutputType = FunctionType::OutputType; using OutputValueType = FunctionType::OutputValueType; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx index b0084eb95ed..ef0ee8f1597 100644 --- a/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkCovarianceImageFunctionTest.cxx @@ -34,7 +34,7 @@ itkCovarianceImageFunctionTest(int, char *[]) using FunctionType = itk::CovarianceImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -61,7 +61,7 @@ itkCovarianceImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, CovarianceImageFunction, ImageFunction); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx index 08bfe9c178a..a5e468f5fc9 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianBlurImageFunctionTest.cxx @@ -28,7 +28,7 @@ itkGaussianBlurImageFunctionTest(int, char *[]) using GFunctionType = itk::GaussianBlurImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -55,7 +55,7 @@ itkGaussianBlurImageFunctionTest(int, char *[]) } // Test the derivative of Gaussian image function - GFunctionType::Pointer gaussianFunction = GFunctionType::New(); + auto gaussianFunction = GFunctionType::New(); gaussianFunction->SetInputImage(image); itk::Index<2> index; index.Fill(25); diff --git a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx index 896efeef6cc..96f785ba4b3 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianDerivativeImageFunctionTest.cxx @@ -29,7 +29,7 @@ TestGaussianDerivativeImageFunction() using ImageType = itk::Image; // Create and allocate the image - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType size; typename ImageType::IndexType start; typename ImageType::RegionType region; @@ -57,7 +57,7 @@ TestGaussianDerivativeImageFunction() // Test the derivative of Gaussian image function using DoGFunctionType = itk::GaussianDerivativeImageFunction; - typename DoGFunctionType::Pointer DoG = DoGFunctionType::New(); + auto DoG = DoGFunctionType::New(); DoG->SetInputImage(image); @@ -168,7 +168,7 @@ itkGaussianDerivativeImageFunctionTest(int, char *[]) "Check legacy support for GaussianDerivativeFunctionPointer"); #endif - DoGFunctionType::Pointer DoG = DoGFunctionType::New(); + auto DoG = DoGFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(DoG, GaussianDerivativeImageFunction, ImageFunction); @@ -187,7 +187,7 @@ itkGaussianDerivativeImageFunctionTest(int, char *[]) std::cout << "\nTesting Gaussian Derivative Spatial Function:"; using GaussianDerivativeFunctionType = itk::GaussianDerivativeSpatialFunction; - GaussianDerivativeFunctionType::Pointer f = GaussianDerivativeFunctionType::New(); + auto f = GaussianDerivativeFunctionType::New(); f->SetScale(1.0); if (f->GetScale() != 1.0) diff --git a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx index 8f8914aeb26..4007811f0c4 100644 --- a/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkGaussianInterpolateImageFunctionTest.cxx @@ -28,7 +28,7 @@ itkGaussianInterpolateImageFunctionTest(int, char *[]) using ImageType = itk::Image; using InterpolatorType = itk::GaussianInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(interpolator, GaussianInterpolateImageFunction, InterpolateImageFunction); @@ -41,7 +41,7 @@ itkGaussianInterpolateImageFunctionTest(int, char *[]) interpolator->SetAlpha(alpha); ITK_TEST_SET_GET_VALUE(alpha, interpolator->GetAlpha()); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::IndexType start; start.Fill(0); diff --git a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx index 086cf5ca584..2b20a29ebd4 100644 --- a/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkImageAdaptorInterpolateImageFunctionTest.cxx @@ -158,7 +158,7 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // Create a test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -197,12 +197,12 @@ itkImageAdaptorInterpolateImageFunctionTest(int, char *[]) // Create the image adaptor using ImageAdaptorType = ImageAdaptorInterpolate::ImageAdaptorType; - ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); + auto adaptor = ImageAdaptorType::New(); adaptor->SetImage(image); // Create the interpolator - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(adaptor); interp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx index c7759cd3ba7..ed4511bb309 100644 --- a/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx +++ b/Modules/Core/ImageFunction/test/itkInterpolateTest.cxx @@ -123,7 +123,7 @@ itkInterpolateTest(int, char *[]) std::cout << "Testing image interpolation methods:\n"; /* Allocate a simple test image */ - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); image->SetLargestPossibleRegion(region); @@ -151,7 +151,7 @@ itkInterpolateTest(int, char *[]) } /* Create and initialize the interpolator */ - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); interp->Print(std::cout); @@ -265,7 +265,7 @@ itkInterpolateTest(int, char *[]) } /* Create and initialize the nearest neigh. interpolator */ - NNInterpolatorType::Pointer nninterp = NNInterpolatorType::New(); + auto nninterp = NNInterpolatorType::New(); nninterp->SetInputImage(image); nninterp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx index ae378d18990..db718fa7a78 100644 --- a/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLabelImageGaussianInterpolateImageFunctionTest.cxx @@ -39,7 +39,7 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) constexpr double FOV = 10.0; constexpr itk::IndexValueType small_xSize = 3; constexpr itk::IndexValueType small_ySize = 3; - ImageType::Pointer small_image = ImageType::New(); + auto small_image = ImageType::New(); { RegionType region; { @@ -88,7 +88,7 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) } using InterpolatorType = itk::LabelImageGaussianInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(small_image); { double sigma[Dimension]; @@ -112,7 +112,7 @@ itkLabelImageGaussianInterpolateImageFunctionTest(int, char *[]) constexpr unsigned char default_background_value = 17; const itk::IndexValueType large_xSize = 5 + 1; constexpr itk::IndexValueType large_ySize = 5; - ImageType::Pointer large_image = ImageType::New(); + auto large_image = ImageType::New(); { RegionType region; { diff --git a/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx index 822e3b2000c..d48ce2f7155 100644 --- a/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkLinearInterpolateImageFunctionTest.cxx @@ -55,9 +55,9 @@ RunLinearInterpolateTest() using InterpolatedVectorType = typename VectorInterpolatorType::OutputType; using InterpolatedVariableVectorType = typename VariableVectorInterpolatorType::OutputType; - typename ImageType::Pointer image = ImageType::New(); - typename VectorImageType::Pointer vectorimage = VectorImageType::New(); - typename VariableVectorImageType::Pointer variablevectorimage = VariableVectorImageType::New(); + auto image = ImageType::New(); + auto vectorimage = VectorImageType::New(); + auto variablevectorimage = VariableVectorImageType::New(); variablevectorimage->SetVectorLength(VectorDimension); IndexType start; @@ -144,13 +144,13 @@ RunLinearInterpolateTest() } } - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(image); - typename VectorInterpolatorType::Pointer vectorinterpolator = VectorInterpolatorType::New(); + auto vectorinterpolator = VectorInterpolatorType::New(); vectorinterpolator->SetInputImage(vectorimage); - typename VariableVectorInterpolatorType::Pointer variablevectorinterpolator = VariableVectorInterpolatorType::New(); + auto variablevectorinterpolator = VariableVectorInterpolatorType::New(); variablevectorinterpolator->SetInputImage(variablevectorimage); typename ImageType::SizeType radius; diff --git a/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx index 4da63914482..c6239b76b30 100644 --- a/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMahalanobisDistanceThresholdImageFunctionTest.cxx @@ -35,7 +35,7 @@ itkMahalanobisDistanceThresholdImageFunctionTest(int, char *[]) using FunctionType = itk::MahalanobisDistanceThresholdImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -60,7 +60,7 @@ itkMahalanobisDistanceThresholdImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, MahalanobisDistanceThresholdImageFunction, ImageFunction); diff --git a/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx index a440e4ae09b..be13b87dbe6 100644 --- a/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMeanImageFunctionTest.cxx @@ -33,7 +33,7 @@ itkMeanImageFunctionTest(int, char *[]) using FunctionType = itk::MeanImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; @@ -55,7 +55,7 @@ itkMeanImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, MeanImageFunction, ImageFunction); diff --git a/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx index f79d8eae6c6..85afb096db0 100644 --- a/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkMedianImageFunctionTest.cxx @@ -30,7 +30,7 @@ itkMedianImageFunctionTest(int, char *[]) using FunctionType = itk::MedianImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -51,7 +51,7 @@ itkMedianImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx index 73158c6acdc..cdbeb9259f3 100644 --- a/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNearestNeighborExtrapolateImageFunctionTest.cxx @@ -41,11 +41,11 @@ itkNearestNeighborExtrapolateImageFunctionTest(int, char *[]) imageSize[1] = 7; ImageType::RegionType imageRegion(imageSize); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(imageRegion); image->Allocate(); - VectorImageType::Pointer vectorimage = VectorImageType::New(); + auto vectorimage = VectorImageType::New(); vectorimage->SetRegions(imageRegion); vectorimage->Allocate(); @@ -74,10 +74,10 @@ itkNearestNeighborExtrapolateImageFunctionTest(int, char *[]) // set up the extrapolator using FunctionType = itk::NearestNeighborExtrapolateImageFunction; - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); using VectorFunctionType = itk::NearestNeighborExtrapolateImageFunction; - VectorFunctionType::Pointer vectorfunction = VectorFunctionType::New(); + auto vectorfunction = VectorFunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx index 163cdc15bee..78d8a9885fe 100644 --- a/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNearestNeighborInterpolateImageFunctionTest.cxx @@ -53,9 +53,9 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) using InterpolatedVectorType = VectorInterpolatorType::OutputType; using InterpolatedVariableVectorType = VariableVectorInterpolatorType::OutputType; - ImageType::Pointer image = ImageType::New(); - VectorImageType::Pointer vectorimage = VectorImageType::New(); - VariableVectorImageType::Pointer variablevectorimage = VariableVectorImageType::New(); + auto image = ImageType::New(); + auto vectorimage = VectorImageType::New(); + auto variablevectorimage = VariableVectorImageType::New(); variablevectorimage->SetVectorLength(VectorDimension); IndexType start; @@ -125,7 +125,7 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) std::cout << std::endl; } - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(image); typename ImageType::SizeType radius; @@ -135,10 +135,10 @@ itkNearestNeighborInterpolateImageFunctionTest(int, char *[]) ITK_TEST_SET_GET_VALUE(radius[d], interpolator->GetRadius()[d]); } - VectorInterpolatorType::Pointer vectorinterpolator = VectorInterpolatorType::New(); + auto vectorinterpolator = VectorInterpolatorType::New(); vectorinterpolator->SetInputImage(vectorimage); - VariableVectorInterpolatorType::Pointer variablevectorinterpolator = VariableVectorInterpolatorType::New(); + auto variablevectorinterpolator = VariableVectorInterpolatorType::New(); variablevectorinterpolator->SetInputImage(variablevectorimage); constexpr double incr = 0.1; diff --git a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx index 93b731cb1d0..6e712f51ca4 100644 --- a/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkNeighborhoodOperatorImageFunctionTest.cxx @@ -32,7 +32,7 @@ itkNeighborhoodOperatorImageFunctionTest(int, char *[]) using FunctionType = itk::NeighborhoodOperatorImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -53,7 +53,7 @@ itkNeighborhoodOperatorImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); auto * oper = new NeighborhoodOperatorType; diff --git a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx index fcd61adcde8..b0641503d76 100644 --- a/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRGBInterpolateImageFunctionTest.cxx @@ -178,7 +178,7 @@ itkRGBInterpolateImageFunctionTest(int, char *[]) // Create a test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -216,7 +216,7 @@ itkRGBInterpolateImageFunctionTest(int, char *[]) } // Create the interpolator - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); interp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx index dbaffe1e8c6..a44fbe85b7e 100644 --- a/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkRayCastInterpolateImageFunctionTest.cxx @@ -42,8 +42,8 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a using RegionType = ImageType::RegionType; /* Allocate a simple test image */ - ImageType::Pointer image = ImageType::New(); - IndexType start; + auto image = ImageType::New(); + IndexType start; start.Fill(0); SizeType size; size[0] = 30; @@ -86,7 +86,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a using RayCastInterpolatorType = itk::RayCastInterpolateImageFunction; /* Create and initialize the interpolator */ - RayCastInterpolatorType::Pointer interp = RayCastInterpolatorType::New(); + auto interp = RayCastInterpolatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(interp, RayCastInterpolateImageFunction, InterpolateImageFunction); @@ -105,7 +105,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a /* Create the transform */ using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); interp->SetTransform(transform); ITK_TEST_SET_GET_VALUE(transform, interp->GetTransform()); @@ -113,7 +113,7 @@ itkRayCastInterpolateImageFunctionTest(int itkNotUsed(argc), char * itkNotUsed(a /* Create the auxiliary interpolator */ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer auxInterpolator = InterpolatorType::New(); + auto auxInterpolator = InterpolatorType::New(); interp->SetInterpolator(auxInterpolator); ITK_TEST_SET_GET_VALUE(auxInterpolator, interp->GetInterpolator()); diff --git a/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx index b94f2fe11b1..f89859961c7 100644 --- a/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkScatterMatrixImageFunctionTest.cxx @@ -32,7 +32,7 @@ itkScatterMatrixImageFunctionTest(int, char *[]) using FunctionType = itk::ScatterMatrixImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -58,7 +58,7 @@ itkScatterMatrixImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx index 9a66911f4bf..177ffd351d3 100644 --- a/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVarianceImageFunctionTest.cxx @@ -32,7 +32,7 @@ itkVarianceImageFunctionTest(int, char *[]) using FunctionType = itk::VarianceImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -51,7 +51,7 @@ itkVarianceImageFunctionTest(int, char *[]) image->FillBuffer(27); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx index b2b6cc5f52c..857df5c3874 100644 --- a/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorInterpolateImageFunctionTest.cxx @@ -161,7 +161,7 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) double spacing[3] = { 0.1, 0.05, 0.025 }; // Create a test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -199,7 +199,7 @@ itkVectorInterpolateImageFunctionTest(int, char *[]) } // Create the interpolator - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); interp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx index caa6c5f75a7..bba8885326d 100644 --- a/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest.cxx @@ -171,7 +171,7 @@ itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest(int, char double spacing[3] = { 0.1, 0.05, 0.025 }; // Create a test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -209,7 +209,7 @@ itkVectorLinearInterpolateNearestNeighborExtrapolateImageFunctionTest(int, char } // Create the interpolator - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); interp->Print(std::cout); diff --git a/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx index 74040d5abc9..62380fcc6c6 100644 --- a/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkVectorMeanImageFunctionTest.cxx @@ -33,7 +33,7 @@ itkVectorMeanImageFunctionTest(int, char *[]) using FunctionType = itk::VectorMeanImageFunction; // Create and allocate the image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; ImageType::RegionType region; @@ -59,7 +59,7 @@ itkVectorMeanImageFunctionTest(int, char *[]) image->FillBuffer(initialValue); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(image); diff --git a/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx b/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx index f864ac70f38..e7e11c48413 100644 --- a/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx +++ b/Modules/Core/ImageFunction/test/itkWindowedSincInterpolateImageFunctionTest.cxx @@ -151,7 +151,7 @@ itkWindowedSincInterpolateImageFunctionTest(int, char *[]) // Create a test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -185,7 +185,7 @@ itkWindowedSincInterpolateImageFunctionTest(int, char *[]) } // Create the interpolator - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); interp->Print(std::cout); diff --git a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.h b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.h index abbe5d72134..04ead5ee005 100644 --- a/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.h +++ b/Modules/Core/Mesh/include/itkAutomaticTopologyMeshSource.h @@ -90,7 +90,7 @@ namespace itk * triangles sharing an edge. \code using MeshSourceType = itk::AutomaticTopologyMeshSource< MeshType >; - MeshSourceType::Pointer meshSource = MeshSourceType::New(); + auto meshSource = MeshSourceType::New(); meshSource->AddTriangle( meshSource->AddPoint(0, 0, 0), meshSource->AddPoint(1, 0, 0), diff --git a/Modules/Core/Mesh/include/itkMeshToMeshFilter.hxx b/Modules/Core/Mesh/include/itkMeshToMeshFilter.hxx index 241021bca2c..647f4ad4719 100644 --- a/Modules/Core/Mesh/include/itkMeshToMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkMeshToMeshFilter.hxx @@ -84,8 +84,8 @@ MeshToMeshFilter::CopyInputMeshToOutputMeshPoints() using OutputPointsContainer = typename TOutputMesh::PointsContainer; using InputPointsContainer = typename TInputMesh::PointsContainer; - typename OutputPointsContainer::Pointer outputPoints = OutputPointsContainer::New(); - const InputPointsContainer * inputPoints = inputMesh->GetPoints(); + auto outputPoints = OutputPointsContainer::New(); + const InputPointsContainer * inputPoints = inputMesh->GetPoints(); if (inputPoints) { @@ -117,8 +117,8 @@ MeshToMeshFilter::CopyInputMeshToOutputMeshPointData() using OutputPointDataContainer = typename TOutputMesh::PointDataContainer; using InputPointDataContainer = typename TInputMesh::PointDataContainer; - typename OutputPointDataContainer::Pointer outputPointData = OutputPointDataContainer::New(); - const InputPointDataContainer * inputPointData = inputMesh->GetPointData(); + auto outputPointData = OutputPointDataContainer::New(); + const InputPointDataContainer * inputPointData = inputMesh->GetPointData(); if (inputPointData) { @@ -150,8 +150,8 @@ MeshToMeshFilter::CopyInputMeshToOutputMeshCellLinks() using OutputCellLinksContainer = typename TOutputMesh::CellLinksContainer; using InputCellLinksContainer = typename TInputMesh::CellLinksContainer; - typename OutputCellLinksContainer::Pointer outputCellLinks = OutputCellLinksContainer::New(); - const InputCellLinksContainer * inputCellLinks = inputMesh->GetCellLinks(); + auto outputCellLinks = OutputCellLinksContainer::New(); + const InputCellLinksContainer * inputCellLinks = inputMesh->GetCellLinks(); if (inputCellLinks) { @@ -186,8 +186,8 @@ MeshToMeshFilter::CopyInputMeshToOutputMeshCells() outputMesh->SetCellsAllocationMethod(MeshEnums::MeshClassCellsAllocationMethod::CellsAllocatedDynamicallyCellByCell); - typename OutputCellsContainer::Pointer outputCells = OutputCellsContainer::New(); - const InputCellsContainer * inputCells = inputMesh->GetCells(); + auto outputCells = OutputCellsContainer::New(); + const InputCellsContainer * inputCells = inputMesh->GetCells(); if (inputCells) { @@ -226,8 +226,8 @@ MeshToMeshFilter::CopyInputMeshToOutputMeshCellData() using OutputCellDataContainer = typename TOutputMesh::CellDataContainer; using InputCellDataContainer = typename TInputMesh::CellDataContainer; - typename OutputCellDataContainer::Pointer outputCellData = OutputCellDataContainer::New(); - const InputCellDataContainer * inputCellData = inputMesh->GetCellData(); + auto outputCellData = OutputCellDataContainer::New(); + const InputCellDataContainer * inputCellData = inputMesh->GetCellData(); if (inputCellData) { diff --git a/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx b/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx index 93232097e50..043272ab6fb 100644 --- a/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkRegularSphereMeshSource.hxx @@ -31,7 +31,7 @@ RegularSphereMeshSource::RegularSphereMeshSource() /** * Create the output */ - typename TOutputMesh::Pointer output = TOutputMesh::New(); + auto output = TOutputMesh::New(); this->ProcessObject::SetNumberOfRequiredOutputs(1); this->ProcessObject::SetNthOutput(0, output.GetPointer()); m_Center.Fill(0); @@ -145,9 +145,9 @@ RegularSphereMeshSource::GenerateData() typename OutputMeshType::CellsContainerPointer myCells = outputMesh->GetCells(); typename OutputMeshType::CellsContainer::Iterator cells = myCells->Begin(); - typename OutputMeshType::Pointer result = OutputMeshType::New(); - PointType v[3]; - PointType * v_pt[3]; + auto result = OutputMeshType::New(); + PointType v[3]; + PointType * v_pt[3]; v_pt[0] = &v[0]; v_pt[1] = &v[1]; v_pt[2] = &v[2]; @@ -159,7 +159,7 @@ RegularSphereMeshSource::GenerateData() // container for the processed edges // when subdividing a triangle, the corresponding subdivided // edges are stocked here with the Id of the middle point. - PointMapType::Pointer handledEdges = PointMapType::New(); + auto handledEdges = PointMapType::New(); // for the points Id to be consecutive, // and for the Ids to exist only if the point has been copied diff --git a/Modules/Core/Mesh/include/itkSimplexMeshToTriangleMeshFilter.hxx b/Modules/Core/Mesh/include/itkSimplexMeshToTriangleMeshFilter.hxx index 2fb623dd4bb..010e99cb24a 100644 --- a/Modules/Core/Mesh/include/itkSimplexMeshToTriangleMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkSimplexMeshToTriangleMeshFilter.hxx @@ -49,7 +49,7 @@ template void SimplexMeshToTriangleMeshFilter::CreateTriangles() { - typename AutoMeshSourceType::Pointer meshSource = AutoMeshSourceType::New(); + auto meshSource = AutoMeshSourceType::New(); typename AutoMeshSourceType::PointType p1, p2, p3; typename TInputMesh::ConstPointer inputMesh = this->GetInput(0); diff --git a/Modules/Core/Mesh/include/itkSphereMeshSource.hxx b/Modules/Core/Mesh/include/itkSphereMeshSource.hxx index a914e5a8fa8..b9421828860 100644 --- a/Modules/Core/Mesh/include/itkSphereMeshSource.hxx +++ b/Modules/Core/Mesh/include/itkSphereMeshSource.hxx @@ -32,7 +32,7 @@ SphereMeshSource::SphereMeshSource() /** * Create the output */ - typename TOutputMesh::Pointer output = TOutputMesh::New(); + auto output = TOutputMesh::New(); this->ProcessObject::SetNumberOfRequiredOutputs(1); this->ProcessObject::SetNthOutput(0, output.GetPointer()); m_Squareness1 = 1.0; diff --git a/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx b/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx index ff258447e9f..423caf34afc 100644 --- a/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx +++ b/Modules/Core/Mesh/include/itkTriangleMeshToBinaryImageFilter.hxx @@ -396,9 +396,9 @@ TriangleMeshToBinaryImageFilter::RasterizeTriangles() OutputImagePointer OutputImage = this->GetOutput(); // need to transform points from physical to index coordinates - PointsContainer::Pointer NewPoints = PointsContainer::New(); - PointSetType::Pointer NewPointSet = PointSetType::New(); - PointSetType::PointType newpoint; + auto NewPoints = PointsContainer::New(); + auto NewPointSet = PointSetType::New(); + PointSetType::PointType newpoint; // the index value type must match the point value type ContinuousIndex ind; diff --git a/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx b/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx index 436f2018731..25bf3e3555f 100644 --- a/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx +++ b/Modules/Core/Mesh/include/itkTriangleMeshToSimplexMeshFilter.hxx @@ -293,8 +293,8 @@ TriangleMeshToSimplexMeshFilter::CreateCells() auto iterator1 = vertexNeighbors.begin(); - typename MapType::Pointer tmpMap = MapType::New(); - CellIdentifier startIdx = NumericTraits::max(), lastIdx = 0, wrongIdx = 0; + auto tmpMap = MapType::New(); + CellIdentifier startIdx = NumericTraits::max(), lastIdx = 0, wrongIdx = 0; while (lastIdx != startIdx) { diff --git a/Modules/Core/Mesh/include/itkVTKPolyDataReader.hxx b/Modules/Core/Mesh/include/itkVTKPolyDataReader.hxx index 399e0647e1d..ccacf94ded4 100644 --- a/Modules/Core/Mesh/include/itkVTKPolyDataReader.hxx +++ b/Modules/Core/Mesh/include/itkVTKPolyDataReader.hxx @@ -35,7 +35,7 @@ VTKPolyDataReader::VTKPolyDataReader() // // Create the output // - typename TOutputMesh::Pointer output = TOutputMesh::New(); + auto output = TOutputMesh::New(); this->ProcessObject::SetNumberOfRequiredOutputs(1); this->ProcessObject::SetNthOutput(0, output.GetPointer()); } diff --git a/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx index e97c06c355a..0b1d6fe0614 100644 --- a/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkBinaryMask3DMeshSourceTest.cxx @@ -95,7 +95,7 @@ itkBinaryMask3DMeshSourceTest(int argc, char * argv[]) Create16CubeConfig(image, 0, 0, 3 * counter, i, j, k, l); } - MeshSourceType::Pointer meshSource = MeshSourceType::New(); + auto meshSource = MeshSourceType::New(); meshSource->SetInput(image); meshSource->SetObjectValue(internalValue); diff --git a/Modules/Core/Mesh/test/itkExtractMeshConnectedRegionsTest.cxx b/Modules/Core/Mesh/test/itkExtractMeshConnectedRegionsTest.cxx index 6a23c14eb14..8be2f181d7c 100644 --- a/Modules/Core/Mesh/test/itkExtractMeshConnectedRegionsTest.cxx +++ b/Modules/Core/Mesh/test/itkExtractMeshConnectedRegionsTest.cxx @@ -39,13 +39,13 @@ itkExtractMeshConnectedRegionsTest(int, char *[]) // Define a simple mesh of three connected pieces. The mesh consists // of several different cell types. - MeshType::Pointer inMesh = MeshType::New(); + auto inMesh = MeshType::New(); // Pass the mesh through the filter in a variety of ways. // - PointType::ValueType pInit[3] = { 1, 2, 3 }; - PointType p = pInit; - ConnectFilterType::Pointer connect = ConnectFilterType::New(); + PointType::ValueType pInit[3] = { 1, 2, 3 }; + PointType p = pInit; + auto connect = ConnectFilterType::New(); connect->SetInput(inMesh); connect->SetClosestPoint(p); @@ -78,7 +78,7 @@ itkExtractMeshConnectedRegionsTest(int, char *[]) // Create a Sphere for running the filter on real input data. using SphereMeshSourceType = itk::SphereMeshSource; - SphereMeshSourceType::Pointer meshSource = SphereMeshSourceType::New(); + auto meshSource = SphereMeshSourceType::New(); PointType center; center.Fill(0); diff --git a/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx b/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx index 50a6b417bad..b3635ab0031 100644 --- a/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkImageToParametricSpaceFilterTest.cxx @@ -43,7 +43,7 @@ itkImageToParametricSpaceFilterTest(int, char *[]) using PointType = MeshType::PointType; // Create an input Mesh - MeshType::Pointer inputMesh = MeshType::New(); + auto inputMesh = MeshType::New(); // Insert data on the Mesh PointsContainerPointer points = inputMesh->GetPoints(); diff --git a/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx index d4efb80db1b..3a84fc7bbbe 100644 --- a/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkInteriorExteriorMeshFilterTest.cxx @@ -44,7 +44,7 @@ itkInteriorExteriorMeshFilterTest(int, char *[]) using PointType = MeshType::PointType; // Create an input Mesh - MeshType::Pointer inputMesh = MeshType::New(); + auto inputMesh = MeshType::New(); // Insert data on the Mesh PointsContainerPointer points = inputMesh->GetPoints(); @@ -79,10 +79,10 @@ itkInteriorExteriorMeshFilterTest(int, char *[]) // Create a Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Create the Spatial Function - SpatialFunctionType::Pointer spatialFunction = SpatialFunctionType::New(); + auto spatialFunction = SpatialFunctionType::New(); SpatialFunctionType::InputType center; center[0] = 0; diff --git a/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx b/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx index 65d00463d75..22bb73b0abd 100644 --- a/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshSourceGraftOutputTest.cxx @@ -119,7 +119,7 @@ MeshSourceGraftOutputFilter::GenerateData() // Create a Filter - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the inputs filter->SetInput(inputMesh); @@ -204,7 +204,7 @@ itkMeshSourceGraftOutputTest(int, char *[]) using PointType = MeshType::PointType; // Create an input Mesh - MeshType::Pointer inputMesh = MeshType::New(); + auto inputMesh = MeshType::New(); // Insert data on the Mesh PointsContainerPointer points = inputMesh->GetPoints(); @@ -251,11 +251,11 @@ itkMeshSourceGraftOutputTest(int, char *[]) // Create a Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Create an Transform // (it doesn't use smart pointers) - TransformType::Pointer affineTransform = TransformType::New(); + auto affineTransform = TransformType::New(); affineTransform->Scale(3.5); TransformType::OffsetType::ValueType tInit[3] = { 100, 200, 300 }; TransformType::OffsetType translation = tInit; diff --git a/Modules/Core/Mesh/test/itkMeshSpatialObjectIOTest.cxx b/Modules/Core/Mesh/test/itkMeshSpatialObjectIOTest.cxx index 90b446efe07..52547e5858c 100644 --- a/Modules/Core/Mesh/test/itkMeshSpatialObjectIOTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshSpatialObjectIOTest.cxx @@ -39,7 +39,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Create an itkMesh std::cout << "Creating Mesh File: "; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::CoordRepType testPointCoords[8][3] = { { 0, 1, 2 }, { 1, 2, 3 }, { 2, 3, 4 }, { 3, 4, 5 }, { 4, 5, 6 }, { 5, 6, 7 }, { 6, 7, 8 }, { 7, 8, 9 } }; @@ -69,7 +69,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Add cell links using CellLinksContainerType = MeshType::CellLinksContainer; - CellLinksContainerType::Pointer linkContainer = CellLinksContainerType::New(); + auto linkContainer = CellLinksContainerType::New(); MeshType::PointCellLinksContainer pcl; for (j = 0; j < 3; ++j) @@ -85,7 +85,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Add point data using PointDataContainer = MeshType::PointDataContainer; - PointDataContainer::Pointer pointData = PointDataContainer::New(); + auto pointData = PointDataContainer::New(); float data = 0.1; for (j = 0; j < 2; ++j) @@ -97,7 +97,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Add cell data using CellDataContainer = MeshType::CellDataContainer; - CellDataContainer::Pointer cellData = CellDataContainer::New(); + auto cellData = CellDataContainer::New(); data = 0.9; for (j = 0; j < 3; ++j) @@ -108,7 +108,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) mesh->SetCellData(cellData); // Create the mesh Spatial Object - MeshSpatialObjectType::Pointer meshSO = MeshSpatialObjectType::New(); + auto meshSO = MeshSpatialObjectType::New(); meshSO->SetMesh(mesh); meshSO->SetId(3); std::cout << "[PASSED]" << std::endl; @@ -116,7 +116,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Writing the file std::cout << "Testing Writing MeshSpatialObject: "; using WriterType = itk::SpatialObjectWriter<3, float, MeshTrait>; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(meshSO); if ((argc > 2) && (!strcmp(argv[2], "binary"))) { @@ -130,7 +130,7 @@ itkMeshSpatialObjectIOTest(int argc, char * argv[]) // Reading the file std::cout << "Testing Reading MeshSpatialObject: "; using ReaderType = itk::SpatialObjectReader<3, float, MeshTrait>; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); if ((argc > 2) && (strcmp(argv[2], "binary"))) { reader->SetFileName(argv[2]); diff --git a/Modules/Core/Mesh/test/itkMeshTest.cxx b/Modules/Core/Mesh/test/itkMeshTest.cxx index 57cc8800e9b..4edfdce0bc5 100644 --- a/Modules/Core/Mesh/test/itkMeshTest.cxx +++ b/Modules/Core/Mesh/test/itkMeshTest.cxx @@ -163,7 +163,7 @@ itkMeshTest(int, char *[]) /** * Create the mesh through its object factory. */ - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->DebugOn(); /** @@ -594,11 +594,11 @@ itkMeshTest(int, char *[]) /** * Create a visitor for each cell type and set the counts class for the visitor */ - TetraCellVisitor::Pointer cv = TetraCellVisitor::New(); + auto cv = TetraCellVisitor::New(); cv->SetCountClass(&counts); - QuadraticEdgeCellVisitor::Pointer ev = QuadraticEdgeCellVisitor::New(); + auto ev = QuadraticEdgeCellVisitor::New(); ev->SetCountClass(&counts); - QuadraticTriangleCellVisitor::Pointer tv = QuadraticTriangleCellVisitor::New(); + auto tv = QuadraticTriangleCellVisitor::New(); tv->SetCountClass(&counts); mv->AddVisitor(cv); mv->AddVisitor(ev); @@ -619,7 +619,7 @@ itkMeshTest(int, char *[]) // Exercising the Graft method - MeshType::Pointer newMesh = MeshType::New(); + auto newMesh = MeshType::New(); newMesh->Graft(mesh); if (newMesh->GetNumberOfPoints() != mesh->GetNumberOfPoints()) diff --git a/Modules/Core/Mesh/test/itkNewTest.cxx b/Modules/Core/Mesh/test/itkNewTest.cxx index 38f54bd1b8d..062b6196c4f 100644 --- a/Modules/Core/Mesh/test/itkNewTest.cxx +++ b/Modules/Core/Mesh/test/itkNewTest.cxx @@ -75,12 +75,12 @@ itkNewTest(int, char *[]) // BackwardDifferenceOperator // Bad // using iDHBO = itk::BackwardDifferenceOperator; - // iDHBO::Pointer dhbo = iDHBO::New(); + // auto dhbo = iDHBO::New(); // ForwardDifferenceOperator // Bad // using iDHFO = itk::ForwardDifferenceOperator; - // iDHFO::Pointer dhfo = iDHFO::New(); + // auto dhfo = iDHFO::New(); return EXIT_SUCCESS; } diff --git a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx index a55c56bf805..57eb4e9beb0 100644 --- a/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkParametricSpaceToImageSpaceMeshFilterTest.cxx @@ -85,7 +85,7 @@ InternalTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -102,7 +102,7 @@ InternalTest(int argc, char * argv[]) // Store the input image for convenience typename ImageType::Pointer image = reader->GetOutput(); - typename InputMeshType::Pointer mesh = InputMeshType::New(); + auto mesh = InputMeshType::New(); // Get the input image indexes for the mesh filter itk::ImageRegionConstIterator imageIterator(image, image->GetBufferedRegion()); @@ -145,7 +145,7 @@ InternalTest(int argc, char * argv[]) using ParametricFilterType = itk::ParametricSpaceToImageSpaceMeshFilter; - typename ParametricFilterType::Pointer parametricFilter = ParametricFilterType::New(); + auto parametricFilter = ParametricFilterType::New(); if (parametricFilter.IsNull()) { diff --git a/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx b/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx index c26c1f6c2c1..215c18b3b03 100644 --- a/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx +++ b/Modules/Core/Mesh/test/itkQuadrilateralCellTest.cxx @@ -79,7 +79,7 @@ itkQuadrilateralCellTest(int, char *[]) /** * Create the mesh through its object factory. */ - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->DebugOn(); constexpr unsigned int numberOfPoints = 6; diff --git a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx index b10a68d63d4..4a5ae3a6fb6 100644 --- a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest.cxx @@ -28,7 +28,7 @@ itkRegularSphereMeshSourceTest(int, char *[]) using SphereMeshSourceType = itk::RegularSphereMeshSource; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); + auto mySphereMeshSource = SphereMeshSourceType::New(); using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; diff --git a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx index 9a0e42eabcb..3f4d6e3c8fd 100644 --- a/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx +++ b/Modules/Core/Mesh/test/itkRegularSphereMeshSourceTest2.cxx @@ -32,7 +32,7 @@ itkRegularSphereMeshSourceTest2(int, char *[]) scale[1] = 2.; scale[2] = 3.; - SphereMeshSourceType::Pointer source1 = SphereMeshSourceType::New(); + auto source1 = SphereMeshSourceType::New(); source1->SetResolution(1); source1->SetScale(scale); source1->Update(); @@ -47,7 +47,7 @@ itkRegularSphereMeshSourceTest2(int, char *[]) } - SphereMeshSourceType::Pointer source2 = SphereMeshSourceType::New(); + auto source2 = SphereMeshSourceType::New(); source2->SetResolution(2); source2->SetScale(scale); source2->Update(); diff --git a/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx b/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx index 2c1688c7461..f4b77464e3a 100644 --- a/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkSimplexMeshAdaptTopologyFilterTest.cxx @@ -38,8 +38,8 @@ itkSimplexMeshAdaptTopologyFilterTest(int, char *[]) // declare the triangle to simplex mesh filter using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; @@ -50,7 +50,7 @@ itkSimplexMeshAdaptTopologyFilterTest(int, char *[]) std::cout << "Triangle mesh created. " << std::endl; - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); simplexFilter->Update(); @@ -61,7 +61,7 @@ itkSimplexMeshAdaptTopologyFilterTest(int, char *[]) using FilterType = itk::SimplexMeshAdaptTopologyFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(simplexMesh); filter->Update(); filter->Print(std::cout); diff --git a/Modules/Core/Mesh/test/itkSimplexMeshTest.cxx b/Modules/Core/Mesh/test/itkSimplexMeshTest.cxx index 4da19944edc..b012e2a1b9c 100644 --- a/Modules/Core/Mesh/test/itkSimplexMeshTest.cxx +++ b/Modules/Core/Mesh/test/itkSimplexMeshTest.cxx @@ -32,7 +32,7 @@ itkSimplexMeshTest(int, char *[]) using SimplexMeshType = itk::SimplexMesh; using SimplexMeshGeometryType = itk::SimplexMeshGeometry; - SimplexMeshType::Pointer simplexMesh = SimplexMeshType::New(); + auto simplexMesh = SimplexMeshType::New(); using NeighborsListType = SimplexMeshType::NeighborListType; diff --git a/Modules/Core/Mesh/test/itkSimplexMeshToTriangleMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkSimplexMeshToTriangleMeshFilterTest.cxx index b702699527a..33909a4d7bc 100644 --- a/Modules/Core/Mesh/test/itkSimplexMeshToTriangleMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkSimplexMeshToTriangleMeshFilterTest.cxx @@ -41,8 +41,8 @@ itkSimplexMeshToTriangleMeshFilterTest(int, char *[]) using TriangleFilterType = itk::SimplexMeshToTriangleMeshFilter; using TriangleMeshPointer = TriangleMeshType::Pointer; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(0); PointType::ValueType scaleInit[3] = { 5, 5, 5 }; VectorType scale = scaleInit; @@ -51,10 +51,10 @@ itkSimplexMeshToTriangleMeshFilterTest(int, char *[]) mySphereMeshSource->SetResolution(1); mySphereMeshSource->SetScale(scale); - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); - TriangleFilterType::Pointer backFilter = TriangleFilterType::New(); + auto backFilter = TriangleFilterType::New(); backFilter->SetInput(simplexFilter->GetOutput()); backFilter->Update(); backFilter->Print(std::cout); diff --git a/Modules/Core/Mesh/test/itkSimplexMeshVolumeCalculatorTest.cxx b/Modules/Core/Mesh/test/itkSimplexMeshVolumeCalculatorTest.cxx index 6ffb5def3c8..5817a932b1e 100644 --- a/Modules/Core/Mesh/test/itkSimplexMeshVolumeCalculatorTest.cxx +++ b/Modules/Core/Mesh/test/itkSimplexMeshVolumeCalculatorTest.cxx @@ -41,8 +41,8 @@ itkSimplexMeshVolumeCalculatorTest(int, char *[]) // Declare the type of the gradient image using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(0); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; @@ -50,13 +50,13 @@ itkSimplexMeshVolumeCalculatorTest(int, char *[]) mySphereMeshSource->SetCenter(center); mySphereMeshSource->SetScale(scale); - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); using VolumeCalculatorType = itk::SimplexMeshVolumeCalculator; - VolumeCalculatorType::Pointer calculator = VolumeCalculatorType::New(); + auto calculator = VolumeCalculatorType::New(); calculator->SetSimplexMesh(simplexFilter->GetOutput()); for (int i = 1; i <= 5; ++i) diff --git a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx index 6d003e72b94..8973bd2edaf 100644 --- a/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx +++ b/Modules/Core/Mesh/test/itkSphereMeshSourceTest.cxx @@ -25,8 +25,8 @@ itkSphereMeshSourceTest(int, char *[]) using fPointType = itk::Point; using fSphereMeshSourceType = itk::SphereMeshSource>; - fSphereMeshSourceType::Pointer mySphereMeshSource = fSphereMeshSourceType::New(); - fPointType center; + auto mySphereMeshSource = fSphereMeshSourceType::New(); + fPointType center; center.Fill(0); fPointType::ValueType scaleInit[3] = { 1, 1, 1 }; fPointType scale = scaleInit; diff --git a/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx index c8abadf2155..544882349c5 100644 --- a/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkTransformMeshFilterTest.cxx @@ -49,7 +49,7 @@ itkTransformMeshFilterTest(int, char *[]) using PointType = MeshType::PointType; // Create an input Mesh - MeshType::Pointer inputMesh = MeshType::New(); + auto inputMesh = MeshType::New(); // Insert data on the Mesh PointsContainerPointer points = inputMesh->GetPoints(); @@ -98,11 +98,11 @@ itkTransformMeshFilterTest(int, char *[]) // Create a Filter - FilterType::Pointer filter = FilterType::New(); - FilterWithBaseTransformType::Pointer filterwithbasetrfs = FilterWithBaseTransformType::New(); + auto filter = FilterType::New(); + auto filterwithbasetrfs = FilterWithBaseTransformType::New(); // Create a Transform - TransformType::Pointer affineTransform = TransformType::New(); + auto affineTransform = TransformType::New(); affineTransform->Scale(3.5); TransformType::OffsetType::ValueType tInit[3] = { 100, 200, 300 }; TransformType::OffsetType translation = tInit; diff --git a/Modules/Core/Mesh/test/itkTriangleCellTest.cxx b/Modules/Core/Mesh/test/itkTriangleCellTest.cxx index 8797cc9bb94..692d8ad6650 100644 --- a/Modules/Core/Mesh/test/itkTriangleCellTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleCellTest.cxx @@ -81,7 +81,7 @@ itkTriangleCellTest(int, char *[]) /** * Create the mesh through its object factory. */ - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->DebugOn(); constexpr unsigned int numberOfPoints = 4; diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx index dbcb9ea65e1..d4044725de6 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest.cxx @@ -41,8 +41,8 @@ itkTriangleMeshToBinaryImageFilterTest(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center[0] = 50; center[1] = 50; center[2] = 50; @@ -62,7 +62,7 @@ itkTriangleMeshToBinaryImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using TriangleMeshToBinaryImageFilterType = itk::TriangleMeshToBinaryImageFilter; - TriangleMeshToBinaryImageFilterType::Pointer imageFilter = TriangleMeshToBinaryImageFilterType::New(); + auto imageFilter = TriangleMeshToBinaryImageFilterType::New(); imageFilter->SetInput(mySphereMeshSource->GetOutput()); ImageType::SizeType size; @@ -87,7 +87,7 @@ itkTriangleMeshToBinaryImageFilterTest(int argc, char * argv[]) imageFilter->Update(); - ImageType::Pointer im = ImageType::New(); + auto im = ImageType::New(); ImageType::SizeType imSize; imSize[0] = imSize[1] = imSize[2] = 100; im->SetRegions(imSize); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx index 6130fe0f684..586a3c5eff7 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest1.cxx @@ -36,8 +36,8 @@ itkTriangleMeshToBinaryImageFilterTest1(int argc, char * argv[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(50); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; @@ -48,14 +48,14 @@ itkTriangleMeshToBinaryImageFilterTest1(int argc, char * argv[]) mySphereMeshSource->Update(); using ImageType = itk::Image; - ImageType::Pointer im = ImageType::New(); + auto im = ImageType::New(); ImageType::SizeType imSize; imSize.Fill(100); im->SetRegions(imSize); im->Allocate(); using TriangleMeshToBinaryImageFilterType = itk::TriangleMeshToBinaryImageFilter; - TriangleMeshToBinaryImageFilterType::Pointer imageFilter = TriangleMeshToBinaryImageFilterType::New(); + auto imageFilter = TriangleMeshToBinaryImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imageFilter, TriangleMeshToBinaryImageFilter, ImageSource); imageFilter->SetInput(mySphereMeshSource->GetOutput()); @@ -63,7 +63,7 @@ itkTriangleMeshToBinaryImageFilterTest1(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(imageFilter->Update()); using ROIImageFilter = itk::RegionOfInterestImageFilter; - ROIImageFilter::Pointer roifilter = ROIImageFilter::New(); + auto roifilter = ROIImageFilter::New(); ROIImageFilter::RegionType region; region.GetModifiableIndex().Fill(35); region.GetModifiableSize().Fill(30); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx index ed7d2854154..a66f0dcb146 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest2.cxx @@ -43,8 +43,8 @@ itkTriangleMeshToBinaryImageFilterTest2(int argc, char * argv[]) using TriangleFilterType = itk::SimplexMeshToTriangleMeshFilter; using TriangleMeshPointer = TriangleMeshType::Pointer; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(50); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; @@ -53,10 +53,10 @@ itkTriangleMeshToBinaryImageFilterTest2(int argc, char * argv[]) mySphereMeshSource->SetResolution(3); mySphereMeshSource->SetScale(scale); - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); - TriangleFilterType::Pointer backFilter = TriangleFilterType::New(); + auto backFilter = TriangleFilterType::New(); backFilter->SetInput(simplexFilter->GetOutput()); backFilter->Update(); @@ -84,7 +84,7 @@ itkTriangleMeshToBinaryImageFilterTest2(int argc, char * argv[]) using TriangleImageType = itk::TriangleMeshToBinaryImageFilter; - TriangleImageType::Pointer imageFilter = TriangleImageType::New(); + auto imageFilter = TriangleImageType::New(); imageFilter->SetInput(triangleMesh); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx index e192d4356f2..3abd5ef9eb4 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest3.cxx @@ -41,7 +41,7 @@ itkTriangleMeshToBinaryImageFilterTest3(int argc, char * argv[]) using MeshType = itk::Mesh; using ReaderType = itk::MeshFileReader; - ReaderType::Pointer polyDataReader = ReaderType::New(); + auto polyDataReader = ReaderType::New(); polyDataReader->SetFileName(argv[1]); @@ -60,7 +60,7 @@ itkTriangleMeshToBinaryImageFilterTest3(int argc, char * argv[]) using TriangleImageType = itk::TriangleMeshToBinaryImageFilter; - TriangleImageType::Pointer imageFilter = TriangleImageType::New(); + auto imageFilter = TriangleImageType::New(); imageFilter->SetInput(polyDataReader->GetOutput()); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx index 1624f9a40f2..cce1b5c363b 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToBinaryImageFilterTest4.cxx @@ -43,7 +43,7 @@ itkTriangleMeshToBinaryImageFilterTest4(int argc, char * argv[]) using MeshType = itk::Mesh; using ReaderType = itk::MeshFileReader; - ReaderType::Pointer polyDataReader = ReaderType::New(); + auto polyDataReader = ReaderType::New(); polyDataReader->SetFileName(argv[1]); @@ -62,7 +62,7 @@ itkTriangleMeshToBinaryImageFilterTest4(int argc, char * argv[]) using TriangleImageType = itk::TriangleMeshToBinaryImageFilter; - TriangleImageType::Pointer imageFilter = TriangleImageType::New(); + auto imageFilter = TriangleImageType::New(); imageFilter->SetInput(polyDataReader->GetOutput()); @@ -91,7 +91,7 @@ itkTriangleMeshToBinaryImageFilterTest4(int argc, char * argv[]) region3D.SetSize(size); region3D.SetIndex(index3D); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region3D); inputImage->SetBufferedRegion(region3D); inputImage->SetRequestedRegion(region3D); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilter2Test.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilter2Test.cxx index 1a3effeb579..d1904e514d8 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilter2Test.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilter2Test.cxx @@ -42,8 +42,8 @@ itkTriangleMeshToSimplexMeshFilter2Test(int, char *[]) // Declare the type of the gradient image using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(0); PointType::ValueType scaleInit[3] = { 10, 10, 10 }; VectorType scale = scaleInit; @@ -52,7 +52,7 @@ itkTriangleMeshToSimplexMeshFilter2Test(int, char *[]) mySphereMeshSource->SetResolution(2); mySphereMeshSource->SetScale(scale); - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); simplexFilter->Update(); diff --git a/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilterTest.cxx index ec6df58d58f..67db6fc8d8f 100644 --- a/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkTriangleMeshToSimplexMeshFilterTest.cxx @@ -39,8 +39,8 @@ itkTriangleMeshToSimplexMeshFilterTest(int, char *[]) // declare the triangle to simplex mesh filter using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(0); PointType::ValueType scaleInit[3] = { 5, 5, 5 }; VectorType scale = scaleInit; @@ -51,7 +51,7 @@ itkTriangleMeshToSimplexMeshFilterTest(int, char *[]) std::cout << "Triangle mesh created. " << std::endl; - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); simplexFilter->Update(); simplexFilter->Print(std::cout); diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataReaderTest.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataReaderTest.cxx index 8e1f645a810..99e850fb4af 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataReaderTest.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataReaderTest.cxx @@ -32,7 +32,7 @@ itkVTKPolyDataReaderTest(int argc, char * argv[]) using MeshType = itk::Mesh; using ReaderType = itk::VTKPolyDataReader; - ReaderType::Pointer polyDataReader = ReaderType::New(); + auto polyDataReader = ReaderType::New(); using PointType = ReaderType::PointType; diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx index 5ec61dcecc8..292e2e5234c 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest01.cxx @@ -40,7 +40,7 @@ itkVTKPolyDataWriterTest01(int argc, char * argv[]) using WriterType = itk::VTKPolyDataWriter; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); constexpr unsigned int numberOfPoints = 4; constexpr unsigned int numberOfCells = 9; @@ -90,7 +90,7 @@ itkVTKPolyDataWriterTest01(int argc, char * argv[]) mesh->SetCell(i, cell); } - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(mesh); writer->SetFileName(argv[1]); writer->Write(); diff --git a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx index 24b4d525c41..dae0c7f5c12 100644 --- a/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx +++ b/Modules/Core/Mesh/test/itkVTKPolyDataWriterTest02.cxx @@ -35,7 +35,7 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[]) using SphereMeshSourceType = itk::RegularSphereMeshSource; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); + auto mySphereMeshSource = SphereMeshSourceType::New(); using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; @@ -125,7 +125,7 @@ itkVTKPolyDataWriterTest02(int argc, char * argv[]) using WriterType = itk::VTKPolyDataWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(myMesh); writer->SetFileName(argv[1]); writer->Write(); diff --git a/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx b/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx index bdc39063e37..1299e34a933 100644 --- a/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx +++ b/Modules/Core/Mesh/test/itkWarpMeshFilterTest.cxx @@ -35,7 +35,7 @@ itkWarpMeshFilterTest(int, char *[]) using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; - SphereMeshSourceType::Pointer sphereMeshSource = SphereMeshSourceType::New(); + auto sphereMeshSource = SphereMeshSourceType::New(); PointType center; center[0] = 25.0; @@ -56,7 +56,7 @@ itkWarpMeshFilterTest(int, char *[]) using VectorType = itk::Vector; using DisplacementFieldType = itk::Image; - DisplacementFieldType::Pointer deformationField = DisplacementFieldType::New(); + auto deformationField = DisplacementFieldType::New(); DisplacementFieldType::IndexType start; start[0] = 0; @@ -100,7 +100,7 @@ itkWarpMeshFilterTest(int, char *[]) // Declare the Warping filter using WarpFilterType = itk::WarpMeshFilter; - WarpFilterType::Pointer warpFilter = WarpFilterType::New(); + auto warpFilter = WarpFilterType::New(); warpFilter->SetInput(sphereMeshSource->GetOutput()); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.hxx index ed8275d017a..b9ab3e6ddaf 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorFlipEdgeFunction.hxx @@ -163,12 +163,12 @@ QuadEdgeMeshEulerOperatorFlipEdgeFunction::Process(QEType * h) - using JoinFacet = QuadEdgeMeshEulerOperatorJoinFacetFunction; using SplitFacet = QuadEdgeMeshEulerOperatorSplitFacetFunction; - QEType * G = h->GetLnext(); - typename JoinFacet::Pointer joinFacet = JoinFacet::New(); + QEType * G = h->GetLnext(); + auto joinFacet = JoinFacet::New(); joinFacet->SetInput(this->m_Mesh); QEType * H = joinFacet->Evaluate(h)->GetLnext(); - typename SplitFacet::Pointer splitFacet = SplitFacet::New(); + auto splitFacet = SplitFacet::New(); splitFacet->SetInput(this->m_Mesh); return (splitFacet->Evaluate(H, G)); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorJoinVertexFunction.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorJoinVertexFunction.hxx index 615ded0eb78..754a1fd6ff8 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorJoinVertexFunction.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorJoinVertexFunction.hxx @@ -194,7 +194,7 @@ QuadEdgeMeshEulerOperatorJoinVertexFunction::Process(QEType * e) using Zip = QuadEdgeMeshZipMeshFunction; if (wasLeftTriangle) { - typename Zip::Pointer zip = Zip::New(); + auto zip = Zip::New(); zip->SetInput(this->m_Mesh); if (QEType::m_NoPoint != zip->Evaluate(leftZip)) { @@ -214,7 +214,7 @@ QuadEdgeMeshEulerOperatorJoinVertexFunction::Process(QEType * e) if (wasRiteTriangle) { NewOrg = riteZip->GetDestination(); - typename Zip::Pointer zip = Zip::New(); + auto zip = Zip::New(); zip->SetInput(this->m_Mesh); if (QEType::m_NoPoint != zip->Evaluate(riteZip)) { diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h index 44017df7de1..bcfc8758899 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshEulerOperatorsTestHelper.h @@ -33,7 +33,7 @@ AssertTopologicalInvariants(TMesh * mesh, IdentifierType Genus) { using CheckerType = itk::QuadEdgeMeshTopologyChecker; - typename CheckerType::Pointer check = CheckerType::New(); + auto check = CheckerType::New(); check->SetMesh(mesh); check->SetExpectedNumberOfPoints(NumVertices); check->SetExpectedNumberOfEdges(NumFaces); diff --git a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshTopologyChecker.hxx b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshTopologyChecker.hxx index 2ed93142af5..6930c041bcc 100644 --- a/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshTopologyChecker.hxx +++ b/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshTopologyChecker.hxx @@ -42,7 +42,7 @@ QuadEdgeMeshTopologyChecker::ValidateEulerCharacteristic() const return (false); } - typename BoundaryEdges::Pointer boundaryEdges = BoundaryEdges::New(); + auto boundaryEdges = BoundaryEdges::New(); // Number of USED points PointIdentifier numPoints = m_Mesh->ComputeNumberOfPoints(); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx index 3ed5c8f859c..1c459a32938 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest1.cxx @@ -35,10 +35,10 @@ itkQuadEdgeMeshAddFaceTest1(int argc, char * argv[]) using BEFunctionType = itk::QuadEdgeMeshBoundaryEdgesMeshFunction; - BEFunctionType::Pointer BoundaryEdges = BEFunctionType::New(); + auto BoundaryEdges = BEFunctionType::New(); std::cout << BoundaryEdges->GetNameOfClass() << std::endl; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); // // // p3--------------p2 // @@ -397,7 +397,7 @@ itkQuadEdgeMeshAddFaceTest1(int argc, char * argv[]) "should return false" << std::endl; - // MeshType::Pointer inconsistentMesh = MeshType::New(); + // auto inconsistentMesh = MeshType::New(); // for(int i=0; i < NumPoints; i++) // { @@ -575,7 +575,7 @@ itkQuadEdgeMeshAddFaceTest1(int argc, char * argv[]) // // - MeshType::Pointer moebiusMesh = MeshType::New(); + auto moebiusMesh = MeshType::New(); constexpr int moebNumPoints = 6; PointIdentifier moebPid[moebNumPoints]; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx index 6f0d8138ba6..2bb763bd917 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshAddFaceTest2.cxx @@ -104,7 +104,7 @@ itkQuadEdgeMeshAddFaceTest2(int, char *[]) std::cout << "Test whether the fourth face was rejected" << std::endl; using TopologyCheckerType = itk::QuadEdgeMeshTopologyChecker; - TopologyCheckerType::Pointer checker = TopologyCheckerType::New(); + auto checker = TopologyCheckerType::New(); checker->SetMesh(mesh); checker->SetExpectedNumberOfPoints(7); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshCellInterfaceTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshCellInterfaceTest.cxx index e2c1099e262..2a301e118b0 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshCellInterfaceTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshCellInterfaceTest.cxx @@ -386,19 +386,19 @@ itkQuadEdgeMeshCellInterfaceTest(int, char *[]) // test the visitor API using QELineVisitorInterfaceType = itk::CellInterfaceVisitorImplementation; - QELineVisitorInterfaceType::Pointer QELineVisitor = QELineVisitorInterfaceType::New(); + auto QELineVisitor = QELineVisitorInterfaceType::New(); using QEPolyVisitorInterfaceType = itk::CellInterfaceVisitorImplementation; - QEPolyVisitorInterfaceType::Pointer QEPolyVisitor = QEPolyVisitorInterfaceType::New(); + auto QEPolyVisitor = QEPolyVisitorInterfaceType::New(); using CellMultiVisitorType = CellType::MultiVisitor; - CellMultiVisitorType::Pointer multiVisitor = CellMultiVisitorType::New(); + auto multiVisitor = CellMultiVisitorType::New(); multiVisitor->AddVisitor(QELineVisitor); multiVisitor->AddVisitor(QEPolyVisitor); - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::PointType pts[3]; pts[0][0] = 0; pts[0][1] = 0; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx index bad20d410bf..d91f2616958 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeleteEdgeTest.cxx @@ -25,7 +25,7 @@ itkQuadEdgeMeshDeleteEdgeTest(int, char *[]) using MeshType = itk::QuadEdgeMesh; std::string indent = " "; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); // Points MeshType::PointType p0, p1, p2, p3, p4, p5; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx index 8d2ed66d315..c764d14ba22 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx @@ -29,7 +29,7 @@ itkQuadEdgeMeshDeletePointAndReorderIDsTest(int, char *[]) using CellType = MeshType::CellType; using QEPolygonCellType = itk::QuadEdgeMeshPolygonCell; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::PointType pts[5]; MeshType::PixelType ptData = 0.; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest.cxx index 7eaa2ad992b..59fe856d436 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest.cxx @@ -62,7 +62,7 @@ itkQuadEdgeMeshEulerOperatorCreateCenterVertexTest(int, char *[]) MeshPointer mesh = MeshType::New(); CreateSquareTriangularMesh(mesh); - CreateCenterVertex::Pointer createCenterVertex = CreateCenterVertex::New(); + auto createCenterVertex = CreateCenterVertex::New(); #ifndef NDEBUG std::cout << " " << "Test No Mesh Input"; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest.cxx index 93732654585..d8bde2e91ef 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest.cxx @@ -72,7 +72,7 @@ itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest(int argc, char * argv[]) MeshPointer mesh = MeshType::New(); CreateSquareTriangularMesh(mesh); - DeleteCenterVertex::Pointer deleteCenterVertex = DeleteCenterVertex::New(); + auto deleteCenterVertex = DeleteCenterVertex::New(); std::cout << " " << "Test No Mesh Input"; if (deleteCenterVertex->Evaluate((QEType *)1)) @@ -246,7 +246,7 @@ itkQuadEdgeMeshEulerOperatorDeleteCenterVertexTest(int argc, char * argv[]) std::cout << "Checking DeleteCenterVertex( CreateCenterVertex()) Invariance."; - CreateCenterVertex::Pointer createCenterVertex = CreateCenterVertex::New(); + auto createCenterVertex = CreateCenterVertex::New(); createCenterVertex->SetInput(mesh); CreateSquareTriangularMesh(mesh); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorFlipTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorFlipTest.cxx index 2de75b50fd2..3aba5ec8faa 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorFlipTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorFlipTest.cxx @@ -31,7 +31,7 @@ itkQuadEdgeMeshEulerOperatorFlipTest(int, char *[]) MeshPointer mesh = MeshType::New(); CreateSquareTriangularMesh(mesh); - FlipEdge::Pointer flipEdge = FlipEdge::New(); + auto flipEdge = FlipEdge::New(); std::cout << flipEdge << std::endl; #ifndef NDEBUG diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinFacetTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinFacetTest.cxx index e9c7f5f0cf4..59c83726c75 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinFacetTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinFacetTest.cxx @@ -68,7 +68,7 @@ itkQuadEdgeMeshEulerOperatorJoinFacetTest(int argc, char * argv[]) std::cout << "Checking JointFacet." << std::endl; - JoinFacet::Pointer joinFacet = JoinFacet::New(); + auto joinFacet = JoinFacet::New(); #ifndef NDEBUG std::cout << " " << "Test No Mesh Input"; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinVertexTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinVertexTest.cxx index cd8c93627ab..2bee8afe3b9 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinVertexTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorJoinVertexTest.cxx @@ -194,7 +194,7 @@ itkQuadEdgeMeshEulerOperatorJoinVertexTest(int argc, char * argv[]) break; } - JoinVertexType::Pointer joinVertex = JoinVertexType::New(); + auto joinVertex = JoinVertexType::New(); std::cout << joinVertex->GetNameOfClass() << std::endl; std::cout << joinVertex << std::endl; @@ -242,7 +242,7 @@ itkQuadEdgeMeshEulerOperatorJoinVertexTest(int argc, char * argv[]) int kk(0); using CheckerType = itk::QuadEdgeMeshTopologyChecker; - CheckerType::Pointer check = CheckerType::New(); + auto check = CheckerType::New(); while (qe != nullptr) { diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx index 738cde977cf..3a7bb8acf2d 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitEdgeTest.cxx @@ -38,7 +38,7 @@ itkQuadEdgeMeshEulerOperatorSplitEdgeTest(int, char *[]) MeshPointer mesh = MeshType::New(); CreateSquareTriangularMesh(mesh); - SplitEdge::Pointer splitEdge = SplitEdge::New(); + auto splitEdge = SplitEdge::New(); std::cout << " " << "Test No Mesh Input"; if (splitEdge->Evaluate((QEType *)1)) diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitFaceTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitFaceTest.cxx index 296c0293681..d69c2d563d5 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitFaceTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitFaceTest.cxx @@ -40,7 +40,7 @@ itkQuadEdgeMeshEulerOperatorSplitFaceTest(int, char *[]) // Split the facet again in order to restore the original situation: std::cout << "Checking SplitFacet." << std::endl; - SplitFacet::Pointer splitFacet = SplitFacet::New(); + auto splitFacet = SplitFacet::New(); std::cout << " " << "Test No Mesh Input"; if (splitFacet->Evaluate((QEType *)1, (QEType *)2)) @@ -93,10 +93,10 @@ itkQuadEdgeMeshEulerOperatorSplitFaceTest(int, char *[]) } std::cout << "OK" << std::endl; - JoinFacet::Pointer joinFacet = JoinFacet::New(); - QEType * DeletedEdge = mesh->FindEdge(12, 7); - QEType * G = DeletedEdge->GetSym()->GetLprev(); - QEType * H = joinFacet->Evaluate(DeletedEdge); + auto joinFacet = JoinFacet::New(); + QEType * DeletedEdge = mesh->FindEdge(12, 7); + QEType * G = DeletedEdge->GetSym()->GetLprev(); + QEType * H = joinFacet->Evaluate(DeletedEdge); if (!splitFacet->Evaluate(H, G)) { diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitVertexTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitVertexTest.cxx index 9229712c9cf..f541ac1f31b 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitVertexTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshEulerOperatorSplitVertexTest.cxx @@ -41,7 +41,7 @@ itkQuadEdgeMeshEulerOperatorSplitVertexTest(int, char *[]) MeshPointer mesh = MeshType::New(); CreateSquareTriangularMesh(mesh); - SplitVertex::Pointer splitVertex = SplitVertex::New(); + auto splitVertex = SplitVertex::New(); std::cout << " " << "Test No Mesh Input"; if (splitVertex->Evaluate((QEType *)1, (QEType *)1)) @@ -135,7 +135,7 @@ itkQuadEdgeMeshEulerOperatorSplitVertexTest(int, char *[]) splitVertex->SetInput(mesh); - JoinVertex::Pointer joinVertex = JoinVertex::New(); + auto joinVertex = JoinVertex::New(); joinVertex->SetInput(mesh); if (!joinVertex->Evaluate(splitVertex->Evaluate(mesh->FindEdge(5, 11), mesh->FindEdge(17, 11)))) { diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx index 3cb32f476f9..b299e71b875 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshIteratorTest.cxx @@ -25,7 +25,7 @@ itkQuadEdgeMeshIteratorTest(int, char *[]) using MeshType = itk::QuadEdgeMesh; using IteratorGeom = MeshType::QEPrimal::IteratorGeom; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); // // p2--------------p1 // diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPolygonCellTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPolygonCellTest.cxx index 56f0fa4b5ff..37aac41b8e9 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPolygonCellTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshPolygonCellTest.cxx @@ -61,7 +61,7 @@ itkQuadEdgeMeshPolygonCellTest(int, char *[]) /** * Create the mesh through its object factory. */ - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->DebugOn(); /** diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx index e354ed4f4d1..a0a29b9bd48 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1.cxx @@ -38,7 +38,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[]) using SphereMeshSourceType = itk::RegularSphereMeshSource; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); + auto mySphereMeshSource = SphereMeshSourceType::New(); using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; @@ -95,7 +95,7 @@ itkQuadEdgeMeshScalarDataVTKPolyDataWriterTest1(int argc, char * argv[]) using WriterType = itk::QuadEdgeMeshScalarDataVTKPolyDataWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(mySphereMeshSource->GetOutput()); writer->SetFileName(argv[1]); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx index 91481030423..a0f89ece207 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest1.cxx @@ -32,7 +32,7 @@ itkQuadEdgeMeshTest1(int, char *[]) using QEPolygonCellType = itk::QuadEdgeMeshPolygonCell; using QELineCellType = itk::QuadEdgeMeshLineCell; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->GetCellBoundaryFeatureNeighbors(0, 0, 0, nullptr); mesh->GetCellNeighbors(0, nullptr); diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest2.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest2.cxx index a700bc1747c..421b18f4000 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest2.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest2.cxx @@ -30,7 +30,7 @@ itkQuadEdgeMeshTest2(int, char *[]) using QuadEdgeType = LineType::QEType; using CellAutoPointer = CellType::CellAutoPointer; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::PointType p0; MeshType::PointType p1; diff --git a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest3.cxx b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest3.cxx index ee4ab0977f3..09182b3f2ba 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest3.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkQuadEdgeMeshTest3.cxx @@ -27,7 +27,7 @@ itkQuadEdgeMeshTest3(int, char *[]) using LineType = itk::QuadEdgeMeshLineCell; using QEPolygonCellType = itk::QuadEdgeMeshPolygonCell; - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::PointType point0; MeshType::PointType point1; diff --git a/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataIOQuadEdgeMeshTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataIOQuadEdgeMeshTest.cxx index 03b5cb95946..a7169696497 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataIOQuadEdgeMeshTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataIOQuadEdgeMeshTest.cxx @@ -30,8 +30,8 @@ itkVTKPolyDataIOQuadEdgeMeshTest(int argc, char * argv[]) using ReaderType = itk::VTKPolyDataReader; using WriterType = itk::VTKPolyDataWriter; - ReaderType::Pointer polyDataReader = ReaderType::New(); - WriterType::Pointer polyDataWriter = WriterType::New(); + auto polyDataReader = ReaderType::New(); + auto polyDataWriter = WriterType::New(); if (argc != 3) { diff --git a/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataReaderQuadEdgeMeshTest.cxx b/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataReaderQuadEdgeMeshTest.cxx index 09eb388a034..b9ff696a2d2 100644 --- a/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataReaderQuadEdgeMeshTest.cxx +++ b/Modules/Core/QuadEdgeMesh/test/itkVTKPolyDataReaderQuadEdgeMeshTest.cxx @@ -33,7 +33,7 @@ itkVTKPolyDataReaderQuadEdgeMeshTest(int argc, char * argv[]) using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::VTKPolyDataReader; - ReaderType::Pointer polyDataReader = ReaderType::New(); + auto polyDataReader = ReaderType::New(); using PointType = ReaderType::PointType; diff --git a/Modules/Core/SpatialObjects/include/itkCastSpatialObjectFilter.h b/Modules/Core/SpatialObjects/include/itkCastSpatialObjectFilter.h index 4f8b9e3d6b4..18543b5c956 100644 --- a/Modules/Core/SpatialObjects/include/itkCastSpatialObjectFilter.h +++ b/Modules/Core/SpatialObjects/include/itkCastSpatialObjectFilter.h @@ -85,7 +85,7 @@ class ITK_TEMPLATE_EXPORT CastSpatialObjectFilter : public Object auto * obj = dynamic_cast(m_Input.GetPointer()); if (obj != nullptr) { - typename OutObjectType::Pointer sObj = OutObjectType::New(); + auto sObj = OutObjectType::New(); sObj = obj; outputList->push_back(sObj); } @@ -96,7 +96,7 @@ class ITK_TEMPLATE_EXPORT CastSpatialObjectFilter : public Object obj = dynamic_cast(it->GetPointer()); if (obj != nullptr) { - typename OutObjectType::Pointer sObj = OutObjectType::New(); + auto sObj = OutObjectType::New(); sObj = obj; outputList->push_back(sObj); } diff --git a/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.hxx index 38c41a5a5a3..db0475f698d 100644 --- a/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkGaussianSpatialObject.hxx @@ -163,7 +163,7 @@ typename EllipseSpatialObject::Pointer GaussianSpatialObject::GetEllipsoid() const { using EllipseType = itk::EllipseSpatialObject; - typename EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(m_RadiusInObjectSpace); ellipse->SetCenterInObjectSpace(m_CenterInObjectSpace); diff --git a/Modules/Core/SpatialObjects/include/itkMetaBlobConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaBlobConverter.hxx index 03372343075..30810d0e7c5 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaBlobConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaBlobConverter.hxx @@ -41,7 +41,7 @@ MetaBlobConverter::MetaObjectToSpatialObject(const MetaObjectType * itkExceptionMacro(<< "Can't downcast MetaObject to BlobMetaObject"); } - typename BlobSpatialObjectType::Pointer blob = BlobSpatialObjectType::New(); + auto blob = BlobSpatialObjectType::New(); blob->GetProperty().SetName(Blob->Name()); blob->SetId(Blob->ID()); diff --git a/Modules/Core/SpatialObjects/include/itkMetaImageConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaImageConverter.hxx index c383d14c8e5..a409cc3ba90 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaImageConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaImageConverter.hxx @@ -44,7 +44,7 @@ auto MetaImageConverter::AllocateImage(const ImageMetaObjectType * image) -> typename ImageType::Pointer { - typename ImageType::Pointer rval = ImageType::New(); + auto rval = ImageType::New(); using SizeType = typename ImageType::SizeType; using SpacingType = typename ImageType::SpacingType; diff --git a/Modules/Core/SpatialObjects/include/itkMetaMeshConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaMeshConverter.hxx index f87737f9e38..faaf3af2d16 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaMeshConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaMeshConverter.hxx @@ -47,7 +47,7 @@ MetaMeshConverter::MetaObjectToSpatialObjec itkExceptionMacro(<< "Can't convert MetaObject to MetaMesh"); } - typename MeshSpatialObjectType::Pointer meshSO = MeshSpatialObjectType::New(); + auto meshSO = MeshSpatialObjectType::New(); meshSO->GetProperty().SetName(_mesh->Name()); meshSO->SetId(_mesh->ID()); @@ -58,7 +58,7 @@ MetaMeshConverter::MetaObjectToSpatialObjec meshSO->GetProperty().SetAlpha(_mesh->Color()[3]); // Create a new Mesh - typename MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); // Add Points using PointListType = typename MeshMetaObjectType::PointListType; @@ -151,7 +151,7 @@ MetaMeshConverter::MetaObjectToSpatialObjec auto it_links = links.begin(); using CellLinksContainerType = typename MeshType::CellLinksContainer; - typename CellLinksContainerType::Pointer linkContainer = CellLinksContainerType::New(); + auto linkContainer = CellLinksContainerType::New(); while (it_links != links.end()) { @@ -171,7 +171,7 @@ MetaMeshConverter::MetaObjectToSpatialObjec // Add point data using PointDataContainer = typename MeshType::PointDataContainer; - typename PointDataContainer::Pointer pointData = PointDataContainer::New(); + auto pointData = PointDataContainer::New(); auto it_pd = _mesh->GetPointData().begin(); @@ -184,7 +184,7 @@ MetaMeshConverter::MetaObjectToSpatialObjec // Add cell data using CellDataContainer = typename MeshType::CellDataContainer; - typename CellDataContainer::Pointer cellData = CellDataContainer::New(); + auto cellData = CellDataContainer::New(); auto it_cd = _mesh->GetCellData().begin(); while (it_cd != _mesh->GetCellData().end()) diff --git a/Modules/Core/SpatialObjects/include/itkMetaSceneConverter.h b/Modules/Core/SpatialObjects/include/itkMetaSceneConverter.h index c9eae89fbe1..ce14ca638fd 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaSceneConverter.h +++ b/Modules/Core/SpatialObjects/include/itkMetaSceneConverter.h @@ -129,7 +129,7 @@ class ITK_TEMPLATE_EXPORT MetaSceneConverter : public Object MetaObject * SpatialObjectToMetaObject(SpatialObjectConstPointer & so) { - typename TConverter::Pointer converter = TConverter::New(); + auto converter = TConverter::New(); // needed just for Image & ImageMask converter->SetWriteImagesInSeparateFile(this->m_WriteImagesInSeparateFile); return converter->SpatialObjectToMetaObject(so); @@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT MetaSceneConverter : public Object SpatialObjectPointer MetaObjectToSpatialObject(const MetaObject * mo) { - typename TConverter::Pointer converter = TConverter::New(); + auto converter = TConverter::New(); return converter->MetaObjectToSpatialObject(mo); } void diff --git a/Modules/Core/SpatialObjects/include/itkMetaSurfaceConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaSurfaceConverter.hxx index f9bb47719f9..14cac665daa 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaSurfaceConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaSurfaceConverter.hxx @@ -39,7 +39,7 @@ MetaSurfaceConverter::MetaObjectToSpatialObject(const MetaObjectTyp { itkExceptionMacro(<< "Can't convert MetaObject to MetaSurface"); } - typename SurfaceSpatialObjectType::Pointer surfaceSO = SurfaceSpatialObjectType::New(); + auto surfaceSO = SurfaceSpatialObjectType::New(); surfaceSO->GetProperty().SetName(surfaceMO->Name()); surfaceSO->SetId(surfaceMO->ID()); diff --git a/Modules/Core/SpatialObjects/include/itkMetaTubeConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaTubeConverter.hxx index e5bd55ab018..65fa97317cc 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaTubeConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaTubeConverter.hxx @@ -40,7 +40,7 @@ MetaTubeConverter::MetaObjectToSpatialObject(const MetaObjectType * itkExceptionMacro(<< "Can't convert MetaObject to MetaTube"); } - typename TubeSpatialObjectType::Pointer tubeSO = TubeSpatialObjectType::New(); + auto tubeSO = TubeSpatialObjectType::New(); tubeSO->GetProperty().SetName(tubeMO->Name()); tubeSO->SetParentPoint(tubeMO->ParentPoint()); diff --git a/Modules/Core/SpatialObjects/include/itkMetaVesselTubeConverter.hxx b/Modules/Core/SpatialObjects/include/itkMetaVesselTubeConverter.hxx index cd00b8539e8..f192d1f6f74 100644 --- a/Modules/Core/SpatialObjects/include/itkMetaVesselTubeConverter.hxx +++ b/Modules/Core/SpatialObjects/include/itkMetaVesselTubeConverter.hxx @@ -41,7 +41,7 @@ MetaVesselTubeConverter::MetaObjectToSpatialObject(const MetaObject itkExceptionMacro(<< "Can't convert MetaObject to MetaVesselTube"); } - typename VesselTubeSpatialObjectType::Pointer vesselTubeSO = VesselTubeSpatialObjectType::New(); + auto vesselTubeSO = VesselTubeSpatialObjectType::New(); vesselTubeSO->SetTypeName("VesselTubeSpatialObject"); vesselTubeSO->GetProperty().SetName(vesselTubeMO->Name()); diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx index 24baeafb93a..d1b289b266e 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObject.hxx @@ -416,8 +416,8 @@ SpatialObject::GetFamilyBoundingBoxInWorldSpace() const -> const Bou { // Next Transform the corners of the bounding box using PointsContainer = typename BoundingBoxType::PointsContainer; - const auto corners = m_FamilyBoundingBoxInObjectSpace->ComputeCorners(); - typename PointsContainer::Pointer transformedCorners = PointsContainer::New(); + const auto corners = m_FamilyBoundingBoxInObjectSpace->ComputeCorners(); + auto transformedCorners = PointsContainer::New(); transformedCorners->Reserve(static_cast(corners.size())); auto it = corners.begin(); @@ -600,7 +600,7 @@ SpatialObject::ComputeObjectToParentTransform() if (this->HasParent()) { - typename TransformType::Pointer inverse = TransformType::New(); + auto inverse = TransformType::New(); if (this->GetParent()->GetObjectToWorldTransform()->GetInverse(inverse)) { m_ObjectToParentTransform->Compose(inverse, true); @@ -664,8 +664,8 @@ SpatialObject::GetMyBoundingBoxInWorldSpace() const -> const Boundin { // Next Transform the corners of the bounding box using PointsContainer = typename BoundingBoxType::PointsContainer; - const auto corners = m_MyBoundingBoxInObjectSpace->ComputeCorners(); - typename PointsContainer::Pointer transformedCorners = PointsContainer::New(); + const auto corners = m_MyBoundingBoxInObjectSpace->ComputeCorners(); + auto transformedCorners = PointsContainer::New(); transformedCorners->Reserve(static_cast(corners.size())); auto it = corners.begin(); diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObjectFactory.h b/Modules/Core/SpatialObjects/include/itkSpatialObjectFactory.h index b13c45e8ce9..0ad86daef2c 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObjectFactory.h +++ b/Modules/Core/SpatialObjects/include/itkSpatialObjectFactory.h @@ -45,7 +45,7 @@ class SpatialObjectFactory : public SpatialObjectFactoryBase static void RegisterSpatialObject() { - typename T::Pointer t = T::New(); + auto t = T::New(); SpatialObjectFactoryBase::Pointer f = SpatialObjectFactoryBase::GetFactory(); f->RegisterSpatialObject(t->GetClassNameAndDimension().c_str(), t->GetClassNameAndDimension().c_str(), diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObjectFactoryBase.h b/Modules/Core/SpatialObjects/include/itkSpatialObjectFactoryBase.h index 78e3937b765..ffefc89601a 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObjectFactoryBase.h +++ b/Modules/Core/SpatialObjects/include/itkSpatialObjectFactoryBase.h @@ -75,7 +75,7 @@ class ITKSpatialObjects_EXPORT SpatialObjectFactoryBase : public ObjectFactoryBa if (m_Factory == nullptr) { // Make and register the factory - SpatialObjectFactoryBase::Pointer p = SpatialObjectFactoryBase::New(); + auto p = SpatialObjectFactoryBase::New(); m_Factory = p.GetPointer(); ObjectFactoryBase::RegisterFactory(p); p->RegisterDefaultSpatialObjects(); diff --git a/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx b/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx index 1efb4e14505..611bcacfef0 100644 --- a/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx +++ b/Modules/Core/SpatialObjects/include/itkSpatialObjectToImageStatisticsCalculator.hxx @@ -50,7 +50,7 @@ bool SpatialObjectToImageStatisticsCalculator::ComputeStatistics() { using MeanAlgorithmType = itk::Statistics::MeanSampleFilter; - typename MeanAlgorithmType::Pointer meanAlgorithm = MeanAlgorithmType::New(); + auto meanAlgorithm = MeanAlgorithmType::New(); meanAlgorithm->SetInput(m_Sample); meanAlgorithm->Update(); @@ -62,7 +62,7 @@ SpatialObjectToImageStatisticsCalculator; - typename CovarianceAlgorithmType::Pointer covarianceAlgorithm = CovarianceAlgorithmType::New(); + auto covarianceAlgorithm = CovarianceAlgorithmType::New(); covarianceAlgorithm->SetInput(m_Sample); covarianceAlgorithm->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx index 80a9cc049dc..bfeec68c49d 100644 --- a/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkArrowSpatialObjectTest.cxx @@ -25,7 +25,7 @@ itkArrowSpatialObjectTest(int, char *[]) { using ArrowType = itk::ArrowSpatialObject<3>; - ArrowType::Pointer myArrow = ArrowType::New(); + auto myArrow = ArrowType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(myArrow, ArrowSpatialObject, SpatialObject); @@ -100,7 +100,7 @@ itkArrowSpatialObjectTest(int, char *[]) std::cout << "Testing 2D Arrow:"; using Arrow2DType = itk::ArrowSpatialObject<2>; - Arrow2DType::Pointer myArrow2D = Arrow2DType::New(); + auto myArrow2D = Arrow2DType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(myArrow2D, ArrowSpatialObject, SpatialObject); diff --git a/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx index 61d589f382c..3b253116456 100644 --- a/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkBoxSpatialObjectTest.cxx @@ -39,16 +39,16 @@ itkBoxSpatialObjectTest(int argc, char * argv[]) using OutputImageType = itk::Image; using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SceneType::Pointer scene = SceneType::New(); + auto scene = SceneType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(scene, GroupSpatialObject, SpatialObject); - BoxType::Pointer box1 = BoxType::New(); + auto box1 = BoxType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(box1, BoxSpatialObject, SpatialObject); - BoxType::Pointer box2 = BoxType::New(); + auto box2 = BoxType::New(); box1->SetId(1); // Test the SetProperty() @@ -137,7 +137,7 @@ itkBoxSpatialObjectTest(int argc, char * argv[]) std::cout << "[PASSED]" << std::endl; std::cout << "Test SpatialObjectToImageFilter / IsInside " << std::endl; - SpatialObjectToImageFilterType::Pointer imageFilter = SpatialObjectToImageFilterType::New(); + auto imageFilter = SpatialObjectToImageFilterType::New(); imageFilter->SetInput(scene); OutputImageType::SizeType size; diff --git a/Modules/Core/SpatialObjects/test/itkCastSpatialObjectFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkCastSpatialObjectFilterTest.cxx index e7732dbd662..8a5c0c36f77 100644 --- a/Modules/Core/SpatialObjects/test/itkCastSpatialObjectFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkCastSpatialObjectFilterTest.cxx @@ -27,7 +27,7 @@ itkCastSpatialObjectFilterTest(int, char *[]) { // Ellipse using EllipseType = itk::EllipseSpatialObject<3>; - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(3); ellipse->GetProperty().SetColor(0, 1, 1); @@ -46,20 +46,20 @@ itkCastSpatialObjectFilterTest(int, char *[]) p.SetAlpha(i + 3); list3.push_back(p); } - TubeType::Pointer tube = TubeType::New(); + auto tube = TubeType::New(); tube->GetProperty().SetName("Tube 3"); tube->SetId(3); tube->SetPoints(list3); // Group using GroupType = itk::GroupSpatialObject<3>; - GroupType::Pointer group = GroupType::New(); + auto group = GroupType::New(); group->AddChild(ellipse); ellipse->AddChild(tube); using CastType = itk::CastSpatialObjectFilter<3>; using TubeListType = std::list; - CastType::Pointer caster = CastType::New(); + auto caster = CastType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(caster, CastSpatialObjectFilter, Object); diff --git a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx index 64a7dfeda98..d20d3d206eb 100644 --- a/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkContourSpatialObjectTest.cxx @@ -61,7 +61,7 @@ itkContourSpatialObjectTest(int, char *[]) pnt[1] = 1; pt4.SetPickedPointInObjectSpace(pnt); - SpatialObjectType::Pointer contour = SpatialObjectType::New(); + auto contour = SpatialObjectType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(contour, ContourSpatialObject, PointBasedSpatialObject); diff --git a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx index 96de562d891..2506936ce5f 100644 --- a/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkDTITubeSpatialObjectTest.cxx @@ -481,7 +481,7 @@ itkDTITubeSpatialObjectTest(int, char *[]) // For coverage only std::cout << "Testing PointBasedSO: "; using PointBasedType = itk::PointBasedSpatialObject<3>; - PointBasedType::Pointer pBSO = PointBasedType::New(); + auto pBSO = PointBasedType::New(); PointBasedType::SpatialObjectPointType pnt; PointBasedType::SpatialObjectPointListType ll; ll.push_back(pnt); diff --git a/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx index ff0e16bc77a..c8aba00b2c1 100644 --- a/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkEllipseSpatialObjectTest.cxx @@ -25,7 +25,7 @@ itkEllipseSpatialObjectTest(int, char *[]) { using EllipseType = itk::EllipseSpatialObject<4>; - EllipseType::Pointer myEllipse = EllipseType::New(); + auto myEllipse = EllipseType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(myEllipse, EllipseSpatialObject, SpatialObject); @@ -81,7 +81,7 @@ itkEllipseSpatialObjectTest(int, char *[]) std::cout << "ObjectToWorldTransform : "; // Create myEllipse2 as a child of myEllipse - EllipseType::Pointer myEllipse2 = EllipseType::New(); + auto myEllipse2 = EllipseType::New(); myEllipse2->SetRadiusInObjectSpace(1); myEllipse->AddChild(myEllipse2); diff --git a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx index a0e4c00c20a..f51b7d22ee2 100644 --- a/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkGaussianSpatialObjectTest.cxx @@ -25,7 +25,7 @@ itkGaussianSpatialObjectTest(int, char *[]) { using GaussianType = itk::GaussianSpatialObject<4>; - GaussianType::Pointer myGaussian = GaussianType::New(); + auto myGaussian = GaussianType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(myGaussian, GaussianSpatialObject, SpatialObject); @@ -88,7 +88,7 @@ itkGaussianSpatialObjectTest(int, char *[]) std::cout << "ObjectToWorldTransform" << std::endl; // Create myGaussian2 as a child of myGaussian - GaussianType::Pointer myGaussian2 = GaussianType::New(); + auto myGaussian2 = GaussianType::New(); std::cout << "AddChild" << std::endl; myGaussian->AddChild(myGaussian2); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx index 9ac72efb47a..2fb60e03374 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest.cxx @@ -41,7 +41,7 @@ itkImageMaskSpatialObjectTest(int, char *[]) using ImageType = ImageMaskSpatialObject::ImageType; using Iterator = itk::ImageRegionIterator; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size = { { 50, 50, 50 } }; ImageType::IndexType index = { { 0, 0, 0 } }; ImageType::RegionType region; @@ -68,7 +68,7 @@ itkImageMaskSpatialObjectTest(int, char *[]) ++it; } - ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New(); + auto maskSO = ImageMaskSpatialObject::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(maskSO, ImageMaskSpatialObject, ImageSpatialObject); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx index 6c6e15e0179..5fa930fa317 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest2.cxx @@ -51,7 +51,7 @@ itkImageMaskSpatialObjectTest2(int, char *[]) // Also explicitly uses nonzero origin, non identity scales // to fully test the commonly encountered cases from the real world - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); // Set the direction for a non-oriented image // to better test the frequently encountered case @@ -103,7 +103,7 @@ itkImageMaskSpatialObjectTest2(int, char *[]) } } - ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New(); + auto maskSO = ImageMaskSpatialObject::New(); maskSO->SetImage(image); maskSO->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx index 08fa7916b0e..e52c37bf154 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest3.cxx @@ -42,7 +42,7 @@ itkImageMaskSpatialObjectTest3(int, char *[]) using PixelType = ImageMaskSpatialObjectType::PixelType; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size = { { 5, 5, 5 } }; ImageType::PointType origin; origin.Fill(0); @@ -69,7 +69,7 @@ itkImageMaskSpatialObjectTest3(int, char *[]) image->SetRegions(region); image->Allocate(true); // initialize buffer to zero - ImageMaskSpatialObjectType::Pointer imageMaskSpatialObject = ImageMaskSpatialObjectType::New(); + auto imageMaskSpatialObject = ImageMaskSpatialObjectType::New(); imageMaskSpatialObject->SetImage(image); imageMaskSpatialObject->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest4.cxx b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest4.cxx index 43f7b4be7c5..8ccbe6fd69b 100644 --- a/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest4.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageMaskSpatialObjectTest4.cxx @@ -46,7 +46,7 @@ Test3dImageMask() // then translate it by 7 in all directions // bounding box should by [7,8] x [7,8] x [7,8] - BoxType::Pointer box1 = BoxType::New(); + auto box1 = BoxType::New(); BoxType::SizeType sizeArray; sizeArray[0] = 1; sizeArray[1] = 1; @@ -55,7 +55,7 @@ Test3dImageMask() box1->SetDefaultInsideValue(1); box1->SetDefaultOutsideValue(0); - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); TransformType::OutputVectorType translation; transform->SetIdentity(); @@ -84,7 +84,7 @@ Test3dImageMask() using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SpatialObjectToImageFilterType::Pointer imageFilter = SpatialObjectToImageFilterType::New(); + auto imageFilter = SpatialObjectToImageFilterType::New(); // note visual studio 2015 u1 (release mode) fails to exectute .Fill // properly here by not initializing the last member. With initializer it @@ -114,7 +114,7 @@ Test3dImageMask() imageFilter->SetInput(box1); imageFilter->Update(); - ImageMaskSpatialObjectType::Pointer maskSpatialObject = ImageMaskSpatialObjectType::New(); + auto maskSpatialObject = ImageMaskSpatialObjectType::New(); maskSpatialObject->SetImage(imageFilter->GetOutput()); maskSpatialObject->Update(); @@ -177,7 +177,7 @@ Test2dImageMask() // then translate it by 7 in all directions // bounding box should by [7,8] x [7,8] - BoxType::Pointer box1 = BoxType::New(); + auto box1 = BoxType::New(); BoxType::SizeType sizeArray; sizeArray[0] = 1; sizeArray[1] = 1; @@ -185,7 +185,7 @@ Test2dImageMask() box1->SetDefaultInsideValue(1); box1->SetDefaultOutsideValue(0); - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); TransformType::OutputVectorType translation; transform->SetIdentity(); @@ -213,7 +213,7 @@ Test2dImageMask() using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SpatialObjectToImageFilterType::Pointer imageFilter = SpatialObjectToImageFilterType::New(); + auto imageFilter = SpatialObjectToImageFilterType::New(); itk::Size<2> size; size.Fill(10); @@ -237,7 +237,7 @@ Test2dImageMask() imageFilter->SetInput(box1); imageFilter->Update(); - ImageMaskSpatialObjectType::Pointer maskSpatialObject = ImageMaskSpatialObjectType::New(); + auto maskSpatialObject = ImageMaskSpatialObjectType::New(); maskSpatialObject->SetImage(imageFilter->GetOutput()); maskSpatialObject->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx index 1220c80f258..46565f45b03 100644 --- a/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkImageSpatialObjectTest.cxx @@ -44,7 +44,7 @@ itkImageSpatialObjectTest(int, char *[]) using Iterator = itk::ImageRegionIterator; using PointType = itk::Point; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size = { { 10, 10, 10 } }; ImageType::IndexType index = { { 0, 0, 0 } }; ImageType::RegionType region; @@ -68,7 +68,7 @@ itkImageSpatialObjectTest(int, char *[]) } it.GoToBegin(); - ImageSpatialObject::Pointer imageSO = ImageSpatialObject::New(); + auto imageSO = ImageSpatialObject::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imageSO, ImageSpatialObject, SpatialObject); @@ -150,7 +150,7 @@ itkImageSpatialObjectTest(int, char *[]) // Now testing the ValueAt() with an interpolator using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); imageSO->SetInterpolator(interpolator); ITK_TEST_SET_GET_VALUE(interpolator, imageSO->GetInterpolator()); diff --git a/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx index 8c0b46218f1..8ab864a004a 100644 --- a/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMeshSpatialObjectTest.cxx @@ -36,7 +36,7 @@ itkMeshSpatialObjectTest(int, char *[]) using CellAutoPointer = CellType::CellAutoPointer; // Create an itkMesh - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); MeshType::CoordRepType testPointCoords[4][3] = { { 0, 0, 0 }, { 9, 0, 0 }, { 9, 9, 0 }, { 0, 0, 9 } }; @@ -56,7 +56,7 @@ itkMeshSpatialObjectTest(int, char *[]) // Create the mesh Spatial Object - MeshSpatialObjectType::Pointer meshSO = MeshSpatialObjectType::New(); + auto meshSO = MeshSpatialObjectType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(meshSO, MeshSpatialObject, SpatialObject); @@ -135,7 +135,7 @@ itkMeshSpatialObjectTest(int, char *[]) using TriangleCellType = itk::TriangleCell; // Create an itkMesh - MeshType::Pointer meshTriangle = MeshType::New(); + auto meshTriangle = MeshType::New(); MeshType::CoordRepType testTrianglePointCoords[4][3] = { { 50, 50, 64 }, { 50, 100, 64 }, { 100, 50, 64 }, { 100, 100, 64 } @@ -163,7 +163,7 @@ itkMeshSpatialObjectTest(int, char *[]) meshTriangle->SetCell(1, testCell4); // Create the mesh Spatial Object - MeshSpatialObjectType::Pointer meshTriangleSO = MeshSpatialObjectType::New(); + auto meshTriangleSO = MeshSpatialObjectType::New(); meshTriangleSO->SetMesh(meshTriangle); meshTriangleSO->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx b/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx index 494004eada5..a03c2f6e024 100644 --- a/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMetaArrowConverterTest.cxx @@ -54,7 +54,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) using ConverterType = itk::MetaArrowConverter; // instantiate new converter and object - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(converter, MetaArrowConverter, MetaConverterBase); @@ -104,7 +104,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) color[3] = 1; // set up itkArrow - SpatialObjectType::Pointer itkArrow = SpatialObjectType::New(); + auto itkArrow = SpatialObjectType::New(); itkArrow->SetDirectionInObjectSpace(direction); itkArrow->SetPositionInObjectSpace(position); itkArrow->SetLengthInObjectSpace(length); @@ -113,7 +113,7 @@ itkMetaArrowConverterTest(int argc, char * argv[]) itkArrow->GetProperty().SetBlue(color[2]); itkArrow->GetProperty().SetAlpha(color[3]); - SpatialObjectParentType::Pointer itkParent = SpatialObjectParentType::New(); + auto itkParent = SpatialObjectParentType::New(); itkParent->SetId(1); itkParent->AddChild(itkArrow); itkParent->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx b/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx index eb40a93fbcf..0352e5ef4f7 100644 --- a/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkMetaGaussianConverterTest.cxx @@ -58,13 +58,13 @@ itkMetaGaussianConverterTest(int argc, char * argv[]) // Instantiate new converter object - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(converter, MetaGaussianConverter, MetaConverterBase); // Set up a Gaussian spatial object - SpatialObjectType::Pointer GaussianSpatialObj = SpatialObjectType::New(); + auto GaussianSpatialObj = SpatialObjectType::New(); // Gaussian spatial object properties SpatialObjectType::ScalarType maximum = 2; @@ -87,7 +87,7 @@ itkMetaGaussianConverterTest(int argc, char * argv[]) GaussianSpatialObj->GetProperty().SetBlue(color[2]); GaussianSpatialObj->GetProperty().SetAlpha(color[3]); - SpatialObjectParentType::Pointer parentSpatialObj = SpatialObjectParentType::New(); + auto parentSpatialObj = SpatialObjectParentType::New(); parentSpatialObj->SetId(1); parentSpatialObj->AddChild(GaussianSpatialObj); diff --git a/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx b/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx index 05b9d6140ab..d8cc2c46fae 100644 --- a/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkNewMetaObjectTypeTest.cxx @@ -239,7 +239,7 @@ itkNewMetaObjectTypeTest(int, char *[]) DummyConverterType::Pointer dummyConverter(DummyConverterType::New()); - MetaSceneConverterType::Pointer converter = MetaSceneConverterType::New(); + auto converter = MetaSceneConverterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(converter, MetaSceneConverter, Object); diff --git a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx index 48fba41bf50..6f8a3becd83 100644 --- a/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkPolygonSpatialObjectTest.cxx @@ -28,7 +28,7 @@ itkPolygonSpatialObjectTest(int, char *[]) // // create rectangle - PolygonType::Pointer rectangle = PolygonType::New(); + auto rectangle = PolygonType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(rectangle, PolygonSpatialObject, PointBasedSpatialObject); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectDuplicatorTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectDuplicatorTest.cxx index 4fd2bf0cafd..c3d9dd4ea35 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectDuplicatorTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectDuplicatorTest.cxx @@ -27,12 +27,12 @@ int itkSpatialObjectDuplicatorTest(int, char *[]) { using EllipseType = itk::EllipseSpatialObject<3>; - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(3); ellipse->GetProperty().SetColor(0, 1, 1); using DuplicatorType = itk::SpatialObjectDuplicator; - DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(duplicator, SpatialObjectDuplicator, Object); @@ -47,11 +47,11 @@ itkSpatialObjectDuplicatorTest(int, char *[]) // Test with a group using GroupType = itk::GroupSpatialObject<3>; - GroupType::Pointer group = GroupType::New(); + auto group = GroupType::New(); group->AddChild(ellipse); using DuplicatorGroupType = itk::SpatialObjectDuplicator; - DuplicatorGroupType::Pointer duplicatorGroup = DuplicatorGroupType::New(); + auto duplicatorGroup = DuplicatorGroupType::New(); duplicatorGroup->SetInput(group); duplicatorGroup->Update(); GroupType::Pointer groupCopy = duplicatorGroup->GetOutput(); @@ -99,13 +99,13 @@ itkSpatialObjectDuplicatorTest(int, char *[]) list3.push_back(p); } - DTITubeType::Pointer dtiTube = DTITubeType::New(); + auto dtiTube = DTITubeType::New(); dtiTube->GetProperty().SetName("Tube 3"); dtiTube->SetId(3); dtiTube->SetPoints(list3); using DuplicatorDTIType = itk::SpatialObjectDuplicator; - DuplicatorDTIType::Pointer duplicatorDti = DuplicatorDTIType::New(); + auto duplicatorDti = DuplicatorDTIType::New(); duplicatorDti->SetInput(dtiTube); duplicatorDti->Update(); DTITubeType::Pointer dtiTube_copy = duplicatorDti->GetOutput(); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx index 4b37c484d99..25789be7792 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageFilterTest.cxx @@ -38,7 +38,7 @@ itkSpatialObjectToImageFilterTest(int, char *[]) { using EllipseType = itk::EllipseSpatialObject<2>; - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(10); ellipse->Update(); @@ -51,7 +51,7 @@ itkSpatialObjectToImageFilterTest(int, char *[]) using ImageType = itk::Image; using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SpatialObjectToImageFilterType::Pointer imageFilter = SpatialObjectToImageFilterType::New(); + auto imageFilter = SpatialObjectToImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imageFilter, SpatialObjectToImageFilter, ImageSource); @@ -134,7 +134,7 @@ itkSpatialObjectToImageFilterTest(int, char *[]) // Test Progress Reporter ShowProgressObject progressWatch(imageFilter); using CommandType = itk::SimpleMemberCommand; - CommandType::Pointer command = CommandType::New(); + auto command = CommandType::New(); command->SetCallbackFunction(&progressWatch, &ShowProgressObject::ShowProgress); imageFilter->AddObserver(itk::ProgressEvent(), command); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx index 705799106e9..550402666f9 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToImageStatisticsCalculatorTest.cxx @@ -38,7 +38,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) spacing.Fill(1); // Circle definition - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); ellipse->SetRadiusInObjectSpace(10); ellipse->Update(); @@ -50,7 +50,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) // Create a test image using ImageFilterType = itk::SpatialObjectToImageFilter; - ImageFilterType::Pointer filter = ImageFilterType::New(); + auto filter = ImageFilterType::New(); filter->SetInput(ellipse); filter->SetSize(size); filter->SetSpacing(spacing); @@ -64,7 +64,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) ellipse->Update(); using CalculatorType = itk::SpatialObjectToImageStatisticsCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, SpatialObjectToImageStatisticsCalculator, Object); @@ -134,7 +134,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) // Create a new 3D image using Image3DType = itk::Image; - Image3DType::Pointer image3D = Image3DType::New(); + auto image3D = Image3DType::New(); using RegionType = Image3DType::RegionType; using SizeType = Image3DType::SizeType; @@ -179,8 +179,8 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) std::cout << "Allocating spatial object." << std::endl; using Ellipse3DType = itk::EllipseSpatialObject<3>; - Ellipse3DType::Pointer ellipse3D = Ellipse3DType::New(); - double radii[3]; + auto ellipse3D = Ellipse3DType::New(); + double radii[3]; radii[0] = 10; radii[1] = 10; radii[2] = 0; @@ -195,7 +195,7 @@ itkSpatialObjectToImageStatisticsCalculatorTest(int, char *[]) // Create a new calculator with a sample size of 3 std::cout << "Updating calculator." << std::endl; using Calculator3DType = itk::SpatialObjectToImageStatisticsCalculator; - Calculator3DType::Pointer calculator3D = Calculator3DType::New(); + auto calculator3D = Calculator3DType::New(); calculator3D->SetImage(image3D); calculator3D->SetSpatialObject(ellipse3D); calculator3D->Update(); diff --git a/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx b/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx index d2905d4cbe9..febdfbbd714 100644 --- a/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkSpatialObjectToPointSetFilterTest.cxx @@ -49,7 +49,7 @@ itkSpatialObjectToPointSetFilterTest(int, char *[]) tube1->Update(); using SpatialObjectToPointSetFilterType = itk::SpatialObjectToPointSetFilter; - SpatialObjectToPointSetFilterType::Pointer pointSetFilter = SpatialObjectToPointSetFilterType::New(); + auto pointSetFilter = SpatialObjectToPointSetFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(pointSetFilter, SpatialObjectToPointSetFilter, MeshSource); @@ -112,10 +112,10 @@ itkSpatialObjectToPointSetFilterTest(int, char *[]) using Tube3DPointListType = Tube3DType::TubePointListType; using Tube3DPointType = Tube3DType::TubePointType; - Group3DType::Pointer group3D = Group3DType::New(); + auto group3D = Group3DType::New(); - Tube3DType::Pointer tube3D = Tube3DType::New(); + auto tube3D = Tube3DType::New(); Tube3DPointListType tubePointList; for (unsigned int i = 0; i < 10; ++i) { @@ -127,7 +127,7 @@ itkSpatialObjectToPointSetFilterTest(int, char *[]) tube3D->SetPoints(tubePointList); tube3D->Update(); - Tube3DType::Pointer tube3D2 = Tube3DType::New(); + auto tube3D2 = Tube3DType::New(); Tube3DPointListType tubePointList2; for (unsigned int i = 10; i < 20; ++i) { @@ -145,7 +145,7 @@ itkSpatialObjectToPointSetFilterTest(int, char *[]) // Create the 3D filter using PointSet3DType = itk::PointSet; using SpatialObjectToPointSet3DFilterType = itk::SpatialObjectToPointSetFilter; - SpatialObjectToPointSet3DFilterType::Pointer pointSetFilter3D = SpatialObjectToPointSet3DFilterType::New(); + auto pointSetFilter3D = SpatialObjectToPointSet3DFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(pointSetFilter3D, SpatialObjectToPointSetFilter, MeshSource); diff --git a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx index 4638cf7511d..80295354d8c 100644 --- a/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx +++ b/Modules/Core/SpatialObjects/test/itkTubeSpatialObjectTest.cxx @@ -482,7 +482,7 @@ itkTubeSpatialObjectTest(int, char *[]) // For coverage only std::cout << "Testing PointBasedSO: "; using PointBasedType = itk::PointBasedSpatialObject<3>; - PointBasedType::Pointer pBSO = PointBasedType::New(); + auto pBSO = PointBasedType::New(); PointBasedType::SpatialObjectPointType pnt; PointBasedType::SpatialObjectPointListType ll; ll.push_back(pnt); diff --git a/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx b/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx index 9db44024f2c..d1e96df5888 100644 --- a/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx +++ b/Modules/Core/TestKernel/src/itkTestDriverInclude.cxx @@ -474,7 +474,7 @@ RegressionTestHelper(const char * testImageFilename, using ReaderType = itk::ImageFileReader; // Read the baseline file - typename ReaderType::Pointer baselineReader = ReaderType::New(); + auto baselineReader = ReaderType::New(); baselineReader->SetFileName(baselineImageFilename); try { @@ -487,7 +487,7 @@ RegressionTestHelper(const char * testImageFilename, } // Read the file generated by the test - typename ReaderType::Pointer testReader = ReaderType::New(); + auto testReader = ReaderType::New(); testReader->SetFileName(testImageFilename); try { @@ -515,7 +515,7 @@ RegressionTestHelper(const char * testImageFilename, // Now compare the two images using DiffType = itk::Testing::ComparisonImageFilter; - typename DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineReader->GetOutput()); diff->SetTestInput(testReader->GetOutput()); diff->SetDifferenceThreshold(intensityTolerance); @@ -566,7 +566,7 @@ RegressionTestHelper(const char * testImageFilename, OutputType::SizeType size; size.Fill(0); - typename RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetOutputMinimum(itk::NumericTraits::NonpositiveMin()); rescale->SetOutputMaximum(itk::NumericTraits::max()); rescale->SetInput(diff->GetOutput()); @@ -589,12 +589,12 @@ RegressionTestHelper(const char * testImageFilename, region.SetSize(size); - ExtractType::Pointer extract = ExtractType::New(); + auto extract = ExtractType::New(); extract->SetDirectionCollapseToIdentity(); extract->SetInput(rescale->GetOutput()); extract->SetExtractionRegion(region); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(extract->GetOutput()); std::ostringstream diffName; @@ -786,7 +786,7 @@ ComputeHash(const char * testImageFilename) // Read the file generated by the test - typename ReaderType::Pointer testReader = ReaderType::New(); + auto testReader = ReaderType::New(); testReader->SetFileName(testImageFilename); try { @@ -800,7 +800,7 @@ ComputeHash(const char * testImageFilename) using HashFilterType = itk::Testing::HashImageFilter; - typename HashFilterType::Pointer hasher = HashFilterType::New(); + auto hasher = HashFilterType::New(); hasher->SetInput(testReader->GetOutput()); hasher->Update(); @@ -902,7 +902,7 @@ HashTestImage(const char * testImageFilename, const std::vector & b using ExtractType = itk::Testing::ExtractSliceImageFilter; // setup reader - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(testImageFilename); reader->UpdateLargestPossibleRegion(); @@ -926,12 +926,12 @@ HashTestImage(const char * testImageFilename, const std::vector & b region.SetSize(size); - ExtractType::Pointer extract = ExtractType::New(); + auto extract = ExtractType::New(); extract->SetDirectionCollapseToIdentity(); extract->SetInput(reader->GetOutput()); extract->SetExtractionRegion(region); - RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetOutputMinimum(itk::NumericTraits::NonpositiveMin()); rescale->SetOutputMaximum(itk::NumericTraits::max()); rescale->SetInput(extract->GetOutput()); diff --git a/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx b/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx index 105e2d906ad..1b03efd0f5f 100644 --- a/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx +++ b/Modules/Core/TestKernel/test/itkTestingExtractSliceImageFilterTest.cxx @@ -35,9 +35,9 @@ itkTestingExtractSliceImageFilterTest(int, char *[]) using FilterType = itk::Testing::ExtractSliceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); InputImageType::SizeType size; size[0] = 20; diff --git a/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx b/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx index ef53c2bbc85..884e8d508d8 100644 --- a/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx +++ b/Modules/Core/TestKernel/test/itkTestingStretchIntensityImageFilterTest.cxx @@ -31,7 +31,7 @@ itkTestingStretchIntensityImageFilterTest(int itkNotUsed(argc), char * itkNotUse using StatsFilterType = itk::StatisticsImageFilter; ImageType::SizeType imageSize = { { 32, 32 } }; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(imageSize); image->Allocate(); PixelType i = -511; @@ -40,7 +40,7 @@ itkTestingStretchIntensityImageFilterTest(int itkNotUsed(argc), char * itkNotUse it.Set(i); } - StretchFilterType::Pointer stretchFilter = StretchFilterType::New(); + auto stretchFilter = StretchFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(stretchFilter, StretchIntensityImageFilter, ImageSource); @@ -74,7 +74,7 @@ itkTestingStretchIntensityImageFilterTest(int itkNotUsed(argc), char * itkNotUse ITK_TEST_EXPECT_EQUAL(stretchFilter->GetInputMinimum(), -511); ITK_TEST_EXPECT_EQUAL(stretchFilter->GetInputMaximum(), 512); - StatsFilterType::Pointer statsFilter = StatsFilterType::New(); + auto statsFilter = StatsFilterType::New(); statsFilter->SetInput(stretchFilter->GetOutput()); ITK_TRY_EXPECT_NO_EXCEPTION(statsFilter->Update()); diff --git a/Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx b/Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx index b9eeba7da02..4a439d378bf 100644 --- a/Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx +++ b/Modules/Core/Transform/include/itkBSplineDeformableTransform.hxx @@ -38,7 +38,7 @@ BSplineDeformableTransform::BSp // Instantiate an identity transform using IdentityTransformType = IdentityTransform; - typename IdentityTransformType::Pointer id = IdentityTransformType::New(); + auto id = IdentityTransformType::New(); this->m_BulkTransform = id; // Setup variables for computing interpolation diff --git a/Modules/Core/Transform/include/itkBSplineTransform.h b/Modules/Core/Transform/include/itkBSplineTransform.h index 141466c2127..29e196fe5e7 100644 --- a/Modules/Core/Transform/include/itkBSplineTransform.h +++ b/Modules/Core/Transform/include/itkBSplineTransform.h @@ -57,7 +57,7 @@ namespace itk * The following illustrates the typical usage of this class: * \code using TransformType = BSplineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetTransformDomainOrigin( origin ); transform->SetTransformDomainPhysicalDimensions( physicalDimensions ); diff --git a/Modules/Core/Transform/include/itkBSplineTransformInitializer.hxx b/Modules/Core/Transform/include/itkBSplineTransformInitializer.hxx index 3116d009b7d..6760eaf0cab 100644 --- a/Modules/Core/Transform/include/itkBSplineTransformInitializer.hxx +++ b/Modules/Core/Transform/include/itkBSplineTransformInitializer.hxx @@ -89,7 +89,7 @@ BSplineTransformInitializer::InitializeTransform() const using CoordRepType = typename ImagePointType::CoordRepType; using PointSetType = PointSet; - typename PointSetType::Pointer cornerPoints = PointSetType::New(); + auto cornerPoints = PointSetType::New(); cornerPoints->Initialize(); using PointType = typename PointSetType::PointType; @@ -136,7 +136,7 @@ BSplineTransformInitializer::InitializeTransform() const SpaceDimension, typename PointSetType::CoordRepType, typename PointSetType::PointsContainer>; - typename BoundingBoxType::Pointer bbox = BoundingBoxType::New(); + auto bbox = BoundingBoxType::New(); bbox->SetPoints(cornerPoints->GetPoints()); bbox->ComputeBoundingBox(); diff --git a/Modules/Core/Transform/include/itkKernelTransform.hxx b/Modules/Core/Transform/include/itkKernelTransform.hxx index 0a54a044cdb..00214368471 100644 --- a/Modules/Core/Transform/include/itkKernelTransform.hxx +++ b/Modules/Core/Transform/include/itkKernelTransform.hxx @@ -385,8 +385,8 @@ KernelTransform::SetParameters(const Paramete this->CopyInParameters(&(parameters.data_block())[offset], &(parameters.data_block())[offset] + parameterSize); } - typename PointsContainer::Pointer landmarks = PointsContainer::New(); - const unsigned int numberOfLandmarks = parameters.Size() / NDimensions; + auto landmarks = PointsContainer::New(); + const unsigned int numberOfLandmarks = parameters.Size() / NDimensions; landmarks->Reserve(numberOfLandmarks); PointsIterator itr = landmarks->Begin(); @@ -424,8 +424,8 @@ KernelTransform::SetFixedParameters(const Fix // setting of the target landmarks, and allowing the Transform // I/O mechanism to be supported. - typename PointsContainer::Pointer landmarks = PointsContainer::New(); - const unsigned int numberOfLandmarks = parameters.Size() / NDimensions; + auto landmarks = PointsContainer::New(); + const unsigned int numberOfLandmarks = parameters.Size() / NDimensions; landmarks->Reserve(numberOfLandmarks); diff --git a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx index c0f6883aa00..5261c224737 100644 --- a/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx +++ b/Modules/Core/Transform/include/itkTransformGeometryImageFilter.hxx @@ -82,7 +82,7 @@ TransformGeometryImageFilter::GenerateData() /** make a cast copied version of the input image **/ using DuplicatorType = CastImageFilter; - typename DuplicatorType::Pointer castFilter = DuplicatorType::New(); + auto castFilter = DuplicatorType::New(); castFilter->SetInput(input); castFilter->GraftOutput(this->GetOutput()); diff --git a/Modules/Core/Transform/test/itkAffineTransformTest.cxx b/Modules/Core/Transform/test/itkAffineTransformTest.cxx index 552b241e7a7..df811210922 100644 --- a/Modules/Core/Transform/test/itkAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkAffineTransformTest.cxx @@ -126,7 +126,7 @@ itkAffineTransformTest(int, char *[]) /* Create a 2D identity transformation and show its parameters */ using Affine2DType = itk::AffineTransform; - Affine2DType::Pointer id2 = Affine2DType::New(); + auto id2 = Affine2DType::New(); matrix2 = id2->GetMatrix(); vector2 = id2->GetOffset(); std::cout << "Matrix from instantiating an identity transform:" << std::endl << matrix2; @@ -155,7 +155,7 @@ itkAffineTransformTest(int, char *[]) vector2[0] = 5; vector2[1] = 6; - Affine2DType::Pointer aff2 = Affine2DType::New(); + auto aff2 = Affine2DType::New(); aff2->SetMatrix(matrix2); aff2->SetOffset(vector2); for (unsigned int i = 0; i < 2; ++i) @@ -170,7 +170,7 @@ itkAffineTransformTest(int, char *[]) aff2->Print(std::cout); /* Get and test inverse of whole transform */ - Affine2DType::Pointer affInv2 = Affine2DType::New(); + auto affInv2 = Affine2DType::New(); if (!aff2->GetInverse(affInv2)) { std::cout << "Test transform does not have an inverse when expected." << std::endl; @@ -475,7 +475,7 @@ itkAffineTransformTest(int, char *[]) Affine3DType::MatrixType matrix3Truth; /* Create a 3D transform and rotate in 3D */ - Affine3DType::Pointer aff3 = Affine3DType::New(); + auto aff3 = Affine3DType::New(); itk::Vector axis; axis[0] = .707; axis[1] = .707; @@ -501,7 +501,7 @@ itkAffineTransformTest(int, char *[]) } /* Generate inverse transform */ - Affine3DType::Pointer inv3 = Affine3DType::New(); + auto inv3 = Affine3DType::New(); if (!aff3->GetInverse(inv3)) { std::cout << "Cannot compute inverse transformation" << std::endl; @@ -542,7 +542,7 @@ itkAffineTransformTest(int, char *[]) } /* Test output of ComputeJacobianWithRespectToParameters */ - Affine3DType::Pointer jaff = Affine3DType::New(); + auto jaff = Affine3DType::New(); Affine3DType::InputPointType jpoint; jpoint[0] = 5.0; @@ -589,7 +589,7 @@ itkAffineTransformTest(int, char *[]) } /* Test SetParameters */ - Affine3DType::Pointer paff = Affine3DType::New(); + auto paff = Affine3DType::New(); paff->Print(std::cout); Affine3DType::ParametersType parameters1(paff->GetNumberOfParameters()); Affine3DType::ParametersType fixed_parameters = paff->GetFixedParameters(); @@ -619,9 +619,9 @@ itkAffineTransformTest(int, char *[]) paff->Print(std::cout); // TEST INVERSE OF INVERSE - Affine3DType::Pointer paff_inv = Affine3DType::New(); + auto paff_inv = Affine3DType::New(); paff->GetInverse(paff_inv); - Affine3DType::Pointer paff_inv_inv = Affine3DType::New(); + auto paff_inv_inv = Affine3DType::New(); paff_inv->GetInverse(paff_inv_inv); std::cout << "TEST INVERSE" << std::endl; @@ -729,7 +729,7 @@ itkAffineTransformTest(int, char *[]) { // Test SetParameters and GetInverse using TransformType = itk::AffineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); TransformType::ParametersType parameters2; TransformType::ParametersType expectedParameters; @@ -782,7 +782,7 @@ itkAffineTransformTest(int, char *[]) transform->SetParameters(expectedParameters); - TransformType::Pointer other = TransformType::New(); + auto other = TransformType::New(); transform->GetInverse(other); TransformType::Pointer otherbis = dynamic_cast(transform->GetInverseTransform().GetPointer()); @@ -820,8 +820,8 @@ itkAffineTransformTest(int, char *[]) } // Try to invert a singular transform - TransformType::Pointer singularTransform = TransformType::New(); - TransformType::Pointer singularTransformInverse = TransformType::New(); + auto singularTransform = TransformType::New(); + auto singularTransformInverse = TransformType::New(); singularTransform->Scale(0.0); if (!singularTransform->GetInverse(singularTransformInverse)) { diff --git a/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx b/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx index 0f0b8778089..efd45b3ad87 100644 --- a/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx +++ b/Modules/Core/Transform/test/itkAzimuthElevationToCartesianTransformTest.cxx @@ -40,7 +40,7 @@ itkAzimuthElevationToCartesianTransformTest(int, char *[]) using AzimuthElevationToCartesianTransformType = itk::AzimuthElevationToCartesianTransform; - AzimuthElevationToCartesianTransformType::Pointer transform = AzimuthElevationToCartesianTransformType::New(); + auto transform = AzimuthElevationToCartesianTransformType::New(); transform->SetAzimuthElevationToCartesianParameters(1.0, 5.0, 45, 45); diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx index 867dc95670c..3708da0afd7 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest.cxx @@ -77,7 +77,7 @@ itkBSplineDeformableTransformTest1() /** * Instantiate a transform */ - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetGridSpacing(spacing); transform->SetGridOrigin(origin); @@ -133,7 +133,7 @@ itkBSplineDeformableTransformTest1() * Set a bulk transform */ using BulkTransformType = itk::VersorRigid3DTransform; - BulkTransformType::Pointer bulkTransform = BulkTransformType::New(); + auto bulkTransform = BulkTransformType::New(); // optional: set bulk transform parameters @@ -391,7 +391,7 @@ itkBSplineDeformableTransformTest1() std::cout << transform->GetValidRegion() << std::endl; using EvenOrderTransformType = itk::BSplineDeformableTransform; - EvenOrderTransformType::Pointer evenOrderTransform = EvenOrderTransformType::New(); + auto evenOrderTransform = EvenOrderTransformType::New(); if (evenOrderTransform.IsNull()) { return EXIT_FAILURE; @@ -415,7 +415,7 @@ itkBSplineDeformableTransformTest1() */ { std::cout << "Exercising SetIdentity() " << std::endl; - TransformType::Pointer transform2 = TransformType::New(); + auto transform2 = TransformType::New(); transform2->SetGridSpacing(spacing); transform2->SetGridOrigin(origin); transform2->SetGridRegion(region); @@ -462,7 +462,7 @@ itkBSplineDeformableTransformTest2() TransformType::InputPointType inputPoint; TransformType::OutputPointType outputPoint; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); // Set up field spacing, origin, region double spacing[Dimension]; @@ -612,7 +612,7 @@ itkBSplineDeformableTransformTest3() /** * Instantiate a transform */ - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetGridSpacing(spacing); transform->SetGridOrigin(origin); diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx index a67e7024b16..ee4ef54d070 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest2.cxx @@ -76,13 +76,13 @@ class BSplineDeformableTransformTest2Helper using FixedReaderType = itk::ImageFileReader; using MovingReaderType = itk::ImageFileReader; - typename FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); - typename MovingReaderType::Pointer movingReader = MovingReaderType::New(); + auto movingReader = MovingReaderType::New(); movingReader->SetFileName(argv[3]); @@ -91,11 +91,11 @@ class BSplineDeformableTransformTest2Helper using FilterType = itk::ResampleImageFilter; - typename FilterType::Pointer resampler = FilterType::New(); + auto resampler = FilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); @@ -121,7 +121,7 @@ class BSplineDeformableTransformTest2Helper using TransformType = itk::BSplineDeformableTransform; - typename TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using RegionType = typename TransformType::RegionType; @@ -182,7 +182,7 @@ class BSplineDeformableTransformTest2Helper bsplineTransform->SetParameters(parameters); - typename CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New(); + auto observer = CommandProgressUpdate::New(); resampler->AddObserver(itk::ProgressEvent(), observer); @@ -194,7 +194,7 @@ class BSplineDeformableTransformTest2Helper using VectorType = itk::Vector; using DeformationFieldType = itk::Image; - typename DeformationFieldType::Pointer field = DeformationFieldType::New(); + auto field = DeformationFieldType::New(); field->SetRegions(fixedRegion); field->SetOrigin(fixedOrigin); field->SetSpacing(fixedSpacing); diff --git a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx index 8778fb3c7d3..b1be3f8a632 100644 --- a/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineDeformableTransformTest3.cxx @@ -77,13 +77,13 @@ class BSplineDeformableTransformTest3Helper using FixedReaderType = itk::ImageFileReader; using MovingReaderType = itk::ImageFileReader; - typename FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); - typename MovingReaderType::Pointer movingReader = MovingReaderType::New(); + auto movingReader = MovingReaderType::New(); movingReader->SetFileName(argv[3]); @@ -92,11 +92,11 @@ class BSplineDeformableTransformTest3Helper using FilterType = itk::ResampleImageFilter; - typename FilterType::Pointer resampler = FilterType::New(); + auto resampler = FilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); @@ -122,7 +122,7 @@ class BSplineDeformableTransformTest3Helper using TransformType = itk::BSplineDeformableTransform; - typename TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using RegionType = typename TransformType::RegionType; @@ -161,7 +161,7 @@ class BSplineDeformableTransformTest3Helper bsplineTransform->SetGridDirection(fixedImage->GetDirection()); using BulkTransformType = itk::Similarity2DTransform; - BulkTransformType::Pointer bulkTransform = BulkTransformType::New(); + auto bulkTransform = BulkTransformType::New(); bulkTransform->SetIdentity(); BulkTransformType::ParametersType bulkParameters = bulkTransform->GetParameters(); @@ -195,7 +195,7 @@ class BSplineDeformableTransformTest3Helper bsplineTransform->SetParameters(parameters); - typename CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New(); + auto observer = CommandProgressUpdate::New(); resampler->AddObserver(itk::ProgressEvent(), observer); @@ -208,7 +208,7 @@ class BSplineDeformableTransformTest3Helper using VectorType = itk::Vector; using DeformationFieldType = itk::Image; - typename DeformationFieldType::Pointer field = DeformationFieldType::New(); + auto field = DeformationFieldType::New(); field->SetRegions(fixedRegion); field->SetOrigin(fixedOrigin); field->SetSpacing(fixedSpacing); diff --git a/Modules/Core/Transform/test/itkBSplineTransformGTest.cxx b/Modules/Core/Transform/test/itkBSplineTransformGTest.cxx index bbef5a3d9f9..765fa02abf0 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformGTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformGTest.cxx @@ -87,8 +87,8 @@ TEST(ITKBSplineTransform, Construction) using BSplineType = itk::BSplineTransform; - BSplineType::Pointer bspline1 = BSplineType::New(); - BSplineType::Pointer bspline2 = BSplineType::New(); + auto bspline1 = BSplineType::New(); + auto bspline2 = BSplineType::New(); bspline_eq(bspline1.GetPointer(), bspline1.GetPointer()); bspline_eq(bspline2.GetPointer(), bspline2.GetPointer()); @@ -149,7 +149,7 @@ TEST(ITKBSplineTransform, Copying_Clone) } } - BSplineType::Pointer bspline1 = BSplineType::New(); + auto bspline1 = BSplineType::New(); bspline1->SetCoefficientImages(coeffImageArray); bspline_eq(bspline1.GetPointer(), bspline1.GetPointer(), "Check after initialization by coefficient images."); @@ -159,7 +159,7 @@ TEST(ITKBSplineTransform, Copying_Clone) EXPECT_EQ(bspline1->GetTransformDomainMeshSize(), itk::MakeSize(7, 7)); ITK_EXPECT_VECTOR_NEAR(bspline1->GetTransformDomainPhysicalDimensions(), itk::MakeVector(7.7, 8.4), 1e-15); - BSplineType::Pointer bspline2 = BSplineType::New(); + auto bspline2 = BSplineType::New(); bspline2->SetFixedParameters(bspline1->GetFixedParameters()); bspline2->SetParameters(bspline1->GetParameters()); diff --git a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx index fa5ebccf440..49b17fb8085 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest1.cxx @@ -52,13 +52,13 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) using FixedReaderType = itk::ImageFileReader; using MovingReaderType = itk::ImageFileReader; - FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); - MovingReaderType::Pointer movingReader = MovingReaderType::New(); + auto movingReader = MovingReaderType::New(); movingReader->SetFileName(argv[3]); @@ -66,11 +66,11 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) using FilterType = itk::ResampleImageFilter; - FilterType::Pointer resampler = FilterType::New(); + auto resampler = FilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); @@ -95,10 +95,10 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) using TransformType = itk::BSplineTransform; - TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using InitializerType = itk::BSplineTransformInitializer; - InitializerType::Pointer transformInitializer = InitializerType::New(); + auto transformInitializer = InitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(transformInitializer, BSplineTransformInitializer, Object); @@ -144,7 +144,7 @@ itkBSplineTransformInitializerTest1(int argc, char * argv[]) using VectorType = itk::Vector; using DeformationFieldType = itk::Image; - DeformationFieldType::Pointer field = DeformationFieldType::New(); + auto field = DeformationFieldType::New(); field->SetRegions(fixedRegion); field->SetOrigin(fixedOrigin); field->SetSpacing(fixedSpacing); diff --git a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx index 23f3e73ed75..3b79c3b955d 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformInitializerTest2.cxx @@ -58,7 +58,7 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) using FixedImageType = itk::Image; using FixedReaderType = itk::ImageFileReader; - FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); @@ -75,11 +75,11 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) using TransformType = itk::BSplineTransform; - TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using InitializerType = itk::BSplineTransformInitializer; - InitializerType::Pointer transformInitializer = InitializerType::New(); + auto transformInitializer = InitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(transformInitializer, BSplineTransformInitializer, Object); @@ -119,7 +119,7 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) // be the same. using PermuterType = itk::PermuteAxesImageFilter; - PermuterType::Pointer permuter = PermuterType::New(); + auto permuter = PermuterType::New(); PermuterType::PermuteOrderArrayType array; array[0] = 1; @@ -129,8 +129,8 @@ itkBSplineTransformInitializerTest2(int argc, char * argv[]) permuter->SetOrder(array); permuter->Update(); - TransformType::Pointer bsplineTransform2 = TransformType::New(); - InitializerType::Pointer transformInitializer2 = InitializerType::New(); + auto bsplineTransform2 = TransformType::New(); + auto transformInitializer2 = InitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(transformInitializer2, BSplineTransformInitializer, Object); diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx index 94063789860..1eea49956a6 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest.cxx @@ -77,7 +77,7 @@ itkBSplineTransformTest1() /** * Instantiate a transform */ - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); /** * Set fixed parameters which store the following information: @@ -427,7 +427,7 @@ itkBSplineTransformTest1() std::cout << transform->GetTransformDomainDirection() << std::endl; using EvenOrderTransformType = itk::BSplineTransform; - EvenOrderTransformType::Pointer evenOrderTransform = EvenOrderTransformType::New(); + auto evenOrderTransform = EvenOrderTransformType::New(); if (evenOrderTransform.IsNull()) { return EXIT_FAILURE; @@ -451,7 +451,7 @@ itkBSplineTransformTest1() */ { std::cout << "Exercising SetIdentity() " << std::endl; - TransformType::Pointer transform2 = TransformType::New(); + auto transform2 = TransformType::New(); transform2->SetTransformDomainOrigin(origin); transform2->SetTransformDomainPhysicalDimensions(dimensions); transform2->SetTransformDomainMeshSize(meshSize); @@ -502,7 +502,7 @@ itkBSplineTransformTest2() TransformType::InputPointType inputPoint; TransformType::OutputPointType outputPoint; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); // Set up field spacing, origin, region double spacing[Dimension]; @@ -637,7 +637,7 @@ itkBSplineTransformTest3() /** * Instantiate a transform */ - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetTransformDomainOrigin(origin); transform->SetTransformDomainPhysicalDimensions(dimensions); diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx index 1771bb5671f..ce44d56bb36 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest2.cxx @@ -76,13 +76,13 @@ class BSplineTransformTest2Helper using FixedReaderType = itk::ImageFileReader; using MovingReaderType = itk::ImageFileReader; - typename FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); - typename MovingReaderType::Pointer movingReader = MovingReaderType::New(); + auto movingReader = MovingReaderType::New(); movingReader->SetFileName(argv[3]); @@ -91,11 +91,11 @@ class BSplineTransformTest2Helper using FilterType = itk::ResampleImageFilter; - typename FilterType::Pointer resampler = FilterType::New(); + auto resampler = FilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); @@ -121,7 +121,7 @@ class BSplineTransformTest2Helper using TransformType = itk::BSplineTransform; - typename TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using MeshSizeType = typename TransformType::MeshSizeType; MeshSizeType meshSize; @@ -158,7 +158,7 @@ class BSplineTransformTest2Helper bsplineTransform->SetParameters(parameters); - typename CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New(); + auto observer = CommandProgressUpdate::New(); resampler->AddObserver(itk::ProgressEvent(), observer); @@ -170,7 +170,7 @@ class BSplineTransformTest2Helper using VectorType = itk::Vector; using DeformationFieldType = itk::Image; - typename DeformationFieldType::Pointer field = DeformationFieldType::New(); + auto field = DeformationFieldType::New(); field->SetRegions(fixedRegion); field->SetOrigin(fixedOrigin); field->SetSpacing(fixedSpacing); diff --git a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx index 6035ac4e9c5..f18ce18ac8d 100644 --- a/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx +++ b/Modules/Core/Transform/test/itkBSplineTransformTest3.cxx @@ -76,13 +76,13 @@ class BSplineTransformTest3Helper using FixedReaderType = itk::ImageFileReader; using MovingReaderType = itk::ImageFileReader; - typename FixedReaderType::Pointer fixedReader = FixedReaderType::New(); + auto fixedReader = FixedReaderType::New(); fixedReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedReader->Update()); - typename MovingReaderType::Pointer movingReader = MovingReaderType::New(); + auto movingReader = MovingReaderType::New(); movingReader->SetFileName(argv[3]); @@ -91,11 +91,11 @@ class BSplineTransformTest3Helper using FilterType = itk::ResampleImageFilter; - typename FilterType::Pointer resampler = FilterType::New(); + auto resampler = FilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); @@ -121,7 +121,7 @@ class BSplineTransformTest3Helper using TransformType = itk::BSplineTransform; - typename TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); using RegionType = typename TransformType::RegionType; @@ -182,7 +182,7 @@ class BSplineTransformTest3Helper bsplineTransform->SetParameters(parameters); - typename CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New(); + auto observer = CommandProgressUpdate::New(); resampler->AddObserver(itk::ProgressEvent(), observer); @@ -195,7 +195,7 @@ class BSplineTransformTest3Helper using VectorType = itk::Vector; using DeformationFieldType = itk::Image; - typename DeformationFieldType::Pointer field = DeformationFieldType::New(); + auto field = DeformationFieldType::New(); field->SetRegions(fixedRegion); field->SetOrigin(fixedOrigin); field->SetSpacing(fixedSpacing); diff --git a/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx index 40df6cc1560..e7507bf98bd 100644 --- a/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredAffineTransformTest.cxx @@ -55,7 +55,7 @@ itkCenteredAffineTransformTest(int, char *[]) /* Create a 2D identity transformation and show its parameters */ using Affine2DType = itk::CenteredAffineTransform; - Affine2DType::Pointer id2 = Affine2DType::New(); + auto id2 = Affine2DType::New(); matrix2 = id2->GetMatrix(); vector2 = id2->GetOffset(); std::cout << "Matrix from instantiating an identity transform:" << std::endl << matrix2; @@ -70,8 +70,8 @@ itkCenteredAffineTransformTest(int, char *[]) vector2[0] = 5; vector2[1] = 6; - Affine2DType::Pointer aff2 = Affine2DType::New(); - Affine2DType::Pointer inverse2 = Affine2DType::New(); + auto aff2 = Affine2DType::New(); + auto inverse2 = Affine2DType::New(); aff2->SetMatrix(matrix2); aff2->SetOffset(vector2); for (i = 0; i < 2; ++i) @@ -202,7 +202,7 @@ itkCenteredAffineTransformTest(int, char *[]) /* Create a 3D transform and rotate in 3D */ using Affine3DType = itk::CenteredAffineTransform; - Affine3DType::Pointer aff3 = Affine3DType::New(); + auto aff3 = Affine3DType::New(); itk::Vector axis; axis[0] = .707; axis[1] = .707; @@ -212,7 +212,7 @@ itkCenteredAffineTransformTest(int, char *[]) aff3->Print(std::cout); /* Generate inverse transform */ - Affine3DType::Pointer inv3 = Affine3DType::New(); + auto inv3 = Affine3DType::New(); if (!aff3->GetInverse(inv3)) { std::cout << "Cannot create inverse transformation" << std::endl; @@ -238,7 +238,7 @@ itkCenteredAffineTransformTest(int, char *[]) image->SetSpacing(spacing); /* Test output of ComputeJacobianWithRespectToParameters */ - Affine3DType::Pointer jaff = Affine3DType::New(); + auto jaff = Affine3DType::New(); const Affine3DType::MatrixType jaffMatrix = jaff->GetMatrix(); std::cout << "GetMatrix:" << std::endl; std::cout << jaffMatrix << std::endl; diff --git a/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx index fb2fcb69a12..b0f2826c75a 100644 --- a/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredEuler3DTransformTest.cxx @@ -32,7 +32,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) bool Ok = true; using EulerTransformType = itk::CenteredEuler3DTransform; - EulerTransformType::Pointer eulerTransform = EulerTransformType::New(); + auto eulerTransform = EulerTransformType::New(); // Testing Identity std::cout << "Testing identity transform: "; @@ -295,7 +295,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) eulerTransform->SetRotation(0.2, 0.1, 0.3); - EulerTransformType::Pointer t2 = EulerTransformType::New(); + auto t2 = EulerTransformType::New(); t2->SetIdentity(); t2->Compose(eulerTransform); if ((std::fabs(t2->GetParameters()[0] - 0.2) > 0.0001) || (std::fabs(t2->GetParameters()[1] - 0.1) > 0.0001) || @@ -323,7 +323,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) } std::cout << " [ PASSED ] " << std::endl; - EulerTransformType::Pointer t3 = EulerTransformType::New(); + auto t3 = EulerTransformType::New(); t2->GetInverse(t3); t3 = dynamic_cast(t2->GetInverseTransform().GetPointer()); @@ -336,7 +336,7 @@ itkCenteredEuler3DTransformTest(int, char *[]) std::cout << "Testing offset updating after changing angle order (ZYX) : "; const double dtr = (std::atan(1.0) * 4.0) / 180.0; // cast angles from degrees to radians - EulerTransformType::Pointer centeredtransform = EulerTransformType::New(); + auto centeredtransform = EulerTransformType::New(); EulerTransformType::ParametersType transformParameters = centeredtransform->GetParameters(); transformParameters[0] = 32; transformParameters[1] = -51; diff --git a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx index 740d0e1d964..b0a9e12cd6c 100644 --- a/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCenteredRigid2DTransformTest.cxx @@ -54,7 +54,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) bool Ok = true; using CenteredRigidTransformType = itk::CenteredRigid2DTransform; - CenteredRigidTransformType::Pointer transform = CenteredRigidTransformType::New(); + auto transform = CenteredRigidTransformType::New(); // 15 degrees in radians const double angle = 15.0 * std::atan(1.0f) / 45.0; @@ -129,8 +129,8 @@ itkCenteredRigid2DTransformTest(int, char *[]) std::cout << "Testing Inverse:"; // Populate the transform with some parameters - CenteredRigidTransformType::Pointer transform2 = CenteredRigidTransformType::New(); - constexpr double a = 0.175; + auto transform2 = CenteredRigidTransformType::New(); + constexpr double a = 0.175; transform2->SetAngle(a); CenteredRigidTransformType::InputPointType c; @@ -216,7 +216,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) { // Test instantiation, inverse computation, back transform etc. using TransformType = CenteredRigidTransformType; - TransformType::Pointer t1 = TransformType::New(); + auto t1 = TransformType::New(); // Set parameters TransformType::ParametersType parameters(t1->GetNumberOfParameters()); @@ -247,7 +247,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t2dash = TransformType::New(); + auto t2dash = TransformType::New(); t1->GetInverse(t2dash); TransformType::InputPointType p3dash = t2dash->TransformPoint(p2); @@ -284,7 +284,7 @@ itkCenteredRigid2DTransformTest(int, char *[]) } // Test compose - TransformType::Pointer t4 = TransformType::New(); + auto t4 = TransformType::New(); parameters[0] = 14.7 / 180.0 * itk::Math::pi; parameters[1] = 4.0; diff --git a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx index f40c6162781..e50510ef0bf 100644 --- a/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkComposeScaleSkewVersor3DTransformTest.cxx @@ -60,7 +60,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); VectorType axis(1.5); @@ -96,8 +96,8 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; } @@ -107,7 +107,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -265,7 +265,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -341,7 +341,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the SetIdentity() method " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -394,7 +394,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the Scaling methods " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); const double angle = (std::atan(1.0) / 45.0) * 30.0; // turn 30 degrees @@ -470,12 +470,12 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) std::cout << "Scale parameters check Passed !" << std::endl; std::cout << " Exercise the SetMatrix() method" << std::endl; - TransformType::Pointer transform2 = TransformType::New(); + auto transform2 = TransformType::New(); transform2->SetFixedParameters(transform->GetFixedParameters()); transform2->SetMatrix(transform->GetMatrix()); transform2->SetOffset(transform->GetOffset()); - TransformType::Pointer transform3 = TransformType::New(); + auto transform3 = TransformType::New(); transform3->SetFixedParameters(transform2->GetFixedParameters()); transform3->SetParameters(transform2->GetParameters()); @@ -535,7 +535,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) } std::cout << "SetMatrix() points check Passed !" << std::endl; - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if (!transform->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; @@ -549,7 +549,7 @@ itkComposeScaleSkewVersor3DTransformTest(int, char *[]) pnt[0] = 10; pnt[1] = 20; pnt[2] = -10; - TransformType::Pointer idT = TransformType::New(); + auto idT = TransformType::New(); for (unsigned int mc = 0; mc < np; ++mc) { std::cout << "Testing parameter #" << mc << std::endl; diff --git a/Modules/Core/Transform/test/itkCompositeTransformTest.cxx b/Modules/Core/Transform/test/itkCompositeTransformTest.cxx index c39d37052fe..9931fbc8c7d 100644 --- a/Modules/Core/Transform/test/itkCompositeTransformTest.cxx +++ b/Modules/Core/Transform/test/itkCompositeTransformTest.cxx @@ -114,7 +114,7 @@ itkCompositeTransformTest(int, char *[]) using CompositeType = itk::CompositeTransform; using ScalarType = CompositeType::ScalarType; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(compositeTransform, CompositeTransform, MultiTransform); @@ -160,9 +160,9 @@ itkCompositeTransformTest(int, char *[]) /* Add an affine transform */ using AffineType = itk::AffineTransform; - AffineType::Pointer affine = AffineType::New(); - Matrix2Type matrix2; - Vector2Type vector2; + auto affine = AffineType::New(); + Matrix2Type matrix2; + Vector2Type vector2; matrix2[0][0] = 1; matrix2[0][1] = 2; matrix2[1][0] = 3; @@ -309,7 +309,7 @@ itkCompositeTransformTest(int, char *[]) } /* Test inverse */ - CompositeType::Pointer inverseTransform = CompositeType::New(); + auto inverseTransform = CompositeType::New(); CompositeType::OutputPointType inverseTruth, inverseOutput; if (!compositeTransform->GetInverse(inverseTransform)) { @@ -347,7 +347,7 @@ itkCompositeTransformTest(int, char *[]) /* * Create and add 2nd transform */ - AffineType::Pointer affine2 = AffineType::New(); + auto affine2 = AffineType::New(); matrix2[0][0] = 11; matrix2[0][1] = 22; matrix2[1][0] = 33; @@ -611,7 +611,7 @@ itkCompositeTransformTest(int, char *[]) */ /* Add yet another affine transform */ - AffineType::Pointer affine3 = AffineType::New(); + auto affine3 = AffineType::New(); matrix2[0][0] = 1.1; matrix2[0][1] = 2.2; matrix2[1][0] = 3.3; @@ -834,11 +834,11 @@ itkCompositeTransformTest(int, char *[]) * transforms */ - CompositeType::Pointer nestedCompositeTransform = CompositeType::New(); - CompositeType::Pointer compositeTransform1 = CompositeType::New(); - CompositeType::Pointer compositeTransform2 = CompositeType::New(); - CompositeType::Pointer compositeTransform3 = CompositeType::New(); - CompositeType::Pointer compositeTransform4 = CompositeType::New(); + auto nestedCompositeTransform = CompositeType::New(); + auto compositeTransform1 = CompositeType::New(); + auto compositeTransform2 = CompositeType::New(); + auto compositeTransform3 = CompositeType::New(); + auto compositeTransform4 = CompositeType::New(); using TranslationTransformType = itk::TranslationTransform; using TranslationTransformPointer = TranslationTransformType::Pointer; diff --git a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx index b86cff85586..e97e0df02af 100644 --- a/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkEuler2DTransformTest.cxx @@ -55,7 +55,7 @@ itkEuler2DTransformTest(int, char *[]) bool Ok = true; using EulerTransformType = itk::Euler2DTransform; - EulerTransformType::Pointer eulerTransform = EulerTransformType::New(); + auto eulerTransform = EulerTransformType::New(); // Testing Identity std::cout << "Testing identity transform: "; @@ -168,7 +168,7 @@ itkEuler2DTransformTest(int, char *[]) eulerTransform->SetIdentity(); eulerTransform->SetRotation(0.2); - EulerTransformType::Pointer t2 = EulerTransformType::New(); + auto t2 = EulerTransformType::New(); t2->SetIdentity(); t2->Compose(eulerTransform); if (std::fabs(t2->GetParameters()[0] - 0.2) > 0.0001) @@ -181,7 +181,7 @@ itkEuler2DTransformTest(int, char *[]) { // Test instantiation, inverse computation, back transform etc. using TransformType = EulerTransformType; - TransformType::Pointer t1 = TransformType::New(); + auto t1 = TransformType::New(); // Set parameters TransformType::ParametersType parameters2(t1->GetNumberOfParameters()); @@ -217,7 +217,7 @@ itkEuler2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t2dash = TransformType::New(); + auto t2dash = TransformType::New(); t1->GetInverse(t2dash); TransformType::InputPointType p3dash; p3dash = t2dash->TransformPoint(p2); @@ -256,7 +256,7 @@ itkEuler2DTransformTest(int, char *[]) } // Test compose - TransformType::Pointer t4 = TransformType::New(); + auto t4 = TransformType::New(); parameters2[0] = 14.7 / 180.0 * itk::Math::pi; parameters2[1] = 67.1; @@ -342,8 +342,8 @@ itkEuler2DTransformTest(int, char *[]) { // Test Set/Get Matrix and Set/Get Offset using TransformType = EulerTransformType; - TransformType::Pointer t1 = TransformType::New(); - TransformType::Pointer t23 = TransformType::New(); + auto t1 = TransformType::New(); + auto t23 = TransformType::New(); TransformType::InputPointType center; center[0] = 9.0; diff --git a/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx b/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx index 3cdf036473a..f6740a5b62d 100644 --- a/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkEuler3DTransformTest.cxx @@ -32,7 +32,7 @@ itkEuler3DTransformTest(int, char *[]) bool Ok = true; using EulerTransformType = itk::Euler3DTransform; - EulerTransformType::Pointer eulerTransform = EulerTransformType::New(); + auto eulerTransform = EulerTransformType::New(); // Testing Identity std::cout << "Testing identity transform: "; @@ -129,7 +129,7 @@ itkEuler3DTransformTest(int, char *[]) std::cout << "Testing Rotation Change from ZXY to ZYX consistency:"; - EulerTransformType::Pointer eulerTransform2 = EulerTransformType::New(); + auto eulerTransform2 = EulerTransformType::New(); EulerTransformType::OutputPointType r1, r2; // rotation angles already set above @@ -334,7 +334,7 @@ itkEuler3DTransformTest(int, char *[]) eulerTransform->SetRotation(0.2, 0.1, 0.3); - EulerTransformType::Pointer t2 = EulerTransformType::New(); + auto t2 = EulerTransformType::New(); t2->SetIdentity(); t2->Compose(eulerTransform); if ((std::fabs(t2->GetParameters()[0] - 0.2) > 0.0001) || (std::fabs(t2->GetParameters()[1] - 0.1) > 0.0001) || @@ -369,8 +369,8 @@ itkEuler3DTransformTest(int, char *[]) using TransformType = itk::Euler3DTransform; using MatrixType = TransformType::MatrixType; - MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + MatrixType matrix; + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix unsigned int par = 0; @@ -446,7 +446,7 @@ itkEuler3DTransformTest(int, char *[]) t = TransformType::New(); t->SetParameters(e); { - TransformType::Pointer t3 = TransformType::New(); + auto t3 = TransformType::New(); t3->SetMatrix(t->GetMatrix()); ParametersType par0 = t3->GetParameters(); @@ -465,8 +465,8 @@ itkEuler3DTransformTest(int, char *[]) { std::cout << "Test GetInverse(): "; - TransformType::Pointer t_inv = TransformType::New(); - const bool invSuccessful = t->GetInverse(t_inv); + auto t_inv = TransformType::New(); + const bool invSuccessful = t->GetInverse(t_inv); if (!invSuccessful) { std::cout << " [ FAILED ] " << std::endl; @@ -474,7 +474,7 @@ itkEuler3DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t3 = TransformType::New(); + auto t3 = TransformType::New(); t3->SetMatrix(MatrixType(t->GetMatrix().GetInverse())); ParametersType par0 = t3->GetParameters(); @@ -492,7 +492,7 @@ itkEuler3DTransformTest(int, char *[]) std::cout << "[ PASSED ]" << std::endl; } { - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if (!t->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Core/Transform/test/itkFixedCenterOfRotationAffineTransformTest.cxx b/Modules/Core/Transform/test/itkFixedCenterOfRotationAffineTransformTest.cxx index a2d98579a7a..8890c236268 100644 --- a/Modules/Core/Transform/test/itkFixedCenterOfRotationAffineTransformTest.cxx +++ b/Modules/Core/Transform/test/itkFixedCenterOfRotationAffineTransformTest.cxx @@ -31,7 +31,7 @@ itkFixedCenterOfRotationAffineTransformTest(int, char *[]) FCoRAffine2DType::InputVectorType vector2; FCoRAffine2DType::InputPointType point2; - FCoRAffine2DType::Pointer id2 = FCoRAffine2DType::New(); + auto id2 = FCoRAffine2DType::New(); matrix2 = id2->GetMatrixComponent(); vector2 = id2->GetOffsetComponent(); point2 = id2->GetCenterOfRotationComponent(); @@ -78,7 +78,7 @@ itkFixedCenterOfRotationAffineTransformTest(int, char *[]) point2[0] = 1.0; point2[1] = 1.0; - FCoRAffine2DType::Pointer aff2 = FCoRAffine2DType::New(); + auto aff2 = FCoRAffine2DType::New(); aff2->SetCenterOfRotationComponent(point2); aff2->SetMatrixComponent(matrix2); aff2->SetOffsetComponent(vector2); diff --git a/Modules/Core/Transform/test/itkIdentityTransformTest.cxx b/Modules/Core/Transform/test/itkIdentityTransformTest.cxx index dee249f50bc..2a57523c39d 100644 --- a/Modules/Core/Transform/test/itkIdentityTransformTest.cxx +++ b/Modules/Core/Transform/test/itkIdentityTransformTest.cxx @@ -33,7 +33,7 @@ itkIdentityTransformTest(int, char *[]) bool Ok = true; using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer transform = IdentityTransformType::New(); + auto transform = IdentityTransformType::New(); std::cout << "Testing TransformPoint: "; IdentityTransformType::InputPointType p(10); @@ -170,7 +170,7 @@ itkIdentityTransformTest(int, char *[]) std::cout << " [ PASSED ] " << std::endl; } - IdentityTransformType::Pointer inv = IdentityTransformType::New(); + auto inv = IdentityTransformType::New(); ITK_TEST_EXPECT_TRUE(transform->GetInverse(inv)); ITK_TEST_EXPECT_TRUE(!transform->GetInverse(nullptr)); diff --git a/Modules/Core/Transform/test/itkMultiTransformTest.cxx b/Modules/Core/Transform/test/itkMultiTransformTest.cxx index 46856be6de1..f52e770ba09 100644 --- a/Modules/Core/Transform/test/itkMultiTransformTest.cxx +++ b/Modules/Core/Transform/test/itkMultiTransformTest.cxx @@ -129,7 +129,7 @@ itkMultiTransformTest(int, char *[]) using Superclass = MultiTransformType::Superclass; using ScalarType = Superclass::ScalarType; - MultiTransformType::Pointer multiTransform = MultiTransformType::New(); + auto multiTransform = MultiTransformType::New(); /* Test obects */ using Matrix2Type = itk::Matrix; @@ -150,9 +150,9 @@ itkMultiTransformTest(int, char *[]) /* Add an affine transform */ using AffineType = itk::AffineTransform; - AffineType::Pointer affine = AffineType::New(); - Matrix2Type matrix2; - Vector2Type vector2; + auto affine = AffineType::New(); + Matrix2Type matrix2; + Vector2Type vector2; matrix2[0][0] = 0; matrix2[0][1] = -1; matrix2[1][0] = 1; @@ -281,13 +281,13 @@ itkMultiTransformTest(int, char *[]) multiTransform->AddTransform(affine); /* Test inverse */ - MultiTransformType::Pointer inverseMultiTransform = MultiTransformType::New(); + auto inverseMultiTransform = MultiTransformType::New(); if (!multiTransform->GetInverse(inverseMultiTransform)) { std::cout << "ERROR: GetInverse() failed." << std::endl; return EXIT_FAILURE; } - AffineType::Pointer inverseAffine = AffineType::New(); + auto inverseAffine = AffineType::New(); if (!affine->GetInverse(inverseAffine)) { std::cout << "FAILED getting inverse of affine." << std::endl; @@ -321,9 +321,9 @@ itkMultiTransformTest(int, char *[]) /* Create a displacement field transform */ using DisplacementTransformType = itk::DisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType size; FieldType::IndexType start; @@ -344,7 +344,7 @@ itkMultiTransformTest(int, char *[]) displacementTransform->SetDisplacementField(field); /* set inverse field */ - FieldType::Pointer inverseField = FieldType::New(); // This is based on itk::Image + auto inverseField = FieldType::New(); // This is based on itk::Image inverseField->SetRegions(region); inverseField->Allocate(); DisplacementTransformType::OutputVectorType inverseVector; @@ -397,7 +397,7 @@ itkMultiTransformTest(int, char *[]) return EXIT_FAILURE; } - DisplacementTransformType::Pointer inverseDisplacement = DisplacementTransformType::New(); + auto inverseDisplacement = DisplacementTransformType::New(); if (!displacementTransform->GetInverse(inverseDisplacement)) { std::cout << "FAILED getting inverse of displacementTransform." << std::endl; @@ -548,7 +548,7 @@ itkMultiTransformTest(int, char *[]) /* * Add a third transform */ - AffineType::Pointer affine3 = AffineType::New(); + auto affine3 = AffineType::New(); matrix2[0][0] = 0; matrix2[0][1] = -1; matrix2[1][0] = 1; @@ -576,7 +576,7 @@ itkMultiTransformTest(int, char *[]) std::cout << "MultiTransform with 3 transforms: " << std::endl << multiTransform << std::endl; /* Get inverse */ - MultiTransformType::Pointer inverseTransform3 = MultiTransformType::New(); + auto inverseTransform3 = MultiTransformType::New(); if (!multiTransform->GetInverse(inverseTransform3)) { std::cout << "Failed calling GetInverse() (3)." << std::endl; diff --git a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx index d9881eb6028..34e73248e87 100644 --- a/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx +++ b/Modules/Core/Transform/test/itkQuaternionRigidTransformTest.cxx @@ -34,7 +34,7 @@ itkQuaternionRigidTransformTest(int, char *[]) /* Create a 3D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); TransformType::OffsetType offset = identityTransform->GetOffset(); std::cout << "Vector from instantiating an identity transform: "; std::cout << offset << std::endl; @@ -55,7 +55,7 @@ itkQuaternionRigidTransformTest(int, char *[]) /* Create a Rigid 3D transform with translation */ { - TransformType::Pointer translation = TransformType::New(); + auto translation = TransformType::New(); TransformType::OutputVectorType itransVector; itransVector[0] = 1; itransVector[1] = 4; @@ -194,7 +194,7 @@ itkQuaternionRigidTransformTest(int, char *[]) /* Create a Rigid 3D transform with a rotation given by a Matrix */ { - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); TransformType::VnlQuaternionType qrotation; // 15 degrees in radians @@ -404,7 +404,7 @@ itkQuaternionRigidTransformTest(int, char *[]) // Test the Jacobian std::cout << "Testing ComputeJacobianWithRespectToParameters()" << std::endl; - TransformType::Pointer quaternionRigid = TransformType::New(); + auto quaternionRigid = TransformType::New(); TransformType::ParametersType parameters(quaternionRigid->GetNumberOfParameters()); parameters.Fill(0.0); @@ -474,8 +474,8 @@ itkQuaternionRigidTransformTest(int, char *[]) TransformType::OutputPointType pOut; quaternionRigid->SetParameters(parameters); { - TransformType::Pointer inverseQuaternionRigid = TransformType::New(); - const bool inverseIsValid = quaternionRigid->GetInverse(inverseQuaternionRigid); + auto inverseQuaternionRigid = TransformType::New(); + const bool inverseIsValid = quaternionRigid->GetInverse(inverseQuaternionRigid); if (!inverseIsValid) { std::cerr << "Error computing inverse transform" << std::endl; @@ -506,7 +506,7 @@ itkQuaternionRigidTransformTest(int, char *[]) /* Create a Rigid 3D transform with a defined center and a rotation given by a Matrix */ { - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); TransformType::VnlQuaternionType qrotation; // 15 degrees in radians @@ -751,7 +751,7 @@ itkQuaternionRigidTransformTest(int, char *[]) using MatrixType = TransformType::MatrixType; MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix par = 0; @@ -829,7 +829,7 @@ itkQuaternionRigidTransformTest(int, char *[]) t = TransformType::New(); t->SetParameters(e); - TransformType::Pointer t2 = TransformType::New(); + auto t2 = TransformType::New(); t2->SetMatrix(t->GetMatrix()); ParametersType p = t2->GetParameters(); diff --git a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx index 4725ae5e2ad..b44873a763d 100644 --- a/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid2DTransformTest.cxx @@ -57,7 +57,7 @@ itkRigid2DTransformTest(int, char *[]) /* Create a 2D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); identityTransform->SetIdentity(); TransformType::OffsetType offset = identityTransform->GetOffset(); std::cout << "Vector from instantiating an identity transform: "; @@ -80,13 +80,13 @@ itkRigid2DTransformTest(int, char *[]) /* Create a Rigid 2D transform with translation */ { - TransformType::Pointer translation = TransformType::New(); + auto translation = TransformType::New(); TransformType::OffsetType::ValueType ioffsetInit[2] = { 1, 4 }; TransformType::OffsetType ioffset = ioffsetInit; translation->SetOffset(ioffset); - TransformType::Pointer translationInverse = TransformType::New(); + auto translationInverse = TransformType::New(); if (!translation->GetInverse(translationInverse)) { std::cout << "Cannot create transform" << std::endl; @@ -234,7 +234,7 @@ itkRigid2DTransformTest(int, char *[]) /* Create a Rigid 2D transform with a rotation given by a Matrix */ { - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); TransformType::MatrixType mrotation; mrotation.SetIdentity(); @@ -262,7 +262,7 @@ itkRigid2DTransformTest(int, char *[]) rotation->SetOffset(ioffset); - TransformType::Pointer rotationInverse = TransformType::New(); + auto rotationInverse = TransformType::New(); if (!rotation->GetInverse(rotationInverse)) { std::cout << "Cannot create transform" << std::endl; @@ -458,7 +458,7 @@ itkRigid2DTransformTest(int, char *[]) { // Test instantiation, inverse computation, back transform etc. - TransformType::Pointer t1 = TransformType::New(); + auto t1 = TransformType::New(); // Set parameters double angle0; @@ -495,7 +495,7 @@ itkRigid2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t2dash = TransformType::New(); + auto t2dash = TransformType::New(); t1->GetInverse(t2dash); TransformType::InputPointType p3dash; p3dash = t2dash->TransformPoint(p2); @@ -535,7 +535,7 @@ itkRigid2DTransformTest(int, char *[]) } // Test compose - TransformType::Pointer t4 = TransformType::New(); + auto t4 = TransformType::New(); angle0 = 14.7 / 180.0 * itk::Math::pi; center.Fill(4.0); diff --git a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx index 124dd694a17..6c5614fb46d 100644 --- a/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DPerspectiveTransformTest.cxx @@ -38,7 +38,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) /* Create a 3D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); identityTransform->SetFocalDistance(focal); TransformType::OffsetType offset = identityTransform->GetOffset(); @@ -62,7 +62,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) /* Create a Rigid 3D transform with translation */ { - TransformType::Pointer translation = TransformType::New(); + auto translation = TransformType::New(); translation->SetFocalDistance(focal); TransformType::OffsetType ioffset; @@ -124,7 +124,7 @@ itkRigid3DPerspectiveTransformTest(int, char *[]) /* Create a Rigid 3D transform with a rotation */ { - TransformType::Pointer rigid = TransformType::New(); + auto rigid = TransformType::New(); rigid->SetFocalDistance(focal); TransformType::OffsetType ioffset; diff --git a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx index 735c3557ce9..43f0f775a2a 100644 --- a/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkRigid3DTransformTest.cxx @@ -71,7 +71,7 @@ TestSettingTranslation() using TransformType = itk::Rigid3DTransformSurrogate; - TransformType::Pointer r1 = TransformType::New(); + auto r1 = TransformType::New(); // r1->SetIdentity(); r1->SetMatrix(R); r1->Translate(T); @@ -80,7 +80,7 @@ TestSettingTranslation() p1.set_size(12); p1 = r1->GetParameters(); - TransformType::Pointer r2 = TransformType::New(); + auto r2 = TransformType::New(); TransformType::ParametersType p2; p2.set_size(12); @@ -95,7 +95,7 @@ TestSettingTranslation() p2[10] = T[1]; p2[11] = T[2]; r2->SetParameters(p2); - TransformType::Pointer r3 = TransformType::New(); + auto r3 = TransformType::New(); r3->SetFixedParameters(r1->GetFixedParameters()); r3->SetParameters(r1->GetParameters()); @@ -133,7 +133,7 @@ itkRigid3DTransformTest(int, char *[]) /* Create a 3D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); TransformType::OffsetType offset = identityTransform->GetOffset(); std::cout << "Vector from instantiating an identity transform: "; std::cout << offset << std::endl; @@ -155,7 +155,7 @@ itkRigid3DTransformTest(int, char *[]) /* Create a Rigid 3D transform with translation */ { - TransformType::Pointer translation = TransformType::New(); + auto translation = TransformType::New(); TransformType::OffsetType::ValueType ioffsetInit[3] = { 1, 4, 9 }; TransformType::OffsetType ioffset = ioffsetInit; @@ -291,7 +291,7 @@ itkRigid3DTransformTest(int, char *[]) /* Create a Rigid 3D transform with a rotation given by a Matrix */ { - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); TransformType::MatrixType mrotation; mrotation.SetIdentity(); @@ -497,8 +497,8 @@ itkRigid3DTransformTest(int, char *[]) std::cout << "Testing SetParameters() ... "; unsigned int j; - TransformType::Pointer t = TransformType::New(); - ParametersType p(t->GetNumberOfParameters()); + auto t = TransformType::New(); + ParametersType p(t->GetNumberOfParameters()); // attempt to set an non-orthogonal matrix for (j = 0; j < t->GetNumberOfParameters(); ++j) @@ -579,8 +579,8 @@ itkRigid3DTransformTest(int, char *[]) // Testing SetIdentity() std::cout << "Testing SetIdentity() ... "; - TransformType::Pointer t = TransformType::New(); - ParametersType p(t->GetNumberOfParameters()); + auto t = TransformType::New(); + ParametersType p(t->GetNumberOfParameters()); t->SetIdentity(); p = t->GetParameters(); @@ -621,7 +621,7 @@ itkRigid3DTransformTest(int, char *[]) using MatrixType = TransformType::MatrixType; MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix par = 0; diff --git a/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx b/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx index ec26b6ebc41..bd9b48fae83 100644 --- a/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleLogarithmicTransformTest.cxx @@ -32,14 +32,14 @@ itkScaleLogarithmicTransformTest(int, char *[]) bool testStatus = true; - TransformType::Pointer scaleLogTransform = TransformType::New(); + auto scaleLogTransform = TransformType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(scaleLogTransform, ScaleLogarithmicTransform, ScaleTransform); /* Create a 3D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); TransformType::ScaleType scale = identityTransform->GetScale(); std::cout << "Scale from instantiating an identity transform: "; for (unsigned int j = 0; j < N; ++j) @@ -64,7 +64,7 @@ itkScaleLogarithmicTransformTest(int, char *[]) /* Create a Scale transform */ { - TransformType::Pointer scaleTransform = TransformType::New(); + auto scaleTransform = TransformType::New(); TransformType::ScaleType::ValueType iscaleInit[3] = { 1, 4, 9 }; TransformType::ScaleType iscale = iscaleInit; diff --git a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx index e6c4ad3e32c..78a83491ebc 100644 --- a/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleSkewVersor3DTransformTest.cxx @@ -66,7 +66,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); VectorType axis(1.5); @@ -99,8 +99,8 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; } @@ -110,7 +110,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -268,7 +268,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -407,7 +407,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the SetIdentity() method " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -462,7 +462,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the Scaling methods " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -533,7 +533,7 @@ itkScaleSkewVersor3DTransformTest(int, char *[]) std::cout << "Input/Output parameter check Passed !" << std::endl; #if 0 // TODO: Need to instrument inverse of ScaleVersor3DTransform { - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if(!transform->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Core/Transform/test/itkScaleTransformTest.cxx b/Modules/Core/Transform/test/itkScaleTransformTest.cxx index cf0c3aede42..a57e912db40 100644 --- a/Modules/Core/Transform/test/itkScaleTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleTransformTest.cxx @@ -37,7 +37,7 @@ itkScaleTransformTest(int, char *[]) /* Create a 3D identity transformation and show its parameters */ { - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); TransformType::ScaleType scale = identityTransform->GetScale(); std::cout << "Scale from instantiating an identity transform: "; for (unsigned int j = 0; j < N; ++j) @@ -62,7 +62,7 @@ itkScaleTransformTest(int, char *[]) /* Create a Scale transform */ { - TransformType::Pointer scaleTransform = TransformType::New(); + auto scaleTransform = TransformType::New(); TransformType::ScaleType::ValueType iscaleInit[3] = { 1, 4, 9 }; TransformType::ScaleType iscale = iscaleInit; diff --git a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx index 9fc31d5e670..170b052e342 100644 --- a/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkScaleVersor3DTransformTest.cxx @@ -57,7 +57,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); std::cout << transform->GetNameOfClass() << std::endl; @@ -97,8 +97,8 @@ itkScaleVersor3DTransformTest(int, char *[]) { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; @@ -124,7 +124,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -282,7 +282,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -419,7 +419,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the SetIdentity() method " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -468,7 +468,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { std::cout << " Exercise the Scaling methods " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -542,7 +542,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { // Exercise exceptions std::cout << " Exercise Exceptions " << std::endl; - TransformHelperType::Pointer transform = TransformHelperType::New(); + auto transform = TransformHelperType::New(); // At this point the method ComputeMatrixParameters() is expected to throw // an exception. @@ -561,7 +561,7 @@ itkScaleVersor3DTransformTest(int, char *[]) { std::cout << "Exercise SetParameters with Versor norm > 1.0 - epsilon" << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); const unsigned int np = transform->GetNumberOfParameters(); @@ -575,7 +575,7 @@ itkScaleVersor3DTransformTest(int, char *[]) transform->SetParameters(parameters); #if 0 // TODO: Need to instrument inverse of ScaleVersor3DTransform { - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if(!transform->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx index 001c0f436df..ac4106d28dc 100644 --- a/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSimilarity2DTransformTest.cxx @@ -54,7 +54,7 @@ itkSimilarity2DTransformTest(int, char *[]) bool Ok = true; using SimilarityTransformType = itk::CenteredSimilarity2DTransform; - SimilarityTransformType::Pointer transform = SimilarityTransformType::New(); + auto transform = SimilarityTransformType::New(); // Test the identity transform std::cout << "Testing Identity:"; @@ -84,8 +84,8 @@ itkSimilarity2DTransformTest(int, char *[]) } // Test SetAngle/GetAngle - SimilarityTransformType::Pointer transform1 = SimilarityTransformType::New(); - SimilarityTransformType::Pointer transform2 = SimilarityTransformType::New(); + auto transform1 = SimilarityTransformType::New(); + auto transform2 = SimilarityTransformType::New(); transform1->SetIdentity(); double angle1 = .125; transform1->SetAngle(angle1); @@ -245,7 +245,7 @@ itkSimilarity2DTransformTest(int, char *[]) { // Test instantiation, inverse computation, back transform etc. using TransformType = itk::Similarity2DTransform; - TransformType::Pointer t1 = TransformType::New(); + auto t1 = TransformType::New(); // Set parameters TransformType::ParametersType parameters(t1->GetNumberOfParameters()); @@ -282,7 +282,7 @@ itkSimilarity2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t2dash = TransformType::New(); + auto t2dash = TransformType::New(); t1->GetInverse(t2dash); TransformType::InputPointType p3dash; p3dash = t2dash->TransformPoint(p2); @@ -334,7 +334,7 @@ itkSimilarity2DTransformTest(int, char *[]) } // Test compose - TransformType::Pointer t4 = TransformType::New(); + auto t4 = TransformType::New(); parameters[0] = 0.6; parameters[1] = 14.7 / 180.0 * itk::Math::pi; @@ -424,7 +424,7 @@ itkSimilarity2DTransformTest(int, char *[]) { // Test instantiation, inverse computation, back transform etc. using TransformType = SimilarityTransformType; - TransformType::Pointer t1 = TransformType::New(); + auto t1 = TransformType::New(); // Set parameters TransformType::ParametersType parameters(t1->GetNumberOfParameters()); @@ -458,7 +458,7 @@ itkSimilarity2DTransformTest(int, char *[]) return EXIT_FAILURE; } - TransformType::Pointer t2dash = TransformType::New(); + auto t2dash = TransformType::New(); t1->GetInverse(t2dash); TransformType::InputPointType p3dash; p3dash = t2dash->TransformPoint(p2); @@ -497,7 +497,7 @@ itkSimilarity2DTransformTest(int, char *[]) } // Test compose - TransformType::Pointer t4 = TransformType::New(); + auto t4 = TransformType::New(); parameters[0] = 0.6; parameters[1] = 14.7 / 180.0 * itk::Math::pi; @@ -583,8 +583,8 @@ itkSimilarity2DTransformTest(int, char *[]) { // Test Set/Get Matrix and Set/Get Offset using TransformType = itk::Similarity2DTransform; - TransformType::Pointer t1 = TransformType::New(); - TransformType::Pointer t2 = TransformType::New(); + auto t1 = TransformType::New(); + auto t2 = TransformType::New(); TransformType::InputPointType center; center[0] = 9.0; diff --git a/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx b/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx index b40f2aaebce..fac50070593 100644 --- a/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSimilarity3DTransformTest.cxx @@ -59,7 +59,7 @@ itkSimilarity3DTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); if (std::fabs(transform->GetScale() - 1.0) > itk::NumericTraits::min()) { std::cout << "Error: Scale: Expected 1.0, got " << transform->GetScale() << " ! " << std::endl; @@ -102,8 +102,8 @@ itkSimilarity3DTransformTest(int, char *[]) } { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; } @@ -112,7 +112,7 @@ itkSimilarity3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -268,7 +268,7 @@ itkSimilarity3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -394,7 +394,7 @@ itkSimilarity3DTransformTest(int, char *[]) { std::cout << " Exercise the SetIdentity() method " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -441,7 +441,7 @@ itkSimilarity3DTransformTest(int, char *[]) { std::cout << " Exercise the Scaling methods " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -511,7 +511,7 @@ itkSimilarity3DTransformTest(int, char *[]) MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix par = 0; @@ -600,7 +600,7 @@ itkSimilarity3DTransformTest(int, char *[]) t->SetCenter(center); t->SetParameters(e); - TransformType::Pointer t2 = TransformType::New(); + auto t2 = TransformType::New(); t2->SetCenter(center); t2->SetMatrix(t->GetMatrix()); diff --git a/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx b/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx index 1370caf56ac..1be52bc9a6d 100644 --- a/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx +++ b/Modules/Core/Transform/test/itkSplineKernelTransformTest.cxx @@ -57,15 +57,15 @@ itkSplineKernelTransformTest(int, char *[]) PointType2D targetPoint2D; PointType2D mappedPoint2D; - EBSTransform2DType::Pointer ebs2D = EBSTransform2DType::New(); - EBRSTransform2DType::Pointer ebrs2D = EBRSTransform2DType::New(); - TPSTransform2DType::Pointer tps2D = TPSTransform2DType::New(); - TPR2LRSTransform2DType::Pointer tpr2lrs2D = TPR2LRSTransform2DType::New(); - VSTransform2DType::Pointer vs2D = VSTransform2DType::New(); + auto ebs2D = EBSTransform2DType::New(); + auto ebrs2D = EBRSTransform2DType::New(); + auto tps2D = TPSTransform2DType::New(); + auto tpr2lrs2D = TPR2LRSTransform2DType::New(); + auto vs2D = VSTransform2DType::New(); // Reserve memory for the number of points - PointSetType2D::Pointer sourceLandmarks2D = PointSetType2D::New(); - PointSetType2D::Pointer targetLandmarks2D = PointSetType2D::New(); + auto sourceLandmarks2D = PointSetType2D::New(); + auto targetLandmarks2D = PointSetType2D::New(); sourceLandmarks2D->GetPoints()->Reserve(4); targetLandmarks2D->GetPoints()->Reserve(4); @@ -358,11 +358,11 @@ itkSplineKernelTransformTest(int, char *[]) PointType3D mappedPoint3D; // Reserve memory for the number of points - EBSTransform3DType::Pointer ebs3D = EBSTransform3DType::New(); + auto ebs3D = EBSTransform3DType::New(); ebs3D->GetModifiableTargetLandmarks()->GetPoints()->Reserve(8); ebs3D->GetModifiableSourceLandmarks()->GetPoints()->Reserve(8); - TPSTransform3DType::Pointer tps3D = TPSTransform3DType::New(); + auto tps3D = TPSTransform3DType::New(); tps3D->GetModifiableTargetLandmarks()->GetPoints()->Reserve(8); tps3D->GetModifiableSourceLandmarks()->GetPoints()->Reserve(8); @@ -483,8 +483,8 @@ itkSplineKernelTransformTest(int, char *[]) PointType4D targetPoint4D; PointType4D mappedPoint4D; - EBSTransform4DType::Pointer ebs4D = EBSTransform4DType::New(); - TPSTransform4DType::Pointer tps4D = TPSTransform4DType::New(); + auto ebs4D = EBSTransform4DType::New(); + auto tps4D = TPSTransform4DType::New(); // Reserve memory for the number of points ebs4D->GetModifiableTargetLandmarks()->GetPoints()->Reserve(16); diff --git a/Modules/Core/Transform/test/itkTransformCloneTest.cxx b/Modules/Core/Transform/test/itkTransformCloneTest.cxx index ce06049b1fb..d5452d1b039 100644 --- a/Modules/Core/Transform/test/itkTransformCloneTest.cxx +++ b/Modules/Core/Transform/test/itkTransformCloneTest.cxx @@ -59,7 +59,7 @@ itkTransformCloneTest(int, char *[]) { using AffineTransformType = itk::AffineTransform; using Transform3DType = itk::Transform; - AffineTransformType::Pointer affineXfrm = AffineTransformType::New(); + auto affineXfrm = AffineTransformType::New(); AffineTransformType::OutputVectorType axis, offset; axis[0] = -1.0; axis[1] = 1.0; @@ -96,7 +96,7 @@ itkTransformCloneTest(int, char *[]) return EXIT_FAILURE; } using CompositeTransformType = itk::CompositeTransform; - CompositeTransformType::Pointer compositeXfrm = CompositeTransformType::New(); + auto compositeXfrm = CompositeTransformType::New(); compositeXfrm->AddTransform(clonePtr); compositeXfrm->SetOnlyMostRecentTransformToOptimizeOn(); diff --git a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx index dc95cd1ee60..b5f7e4344cd 100644 --- a/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx +++ b/Modules/Core/Transform/test/itkTransformGeometryImageFilterTest.cxx @@ -120,13 +120,13 @@ itkTransformGeometryImageFilterTest(int argc, char * argv[]) double rotationAngle = .5; // Radians - TransformType::Pointer transform = TransformType::New(); // Identity by default + auto transform = TransformType::New(); // Identity by default transform->SetCenter(center); transform->Translate(translation); transform->SetRotation(rotationAxis, rotationAngle); // Set up the transform filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, TransformGeometryImageFilter, InPlaceImageFilter); // Test the exceptions diff --git a/Modules/Core/Transform/test/itkTransformTest.cxx b/Modules/Core/Transform/test/itkTransformTest.cxx index ef5652cc823..9222f779712 100644 --- a/Modules/Core/Transform/test/itkTransformTest.cxx +++ b/Modules/Core/Transform/test/itkTransformTest.cxx @@ -196,7 +196,7 @@ class TransformTester RunTests() { std::cout << "Testing itkTransform<" << NInputDimensions << "," << NOutputDimensions << ">" << std::endl; - typename TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); InputPointType pnt; pnt.Fill(2.9); diff --git a/Modules/Core/Transform/test/itkTransformsSetParametersTest.cxx b/Modules/Core/Transform/test/itkTransformsSetParametersTest.cxx index 67be20906a8..c8b84f323a4 100644 --- a/Modules/Core/Transform/test/itkTransformsSetParametersTest.cxx +++ b/Modules/Core/Transform/test/itkTransformsSetParametersTest.cxx @@ -47,9 +47,9 @@ TestKernelTransform(const char * name, KernelType *) using KernelPointSetType = typename KernelType::PointSetType; - typename KernelType::Pointer kernel = KernelType::New(); - typename KernelPointSetType::Pointer targetLandmarks = KernelPointSetType::New(); - typename KernelPointSetType::Pointer sourceLandmarks = KernelPointSetType::New(); + auto kernel = KernelType::New(); + auto targetLandmarks = KernelPointSetType::New(); + auto sourceLandmarks = KernelPointSetType::New(); targetLandmarks->GetPoints()->Reserve(4); sourceLandmarks->GetPoints()->Reserve(4); @@ -105,7 +105,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "AffineTransform->SetParameters() - " << std::flush; using Affine = itk::AffineTransform; - Affine::Pointer affine = Affine::New(); + auto affine = Affine::New(); beginMTime = affine->GetMTime(); Affine::ParametersType affineParams = affine->GetParameters(); affineParams[0] = 1.0; @@ -119,7 +119,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "CenteredAffineTransform->SetParameters() - " << std::flush; using CenteredAffine = itk::CenteredAffineTransform; - CenteredAffine::Pointer centeredAffine = CenteredAffine::New(); + auto centeredAffine = CenteredAffine::New(); beginMTime = centeredAffine->GetMTime(); CenteredAffine::ParametersType centeredAffineParams = centeredAffine->GetParameters(); centeredAffineParams[0] = 1.0; @@ -132,7 +132,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "CenteredEuler3DTransform->SetParameters() - " << std::flush; using CenteredEuler3D = itk::CenteredEuler3DTransform; - CenteredEuler3D::Pointer centeredEuler3D = CenteredEuler3D::New(); + auto centeredEuler3D = CenteredEuler3D::New(); beginMTime = centeredEuler3D->GetMTime(); CenteredEuler3D::ParametersType centeredEuler3DParams = centeredEuler3D->GetParameters(); centeredEuler3DParams[0] = 1.0; @@ -145,7 +145,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "CenteredRigid2DTransform->SetParameters() - " << std::flush; using CenteredRigid2D = itk::CenteredRigid2DTransform; - CenteredRigid2D::Pointer centeredRigid2D = CenteredRigid2D::New(); + auto centeredRigid2D = CenteredRigid2D::New(); beginMTime = centeredRigid2D->GetMTime(); CenteredRigid2D::ParametersType centeredRigid2DParams = centeredRigid2D->GetParameters(); centeredRigid2DParams[0] = 1.0; @@ -158,7 +158,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "CenteredSimilarity2DTransform->SetParameters() - " << std::flush; using CenteredSimilarity2D = itk::CenteredSimilarity2DTransform; - CenteredSimilarity2D::Pointer centeredSimilarity2D = CenteredSimilarity2D::New(); + auto centeredSimilarity2D = CenteredSimilarity2D::New(); beginMTime = centeredSimilarity2D->GetMTime(); CenteredSimilarity2D::ParametersType centeredSimilarity2DParams = centeredSimilarity2D->GetParameters(); centeredSimilarity2DParams[0] = 1.0; @@ -171,7 +171,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Euler2DTransform->SetParameters() - " << std::flush; using Euler2D = itk::Euler2DTransform; - Euler2D::Pointer euler2D = Euler2D::New(); + auto euler2D = Euler2D::New(); beginMTime = euler2D->GetMTime(); Euler2D::ParametersType euler2DParams = euler2D->GetParameters(); euler2DParams[0] = 1.0; @@ -184,7 +184,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Euler3DTransform->SetParameters() - " << std::flush; using Euler3D = itk::Euler3DTransform; - Euler3D::Pointer euler3D = Euler3D::New(); + auto euler3D = Euler3D::New(); beginMTime = euler3D->GetMTime(); Euler3D::ParametersType euler3DParams = euler3D->GetParameters(); euler3DParams[0] = 1.0; @@ -197,7 +197,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "FixedCenteredAffineTransform->SetParameters() - " << std::flush; using FixedCenteredAffine = itk::FixedCenterOfRotationAffineTransform; - FixedCenteredAffine::Pointer fixedCenteredAffine = FixedCenteredAffine::New(); + auto fixedCenteredAffine = FixedCenteredAffine::New(); beginMTime = fixedCenteredAffine->GetMTime(); FixedCenteredAffine::ParametersType fixedCenteredAffineParams = fixedCenteredAffine->GetParameters(); fixedCenteredAffineParams[0] = 1.0; @@ -211,7 +211,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "QuaternionRigidTransform->SetParameters() - " << std::flush; using QuaternionRigid = itk::QuaternionRigidTransform; - QuaternionRigid::Pointer quaternionRigid = QuaternionRigid::New(); + auto quaternionRigid = QuaternionRigid::New(); beginMTime = quaternionRigid->GetMTime(); QuaternionRigid::ParametersType quaternionRigidParams = quaternionRigid->GetParameters(); quaternionRigidParams[0] = 1.0; @@ -224,7 +224,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Rigid2DTransform->SetParameters() - " << std::flush; using Rigid2D = itk::Rigid2DTransform; - Rigid2D::Pointer rigid2D = Rigid2D::New(); + auto rigid2D = Rigid2D::New(); beginMTime = rigid2D->GetMTime(); Rigid2D::ParametersType rigid2DParams = rigid2D->GetParameters(); rigid2DParams[0] = 1.0; @@ -238,7 +238,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Rigid3DPerspectiveTransform->SetParameters() - " << std::flush; using Rigid3DPerspective = itk::Rigid3DPerspectiveTransform; - Rigid3DPerspective::Pointer rigid3DPerspective = Rigid3DPerspective::New(); + auto rigid3DPerspective = Rigid3DPerspective::New(); beginMTime = rigid3DPerspective->GetMTime(); Rigid3DPerspective::ParametersType rigid3DPerspectiveParams = rigid3DPerspective->GetParameters(); rigid3DPerspectiveParams[0] = 1.0; @@ -251,7 +251,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "ScalableAffineTransform->SetParameters() - " << std::flush; using ScalableAffine = itk::ScalableAffineTransform; - ScalableAffine::Pointer scalableAffine = ScalableAffine::New(); + auto scalableAffine = ScalableAffine::New(); beginMTime = scalableAffine->GetMTime(); ScalableAffine::ParametersType scalableAffineParams = scalableAffine->GetParameters(); scalableAffineParams[0] = 1.0; @@ -264,7 +264,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "ScaleLogarithmicTransform->SetParameters() - " << std::flush; using ScaleLogarithmic = itk::ScaleLogarithmicTransform; - ScaleLogarithmic::Pointer scaleLogarithmic = ScaleLogarithmic::New(); + auto scaleLogarithmic = ScaleLogarithmic::New(); beginMTime = scaleLogarithmic->GetMTime(); ScaleLogarithmic::ParametersType scaleLogarithmicParams = scaleLogarithmic->GetParameters(); scaleLogarithmicParams[0] = 1.0; @@ -277,7 +277,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "ScaleSkewVersor3DTransform->SetParameters() - " << std::flush; using ScaleSkewVersor3D = itk::ScaleSkewVersor3DTransform; - ScaleSkewVersor3D::Pointer scaleSkewVersor3D = ScaleSkewVersor3D::New(); + auto scaleSkewVersor3D = ScaleSkewVersor3D::New(); beginMTime = scaleSkewVersor3D->GetMTime(); ScaleSkewVersor3D::ParametersType scaleSkewVersor3DParams = scaleSkewVersor3D->GetParameters(); scaleSkewVersor3DParams[0] = 1.0; @@ -290,7 +290,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "ScaleTransform->SetParameters() - " << std::flush; using Scale = itk::ScaleTransform; - Scale::Pointer scale = Scale::New(); + auto scale = Scale::New(); beginMTime = scale->GetMTime(); Scale::ParametersType scaleParams = scale->GetParameters(); scaleParams[0] = 1.0; @@ -303,7 +303,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Similarity2DTransform->SetParameters() - " << std::flush; using Similarity2D = itk::Similarity2DTransform; - Similarity2D::Pointer similarity2D = Similarity2D::New(); + auto similarity2D = Similarity2D::New(); beginMTime = similarity2D->GetMTime(); Similarity2D::ParametersType similarity2DParams = similarity2D->GetParameters(); similarity2DParams[0] = 1.0; @@ -316,7 +316,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "Similarity3DTransform->SetParameters() - " << std::flush; using Similarity3D = itk::Similarity3DTransform; - Similarity3D::Pointer similarity3D = Similarity3D::New(); + auto similarity3D = Similarity3D::New(); beginMTime = similarity3D->GetMTime(); Similarity3D::ParametersType similarity3DParams = similarity3D->GetParameters(); similarity3DParams[0] = 1.0; @@ -329,7 +329,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "TranslationTransform->SetParameters() - " << std::flush; using Translation = itk::TranslationTransform; - Translation::Pointer translation = Translation::New(); + auto translation = Translation::New(); beginMTime = translation->GetMTime(); Translation::ParametersType translationParams = translation->GetParameters(); translationParams[0] = 1.0; @@ -342,7 +342,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "VersorTransform->SetParameters() - " << std::flush; using Versor = itk::VersorTransform; - Versor::Pointer versor = Versor::New(); + auto versor = Versor::New(); beginMTime = versor->GetMTime(); Versor::ParametersType versorParams = versor->GetParameters(); versorParams[0] = 1.0; @@ -355,7 +355,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "AzimuthElevationToCartesianTransform->SetParameters() - " << std::flush; using AzimuthElevationToCartesian = itk::AzimuthElevationToCartesianTransform; - AzimuthElevationToCartesian::Pointer azimuthElevation = AzimuthElevationToCartesian::New(); + auto azimuthElevation = AzimuthElevationToCartesian::New(); beginMTime = azimuthElevation->GetMTime(); AzimuthElevationToCartesian::ParametersType azimuthElevationParams = azimuthElevation->GetParameters(); azimuthElevationParams[0] = 1.0; @@ -368,7 +368,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "VersorRigid3DTransform->SetParameters() - " << std::flush; using VersorRigid3D = itk::VersorRigid3DTransform; - VersorRigid3D::Pointer versorRigid3D = VersorRigid3D::New(); + auto versorRigid3D = VersorRigid3D::New(); beginMTime = versorRigid3D->GetMTime(); VersorRigid3D::ParametersType versorRigid3DParams = versorRigid3D->GetParameters(); versorRigid3DParams[0] = 1.0; @@ -382,7 +382,7 @@ itkTransformsSetParametersTest(int, char *[]) std::cout << "BSplineTransform->SetParameters() - Not Tested (manual check indicates PASS)" << std::endl; // using BSplineDeformable = itk::BSplineTransform< double >; - // BSplineDeformable::Pointer bSplineDeformable = BSplineDeformable::New(); + // auto bSplineDeformable = BSplineDeformable::New(); // beginMTime = bSplineDeformable->GetMTime(); // bSplineDeformable->SetIdentity(); // BSplineDeformable::ParametersType bSplineDeformableParams; = bSplineDeformable->GetParameters(); diff --git a/Modules/Core/Transform/test/itkTranslationTransformTest.cxx b/Modules/Core/Transform/test/itkTranslationTransformTest.cxx index 3533a8bddd5..2eba37de264 100644 --- a/Modules/Core/Transform/test/itkTranslationTransformTest.cxx +++ b/Modules/Core/Transform/test/itkTranslationTransformTest.cxx @@ -51,7 +51,7 @@ itkTranslationTransformTest(int, char *[]) /* Create a 2D identity transformation and show its parameters */ using TransformType = itk::TranslationTransform; - TransformType::Pointer id2 = TransformType::New(); + auto id2 = TransformType::New(); vector2 = id2->GetOffset(); std::cout << "Vector from instantiating an identity transform:" << std::endl; PrintVector(vector2); @@ -59,7 +59,7 @@ itkTranslationTransformTest(int, char *[]) /* Create and show a simple 2D transform from given parameters */ vector2[0] = 5; vector2[1] = 6; - TransformType::Pointer aff2 = TransformType::New(); + auto aff2 = TransformType::New(); aff2->SetOffset(vector2); for (i = 0; i < 2; ++i) { @@ -67,7 +67,7 @@ itkTranslationTransformTest(int, char *[]) } std::cout << "Instantiation of a given 2D transform:" << std::endl << aff2; - TransformType::Pointer inverse2 = TransformType::New(); + auto inverse2 = TransformType::New(); if (!aff2->GetInverse(inverse2)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx b/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx index 96ea2eeb99c..6a2f7a0ac0f 100644 --- a/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx +++ b/Modules/Core/Transform/test/itkVersorRigid3DTransformTest.cxx @@ -63,7 +63,7 @@ itkVersorRigid3DTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); VectorType axis(1.5); @@ -93,8 +93,8 @@ itkVersorRigid3DTransformTest(int, char *[]) { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; } @@ -104,7 +104,7 @@ itkVersorRigid3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -262,7 +262,7 @@ itkVersorRigid3DTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -383,7 +383,7 @@ itkVersorRigid3DTransformTest(int, char *[]) { std::cout << " Exercise the SetIdentity() method " << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -435,7 +435,7 @@ itkVersorRigid3DTransformTest(int, char *[]) MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix par = 0; @@ -511,7 +511,7 @@ itkVersorRigid3DTransformTest(int, char *[]) t = TransformType::New(); t->SetParameters(e); - TransformType::Pointer t2 = TransformType::New(); + auto t2 = TransformType::New(); t2->SetMatrix(t->GetMatrix()); ParametersType p = t2->GetParameters(); @@ -526,7 +526,7 @@ itkVersorRigid3DTransformTest(int, char *[]) } } { - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if (!t->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Core/Transform/test/itkVersorTransformTest.cxx b/Modules/Core/Transform/test/itkVersorTransformTest.cxx index 9ce354df0a4..c1ba2007ba9 100644 --- a/Modules/Core/Transform/test/itkVersorTransformTest.cxx +++ b/Modules/Core/Transform/test/itkVersorTransformTest.cxx @@ -63,7 +63,7 @@ itkVersorTransformTest(int, char *[]) { std::cout << "Test default constructor... "; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); VectorType axis(1.5); @@ -90,8 +90,8 @@ itkVersorTransformTest(int, char *[]) { std::cout << "Test initial rotation matrix " << std::endl; - TransformType::Pointer transform = TransformType::New(); - MatrixType matrix = transform->GetMatrix(); + auto transform = TransformType::New(); + MatrixType matrix = transform->GetMatrix(); std::cout << "Matrix = " << std::endl; std::cout << matrix << std::endl; } @@ -101,7 +101,7 @@ itkVersorTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer rotation = TransformType::New(); + auto rotation = TransformType::New(); itk::Vector axis(1); @@ -259,7 +259,7 @@ itkVersorTransformTest(int, char *[]) { bool Ok = true; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::Vector axis(1); @@ -371,7 +371,7 @@ itkVersorTransformTest(int, char *[]) MatrixType matrix; - TransformType::Pointer t = TransformType::New(); + auto t = TransformType::New(); // attempt to set an non-orthogonal matrix par = 0; @@ -454,7 +454,7 @@ itkVersorTransformTest(int, char *[]) t = TransformType::New(); t->SetParameters(e); - TransformType::Pointer t2 = TransformType::New(); + auto t2 = TransformType::New(); t2->SetMatrix(t->GetMatrix()); ParametersType p = t2->GetParameters(); @@ -499,7 +499,7 @@ itkVersorTransformTest(int, char *[]) } } { - TransformType::Pointer tInverse = TransformType::New(); + auto tInverse = TransformType::New(); if (!t->GetInverse(tInverse)) { std::cout << "Cannot create inverse transform" << std::endl; diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx index 7e35181d173..b5b0e21dbf3 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkGradientAnisotropicDiffusionImageFilterTest2.cxx @@ -42,7 +42,7 @@ SameImage(ImagePointer testImage, ImagePointer baselineImage) unsigned long numberOfPixelTolerance = 0; using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineImage); diff->SetTestInput(testImage); diff->SetDifferenceThreshold(intensityTolerance); @@ -114,7 +114,7 @@ itkGradientAnisotropicDiffusionImageFilterTest2(int ac, char * av[]) // We now set up testing when the image spacing is not trivial 1 and // perform diffusion with spacing on using ChangeInformationType = itk::ChangeInformationImageFilter; - ChangeInformationType::Pointer changeInfo = ChangeInformationType::New(); + auto changeInfo = ChangeInformationType::New(); changeInfo->SetInput(input->GetOutput()); myFloatImage::SpacingType spacing; spacing[0] = input->GetOutput()->GetSpacing()[0] * 100.0; diff --git a/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx b/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx index 2297369295d..0f116ca3dc3 100644 --- a/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx +++ b/Modules/Filtering/AnisotropicSmoothing/test/itkMinMaxCurvatureFlowImageFilterTest.cxx @@ -140,7 +140,7 @@ testMinMaxCurvatureFlow(itk::Size & size, // ND image s using ImageType = itk::Image; using IteratorType = itk::ImageRegionIterator; using DenoiserType = itk::MinMaxCurvatureFlowImageFilter; - typename DenoiserType::Pointer denoiser = DenoiserType::New(); + auto denoiser = DenoiserType::New(); int j; @@ -154,7 +154,7 @@ testMinMaxCurvatureFlow(itk::Size & size, // ND image s PixelType background = 255.0; // intensity value of the background std::cout << "Create an image of circle/sphere with noise" << std::endl; - typename ImageType::Pointer circleImage = ImageType::New(); + auto circleImage = ImageType::New(); typename ImageType::RegionType region; @@ -301,7 +301,7 @@ testMinMaxCurvatureFlow(itk::Size & size, // ND image s * Exercise error handling */ using WrongFunctionType = itk::CurvatureFlowFunction; - typename WrongFunctionType::Pointer wrongFunction = WrongFunctionType::New(); + auto wrongFunction = WrongFunctionType::New(); passed = false; try diff --git a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx index 1a0523d1e45..942eb5641e0 100644 --- a/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx +++ b/Modules/Filtering/AntiAlias/test/itkAntiAliasBinaryImageFilterTest.cxx @@ -96,7 +96,7 @@ itkAntiAliasBinaryImageFilterTest(int argc, char * argv[]) itk::AntiAliasBinaryImageFilter::New(); // Create a binary image of a sphere. - BinaryImageType::Pointer image = BinaryImageType::New(); + auto image = BinaryImageType::New(); BinaryImageType::RegionType region; BinaryImageType::RegionType::SizeType sz; BinaryImageType::RegionType::IndexType idx; @@ -141,7 +141,7 @@ itkAntiAliasBinaryImageFilterTest(int argc, char * argv[]) else { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(antialiaser->GetOutput()); writer->SetFileName(outputImage); ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); diff --git a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx index 04895b530a5..93489e0c0f4 100644 --- a/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkMRIBiasFieldCorrectionFilter.hxx @@ -468,7 +468,7 @@ MRIBiasFieldCorrectionFilter::EstimateBia m_EnergyFunction->SetRegion(region); // Initialize the 1+1 optimizer - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetDebug(this->GetDebug()); optimizer->SetNormalVariateGenerator(m_NormalVariateGenerator); optimizer->SetCostFunction(m_EnergyFunction); diff --git a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx index 3313615fba7..0fac9cd8541 100644 --- a/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx +++ b/Modules/Filtering/BiasCorrection/include/itkN4BiasFieldCorrectionImageFilter.hxx @@ -146,7 +146,7 @@ CLANG_SUPPRESS_Wfloat_equal // Duplicate logInputImage since we reuse the original at each iteration. using DuplicatorType = ImageDuplicator; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(logInputImage); duplicator->Update(); @@ -191,7 +191,7 @@ CLANG_SUPPRESS_Wfloat_equal this->SharpenImage(logUncorrectedImage, logSharpenedImage); using SubtracterType = SubtractImageFilter; - typename SubtracterType::Pointer subtracter1 = SubtracterType::New(); + auto subtracter1 = SubtracterType::New(); subtracter1->SetInput1(logUncorrectedImage); subtracter1->SetInput2(logSharpenedImage); @@ -206,7 +206,7 @@ CLANG_SUPPRESS_Wfloat_equal this->m_CurrentConvergenceMeasurement = this->CalculateConvergenceMeasurement(logBiasField, newLogBiasField); logBiasField = newLogBiasField; - typename SubtracterType::Pointer subtracter2 = SubtracterType::New(); + auto subtracter2 = SubtracterType::New(); subtracter2->SetInput1(logInputImage); subtracter2->SetInput2(logBiasField); @@ -218,7 +218,7 @@ CLANG_SUPPRESS_Wfloat_equal using BSplineReconstructerType = BSplineControlPointImageFilter; - typename BSplineReconstructerType::Pointer reconstructer = BSplineReconstructerType::New(); + auto reconstructer = BSplineReconstructerType::New(); reconstructer->SetInput(this->m_LogBiasFieldControlPointLattice); reconstructer->SetOrigin(logBiasField->GetOrigin()); reconstructer->SetSpacing(logBiasField->GetSpacing()); @@ -241,8 +241,8 @@ CLANG_SUPPRESS_Wfloat_equal } using CustomBinaryFilter = itk::BinaryGeneratorImageFilter; - typename CustomBinaryFilter::Pointer expAndDivFilter = CustomBinaryFilter::New(); - auto expAndDivLambda = + auto expAndDivFilter = CustomBinaryFilter::New(); + auto expAndDivLambda = [](const typename InputImageType::PixelType & input, const typename RealImageType::PixelType & biasField) -> typename OutputImageType::PixelType { @@ -487,7 +487,7 @@ CLANG_SUPPRESS_Wfloat_equal const bool filterHandlesMemory = false; using ImporterType = ImportImageFilter; - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(fieldEstimate->GetBufferPointer(), numberOfPixels, filterHandlesMemory); importer->SetRegion(fieldEstimate->GetBufferedRegion()); importer->SetOrigin(fieldEstimate->GetOrigin()); @@ -541,7 +541,7 @@ CLANG_SUPPRESS_Wfloat_equal } } - typename BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); + auto bspliner = BSplineFilterType::New(); typename BSplineFilterType::ArrayType numberOfControlPoints; typename BSplineFilterType::ArrayType numberOfFittingLevels; @@ -593,7 +593,7 @@ CLANG_SUPPRESS_Wfloat_equal using AdderType = AddImageFilter; - typename AdderType::Pointer adder = AdderType::New(); + auto adder = AdderType::New(); adder->SetInput1(this->m_LogBiasFieldControlPointLattice); adder->SetInput2(phiLattice); adder->Update(); @@ -614,7 +614,7 @@ CLANG_SUPPRESS_Wfloat_equal const InputImageType * inputImage = this->GetInput(); using BSplineReconstructerType = BSplineControlPointImageFilter; - typename BSplineReconstructerType::Pointer reconstructer = BSplineReconstructerType::New(); + auto reconstructer = BSplineReconstructerType::New(); reconstructer->SetInput(controlPointLattice); reconstructer->SetOrigin(inputImage->GetOrigin()); reconstructer->SetSpacing(inputImage->GetSpacing()); @@ -626,7 +626,7 @@ CLANG_SUPPRESS_Wfloat_equal biasFieldBsplineImage->Update(); using SelectorType = VectorIndexSelectionCastImageFilter; - typename SelectorType::Pointer selector = SelectorType::New(); + auto selector = SelectorType::New(); selector->SetInput(biasFieldBsplineImage); selector->SetIndex(0); @@ -645,7 +645,7 @@ CLANG_SUPPRESS_Wfloat_equal const RealImageType * fieldEstimate1, const RealImageType * fieldEstimate2) const { using SubtracterType = SubtractImageFilter; - typename SubtracterType::Pointer subtracter = SubtracterType::New(); + auto subtracter = SubtracterType::New(); subtracter->SetInput1(fieldEstimate1); subtracter->SetInput2(fieldEstimate2); subtracter->Update(); diff --git a/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx b/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx index d43ca2f3f27..bbde8aa4917 100644 --- a/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx +++ b/Modules/Filtering/BiasCorrection/test/itkMRIBiasFieldCorrectionFilterTest.cxx @@ -53,7 +53,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) imageRegion.SetIndex(imageIndex); // creates an image that will stores the Gaussian pixel * bias values - ImageType::Pointer imageWithBias = ImageType::New(); + auto imageWithBias = ImageType::New(); imageWithBias->SetBufferedRegion(imageRegion); imageWithBias->SetLargestPossibleRegion(imageRegion); imageWithBias->SetSpacing(spacing); @@ -61,7 +61,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) imageWithBias->Allocate(); // creates the image source with a sphere. - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetBufferedRegion(imageRegion); image->SetLargestPossibleRegion(imageRegion); image->SetSpacing(spacing); @@ -69,7 +69,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) image->Allocate(); // creates an image for bias - ImageType::Pointer biasImage = ImageType::New(); + auto biasImage = ImageType::New(); biasImage->SetBufferedRegion(imageRegion); biasImage->SetLargestPossibleRegion(imageRegion); biasImage->SetSpacing(spacing); @@ -93,7 +93,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) // fills the image with a sphere filled with intensity values from a // normal distribution. using SphereType = itk::SphereSpatialFunction; - SphereType::Pointer sphere = SphereType::New(); + auto sphere = SphereType::New(); SphereType::InputType center; center[0] = imageSize[0] / 2; @@ -162,7 +162,7 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) // creates a bias correction filter and run it. using FilterType = itk::MRIBiasFieldCorrectionFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MRIBiasFieldCorrectionFilter, ImageToImageFilter); @@ -259,18 +259,18 @@ itkMRIBiasFieldCorrectionFilterTest(int, char *[]) if (SaveImages) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName("MRISource.mhd"); writer->Update(); - WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(imageWithBias); writer2->SetFileName("MRISourceWithBias.mhd"); writer2->Update(); - WriterType::Pointer writer3 = WriterType::New(); + auto writer3 = WriterType::New(); writer3->SetInput(filter->GetOutput()); writer3->SetFileName("MRICorrected.mhd"); writer3->Update(); diff --git a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx index 5d0802362df..784e80f0643 100644 --- a/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx +++ b/Modules/Filtering/BiasCorrection/test/itkN4BiasFieldCorrectionImageFilterTest.cxx @@ -121,7 +121,7 @@ N4(int argc, char * argv[]) using ImagePointer = typename ImageType::Pointer; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[2]); reader->Update(); @@ -136,7 +136,7 @@ N4(int argc, char * argv[]) if (argc > 6) { using MaskReaderType = itk::ImageFileReader; - typename MaskReaderType::Pointer maskreader = MaskReaderType::New(); + auto maskreader = MaskReaderType::New(); maskreader->SetFileName(argv[6]); try { @@ -154,7 +154,7 @@ N4(int argc, char * argv[]) { std::cout << "Mask not read. Creating Otsu mask." << std::endl; using ThresholderType = itk::OtsuThresholdImageFilter; - typename ThresholderType::Pointer otsu = ThresholderType::New(); + auto otsu = ThresholderType::New(); otsu->SetInput(inputImage); // otsu->SetNumberOfHistogramBins( 200 ); otsu->SetInsideValue(0); @@ -167,7 +167,7 @@ N4(int argc, char * argv[]) // Instantiate N4 and assign variables not exposed to the user in this test. using CorrecterType = itk::N4BiasFieldCorrectionImageFilter; - typename CorrecterType::Pointer correcter = CorrecterType::New(); + auto correcter = CorrecterType::New(); unsigned int splineOrder = 3; correcter->SetSplineOrder(splineOrder); @@ -251,7 +251,7 @@ N4(int argc, char * argv[]) } using PadderType = itk::ConstantPadImageFilter; - typename PadderType::Pointer padder = PadderType::New(); + auto padder = PadderType::New(); padder->SetInput(inputImage); padder->SetPadLowerBound(lowerBound); padder->SetPadUpperBound(upperBound); @@ -262,7 +262,7 @@ N4(int argc, char * argv[]) inputImage->DisconnectPipeline(); using MaskPadderType = itk::ConstantPadImageFilter; - typename MaskPadderType::Pointer maskPadder = MaskPadderType::New(); + auto maskPadder = MaskPadderType::New(); maskPadder->SetInput(maskImage); maskPadder->SetPadLowerBound(lowerBound); maskPadder->SetPadUpperBound(upperBound); @@ -277,12 +277,12 @@ N4(int argc, char * argv[]) // Handle the shrink factor using ShrinkerType = itk::ShrinkImageFilter; - typename ShrinkerType::Pointer shrinker = ShrinkerType::New(); + auto shrinker = ShrinkerType::New(); shrinker->SetInput(inputImage); shrinker->SetShrinkFactors(1); using MaskShrinkerType = itk::ShrinkImageFilter; - typename MaskShrinkerType::Pointer maskshrinker = MaskShrinkerType::New(); + auto maskshrinker = MaskShrinkerType::New(); maskshrinker->SetInput(maskImage); maskshrinker->SetShrinkFactors(1); @@ -304,7 +304,7 @@ N4(int argc, char * argv[]) correcter->SetMaskImage(maskImage); using CommandType = CommandIterationUpdate; - typename CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); correcter->AddObserver(itk::IterationEvent(), observer); ITK_TRY_EXPECT_NO_EXCEPTION(correcter->Update()); @@ -348,7 +348,7 @@ itkN4BiasFieldCorrectionImageFilterTest(int argc, char * argv[]) using MaskImageType = itk::Image; using CorrecterType = itk::N4BiasFieldCorrectionImageFilter; - typename CorrecterType::Pointer correcter = CorrecterType::New(); + auto correcter = CorrecterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(correcter, N4BiasFieldCorrectionImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx index be773ca6643..23f5b2a50ee 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryClosingByReconstructionImageFilter.hxx @@ -95,7 +95,7 @@ BinaryClosingByReconstructionImageFilter::GenerateData() /** set up the minipipeline */ - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, .8f); progress->RegisterInternalFilter(dilate, .2f); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx index 5f6a32745a5..44ab497e2c0 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryDilateImageFilter.hxx @@ -111,7 +111,7 @@ BinaryDilateImageFilter::GenerateData() // The temp image size is equal to the output requested region for thread // padded by max( connectivity neighborhood radius, SE kernel radius ). using TempImageType = itk::Image; - typename TempImageType::Pointer tmpImage = TempImageType::New(); + auto tmpImage = TempImageType::New(); // Define regions of temp image tmpImage->SetRegions(tmpRequestedRegion); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx index f6cb50c75c9..ec192d7f745 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryErodeImageFilter.hxx @@ -101,7 +101,7 @@ BinaryErodeImageFilter::GenerateData() // The temp image size is equal to the output requested region for thread // padded by max( connectivity neighborhood radius, SE kernel radius ). using TempImageType = itk::Image; - typename TempImageType::Pointer tmpImage = TempImageType::New(); + auto tmpImage = TempImageType::New(); // Define regions of temp image tmpImage->SetRegions(tmpRequestedRegion); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx index f3d30d4cfa7..658b34623d6 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.hxx @@ -87,7 +87,7 @@ BinaryMorphologicalClosingImageFilter::Gener if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(backgroundValue); @@ -96,12 +96,12 @@ BinaryMorphologicalClosingImageFilter::Gener dilate->SetInput(pad->GetOutput()); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(erode->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(pad, .1f); progress->RegisterInternalFilter(erode, .35f); @@ -118,7 +118,7 @@ BinaryMorphologicalClosingImageFilter::Gener else { /** set up the minipipeline */ - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, .45f); progress->RegisterInternalFilter(dilate, .45f); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalOpeningImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalOpeningImageFilter.hxx index 294a68f2d54..7e0a57d377c 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalOpeningImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalOpeningImageFilter.hxx @@ -64,7 +64,7 @@ BinaryMorphologicalOpeningImageFilter::Gener erode->SetBackgroundValue(m_BackgroundValue); // Replacement value for eroded voxels /** set up the minipipeline */ - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, .5f); progress->RegisterInternalFilter(dilate, .5f); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx index b93a461ec83..2bff5cf86e6 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx @@ -111,7 +111,7 @@ BinaryMorphologyImageFilter::AnalyzeKernel() // ---------------------------------------------- // To do this we convert the SE into a temp image using BoolImageType = Image; - typename BoolImageType::Pointer tmpSEImage = BoolImageType::New(); + auto tmpSEImage = BoolImageType::New(); tmpSEImage->SetRegions(this->GetKernel().GetSize()); // allocation diff --git a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryOpeningByReconstructionImageFilter.hxx b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryOpeningByReconstructionImageFilter.hxx index 80853f09070..6ddeaf19a83 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryOpeningByReconstructionImageFilter.hxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryOpeningByReconstructionImageFilter.hxx @@ -77,7 +77,7 @@ BinaryOpeningByReconstructionImageFilter::GenerateData() dilate->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); /** set up the minipipeline */ - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, .8f); progress->RegisterInternalFilter(dilate, .2f); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx index bcb12b3234c..d3923584116 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryClosingByReconstructionImageFilterTest.cxx @@ -43,7 +43,7 @@ itkBinaryClosingByReconstructionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -57,7 +57,7 @@ itkBinaryClosingByReconstructionImageFilterTest(int argc, char * argv[]) ball.CreateStructuringElement(); using FilterType = itk::BinaryClosingByReconstructionImageFilter; - FilterType::Pointer reconstructionFilter = FilterType::New(); + auto reconstructionFilter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(reconstructionFilter, BinaryClosingByReconstructionImageFilter, KernelImageFilter); @@ -76,7 +76,7 @@ itkBinaryClosingByReconstructionImageFilterTest(int argc, char * argv[]) reconstructionFilter->SetInput(reader->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reconstructionFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx index 645ad527f40..8478c04be20 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest.cxx @@ -45,7 +45,7 @@ itkBinaryDilateImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -118,7 +118,7 @@ itkBinaryDilateImageFilterTest(int, char *[]) using myFilterType = itk::BinaryDilateImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher filterWatcher(filter); // Create the structuring element diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest2.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest2.cxx index 1b7531253b8..5ca4200b935 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest2.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest2.cxx @@ -44,7 +44,7 @@ itkBinaryDilateImageFilterTest2(int, char *[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -124,7 +124,7 @@ itkBinaryDilateImageFilterTest2(int, char *[]) using myFilterType = itk::FastIncrementalBinaryDilateImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Create the structuring element myKernelType cross; diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx index db7c0cfe546..e13d7c24985 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryDilateImageFilterTest3.cxx @@ -39,7 +39,7 @@ itkBinaryDilateImageFilterTest3(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using SRType = itk::BinaryBallStructuringElement; @@ -48,7 +48,7 @@ itkBinaryDilateImageFilterTest3(int argc, char * argv[]) kernel.CreateStructuringElement(); using FilterType = itk::BinaryDilateImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetKernel(kernel); @@ -107,7 +107,7 @@ itkBinaryDilateImageFilterTest3(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx index c900a0737fb..43547700232 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest.cxx @@ -45,7 +45,7 @@ itkBinaryErodeImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -118,7 +118,7 @@ itkBinaryErodeImageFilterTest(int, char *[]) using myFilterType = itk::BinaryErodeImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); // Create the structuring element diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx index 6064ced93a3..06b4bbcf7c6 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryErodeImageFilterTest3.cxx @@ -39,7 +39,7 @@ itkBinaryErodeImageFilterTest3(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using SRType = itk::BinaryBallStructuringElement; @@ -48,7 +48,7 @@ itkBinaryErodeImageFilterTest3(int argc, char * argv[]) kernel.CreateStructuringElement(); using FilterType = itk::BinaryErodeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetKernel(kernel); @@ -107,7 +107,7 @@ itkBinaryErodeImageFilterTest3(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx index 96f2e9a3d00..07c99410ad9 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalClosingImageFilterTest.cxx @@ -44,7 +44,7 @@ itkBinaryMorphologicalClosingImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using KernelType = itk::BinaryBallStructuringElement; @@ -55,7 +55,7 @@ itkBinaryMorphologicalClosingImageFilterTest(int argc, char * argv[]) ball.CreateStructuringElement(); using FilterType = itk::BinaryMorphologicalClosingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetKernel(ball); // test the default attribute values, and exercise the accesors @@ -78,7 +78,7 @@ itkBinaryMorphologicalClosingImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx index 40e4e6d0f56..13cd374b920 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryMorphologicalOpeningImageFilterTest.cxx @@ -44,7 +44,7 @@ itkBinaryMorphologicalOpeningImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using KernelType = itk::BinaryBallStructuringElement; @@ -55,7 +55,7 @@ itkBinaryMorphologicalOpeningImageFilterTest(int argc, char * argv[]) ball.CreateStructuringElement(); using FilterType = itk::BinaryMorphologicalOpeningImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetKernel(ball); if (filter->GetBackgroundValue() != 0) @@ -75,7 +75,7 @@ itkBinaryMorphologicalOpeningImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx index ba963945a56..e552ca4fae4 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryOpeningByReconstructionImageFilterTest.cxx @@ -41,7 +41,7 @@ itkBinaryOpeningByReconstructionImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -53,7 +53,7 @@ itkBinaryOpeningByReconstructionImageFilterTest(int argc, char * argv[]) ball.CreateStructuringElement(); using I2LType = itk::BinaryOpeningByReconstructionImageFilter; - I2LType::Pointer reconstruction = I2LType::New(); + auto reconstruction = I2LType::New(); reconstruction->SetInput(reader->GetOutput()); reconstruction->SetKernel(ball); reconstruction->SetFullyConnected(std::stoi(argv[3])); @@ -62,7 +62,7 @@ itkBinaryOpeningByReconstructionImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(reconstruction, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reconstruction->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryThinningImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryThinningImageFilterTest.cxx index ba8f8e8510a..38d5af15786 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryThinningImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkBinaryThinningImageFilterTest.cxx @@ -41,12 +41,12 @@ itkBinaryThinningImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ThinningType = itk::BinaryThinningImageFilter; - ThinningType::Pointer thinning = ThinningType::New(); + auto thinning = ThinningType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(thinning, BinaryThinningImageFilter, ImageToImageFilter); @@ -55,14 +55,14 @@ itkBinaryThinningImageFilterTest(int argc, char * argv[]) // Rescale the image so that it can be seen. using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(thinning->GetOutput()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); // Write out the test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx b/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx index 444d7f9dcf6..182c53b346e 100644 --- a/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/BinaryMathematicalMorphology/test/itkErodeObjectMorphologyImageFilterTest.cxx @@ -46,7 +46,7 @@ itkErodeObjectMorphologyImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -124,7 +124,7 @@ itkErodeObjectMorphologyImageFilterTest(int, char *[]) using myFilterType = itk::ErodeObjectMorphologyImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); // Create the structuring element diff --git a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h index a99da91b129..b8e8fc2a2bb 100644 --- a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h +++ b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.h @@ -86,7 +86,7 @@ extern ITKColormap_EXPORT std::ostream & * The color map is specified by passing the SetColormap function one of the * predefined maps. The following selects the "RGBColormapFilterEnum::Hot" colormap: \code - RGBFilterType::Pointer colormapImageFilter = RGBFilterType::New(); + auto colormapImageFilter = RGBFilterType::New(); colormapImageFilter->SetColormap( RGBFilterType::Hot ); \endcode * @@ -100,7 +100,7 @@ extern ITKColormap_EXPORT std::ostream & // Create the custom colormap using ColormapType = itk::Function::CustomColormapFunction; - ColormapType::Pointer colormap = ColormapType::New(); + auto colormap = ColormapType::New(); // Setup the red channel of the colormap ColormapType::ChannelType redChannel; redChannel.push_back(0); redChannel.push_back(255); diff --git a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx index 7bbca4f9bea..778b1898dbf 100644 --- a/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx +++ b/Modules/Filtering/Colormap/include/itkScalarToRGBColormapImageFilter.hxx @@ -61,7 +61,7 @@ ScalarToRGBColormapImageFilter::ScalarToRGBColormapIm using DefaultColormapType = Function::GreyColormapFunction; - typename DefaultColormapType::Pointer greyColormap = DefaultColormapType::New(); + auto greyColormap = DefaultColormapType::New(); this->SetColormap(greyColormap); } @@ -135,21 +135,21 @@ ScalarToRGBColormapImageFilter::SetColormap(RGBColorm case RGBColormapFilterEnum::Red: { using SpecificColormapType = Function::RedColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Green: { using SpecificColormapType = Function::GreenColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Blue: { using SpecificColormapType = Function::BlueColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } @@ -157,77 +157,77 @@ ScalarToRGBColormapImageFilter::SetColormap(RGBColorm default: { using SpecificColormapType = Function::GreyColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Hot: { using SpecificColormapType = Function::HotColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Cool: { using SpecificColormapType = Function::CoolColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Spring: { using SpecificColormapType = Function::SpringColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Summer: { using SpecificColormapType = Function::SummerColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Autumn: { using SpecificColormapType = Function::AutumnColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Winter: { using SpecificColormapType = Function::WinterColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Copper: { using SpecificColormapType = Function::CopperColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::Jet: { using SpecificColormapType = Function::JetColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::HSV: { using SpecificColormapType = Function::HSVColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } case RGBColormapFilterEnum::OverUnder: { using SpecificColormapType = Function::OverUnderColormapFunction; - typename SpecificColormapType::Pointer colormap = SpecificColormapType::New(); + auto colormap = SpecificColormapType::New(); this->SetColormap(colormap); break; } diff --git a/Modules/Filtering/Colormap/test/itkCustomColormapFunctionTest.cxx b/Modules/Filtering/Colormap/test/itkCustomColormapFunctionTest.cxx index 4592bc644d7..48edbc71b55 100644 --- a/Modules/Filtering/Colormap/test/itkCustomColormapFunctionTest.cxx +++ b/Modules/Filtering/Colormap/test/itkCustomColormapFunctionTest.cxx @@ -60,7 +60,7 @@ class CustomColormapFunctionHelper : public CustomColormapFunction; - typename ColormapType::Pointer colormap = ColormapType::New(); + auto colormap = ColormapType::New(); // Set the RGB channels colormap->SetRedChannel(redChannel); diff --git a/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx b/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx index d36bf7667d9..3e773fc9521 100644 --- a/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx +++ b/Modules/Filtering/Colormap/test/itkScalarToRGBColormapImageFilterTest.cxx @@ -49,7 +49,7 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -57,10 +57,10 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) using VectorImageType = itk::VectorImage; using VectorFilterType = itk::ScalarToRGBColormapImageFilter; - VectorFilterType::Pointer vfilter = VectorFilterType::New(); + auto vfilter = VectorFilterType::New(); using RGBFilterType = itk::ScalarToRGBColormapImageFilter; - RGBFilterType::Pointer rgbfilter = RGBFilterType::New(); + auto rgbfilter = RGBFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(rgbfilter, ScalarToRGBColormapImageFilter, ImageToImageFilter); @@ -141,11 +141,11 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) { using ColormapType = itk::Function::CustomColormapFunction; - ColormapType::Pointer colormap = ColormapType::New(); + auto colormap = ColormapType::New(); using VectorColormapType = itk::Function::CustomColormapFunction; - VectorColormapType::Pointer vcolormap = VectorColormapType::New(); + auto vcolormap = VectorColormapType::New(); std::ifstream str(argv[4]); std::string line; @@ -189,12 +189,12 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) } using RGBHasher = itk::Testing::HashImageFilter; - RGBHasher::Pointer rgbhasher = RGBHasher::New(); + auto rgbhasher = RGBHasher::New(); rgbhasher->SetInput(rgbfilter->GetOutput()); rgbhasher->InPlaceOff(); using VectorHasher = itk::Testing::HashImageFilter; - VectorHasher::Pointer vhasher = VectorHasher::New(); + auto vhasher = VectorHasher::New(); vhasher->SetInput(vfilter->GetOutput()); try @@ -211,7 +211,7 @@ itkScalarToRGBColormapImageFilterTest(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rgbfilter->GetOutput()); writer->Update(); diff --git a/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx index 5f7a1eb34f8..1cf62098eb8 100644 --- a/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkConvolutionImageFilter.hxx @@ -39,7 +39,7 @@ ConvolutionImageFilter::GenerateData() this->AllocateOutputs(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Build a mini-pipeline that involves a @@ -52,7 +52,7 @@ ConvolutionImageFilter::GenerateData() using RealImageType = Image; using NormalizeFilterType = NormalizeToConstantImageFilter; - typename NormalizeFilterType::Pointer normalizeFilter = NormalizeFilterType::New(); + auto normalizeFilter = NormalizeFilterType::New(); normalizeFilter->SetConstant(NumericTraits::OneValue()); normalizeFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); normalizeFilter->SetInput(this->GetKernelImage()); @@ -96,7 +96,7 @@ ConvolutionImageFilter::ComputeConvolut // Flip the kernel using FlipperType = FlipImageFilter; - typename FlipperType::Pointer flipper = FlipperType::New(); + auto flipper = FlipperType::New(); typename FlipperType::FlipAxesArrayType axesArray; axesArray.Fill(true); flipper->SetFlipAxes(axesArray); @@ -106,7 +106,7 @@ ConvolutionImageFilter::ComputeConvolut { // Pad the kernel if necessary to an odd size in each dimension. using PadImageFilterType = ConstantPadImageFilter; - typename PadImageFilterType::Pointer kernelPadImageFilter = PadImageFilterType::New(); + auto kernelPadImageFilter = PadImageFilterType::New(); kernelPadImageFilter->SetConstant(NumericTraits::ZeroValue()); kernelPadImageFilter->SetPadLowerBound(this->GetKernelPadSize()); kernelPadImageFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -126,12 +126,12 @@ ConvolutionImageFilter::ComputeConvolut KernelSizeType radius = this->GetKernelRadius(kernelImage); kernelOperator.CreateToRadius(radius); - typename InputImageType::Pointer localInput = InputImageType::New(); + auto localInput = InputImageType::New(); localInput->Graft(this->GetInput()); // The NeighborhoodOperatorImageFilter does all the work. using ConvolutionFilterType = NeighborhoodOperatorImageFilter; - typename ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetOperator(kernelOperator); convolutionFilter->OverrideBoundaryCondition(this->GetBoundaryCondition()); convolutionFilter->SetInput(localInput); diff --git a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx index 4d2224607f4..52246d1809c 100644 --- a/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkFFTConvolutionImageFilter.hxx @@ -65,10 +65,10 @@ void FFTConvolutionImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); - typename InputImageType::Pointer localInput = InputImageType::New(); + auto localInput = InputImageType::New(); localInput->Graft(this->GetInput()); const KernelImageType * kernelImage = this->GetKernelImage(); @@ -79,7 +79,7 @@ FFTConvolutionImageFilter; - typename MultiplyFilterType::Pointer multiplyFilter = MultiplyFilterType::New(); + auto multiplyFilter = MultiplyFilterType::New(); multiplyFilter->SetInput1(input); multiplyFilter->SetInput2(kernel); multiplyFilter->ReleaseDataFlagOn(); @@ -133,7 +133,7 @@ FFTConvolutionImageFilter; - typename InputPadFilterType::Pointer inputPadder = InputPadFilterType::New(); + auto inputPadder = InputPadFilterType::New(); inputPadder->SetBoundaryCondition(this->GetBoundaryCondition()); InputSizeType inputLowerBound = this->GetPadLowerBound(); @@ -159,7 +159,7 @@ FFTConvolutionImageFilter; - typename InputCastFilterType::Pointer inputCaster = InputCastFilterType::New(); + auto inputCaster = InputCastFilterType::New(); // See if we can avoid unnecessary casting and copying of memory inputCaster->InPlaceOn(); inputCaster->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -180,7 +180,7 @@ FFTConvolutionImageFilterSetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); imageFFTFilter->SetInput(paddedInput); imageFFTFilter->ReleaseDataFlagOn(); @@ -218,7 +218,7 @@ FFTConvolutionImageFilterGetNormalize()) { using NormalizeFilterType = NormalizeToConstantImageFilter; - typename NormalizeFilterType::Pointer normalizeFilter = NormalizeFilterType::New(); + auto normalizeFilter = NormalizeFilterType::New(); normalizeFilter->SetConstant(NumericTraits::OneValue()); normalizeFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); normalizeFilter->SetInput(kernel); @@ -254,7 +254,7 @@ FFTConvolutionImageFilter; - typename KernelShiftFilterType::Pointer kernelShifter = KernelShiftFilterType::New(); + auto kernelShifter = KernelShiftFilterType::New(); typename KernelShiftFilterType::OffsetType kernelShift; for (unsigned int i = 0; i < ImageDimension; ++i) { @@ -266,14 +266,14 @@ FFTConvolutionImageFilterReleaseDataFlagOn(); progress->RegisterInternalFilter(kernelShifter, 0.1f * progressWeight); - typename FFTFilterType::Pointer kernelFFTFilter = FFTFilterType::New(); + auto kernelFFTFilter = FFTFilterType::New(); kernelFFTFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); kernelFFTFilter->SetInput(kernelShifter->GetOutput()); progress->RegisterInternalFilter(kernelFFTFilter, 0.699f * progressWeight); kernelFFTFilter->Update(); using InfoFilterType = ChangeInformationImageFilter; - typename InfoFilterType::Pointer kernelInfoFilter = InfoFilterType::New(); + auto kernelInfoFilter = InfoFilterType::New(); kernelInfoFilter->ChangeRegionOn(); using InfoOffsetValueType = typename InfoFilterType::OutputImageOffsetValueType; @@ -301,7 +301,7 @@ FFTConvolutionImageFilterSetActualXDimensionIsOdd(this->GetXDimensionIsOdd()); ifftFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); ifftFilter->SetInput(paddedOutput); @@ -324,7 +324,7 @@ FFTConvolutionImageFilter; - typename ExtractFilterType::Pointer extractFilter = ExtractFilterType::New(); + auto extractFilter = ExtractFilterType::New(); extractFilter->InPlaceOn(); extractFilter->GraftOutput(this->GetOutput()); diff --git a/Modules/Filtering/Convolution/include/itkFFTNormalizedCorrelationImageFilter.h b/Modules/Filtering/Convolution/include/itkFFTNormalizedCorrelationImageFilter.h index cccf21f539c..2bf6e85f08d 100644 --- a/Modules/Filtering/Convolution/include/itkFFTNormalizedCorrelationImageFilter.h +++ b/Modules/Filtering/Convolution/include/itkFFTNormalizedCorrelationImageFilter.h @@ -72,7 +72,7 @@ namespace itk * Example filter usage: \code using FilterType = itk::FFTNormalizedCorrelationImageFilter< ShortImageType, DoubleImageType >; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetFixedImage( fixedImage ); filter->SetMovingImage( movingImage ); filter->SetRequiredNumberOfOverlappingPixels(20); diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h index 3c7dcf969b4..bb4981f7745 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.h @@ -111,7 +111,7 @@ namespace itk * Example filter usage: \code using FilterType = itk::MaskedFFTNormalizedCorrelationImageFilter< ShortImageType, DoubleImageType >; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetFixedImage( fixedImage ); filter->SetMovingImage( movingImage ); filter->SetFixedImageMask( fixedMask ); diff --git a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx index 358bb0d0d44..03e8826ea85 100644 --- a/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx +++ b/Modules/Filtering/Convolution/include/itkMaskedFFTNormalizedCorrelationImageFilter.hxx @@ -231,7 +231,7 @@ MaskedFFTNormalizedCorrelationImageFilter rotatedMovingDenom = this->ElementPositive(rotatedMovingDenom); using SqrtType = itk::SqrtImageFilter; - typename SqrtType::Pointer sqrtFilter = SqrtType::New(); + auto sqrtFilter = SqrtType::New(); sqrtFilter->SetInput(this->ElementProduct(fixedDenom, rotatedMovingDenom)); sqrtFilter->Update(); RealImagePointer denominator = sqrtFilter->GetOutput(); @@ -247,7 +247,7 @@ MaskedFFTNormalizedCorrelationImageFilter // Given the numberOfOverlapPixels, we can check that the m_RequiredNumberOfOverlappingPixels is not set higher than // the actual maximum overlap voxels. If it is, we set m_RequiredNumberOfOverlappingPixels to be this maximum. using CalculatorType = itk::MinimumMaximumImageCalculator; - typename CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(numberOfOverlapPixels); calculator->ComputeMaximum(); m_MaximumNumberOfOverlappingPixels = static_cast(calculator->GetMaximum()); @@ -270,7 +270,7 @@ MaskedFFTNormalizedCorrelationImageFilter // and set to zero all values outside of this range. // Also, zero-out the correlation values that arise from too few voxels since they are statistically unreliable. using PostProcessType = itk::TernaryGeneratorImageFilter; - typename PostProcessType::Pointer postProcessor = PostProcessType::New(); + auto postProcessor = PostProcessType::New(); auto functor = Functor::PostProcessCorrelation(); functor.SetRequiredNumberOfOverlappingPixels(requiredNumberOfOverlappingPixels); @@ -302,7 +302,7 @@ MaskedFFTNormalizedCorrelationImageFilter using FlipperType = itk::FlipImageFilter; typename FlipperType::FlipAxesArrayType flipAxes; flipAxes.Fill(true); - typename FlipperType::Pointer rotater = FlipperType::New(); + auto rotater = FlipperType::New(); rotater->SetFlipAxes(flipAxes); rotater->SetInput(inputImage); rotater->Update(); @@ -326,7 +326,7 @@ MaskedFFTNormalizedCorrelationImageFilter // The mask must have only 0 and 1 values. // Threshold the mask. All voxels less than or equal to 0 are set to 0, and all others are set to 1. using ThresholdType = itk::BinaryThresholdImageFilter; - typename ThresholdType::Pointer thresholder = ThresholdType::New(); + auto thresholder = ThresholdType::New(); thresholder->SetInput(inputMask); thresholder->SetUpperThreshold(0); thresholder->SetInsideValue(0); @@ -361,7 +361,7 @@ MaskedFFTNormalizedCorrelationImageFilter // We achieve this by multiplying the image with the mask, since the mask now contains // only values 0 and 1. using MultiplyType = itk::MultiplyImageFilter; - typename MultiplyType::Pointer multiplier = MultiplyType::New(); + auto multiplier = MultiplyType::New(); multiplier->SetInput1(inputImage); multiplier->SetInput2(inputMask); multiplier->Update(); @@ -383,14 +383,14 @@ MaskedFFTNormalizedCorrelationImageFilter upperPad = FFTImageSize - inputImage->GetLargestPossibleRegion().GetSize(); using PadType = itk::ConstantPadImageFilter; - typename PadType::Pointer padder = PadType::New(); + auto padder = PadType::New(); padder->SetInput(inputImage); padder->SetConstant(constantPixel); padder->SetPadUpperBound(upperPad); // The input type must be real or else the code will not compile. using FFTFilterType = itk::ForwardFFTImageFilter; - typename FFTFilterType::Pointer FFTFilter = FFTFilterType::New(); + auto FFTFilter = FFTFilterType::New(); FFTFilter->SetInput(padder->GetOutput()); FFTFilter->Update(); @@ -415,7 +415,7 @@ MaskedFFTNormalizedCorrelationImageFilter // It also converts the image from complex (with small imaginary values since // the input to the original FFTs was real) to real. using FFTFilterType = itk::InverseFFTImageFilter; - typename FFTFilterType::Pointer FFTFilter = FFTFilterType::New(); + auto FFTFilter = FFTFilterType::New(); FFTFilter->SetInput(inputImage); // Extract the relevant part out of the image. @@ -427,7 +427,7 @@ MaskedFFTNormalizedCorrelationImageFilter imageRegion.SetIndex(imageIndex); imageRegion.SetSize(combinedImageSize); using ExtractType = itk::RegionOfInterestImageFilter; - typename ExtractType::Pointer extracter = ExtractType::New(); + auto extracter = ExtractType::New(); extracter->SetInput(FFTFilter->GetOutput()); extracter->SetRegionOfInterest(imageRegion); extracter->Update(); @@ -450,7 +450,7 @@ MaskedFFTNormalizedCorrelationImageFilter LocalInputImageType * inputImage2) { using MultiplyType = itk::MultiplyImageFilter; - typename MultiplyType::Pointer multiplier = MultiplyType::New(); + auto multiplier = MultiplyType::New(); multiplier->SetInput1(inputImage1); multiplier->SetInput2(inputImage2); multiplier->Update(); @@ -467,7 +467,7 @@ MaskedFFTNormalizedCorrelationImageFilter LocalInputImageType * inputImage2) { using DivideType = itk::DivideImageFilter; - typename DivideType::Pointer divider = DivideType::New(); + auto divider = DivideType::New(); divider->SetInput1(inputImage1); divider->SetInput2(inputImage2); divider->Update(); @@ -484,7 +484,7 @@ MaskedFFTNormalizedCorrelationImageFilter LocalInputImageType * inputImage2) { using SubtractType = itk::SubtractImageFilter; - typename SubtractType::Pointer subtracter = SubtractType::New(); + auto subtracter = SubtractType::New(); subtracter->SetInput1(inputImage1); subtracter->SetInput2(inputImage2); subtracter->Update(); @@ -501,7 +501,7 @@ MaskedFFTNormalizedCorrelationImageFilter { // Set all negative values to 0. using ThresholdType = itk::ThresholdImageFilter; - typename ThresholdType::Pointer thresholder = ThresholdType::New(); + auto thresholder = ThresholdType::New(); thresholder->SetInput(inputImage); thresholder->ThresholdBelow(0); thresholder->SetOutsideValue(0); @@ -518,7 +518,7 @@ MaskedFFTNormalizedCorrelationImageFilter LocalInputImageType * inputImage) { using RoundType = itk::RoundImageFilter; - typename RoundType::Pointer rounder = RoundType::New(); + auto rounder = RoundType::New(); rounder->SetInput(inputImage); rounder->Update(); typename LocalOutputImageType::Pointer outputImage = rounder->GetOutput(); @@ -578,7 +578,7 @@ MaskedFFTNormalizedCorrelationImageFilter { // First find the maximum of the inputImage. using CalculatorType = itk::MinimumMaximumImageCalculator; - typename CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(inputImage); calculator->ComputeMaximum(); diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx index 1935e5b80cb..759156aba74 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterDeltaFunctionTest.cxx @@ -37,13 +37,13 @@ itkConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; // Read kernel image. - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); // Set up delta function image. ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - ImageType::Pointer deltaFunctionImage = ImageType::New(); + auto deltaFunctionImage = ImageType::New(); deltaFunctionImage->SetRegions(region); deltaFunctionImage->Allocate(true); // initialize // buffer @@ -59,12 +59,12 @@ itkConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) deltaFunctionImage->SetPixel(middleIndex, 1); using ConvolutionFilterType = itk::ConvolutionImageFilter; - ConvolutionFilterType::Pointer convolver = ConvolutionFilterType::New(); + auto convolver = ConvolutionFilterType::New(); convolver->SetInput(deltaFunctionImage); convolver->SetKernelImage(reader->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(convolver->GetOutput()); diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx index 615b09812c3..e43cb6d05f5 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTest.cxx @@ -40,16 +40,16 @@ itkConvolutionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); reader1->Update(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); reader2->Update(); using ConvolutionFilterType = itk::ConvolutionImageFilter; - ConvolutionFilterType::Pointer convoluter = ConvolutionFilterType::New(); + auto convoluter = ConvolutionFilterType::New(); convoluter->SetInput(reader1->GetOutput()); convoluter->SetKernelImage(reader2->GetOutput()); @@ -61,7 +61,7 @@ itkConvolutionImageFilterTest(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(convoluter->GetOutput()); @@ -82,7 +82,7 @@ itkConvolutionImageFilterTest(int argc, char * argv[]) // convoluter->Print(std::cout); - ImageType::Pointer emtpyImage = ImageType::New(); + auto emtpyImage = ImageType::New(); convoluter->SetInput(emtpyImage); try { @@ -166,7 +166,7 @@ itkConvolutionImageFilterTest(int argc, char * argv[]) // Test VALID output region mode with kernel that is larger than // the input image. Should result in a zero-size valid region. - ImageType::Pointer largeKernel = ImageType::New(); + auto largeKernel = ImageType::New(); ImageType::RegionType kernelRegion(reader1->GetOutput()->GetLargestPossibleRegion().GetSize()); kernelRegion.PadByRadius(5); diff --git a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx index 63abb56c27d..92c555a48eb 100644 --- a/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx +++ b/Modules/Filtering/Convolution/test/itkConvolutionImageFilterTestInt.cxx @@ -42,14 +42,14 @@ itkConvolutionImageFilterTestInt(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ConvolutionFilterType = itk::ConvolutionImageFilter; - ConvolutionFilterType::Pointer convolver = ConvolutionFilterType::New(); + auto convolver = ConvolutionFilterType::New(); convolver->SetInput(reader1->GetOutput()); convolver->SetKernelImage(reader2->GetOutput()); @@ -83,7 +83,7 @@ itkConvolutionImageFilterTestInt(int argc, char * argv[]) using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(convolver->GetOutput()); constexpr unsigned int numberOfStreamDivisions = 4; @@ -93,7 +93,7 @@ itkConvolutionImageFilterTestInt(int argc, char * argv[]) streamingFilter->SetInput(monitor->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(streamingFilter->GetOutput()); diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx index f3b1a7212df..79243a198c7 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterDeltaFunctionTest.cxx @@ -39,14 +39,14 @@ itkFFTConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; // Read kernel image - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); // Set up delta function image ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); - ImageType::Pointer deltaFunctionImage = ImageType::New(); + auto deltaFunctionImage = ImageType::New(); deltaFunctionImage->SetRegions(region); deltaFunctionImage->Allocate(true); // initialize buffer to zero @@ -60,7 +60,7 @@ itkFFTConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) deltaFunctionImage->SetPixel(middleIndex, 1); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolver = ConvolutionFilterType::New(); + auto convolver = ConvolutionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(convolver, FFTConvolutionImageFilter, ConvolutionImageFilterBase); @@ -80,7 +80,7 @@ itkFFTConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(convolver->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(convolver->GetOutput()); diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx index c6a761c491f..f3e911dc0d6 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTest.cxx @@ -48,23 +48,23 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader1->Update()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader2->Update()); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convoluter = ConvolutionFilterType::New(); + auto convoluter = ConvolutionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(convoluter, FFTConvolutionImageFilter, ConvolutionImageFilterBase); // Test empty image exception - ImageType::Pointer emptyImage = ImageType::New(); + auto emptyImage = ImageType::New(); convoluter->SetInput(emptyImage); try { @@ -80,7 +80,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) // Test generality of filter by changing the image index using ChangeInformationFilterType = itk::ChangeInformationImageFilter; - ChangeInformationFilterType::Pointer inputChanger = ChangeInformationFilterType::New(); + auto inputChanger = ChangeInformationFilterType::New(); inputChanger->ChangeRegionOn(); ImageType::OffsetType inputOffset = { { -2, 3 } }; inputChanger->SetOutputOffset(inputOffset); @@ -89,7 +89,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) convoluter->SetInput(inputChanger->GetOutput()); // Test generality of filter by changing the kernel index - ChangeInformationFilterType::Pointer kernelChanger = ChangeInformationFilterType::New(); + auto kernelChanger = ChangeInformationFilterType::New(); kernelChanger->ChangeRegionOn(); ImageType::OffsetType kernelOffset = { { 3, -5 } }; kernelChanger->SetOutputOffset(kernelOffset); @@ -196,7 +196,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(convoluter->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(convoluter->GetOutput()); @@ -205,7 +205,7 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[]) // Test VALID output region mode with kernel that is larger than // the input image. Should result in a zero-size valid region. - ImageType::Pointer largeKernel = ImageType::New(); + auto largeKernel = ImageType::New(); ImageType::RegionType kernelRegion(reader1->GetOutput()->GetLargestPossibleRegion().GetSize()); kernelRegion.PadByRadius(5); diff --git a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx index 6accdc98e3a..cc08350e92e 100644 --- a/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTConvolutionImageFilterTestInt.cxx @@ -40,18 +40,18 @@ itkFFTConvolutionImageFilterTestInt(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader1->Update()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader2->Update()); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolver = ConvolutionFilterType::New(); + auto convolver = ConvolutionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(convolver, FFTConvolutionImageFilter, ConvolutionImageFilterBase); @@ -97,7 +97,7 @@ itkFFTConvolutionImageFilterTestInt(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(convolver->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(convolver->GetOutput()); diff --git a/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx index 0c060055f52..23359c5b040 100644 --- a/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkFFTNormalizedCorrelationImageFilterTest.cxx @@ -52,13 +52,13 @@ itkFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) } using ReaderType = itk::ImageFileReader; - ReaderType::Pointer fixedImageReader = ReaderType::New(); + auto fixedImageReader = ReaderType::New(); fixedImageReader->SetFileName(fixedImageFileName); - ReaderType::Pointer movingImageReader = ReaderType::New(); + auto movingImageReader = ReaderType::New(); movingImageReader->SetFileName(movingImageFileName); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetFixedImage(fixedImageReader->GetOutput()); filter->SetMovingImage(movingImageReader->GetOutput()); // Larger values zero-out pixels on a larger border around the correlation image. @@ -79,13 +79,13 @@ itkFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) // mapped to 127 or 128, depending on whether they are slightly negative or positive. // Therefore, we truncate instead so that all values near 0 get mapped to 127. using RescaleType = itk::ShiftScaleImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetOutput()); rescaler->SetShift(1); rescaler->SetScale(255.0 / 2.0); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputImageFileName); writer->SetInput(rescaler->GetOutput()); try diff --git a/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx index ebebc50e7ce..2dd6b52faff 100644 --- a/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkMaskedFFTNormalizedCorrelationImageFilterTest.cxx @@ -57,13 +57,13 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) requiredFractionOfOverlappingPixels = std::stod(argv[4]); } - ReaderType::Pointer fixedImageReader = ReaderType::New(); + auto fixedImageReader = ReaderType::New(); fixedImageReader->SetFileName(fixedImageFileName); - ReaderType::Pointer movingImageReader = ReaderType::New(); + auto movingImageReader = ReaderType::New(); movingImageReader->SetFileName(movingImageFileName); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetFixedImage(fixedImageReader->GetOutput()); filter->SetMovingImage(movingImageReader->GetOutput()); // Larger values zero-out pixels on a larger border around the correlation image. @@ -73,8 +73,8 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) if (argc > 5) { - char * fixedMaskFileName = argv[5]; - MaskReaderType::Pointer fixedMaskReader = MaskReaderType::New(); + char * fixedMaskFileName = argv[5]; + auto fixedMaskReader = MaskReaderType::New(); fixedMaskReader->SetFileName(fixedMaskFileName); fixedMaskReader->Update(); filter->SetFixedImageMask(fixedMaskReader->GetOutput()); @@ -82,8 +82,8 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) if (argc > 6) { - char * movingMaskFileName = argv[6]; - MaskReaderType::Pointer movingMaskReader = MaskReaderType::New(); + char * movingMaskFileName = argv[6]; + auto movingMaskReader = MaskReaderType::New(); movingMaskReader->SetFileName(movingMaskFileName); movingMaskReader->Update(); filter->SetMovingImageMask(movingMaskReader->GetOutput()); @@ -102,13 +102,13 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[]) // mapped to 127 or 128, depending on whether they are slightly negative or positive. // Therefore, we truncate instead so that all values near 0 get mapped to 127. using RescaleType = itk::ShiftScaleImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetOutput()); rescaler->SetShift(1); rescaler->SetScale(255.0 / 2.0); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputImageFileName); writer->SetInput(rescaler->GetOutput()); try diff --git a/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx b/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx index effd5b9bfd1..61823568df0 100644 --- a/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx +++ b/Modules/Filtering/Convolution/test/itkNormalizedCorrelationImageFilterTest.cxx @@ -61,14 +61,14 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[]) // resample the mask to be the size of the input using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); if (interpolator.IsNull()) { return EXIT_FAILURE; } using ResampleType = itk::ResampleImageFilter; - ResampleType::Pointer resample = ResampleType::New(); + auto resample = ResampleType::New(); resample->SetInput(mask->GetOutput()); resample->SetOutputParametersFromImage(input->GetOutput()); @@ -76,7 +76,7 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::NormalizedCorrelationImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter, "Normalized correlation"); filter->SetInput(input->GetOutput()); @@ -85,7 +85,7 @@ itkNormalizedCorrelationImageFilterTest(int ac, char * av[]) using ThresholdType = itk::BinaryThresholdImageFilter; - ThresholdType::Pointer threshold = ThresholdType::New(); + auto threshold = ThresholdType::New(); threshold->SetInput(filter->GetOutput()); threshold->SetLowerThreshold(0.1); threshold->SetUpperThreshold(1.0); diff --git a/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx b/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx index 16d9320e55f..656ac5a7544 100644 --- a/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx +++ b/Modules/Filtering/CurvatureFlow/test/itkBinaryMinMaxCurvatureFlowImageFilterTest.cxx @@ -110,7 +110,7 @@ testBinaryMinMaxCurvatureFlow(itk::Size & size, // ND image siz using IteratorType = itk::ImageRegionIterator; using DenoiserType = itk::BinaryMinMaxCurvatureFlowImageFilter; - typename DenoiserType::Pointer denoiser = DenoiserType::New(); + auto denoiser = DenoiserType::New(); int j; @@ -124,7 +124,7 @@ testBinaryMinMaxCurvatureFlow(itk::Size & size, // ND image siz PixelType background = 255.0; // intensity value of the background std::cout << "Create an image of circle/sphere with noise" << std::endl; - typename ImageType::Pointer circleImage = ImageType::New(); + auto circleImage = ImageType::New(); typename ImageType::RegionType region; @@ -260,7 +260,7 @@ testBinaryMinMaxCurvatureFlow(itk::Size & size, // ND image siz * Exercise error handling */ using WrongFunctionType = itk::CurvatureFlowFunction; - typename WrongFunctionType::Pointer wrongFunction = WrongFunctionType::New(); + auto wrongFunction = WrongFunctionType::New(); passed = false; try diff --git a/Modules/Filtering/CurvatureFlow/test/itkCurvatureFlowTest.cxx b/Modules/Filtering/CurvatureFlow/test/itkCurvatureFlowTest.cxx index 3d8aa330b84..84b4d07aa6a 100644 --- a/Modules/Filtering/CurvatureFlow/test/itkCurvatureFlowTest.cxx +++ b/Modules/Filtering/CurvatureFlow/test/itkCurvatureFlowTest.cxx @@ -119,7 +119,7 @@ itkCurvatureFlowTest(int argc, char * argv[]) std::cout << "Test error handling." << std::endl; using FilterType = itk::CurvatureFlowImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(nullptr); bool passed = false; @@ -148,9 +148,9 @@ itkCurvatureFlowTest(int argc, char * argv[]) std::cout << "Test when wrong function type." << std::endl; using FunctionType = itk::DummyFunction; filter = FilterType::New(); - FunctionType::Pointer function = FunctionType::New(); - ImageType::Pointer dummy = ImageType::New(); - ImageType::SizeType size; + auto function = FunctionType::New(); + auto dummy = ImageType::New(); + ImageType::SizeType size; size.Fill(3); ImageType::RegionType region(size); dummy->SetRegions(region); @@ -173,7 +173,7 @@ itkCurvatureFlowTest(int argc, char * argv[]) std::cout << "Create input image using RandomImageSource" << std::endl; using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ImageType::SizeValueType size[ImageDimension] = { 64, 64 }; source->SetSize(size); @@ -185,7 +185,7 @@ itkCurvatureFlowTest(int argc, char * argv[]) std::cout << "Run CurvatureFlowImageFiler with progress cout's" << std::endl; using DenoiserType = itk::CurvatureFlowImageFilter; - DenoiserType::Pointer denoiser = DenoiserType::New(); + auto denoiser = DenoiserType::New(); denoiser->SetInput(source->GetOutput()); denoiser->SetTimeStep(0.05); @@ -201,16 +201,16 @@ itkCurvatureFlowTest(int argc, char * argv[]) std::cout << "Run CurvatureFlowImageFilter using streamer" << std::endl; using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(denoiser->GetInput()); - DenoiserType::Pointer denoiser2 = DenoiserType::New(); + auto denoiser2 = DenoiserType::New(); denoiser2->SetInput(caster->GetOutput()); denoiser2->SetTimeStep(denoiser->GetTimeStep()); denoiser2->SetNumberOfIterations(denoiser->GetNumberOfIterations()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(denoiser2->GetOutput()); streamer->SetNumberOfStreamDivisions(3); streamer->Update(); @@ -251,7 +251,7 @@ itkCurvatureFlowTest(int argc, char * argv[]) vtkIO = itk::VTKImageIO::New(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(streamer->GetOutput()); writer->SetFileName(argv[1]); writer->SetImageIO(vtkIO); diff --git a/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.hxx index 904c0084427..bcf73c790aa 100644 --- a/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkInverseDeconvolutionImageFilter.hxx @@ -38,10 +38,10 @@ InverseDeconvolutionImageFilterSetMiniPipelineFilter(this); - typename InputImageType::Pointer localInput = InputImageType::New(); + auto localInput = InputImageType::New(); localInput->Graft(this->GetInput()); const KernelImageType * kernelImage = this->GetKernelImage(); @@ -60,7 +60,7 @@ InverseDeconvolutionImageFilterGetKernelZeroMagnitudeThreshold()); - typename InverseFilterType::Pointer inverseFilter = InverseFilterType::New(); + auto inverseFilter = InverseFilterType::New(); inverseFilter->SetInput1(input); inverseFilter->SetInput2(kernel); inverseFilter->ReleaseDataFlagOn(); diff --git a/Modules/Filtering/Deconvolution/include/itkIterativeDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkIterativeDeconvolutionImageFilter.hxx index b33b4389e1e..fc277f4574f 100644 --- a/Modules/Filtering/Deconvolution/include/itkIterativeDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkIterativeDeconvolutionImageFilter.hxx @@ -110,7 +110,7 @@ void IterativeDeconvolutionImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); typename Superclass::InputImageConstPointer inputPtr = this->GetInput(); diff --git a/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx index 8b522fbe52f..f07d0ff4274 100644 --- a/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkParametricBlindLeastSquaresDeconvolutionImageFilter.hxx @@ -70,7 +70,7 @@ ParametricBlindLeastSquaresDeconvolutionImageFilterPrepareInput(this->GetInput(), m_TransformedInput, progress, 0.5f * progressWeight); using DuplicatorType = ImageDuplicator; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(m_TransformedInput); duplicator->Update(); m_TransformedCurrentEstimate = duplicator->GetOutput(); @@ -137,7 +137,7 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; - typename InverseFFTFilterType::Pointer ifft = InverseFFTFilterType::New(); + auto ifft = InverseFFTFilterType::New(); ifft->SetActualXDimensionIsOdd(this->GetXDimensionIsOdd()); ifft->SetInput(m_TransformedCurrentEstimate); ifft->UpdateLargestPossibleRegion(); @@ -145,7 +145,7 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; - typename EstimateShiftFilterType::Pointer estimateShifter = EstimateShiftFilterType::New(); + auto estimateShifter = EstimateShiftFilterType::New(); typename EstimateShiftFilterType::OffsetType shift; typename InternalImageType::SizeType inputSize = this->GetInput()->GetLargestPossibleRegion().GetSize(); for (unsigned int i = 0; i < InternalImageType::ImageDimension; ++i) @@ -158,18 +158,18 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; - typename NormalizeEstimateFilterType::Pointer normalizer = NormalizeEstimateFilterType::New(); + auto normalizer = NormalizeEstimateFilterType::New(); normalizer->SetConstant(1.0); normalizer->SetInput(estimateShifter->GetOutput()); // Take the DFT of the shifted image using ForwardFFTFilterType = RealToHalfHermitianForwardFFTImageFilter; - typename ForwardFFTFilterType::Pointer fft = ForwardFFTFilterType::New(); + auto fft = ForwardFFTFilterType::New(); fft->SetInput(normalizer->GetOutput()); fft->UpdateLargestPossibleRegion(); using ComplexAdaptorType = ComplexConjugateImageAdaptor; - typename ComplexAdaptorType::Pointer complexAdaptor = ComplexAdaptorType::New(); + auto complexAdaptor = ComplexAdaptorType::New(); complexAdaptor->SetImage(fft->GetOutput()); // Now we can compute the Jacobian (the derivative of the least-squares @@ -178,12 +178,12 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; - typename MultiplyFilterType::Pointer multiplier = MultiplyFilterType::New(); + auto multiplier = MultiplyFilterType::New(); multiplier->SetInput1(m_DifferenceFilter->GetOutput()); multiplier->SetInput2(complexAdaptor); // Compute the inverse DFT of the result to get the Jacobian - typename InverseFFTFilterType::Pointer jacobianIFFT = InverseFFTFilterType::New(); + auto jacobianIFFT = InverseFFTFilterType::New(); jacobianIFFT->SetInput(multiplier->GetOutput()); jacobianIFFT->SetActualXDimensionIsOdd(this->GetXDimensionIsOdd()); jacobianIFFT->UpdateLargestPossibleRegion(); @@ -255,7 +255,7 @@ ParametricBlindLeastSquaresDeconvolutionImageFilter; - typename InverseFFTFilterType::Pointer ifft = InverseFFTFilterType::New(); + auto ifft = InverseFFTFilterType::New(); ifft->SetActualXDimensionIsOdd(this->GetXDimensionIsOdd()); ifft->SetInput(m_TransformedCurrentEstimate); ifft->UpdateLargestPossibleRegion(); diff --git a/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.hxx index 09c90fd2484..7b09ab56b3e 100644 --- a/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkTikhonovDeconvolutionImageFilter.hxx @@ -38,10 +38,10 @@ TikhonovDeconvolutionImageFilterSetMiniPipelineFilter(this); - typename InputImageType::Pointer localInput = InputImageType::New(); + auto localInput = InputImageType::New(); localInput->Graft(this->GetInput()); const KernelImageType * kernelImage = this->GetKernelImage(); @@ -59,7 +59,7 @@ TikhonovDeconvolutionImageFilter; - typename TikhonovFilterType::Pointer tikhonovFilter = TikhonovFilterType::New(); + auto tikhonovFilter = TikhonovFilterType::New(); tikhonovFilter->SetInput1(input); tikhonovFilter->SetInput2(kernel); tikhonovFilter->SetFunctor(tikhonovFunctor); diff --git a/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.hxx b/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.hxx index 407d04e4c3d..5b3cd77d200 100644 --- a/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.hxx +++ b/Modules/Filtering/Deconvolution/include/itkWienerDeconvolutionImageFilter.hxx @@ -38,10 +38,10 @@ WienerDeconvolutionImageFilterSetMiniPipelineFilter(this); - typename InputImageType::Pointer localInput = InputImageType::New(); + auto localInput = InputImageType::New(); localInput->Graft(this->GetInput()); const KernelImageType * kernelImage = this->GetKernelImage(); @@ -58,7 +58,7 @@ WienerDeconvolutionImageFilter; - typename WienerFilterType::Pointer wienerFilter = WienerFilterType::New(); + auto wienerFilter = WienerFilterType::New(); wienerFilter->SetInput(0, input); wienerFilter->SetInput(1, kernel); wienerFilter->SetFunctor(wienerFunctor); diff --git a/Modules/Filtering/Deconvolution/test/itkInverseDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkInverseDeconvolutionImageFilterTest.cxx index 9738ffdfcc8..85913b3aedf 100644 --- a/Modules/Filtering/Deconvolution/test/itkInverseDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkInverseDeconvolutionImageFilterTest.cxx @@ -39,11 +39,11 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); reader1->Update(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); reader2->Update(); @@ -51,7 +51,7 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) cbc.SetConstant(0.0); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(reader1->GetOutput()); convolutionFilter->SetKernelImage(reader2->GetOutput()); convolutionFilter->SetBoundaryCondition(&cbc); @@ -69,7 +69,7 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) convolutionFilter->SetNormalize(normalize); using DeconvolutionFilterType = itk::InverseDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(reader2->GetOutput()); @@ -84,7 +84,7 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(zeroMagnitudeThreshold, deconvolutionFilter->GetKernelZeroMagnitudeThreshold()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); @@ -106,7 +106,7 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[]) using IntImageType = itk::Image; using FilterType = itk::InverseDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx index c5b5a8e5169..a4a3762b342 100644 --- a/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkLandweberDeconvolutionImageFilterTest.cxx @@ -42,24 +42,24 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer inputReader = ReaderType::New(); + auto inputReader = ReaderType::New(); inputReader->SetFileName(argv[1]); inputReader->Update(); - ReaderType::Pointer kernelReader = ReaderType::New(); + auto kernelReader = ReaderType::New(); kernelReader->SetFileName(argv[2]); kernelReader->Update(); // Generate a convolution of the input image with the kernel image using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(inputReader->GetOutput()); convolutionFilter->NormalizeOn(); convolutionFilter->SetKernelImage(kernelReader->GetOutput()); // Test the deconvolution algorithm using DeconvolutionFilterType = itk::LandweberDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(kernelReader->GetOutput()); deconvolutionFilter->NormalizeOn(); @@ -75,7 +75,7 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) // Add an observer to report on filter iteration progress using IterationCommandType = itk::DeconvolutionIterationCommand; - IterationCommandType::Pointer observer = IterationCommandType::New(); + auto observer = IterationCommandType::New(); deconvolutionFilter->AddObserver(itk::IterationEvent(), observer); itk::SimpleFilterWatcher watcher(deconvolutionFilter); @@ -83,7 +83,7 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) // Write the deconvolution result try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); writer->Update(); @@ -108,7 +108,7 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) using IntImageType = itk::Image; using FilterType = itk::LandweberDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx index 0b4fde78883..3d37c6397db 100644 --- a/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkParametricBlindLeastSquaresDeconvolutionImageFilterTest.cxx @@ -124,14 +124,14 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer inputReader = ReaderType::New(); + auto inputReader = ReaderType::New(); inputReader->SetFileName(argv[1]); inputReader->Update(); // Create a masked parametric image source so that we can optimize // for the sigma parameters only. using KernelSourceType = itk::ExampleImageSource; - KernelSourceType::Pointer kernelSource = KernelSourceType::New(); + auto kernelSource = KernelSourceType::New(); kernelSource->SetScale(1.0); KernelSourceType::SizeType size = { { 32, 32 } }; @@ -161,7 +161,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv // from a parametric image source. We'll try to recover those // parameters later. using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(inputReader->GetOutput()); convolutionFilter->NormalizeOn(); convolutionFilter->SetKernelImage(kernelSource->GetOutput()); @@ -172,7 +172,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv // Create an instance of the deconvolution filter using DeconvolutionFilterType = itk::ParametricBlindLeastSquaresDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetKernelSource(kernelSource); deconvolutionFilter->SetSizeGreatestPrimeFactor(5); @@ -195,7 +195,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv std::cout << "Kernel parameters: " << kernelSource->GetParameters() << std::endl; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(deconvolutionFilter->GetOutput()); writer->Update(); @@ -228,7 +228,7 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv { try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[6]); writer->SetInput(convolutionFilter->GetOutput()); writer->Update(); diff --git a/Modules/Filtering/Deconvolution/test/itkProjectedIterativeDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkProjectedIterativeDeconvolutionImageFilterTest.cxx index 4f6f6df8856..52f3739736e 100644 --- a/Modules/Filtering/Deconvolution/test/itkProjectedIterativeDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkProjectedIterativeDeconvolutionImageFilterTest.cxx @@ -34,7 +34,7 @@ itkProjectedIterativeDeconvolutionImageFilterTest(int, char *[]) using ProjectedDeconvolutionFilterType = itk::ProjectedIterativeDeconvolutionImageFilter; // Just instantiate the filter and print it - ProjectedDeconvolutionFilterType::Pointer deconvolutionFilter = ProjectedDeconvolutionFilterType::New(); + auto deconvolutionFilter = ProjectedDeconvolutionFilterType::New(); deconvolutionFilter->Print(std::cout); itk::SimpleFilterWatcher watcher(deconvolutionFilter); diff --git a/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx index 5a9440fe7ca..269ab676bcf 100644 --- a/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkProjectedLandweberDeconvolutionImageFilterTest.cxx @@ -38,24 +38,24 @@ itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer inputReader = ReaderType::New(); + auto inputReader = ReaderType::New(); inputReader->SetFileName(argv[1]); inputReader->Update(); - ReaderType::Pointer kernelReader = ReaderType::New(); + auto kernelReader = ReaderType::New(); kernelReader->SetFileName(argv[2]); kernelReader->Update(); // Generate a convolution of the input image with the kernel image using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(inputReader->GetOutput()); convolutionFilter->NormalizeOn(); convolutionFilter->SetKernelImage(kernelReader->GetOutput()); // Test the deconvolution algorithm using DeconvolutionFilterType = itk::ProjectedLandweberDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(kernelReader->GetOutput()); deconvolutionFilter->NormalizeOn(); @@ -65,13 +65,13 @@ itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) // Add an observer to report on filter iteration progress using IterationCommandType = itk::DeconvolutionIterationCommand; - IterationCommandType::Pointer observer = IterationCommandType::New(); + auto observer = IterationCommandType::New(); deconvolutionFilter->AddObserver(itk::IterationEvent(), observer); // Write the deconvolution result try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); writer->Update(); @@ -97,7 +97,7 @@ itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[]) using FilterType = itk::ProjectedLandweberDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx index 5c3505196cb..e073fc5446b 100644 --- a/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkRichardsonLucyDeconvolutionImageFilterTest.cxx @@ -40,17 +40,17 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer inputReader = ReaderType::New(); + auto inputReader = ReaderType::New(); inputReader->SetFileName(argv[1]); inputReader->Update(); - ReaderType::Pointer kernelReader = ReaderType::New(); + auto kernelReader = ReaderType::New(); kernelReader->SetFileName(argv[2]); kernelReader->Update(); // Generate a convolution of the input image with the kernel image using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(inputReader->GetOutput()); convolutionFilter->NormalizeOn(); convolutionFilter->SetKernelImage(kernelReader->GetOutput()); @@ -60,7 +60,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) { try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(convolutionFilter->GetOutput()); writer->Update(); @@ -74,7 +74,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) // Test the deconvolution algorithm using DeconvolutionFilterType = itk::RichardsonLucyDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(kernelReader->GetOutput()); deconvolutionFilter->NormalizeOn(); @@ -83,7 +83,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) // Add an observer to report on filter iteration progress using IterationCommandType = itk::DeconvolutionIterationCommand; - IterationCommandType::Pointer observer = IterationCommandType::New(); + auto observer = IterationCommandType::New(); deconvolutionFilter->AddObserver(itk::IterationEvent(), observer); itk::SimpleFilterWatcher watcher(deconvolutionFilter); @@ -91,7 +91,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) // Write the deconvolution result try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); writer->Update(); @@ -145,7 +145,7 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[]) using IntImageType = itk::Image; using FilterType = itk::RichardsonLucyDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx index ba56c0c1729..33cf1cae025 100644 --- a/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkTikhonovDeconvolutionImageFilterTest.cxx @@ -40,11 +40,11 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); reader1->Update(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); reader2->Update(); @@ -52,7 +52,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) cbc.SetConstant(0.0); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(reader1->GetOutput()); convolutionFilter->SetKernelImage(reader2->GetOutput()); @@ -70,7 +70,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) convolutionFilter->SetNormalize(normalize); using DeconvolutionFilterType = itk::TikhonovDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(reader2->GetOutput()); @@ -85,7 +85,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(regularizationConstant, deconvolutionFilter->GetRegularizationConstant()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); @@ -107,7 +107,7 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[]) using IntImageType = itk::Image; using FilterType = itk::TikhonovDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx b/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx index 8ecd7f2e203..5ffe46a7ca7 100644 --- a/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx +++ b/Modules/Filtering/Deconvolution/test/itkWienerDeconvolutionImageFilterTest.cxx @@ -39,11 +39,11 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); reader1->Update(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); reader2->Update(); @@ -51,7 +51,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) cbc.SetConstant(0.0); using ConvolutionFilterType = itk::FFTConvolutionImageFilter; - ConvolutionFilterType::Pointer convolutionFilter = ConvolutionFilterType::New(); + auto convolutionFilter = ConvolutionFilterType::New(); convolutionFilter->SetInput(reader1->GetOutput()); convolutionFilter->SetKernelImage(reader2->GetOutput()); convolutionFilter->SetBoundaryCondition(&cbc); @@ -68,7 +68,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) convolutionFilter->SetNormalize(normalize); using DeconvolutionFilterType = itk::WienerDeconvolutionImageFilter; - DeconvolutionFilterType::Pointer deconvolutionFilter = DeconvolutionFilterType::New(); + auto deconvolutionFilter = DeconvolutionFilterType::New(); deconvolutionFilter->SetInput(convolutionFilter->GetOutput()); deconvolutionFilter->SetKernelImage(reader2->GetOutput()); @@ -83,7 +83,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(noiseVariance, deconvolutionFilter->GetNoiseVariance()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(deconvolutionFilter->GetOutput()); @@ -105,7 +105,7 @@ itkWienerDeconvolutionImageFilterTest(int argc, char * argv[]) using IntImageType = itk::Image; using FilterType = itk::WienerDeconvolutionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); return EXIT_SUCCESS; diff --git a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx index 180a070c5a9..e0f8c59c3e0 100644 --- a/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx +++ b/Modules/Filtering/Denoising/include/itkPatchBasedDenoisingImageFilter.hxx @@ -373,7 +373,7 @@ PatchBasedDenoisingImageFilter::Initialize() if (m_Sampler.IsNull()) { using SamplerType = itk::Statistics::SpatialNeighborSubsampler; - typename SamplerType::Pointer defaultSampler = SamplerType::New(); + auto defaultSampler = SamplerType::New(); defaultSampler->SetRadius(25); this->SetSampler(defaultSampler); @@ -477,7 +477,7 @@ PatchBasedDenoisingImageFilter::InitializePatchWeight typename WeightsImageType::SizeType physicalSize; physicalSize.Fill(physicalDiameter); typename WeightsImageType::RegionType physicalRegion(physicalSize); - typename WeightsImageType::Pointer physicalWeightsImage = WeightsImageType::New(); + auto physicalWeightsImage = WeightsImageType::New(); physicalWeightsImage->SetRegions(physicalRegion); physicalWeightsImage->SetSpacing(physicalSpacing); physicalWeightsImage->Allocate(); @@ -532,9 +532,9 @@ PatchBasedDenoisingImageFilter::InitializePatchWeight using TransformType = itk::IdentityTransform; using InterpolatorType = itk::LinearInterpolateImageFunction; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - typename TransformType::Pointer transform = TransformType::New(); + auto resampler = ResampleFilterType::New(); + auto interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); transform->SetIdentity(); resampler->SetTransform(transform); @@ -591,7 +591,7 @@ void PatchBasedDenoisingImageFilter::DispatchedMinMax(const TInputImageType * img) { using MinMaxFilter = MinimumMaximumImageFilter; - typename MinMaxFilter::Pointer minmax = MinMaxFilter::New(); + auto minmax = MinMaxFilter::New(); minmax->SetInput(img); minmax->Modified(); minmax->Update(); @@ -608,10 +608,10 @@ PatchBasedDenoisingImageFilter::DispatchedArrayMinMax using AdaptorType = NthElementImageAdaptor; using MinMaxFilter = MinimumMaximumImageFilter; - typename AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetImage(const_cast(img)); - typename MinMaxFilter::Pointer minmax = MinMaxFilter::New(); + auto minmax = MinMaxFilter::New(); for (unsigned int pc = 0; pc < m_NumPixelComponents; ++pc) { @@ -1340,7 +1340,7 @@ PatchBasedDenoisingImageFilter::InitializeIteration() // Provide a sampler to the thread m_ThreadData[thread].sampler = dynamic_cast(m_Sampler->Clone().GetPointer()); - typename ListAdaptorType::Pointer searchList = ListAdaptorType::New(); + auto searchList = ListAdaptorType::New(); searchList->SetImage(this->m_OutputImage); searchList->SetRadius(radius); m_ThreadData[thread].sampler->SetSeed(thread); @@ -1535,7 +1535,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeSigmaU const OutputImageType * output = this->m_OutputImage; const InputImageType * inputImage = this->m_InputImage; - typename ListAdaptorType::Pointer inList = ListAdaptorType::New(); + auto inList = ListAdaptorType::New(); inList->SetImage(output); inList->SetRadius(radius); @@ -1972,7 +1972,7 @@ PatchBasedDenoisingImageFilter::ThreadedComputeImageU OutputImageType * output = this->m_OutputImage; const InputImageType * inputImage = this->m_InputImage; - typename ListAdaptorType::Pointer inList = ListAdaptorType::New(); + auto inList = ListAdaptorType::New(); inList->SetImage(output); inList->SetRadius(radius); diff --git a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterDefaultTest.cxx b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterDefaultTest.cxx index b0f19e03555..cfd08abfd50 100644 --- a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterDefaultTest.cxx +++ b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterDefaultTest.cxx @@ -37,14 +37,14 @@ doDenoising(const std::string & inputFileName, const std::string & outputFileNam using WriterType = itk::ImageFileWriter; // Read the noisy image to be denoised - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); // Create filter and initialize - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); // Use 2 threads for consistency @@ -55,7 +55,7 @@ doDenoising(const std::string & inputFileName, const std::string & outputFileNam // Write the denoised image to file - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(filter->GetOutput()); @@ -82,7 +82,7 @@ itkPatchBasedDenoisingImageFilterDefaultTest(int argc, char * argv[]) using ImageType = itk::Image; using FilterType = itk::PatchBasedDenoisingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PatchBasedDenoisingImageFilter, PatchBasedDenoisingBaseImageFilter); diff --git a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx index 45326b1d181..344988cc352 100644 --- a/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx +++ b/Modules/Filtering/Denoising/test/itkPatchBasedDenoisingImageFilterTest.cxx @@ -91,14 +91,14 @@ doDenoising(const std::string & inputFileName, using WriterType = itk::ImageFileWriter; // Read the noisy image to be denoised - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); // Create filter and initialize - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); typename FilterType::InputImageType::Pointer inputImage = reader->GetOutput(); filter->SetInput(inputImage); @@ -155,7 +155,7 @@ doDenoising(const std::string & inputFileName, filter->SetNumberOfWorkUnits(numThreads); // Sampling the image to find similar patches - typename SamplerType::Pointer sampler = SamplerType::New(); + auto sampler = SamplerType::New(); // Variance (in physical units) for semi-local Gaussian sampling sampler->SetVariance(400); @@ -273,7 +273,7 @@ doDenoising(const std::string & inputFileName, } // Write the denoised image to file - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(filter->GetOutput()); @@ -308,7 +308,7 @@ itkPatchBasedDenoisingImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using FilterType = itk::PatchBasedDenoisingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PatchBasedDenoisingImageFilter, PatchBasedDenoisingBaseImageFilter); diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx index cb1758f0eaf..9ba609f3b32 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DReconstructionImageFilterTest.cxx @@ -61,7 +61,7 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) // Create a reference image // using ReferenceImageType = TensorReconstructionImageFilterType::ReferenceImageType; - ReferenceImageType::Pointer referenceImage = ReferenceImageType::New(); + auto referenceImage = ReferenceImageType::New(); using ReferenceRegionType = ReferenceImageType::RegionType; using ReferenceIndexType = ReferenceRegionType::IndexType; using ReferenceSizeType = ReferenceRegionType::SizeType; @@ -94,10 +94,10 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) for (unsigned int i = 0; i < numberOfGradientImages; ++i) { - GradientImageType::Pointer gradientImage = GradientImageType::New(); - GradientSizeType sizeGradientImage = { { 4, 4, 4 } }; - GradientIndexType indexGradientImage = { { 0, 0, 0 } }; - GradientRegionType regionGradientImage; + auto gradientImage = GradientImageType::New(); + GradientSizeType sizeGradientImage = { { 4, 4, 4 } }; + GradientIndexType indexGradientImage = { { 0, 0, 0 } }; + GradientRegionType regionGradientImage; regionGradientImage.SetSize(sizeGradientImage); regionGradientImage.SetIndex(indexGradientImage); gradientImage->SetRegions(regionGradientImage); @@ -127,7 +127,7 @@ itkDiffusionTensor3DReconstructionImageFilterTest(int argc, char * argv[]) // With all pixels set to 255, it won't actually suppress any voxels // from processing, but it will at least exercise the mask code. using MaskImageType = TensorReconstructionImageFilterType::MaskImageType; - MaskImageType::Pointer maskImage = MaskImageType::New(); + auto maskImage = MaskImageType::New(); maskImage->SetRegions(regionReferenceImage); maskImage->Allocate(); maskImage->FillBuffer(255); diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx index 1a2a62120cf..0ecb44232e4 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkDiffusionTensor3DTest.cxx @@ -150,7 +150,7 @@ itkDiffusionTensor3DTest(int, char *[]) using PixelType = Float3DTensorType; using ImageType = itk::Image; - ImageType::Pointer dti = ImageType::New(); + auto dti = ImageType::New(); ImageType::SizeType size; ImageType::IndexType start; diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx index 22716adb8da..1d3b5f759fd 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkTensorFractionalAnisotropyImageFilterTest.cxx @@ -42,7 +42,7 @@ itkTensorFractionalAnisotropyImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -109,7 +109,7 @@ itkTensorFractionalAnisotropyImageFilterTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images @@ -121,7 +121,7 @@ itkTensorFractionalAnisotropyImageFilterTest(int, char *[]) using FAFilterType = itk::TensorFractionalAnisotropyImageFilter; - FAFilterType::Pointer fractionalAnisotropyFilter = FAFilterType::New(); + auto fractionalAnisotropyFilter = FAFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( fractionalAnisotropyFilter, TensorFractionalAnisotropyImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx b/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx index 4c0d9c28b6b..b111b9cfd7b 100644 --- a/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx +++ b/Modules/Filtering/DiffusionTensorImage/test/itkTensorRelativeAnisotropyImageFilterTest.cxx @@ -42,7 +42,7 @@ itkTensorRelativeAnisotropyImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -109,7 +109,7 @@ itkTensorRelativeAnisotropyImageFilterTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images @@ -121,7 +121,7 @@ itkTensorRelativeAnisotropyImageFilterTest(int, char *[]) using FAFilterType = itk::TensorRelativeAnisotropyImageFilter; - FAFilterType::Pointer relativeAnisotropyFilter = FAFilterType::New(); + auto relativeAnisotropyFilter = FAFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( relativeAnisotropyFilter, TensorRelativeAnisotropyImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx b/Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx index 37e58c60f1b..b6fe67fc9e3 100644 --- a/Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkBSplineExponentialDiffeomorphicTransform.hxx @@ -106,7 +106,7 @@ BSplineExponentialDiffeomorphicTransform::Upd using ImporterType = ImportImageFilter; const bool importFilterWillReleaseMemory = false; - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(velocityField->GetBufferedRegion()); importer->SetOrigin(velocityField->GetOrigin()); @@ -130,13 +130,13 @@ BSplineExponentialDiffeomorphicTransform::Upd using RealImageType = Image; using MultiplierType = MultiplyImageFilter; - typename MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(updateField); multiplier->SetConstant(factor); multiplier->Update(); using AdderType = AddImageFilter; - typename AdderType::Pointer adder = AdderType::New(); + auto adder = AdderType::New(); adder->SetInput1(velocityField); adder->SetInput2(multiplier->GetOutput()); @@ -181,7 +181,7 @@ BSplineExponentialDiffeomorphicTransform::BSp const ConstantVelocityFieldType * field, const ArrayType & numberOfControlPoints) { - typename BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); + auto bspliner = BSplineFilterType::New(); bspliner->SetUseInputFieldToDefineTheBSplineDomain(true); bspliner->SetDisplacementField(field); bspliner->SetNumberOfControlPoints(numberOfControlPoints); diff --git a/Modules/Filtering/DisplacementField/include/itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx index be4c2e2b25f..ccfacd8cac8 100644 --- a/Modules/Filtering/DisplacementField/include/itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx @@ -106,7 +106,7 @@ BSplineSmoothingOnUpdateDisplacementFieldTransform(const_cast(update).data_block()); - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(displacementField->GetBufferedRegion()); importer->SetOrigin(displacementField->GetOrigin()); @@ -151,7 +151,7 @@ BSplineSmoothingOnUpdateDisplacementFieldTransformSetImportPointer(displacementField->GetBufferPointer(), numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(displacementField->GetBufferedRegion()); importer->SetOrigin(displacementField->GetOrigin()); @@ -179,7 +179,7 @@ BSplineSmoothingOnUpdateDisplacementFieldTransformSetUseInputFieldToDefineTheBSplineDomain(true); bspliner->SetDisplacementField(field); bspliner->SetNumberOfControlPoints(numberOfControlPoints); diff --git a/Modules/Filtering/DisplacementField/include/itkComposeDisplacementFieldsImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkComposeDisplacementFieldsImageFilter.hxx index 0b0c170bbed..6375cd1f8e4 100644 --- a/Modules/Filtering/DisplacementField/include/itkComposeDisplacementFieldsImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkComposeDisplacementFieldsImageFilter.hxx @@ -37,7 +37,7 @@ ComposeDisplacementFieldsImageFilter::ComposeDisplacem this->DynamicMultiThreadingOn(); using DefaultInterpolatorType = VectorLinearInterpolateImageFunction; - typename DefaultInterpolatorType::Pointer interpolator = DefaultInterpolatorType::New(); + auto interpolator = DefaultInterpolatorType::New(); this->m_Interpolator = interpolator; } diff --git a/Modules/Filtering/DisplacementField/include/itkConstantVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkConstantVelocityFieldTransform.hxx index 6c3b7ffd6cb..86b073631c9 100644 --- a/Modules/Filtering/DisplacementField/include/itkConstantVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkConstantVelocityFieldTransform.hxx @@ -46,7 +46,7 @@ ConstantVelocityFieldTransform::ConstantVeloc // Setup and assign default interpolator using DefaultInterpolatorType = VectorLinearInterpolateImageFunction; - typename DefaultInterpolatorType::Pointer interpolator = DefaultInterpolatorType::New(); + auto interpolator = DefaultInterpolatorType::New(); this->m_ConstantVelocityFieldInterpolator = interpolator; // Setup and assign parameter helper. This will hold the displacement field @@ -195,7 +195,7 @@ ConstantVelocityFieldTransform::SetFixedParam PixelType zeroDisplacement; zeroDisplacement.Fill(0.0); - typename ConstantVelocityFieldType::Pointer velocityField = ConstantVelocityFieldType::New(); + auto velocityField = ConstantVelocityFieldType::New(); velocityField->SetSpacing(spacing); velocityField->SetOrigin(origin); velocityField->SetDirection(direction); @@ -258,7 +258,7 @@ ConstantVelocityFieldTransform::IntegrateVelo ConstantVelocityFieldPointer constantVelocityField = this->GetModifiableConstantVelocityField(); - typename ExponentiatorType::Pointer exponentiator = ExponentiatorType::New(); + auto exponentiator = ExponentiatorType::New(); exponentiator->SetInput(constantVelocityField); if (this->m_CalculateNumberOfIntegrationStepsAutomatically || this->GetNumberOfIntegrationSteps() == 0) { @@ -278,7 +278,7 @@ ConstantVelocityFieldTransform::IntegrateVelo // Calculate inverse displacement field - typename ExponentiatorType::Pointer exponentiatorInv = ExponentiatorType::New(); + auto exponentiatorInv = ExponentiatorType::New(); exponentiatorInv->SetInput(constantVelocityField); if (this->m_CalculateNumberOfIntegrationStepsAutomatically || this->m_NumberOfIntegrationSteps == 0) { @@ -319,7 +319,7 @@ typename ConstantVelocityFieldTransform::Disp ConstantVelocityFieldTransform::CopyDisplacementField( const DisplacementFieldType * toCopy) const { - typename DisplacementFieldType::Pointer rval = DisplacementFieldType::New(); + auto rval = DisplacementFieldType::New(); rval->SetOrigin(toCopy->GetOrigin()); rval->SetSpacing(toCopy->GetSpacing()); rval->SetDirection(toCopy->GetDirection()); diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx index d741d83416f..9c4f9937f18 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldToBSplineImageFilter.hxx @@ -122,10 +122,10 @@ DisplacementFieldToBSplineImageFilter itkExceptionMacro("The number of input points does not match the number of weight elements."); } - typename InputPointSetType::Pointer fieldPoints = InputPointSetType::New(); + auto fieldPoints = InputPointSetType::New(); fieldPoints->Initialize(); - typename WeightsContainerType::Pointer weights = WeightsContainerType::New(); + auto weights = WeightsContainerType::New(); IdentifierType numberOfPoints = NumericTraits::ZeroValue(); @@ -144,14 +144,14 @@ DisplacementFieldToBSplineImageFilter typename InputFieldType::DirectionType identity; identity.SetIdentity(); - typename OutputFieldType::Pointer bsplinePhysicalDomainField = OutputFieldType::New(); + auto bsplinePhysicalDomainField = OutputFieldType::New(); bsplinePhysicalDomainField->SetOrigin(this->m_BSplineDomainOrigin); bsplinePhysicalDomainField->SetSpacing(this->m_BSplineDomainSpacing); bsplinePhysicalDomainField->SetRegions(this->m_BSplineDomainSize); bsplinePhysicalDomainField->SetDirection(this->m_BSplineDomainDirection); // bsplinePhysicalDomainField->Allocate(); - typename OutputFieldType::Pointer bsplineParametricDomainField = OutputFieldType::New(); + auto bsplineParametricDomainField = OutputFieldType::New(); bsplineParametricDomainField->SetOrigin(this->m_BSplineDomainOrigin); bsplineParametricDomainField->SetSpacing(this->m_BSplineDomainSpacing); bsplineParametricDomainField->SetRegions(this->m_BSplineDomainSize); @@ -364,7 +364,7 @@ DisplacementFieldToBSplineImageFilter ArrayType close; close.Fill(false); - typename BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); + auto bspliner = BSplineFilterType::New(); bspliner->SetOrigin(this->m_BSplineDomainOrigin); bspliner->SetSpacing(this->m_BSplineDomainSpacing); bspliner->SetSize(this->m_BSplineDomainSize); diff --git a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx index c556fdcd16d..d9a9721e336 100644 --- a/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkDisplacementFieldTransform.hxx @@ -40,10 +40,10 @@ DisplacementFieldTransform::DisplacementField // Setup and assign default interpolator using DefaultInterpolatorType = VectorLinearInterpolateImageFunction; - typename DefaultInterpolatorType::Pointer interpolator = DefaultInterpolatorType::New(); + auto interpolator = DefaultInterpolatorType::New(); this->m_Interpolator = interpolator; - typename DefaultInterpolatorType::Pointer inverseInterpolator = DefaultInterpolatorType::New(); + auto inverseInterpolator = DefaultInterpolatorType::New(); this->m_InverseInterpolator = inverseInterpolator; // Setup and assign parameter helper. This will hold the displacement field @@ -531,7 +531,7 @@ DisplacementFieldTransform::SetFixedParameter PixelType zeroDisplacement; zeroDisplacement.Fill(0.0); - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetSpacing(spacing); displacementField->SetOrigin(origin); displacementField->SetDirection(direction); @@ -543,7 +543,7 @@ DisplacementFieldTransform::SetFixedParameter if (!this->m_InverseDisplacementField.IsNull()) { - typename DisplacementFieldType::Pointer inverseDisplacementField = DisplacementFieldType::New(); + auto inverseDisplacementField = DisplacementFieldType::New(); inverseDisplacementField->SetSpacing(spacing); inverseDisplacementField->SetOrigin(origin); inverseDisplacementField->SetDirection(direction); diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx index a622c99e7a5..28adb4ae3cd 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianExponentialDiffeomorphicTransform.hxx @@ -66,7 +66,7 @@ GaussianExponentialDiffeomorphicTransform::Up using ImporterType = ImportImageFilter; const bool importFilterWillReleaseMemory = false; - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(velocityField->GetBufferedRegion()); importer->SetOrigin(velocityField->GetOrigin()); @@ -90,13 +90,13 @@ GaussianExponentialDiffeomorphicTransform::Up using RealImageType = Image; using MultiplierType = MultiplyImageFilter; - typename MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(updateField); multiplier->SetConstant(factor); multiplier->Update(); using AdderType = AddImageFilter; - typename AdderType::Pointer adder = AdderType::New(); + auto adder = AdderType::New(); adder->SetInput1(velocityField); adder->SetInput2(multiplier->GetOutput()); @@ -146,13 +146,13 @@ GaussianExponentialDiffeomorphicTransform::Ga } using DuplicatorType = ImageDuplicator; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(field); duplicator->Update(); ConstantVelocityFieldPointer smoothField = duplicator->GetOutput(); - typename GaussianSmoothingSmootherType::Pointer smoother = GaussianSmoothingSmootherType::New(); + auto smoother = GaussianSmoothingSmootherType::New(); for (unsigned int dimension = 0; dimension < Superclass::Dimension; ++dimension) { diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx index 3b2635bcaa2..e1314241b59 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateDisplacementFieldTransform.hxx @@ -70,7 +70,7 @@ GaussianSmoothingOnUpdateDisplacementFieldTransform(const_cast(update).data_block()); - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(displacementField->GetBufferedRegion()); importer->SetOrigin(displacementField->GetOrigin()); @@ -107,7 +107,7 @@ GaussianSmoothingOnUpdateDisplacementFieldTransformSetImportPointer(displacementField->GetBufferPointer(), numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(displacementField->GetBufferedRegion()); importer->SetOrigin(displacementField->GetOrigin()); @@ -139,13 +139,13 @@ GaussianSmoothingOnUpdateDisplacementFieldTransform; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(field); duplicator->Update(); DisplacementFieldPointer smoothField = duplicator->GetOutput(); - typename GaussianSmoothingSmootherType::Pointer smoother = GaussianSmoothingSmootherType::New(); + auto smoother = GaussianSmoothingSmootherType::New(); for (unsigned int dimension = 0; dimension < Superclass::Dimension; ++dimension) { diff --git a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx index 4cb5bc482ae..db2b56907cf 100644 --- a/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.hxx @@ -70,7 +70,7 @@ GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform(const_cast(update).data_block()); - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(velocityField->GetBufferedRegion()); importer->SetOrigin(velocityField->GetOrigin()); @@ -110,7 +110,7 @@ GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransformSetImportPointer(velocityField->GetBufferPointer(), numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(velocityField->GetBufferedRegion()); importer->SetOrigin(velocityField->GetOrigin()); @@ -147,14 +147,14 @@ GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(field); duplicator->Update(); TimeVaryingVelocityFieldPointer smoothField = duplicator->GetOutput(); using SmootherType = VectorNeighborhoodOperatorImageFilter; - typename SmootherType::Pointer smoother = SmootherType::New(); + auto smoother = SmootherType::New(); for (unsigned int d = 0; d < TimeVaryingVelocityFieldDimension; ++d) { diff --git a/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx index 8c2ede56d68..b3803a52a5e 100644 --- a/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInverseDisplacementFieldImageFilter.hxx @@ -112,7 +112,7 @@ InverseDisplacementFieldImageFilter::PrepareKernelBas using ResamplerType = itk::ResampleImageFilter; - typename ResamplerType::Pointer resampler = ResamplerType::New(); + auto resampler = ResamplerType::New(); const InputImageType * inputImage = this->GetInput(); diff --git a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx index d09fd022fe7..d83c8950182 100644 --- a/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkInvertDisplacementFieldImageFilter.hxx @@ -80,7 +80,7 @@ InvertDisplacementFieldImageFilter::GenerateData() if (this->GetInverseFieldInitialEstimate()) { using DuplicatorType = ImageDuplicator; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(this->GetInverseFieldInitialEstimate()); duplicator->Update(); @@ -117,7 +117,7 @@ InvertDisplacementFieldImageFilter::GenerateData() << ", max error norm = " << this->m_MaxErrorNorm); using ComposerType = ComposeDisplacementFieldsImageFilter; - typename ComposerType::Pointer composer = ComposerType::New(); + auto composer = ComposerType::New(); composer->SetDisplacementField(displacementField); composer->SetWarpingField(inverseDisplacementField); diff --git a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx index e4c7e17ceec..a5536090430 100644 --- a/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx +++ b/Modules/Filtering/DisplacementField/include/itkIterativeInverseDisplacementFieldImageFilter.hxx @@ -77,8 +77,8 @@ IterativeInverseDisplacementFieldImageFilter::Generat outputPtr->SetDirection(inputPtr->GetDirection()); outputPtr->Allocate(); - typename VectorWarperType::Pointer vectorWarper = VectorWarperType::New(); - typename FieldInterpolatorType::Pointer VectorInterpolator = FieldInterpolatorType::New(); + auto vectorWarper = VectorWarperType::New(); + auto VectorInterpolator = FieldInterpolatorType::New(); vectorWarper->SetInput(negField); vectorWarper->SetInterpolator(VectorInterpolator); vectorWarper->SetOutputOrigin(inputPtr->GetOrigin()); diff --git a/Modules/Filtering/DisplacementField/include/itkTimeVaryingBSplineVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkTimeVaryingBSplineVelocityFieldTransform.hxx index d794970e25c..406ddb03d4a 100644 --- a/Modules/Filtering/DisplacementField/include/itkTimeVaryingBSplineVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkTimeVaryingBSplineVelocityFieldTransform.hxx @@ -63,7 +63,7 @@ TimeVaryingBSplineVelocityFieldTransform::Int closeDimensions[NDimensions] = 1; } - typename BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); + auto bspliner = BSplineFilterType::New(); bspliner->SetInput(this->GetTimeVaryingVelocityFieldControlPointLattice()); bspliner->SetSplineOrder(this->m_SplineOrder); bspliner->SetSpacing(this->m_VelocityFieldSpacing); @@ -78,7 +78,7 @@ TimeVaryingBSplineVelocityFieldTransform::Int using IntegratorType = TimeVaryingVelocityFieldIntegrationImageFilter; - typename IntegratorType::Pointer integrator = IntegratorType::New(); + auto integrator = IntegratorType::New(); integrator->SetInput(bsplinerOutput); integrator->SetLowerTimeBound(this->GetLowerTimeBound()); integrator->SetUpperTimeBound(this->GetUpperTimeBound()); @@ -97,7 +97,7 @@ TimeVaryingBSplineVelocityFieldTransform::Int this->SetDisplacementField(displacementField); this->GetModifiableInterpolator()->SetInputImage(displacementField); - typename IntegratorType::Pointer inverseIntegrator = IntegratorType::New(); + auto inverseIntegrator = IntegratorType::New(); inverseIntegrator->SetInput(bsplinerOutput); inverseIntegrator->SetLowerTimeBound(this->GetUpperTimeBound()); inverseIntegrator->SetUpperTimeBound(this->GetLowerTimeBound()); @@ -139,7 +139,7 @@ TimeVaryingBSplineVelocityFieldTransform::Upd auto * updateFieldPointer = reinterpret_cast(scaledUpdate.data_block()); using ImporterType = ImportImageFilter; - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer(updateFieldPointer, numberOfPixels, importFilterWillReleaseMemory); importer->SetRegion(this->GetTimeVaryingVelocityFieldControlPointLattice()->GetBufferedRegion()); importer->SetOrigin(this->GetTimeVaryingVelocityFieldControlPointLattice()->GetOrigin()); @@ -148,7 +148,7 @@ TimeVaryingBSplineVelocityFieldTransform::Upd importer->Update(); using AdderType = AddImageFilter; - typename AdderType::Pointer adder = AdderType::New(); + auto adder = AdderType::New(); adder->SetInput1(this->GetVelocityField()); adder->SetInput2(importer->GetOutput()); diff --git a/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldTransform.hxx index 91b15511583..07dd243aa8f 100644 --- a/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkTimeVaryingVelocityFieldTransform.hxx @@ -33,7 +33,7 @@ TimeVaryingVelocityFieldTransform::IntegrateV { using IntegratorType = TimeVaryingVelocityFieldIntegrationImageFilter; - typename IntegratorType::Pointer integrator = IntegratorType::New(); + auto integrator = IntegratorType::New(); integrator->SetInput(this->GetVelocityField()); integrator->SetLowerTimeBound(this->GetLowerTimeBound()); integrator->SetUpperTimeBound(this->GetUpperTimeBound()); @@ -52,7 +52,7 @@ TimeVaryingVelocityFieldTransform::IntegrateV this->SetDisplacementField(displacementField); this->GetModifiableInterpolator()->SetInputImage(displacementField); - typename IntegratorType::Pointer inverseIntegrator = IntegratorType::New(); + auto inverseIntegrator = IntegratorType::New(); inverseIntegrator->SetInput(this->GetVelocityField()); inverseIntegrator->SetLowerTimeBound(this->GetUpperTimeBound()); inverseIntegrator->SetUpperTimeBound(this->GetLowerTimeBound()); diff --git a/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.hxx b/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.hxx index 046f95ca881..8859b34c884 100644 --- a/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.hxx +++ b/Modules/Filtering/DisplacementField/include/itkVelocityFieldTransform.hxx @@ -43,7 +43,7 @@ VelocityFieldTransform::VelocityFieldTransfor // Setup and assign default interpolator using DefaultInterpolatorType = VectorLinearInterpolateImageFunction; - typename DefaultInterpolatorType::Pointer interpolator = DefaultInterpolatorType::New(); + auto interpolator = DefaultInterpolatorType::New(); this->m_VelocityFieldInterpolator = interpolator; // Setup and assign parameter helper. This will hold the displacement field @@ -190,7 +190,7 @@ VelocityFieldTransform::SetFixedParameters( PixelType zeroDisplacement; zeroDisplacement.Fill(0.0); - typename VelocityFieldType::Pointer velocityField = VelocityFieldType::New(); + auto velocityField = VelocityFieldType::New(); velocityField->SetSpacing(spacing); velocityField->SetOrigin(origin); velocityField->SetDirection(direction); @@ -247,7 +247,7 @@ typename VelocityFieldTransform::Displacement VelocityFieldTransform::CopyDisplacementField( const DisplacementFieldType * toCopy) const { - typename DisplacementFieldType::Pointer rval = DisplacementFieldType::New(); + auto rval = DisplacementFieldType::New(); rval->SetOrigin(toCopy->GetOrigin()); rval->SetSpacing(toCopy->GetSpacing()); rval->SetDirection(toCopy->GetDirection()); diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx index 535717a4240..123ccae459e 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineExponentialDiffeomorphicTransformTest.cxx @@ -36,14 +36,14 @@ itkBSplineExponentialDiffeomorphicTransformTest(int, char *[]) using DisplacementTransformType = itk::BSplineExponentialDiffeomorphicTransform; /* Create a displacement field transform */ - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetCalculateNumberOfIntegrationStepsAutomatically(true); displacementTransform->SetNumberOfIntegrationSteps(10); displacementTransform->Print(std::cout, 3); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType size; FieldType::IndexType start; diff --git a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx index 4deb22a14fd..8dd8b8105e0 100644 --- a/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest.cxx @@ -35,10 +35,10 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) using DisplacementTransformType = itk::BSplineSmoothingOnUpdateDisplacementFieldTransform; /* Create a displacement field transform */ - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType size; FieldType::IndexType start; diff --git a/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx index fabc953424a..55a6b0d3d58 100644 --- a/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkComposeDisplacementFieldsImageFilterTest.cxx @@ -40,7 +40,7 @@ itkComposeDisplacementFieldsImageFilterTest(int, char *[]) VectorType ones(1); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); field->SetOrigin(origin); field->SetSpacing(spacing); field->SetRegions(size); @@ -49,7 +49,7 @@ itkComposeDisplacementFieldsImageFilterTest(int, char *[]) field->FillBuffer(ones); using ComposerType = itk::ComposeDisplacementFieldsImageFilter; - ComposerType::Pointer composer = ComposerType::New(); + auto composer = ComposerType::New(); composer->SetDisplacementField(field); composer->SetWarpingField(field); composer->Update(); diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx index 173828da477..51a2364f164 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldJacobianDeterminantFilterTest.cxx @@ -43,7 +43,7 @@ TestDisplacementJacobianDeterminantValue() VectorImageType::SizeType size = { { 4096, 4096 } }; region.SetSize(size); - VectorImageType::Pointer dispacementfield = VectorImageType::New(); + auto dispacementfield = VectorImageType::New(); dispacementfield->SetLargestPossibleRegion(region); dispacementfield->SetBufferedRegion(region); dispacementfield->Allocate(); @@ -76,7 +76,7 @@ TestDisplacementJacobianDeterminantValue() const float expectedJacobianDeterminant = (((.25 + 1.0) * (.375 + 1.0)) - (.125 * .125)); using FilterType = itk::DisplacementFieldJacobianDeterminantFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DisplacementFieldJacobianDeterminantFilter, ImageToImageFilter); @@ -141,7 +141,7 @@ itkDisplacementFieldJacobianDeterminantFilterTest(int, char *[]) // Set up filter using FilterType = itk::DisplacementFieldJacobianDeterminantFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DisplacementFieldJacobianDeterminantFilter, ImageToImageFilter); diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx index 15966e40676..cff0d44e009 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldToBSplineImageFilterTest.cxx @@ -40,7 +40,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) VectorType ones(1); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); field->SetOrigin(origin); field->SetSpacing(spacing); field->SetRegions(size); @@ -51,13 +51,13 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) using BSplineFilterType = itk::DisplacementFieldToBSplineImageFilter; using RealImageType = BSplineFilterType::RealImageType; - RealImageType::Pointer confidenceImage = RealImageType::New(); + auto confidenceImage = RealImageType::New(); confidenceImage->CopyInformation(field); confidenceImage->SetRegions(size); confidenceImage->Allocate(); confidenceImage->FillBuffer(1.0); - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); pointSet->Initialize(); VectorType ones_points(1.0); @@ -84,7 +84,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) BSplineFilterType::ArrayType numberOfControlPoints; numberOfControlPoints.Fill(4); - BSplineFilterType::Pointer bspliner = BSplineFilterType::New(); + auto bspliner = BSplineFilterType::New(); bspliner->SetDisplacementField(field); bspliner->SetConfidenceImage(confidenceImage); bspliner->SetPointSet(pointSet); @@ -149,7 +149,7 @@ itkDisplacementFieldToBSplineImageFilterTest(int, char *[]) /** do a second run using only the point set. */ - BSplineFilterType::Pointer bspliner2 = BSplineFilterType::New(); + auto bspliner2 = BSplineFilterType::New(); bspliner2->SetPointSet(pointSet); bspliner2->SetUseInputFieldToDefineTheBSplineDomain(false); bspliner2->SetBSplineDomainFromImage(field); diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx index 8c7e4c6d33f..ba6ca64e1f5 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformCloneTest.cxx @@ -51,9 +51,9 @@ itkDisplacementFieldTransformCloneTest(int, char *[]) using FieldType = DisplacementTransformType::DisplacementFieldType; // Create a displacement field transform - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); FieldType::SizeType size; FieldType::IndexType start; diff --git a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx index 5e5314b8d77..b65c8d6012f 100644 --- a/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkDisplacementFieldTransformTest.cxx @@ -173,7 +173,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) itk::StdStreamStateSave coutState(std::cout); // Create a displacement field transform - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(displacementTransform, DisplacementFieldTransform, Transform); @@ -191,11 +191,11 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) using InterpolatorType = itk::VectorLinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); displacementTransform->SetInterpolator(interpolator); ITK_TEST_SET_GET_VALUE(interpolator, displacementTransform->GetInterpolator()); - InterpolatorType::Pointer inverseInterpolator = InterpolatorType::New(); + auto inverseInterpolator = InterpolatorType::New(); displacementTransform->SetInverseInterpolator(inverseInterpolator); ITK_TEST_SET_GET_VALUE(inverseInterpolator, displacementTransform->GetInverseInterpolator()); @@ -208,7 +208,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(directionTolerance, displacementTransform->GetDirectionTolerance()); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); FieldType::SizeType size; FieldType::IndexType start; @@ -282,7 +282,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) affineMatrix(0, 1) = 0.02; affineMatrix(1, 1) = 1.1; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); affineTransform->SetMatrix(affineMatrix); @@ -588,7 +588,7 @@ itkDisplacementFieldTransformTest(int argc, char * argv[]) // The inverse displacement field for the inverse displacement transform must // have been set to nullptr when calling SetDisplacementField(), so // 'false' should be returned here - DisplacementTransformType::Pointer inverseTransform = DisplacementTransformType::New(); + auto inverseTransform = DisplacementTransformType::New(); if (displacementTransform->GetInverse(inverseTransform)) { std::cout << "Test failed!" << std::endl; diff --git a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx index 939b02dacfe..c9831952ca0 100644 --- a/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkExponentialDisplacementFieldImageFilterTest.cxx @@ -46,7 +46,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); // Define their size, and start index SizeType size; @@ -89,7 +89,7 @@ itkExponentialDisplacementFieldImageFilterTest(int, char *[]) // Create one filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the input images diff --git a/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx index 519bf0727ac..85bef5c484b 100644 --- a/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkGaussianExponentialDiffeomorphicTransformTest.cxx @@ -37,14 +37,14 @@ itkGaussianExponentialDiffeomorphicTransformTest(int, char *[]) using DisplacementTransformType = itk::GaussianExponentialDiffeomorphicTransform; /* Create a displacement field transform */ - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetCalculateNumberOfIntegrationStepsAutomatically(true); displacementTransform->SetNumberOfIntegrationSteps(10); displacementTransform->Print(std::cout, 3); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType size; FieldType::IndexType start; diff --git a/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx index f024d194db3..59411524847 100644 --- a/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest.cxx @@ -37,9 +37,9 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformTest(int, char *[]) using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; /* Create a displacement field transform */ - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType size; FieldType::IndexType start; diff --git a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx index de4a162dee5..b01a8cf10f9 100644 --- a/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInverseDisplacementFieldImageFilterTest.cxx @@ -42,7 +42,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) using FilterType = itk::InverseDisplacementFieldImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, InverseDisplacementFieldImageFilter, ImageToImageFilter); @@ -50,7 +50,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter); // Creating an input displacement field - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); DisplacementFieldType::SpacingType spacing; spacing.Fill(1.0); @@ -120,7 +120,7 @@ itkInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) // Write an image for regression testing using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx index a2aaa9eb4ec..9c59c09d2bb 100644 --- a/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkInvertDisplacementFieldImageFilterTest.cxx @@ -40,7 +40,7 @@ itkInvertDisplacementFieldImageFilterTest(int, char *[]) VectorType ones(1); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); field->SetOrigin(origin); field->SetSpacing(spacing); field->SetRegions(size); @@ -84,7 +84,7 @@ itkInvertDisplacementFieldImageFilterTest(int, char *[]) float meanTolerance = 0.001; using InverterType = itk::InvertDisplacementFieldImageFilter; - InverterType::Pointer inverter = InverterType::New(); + auto inverter = InverterType::New(); inverter->SetInput(field); inverter->SetMaximumNumberOfIterations(numberOfIterations); inverter->SetMeanErrorToleranceThreshold(meanTolerance); diff --git a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx index 58aadddeb1e..4005b852f33 100644 --- a/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkIterativeInverseDisplacementFieldImageFilterTest.cxx @@ -43,12 +43,12 @@ itkIterativeInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) using FilterType = itk::IterativeInverseDisplacementFieldImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); // Creating an input displacement field - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); DisplacementFieldType::SpacingType spacing; spacing.Fill(1.0); @@ -119,7 +119,7 @@ itkIterativeInverseDisplacementFieldImageFilterTest(int argc, char * argv[]) // Write an image for regression testing using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx index d8fdb87570b..90821d12a8a 100644 --- a/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkLandmarkDisplacementFieldSourceTest.cxx @@ -45,7 +45,7 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) using FilterType = itk::LandmarkDisplacementFieldSource; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -82,8 +82,8 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) using LandmarkContainerType = FilterType::LandmarkContainer; using LandmarkPointType = FilterType::LandmarkPointType; - LandmarkContainerType::Pointer sourceLandmarks = LandmarkContainerType::New(); - LandmarkContainerType::Pointer targetLandmarks = LandmarkContainerType::New(); + auto sourceLandmarks = LandmarkContainerType::New(); + auto targetLandmarks = LandmarkContainerType::New(); LandmarkPointType sourcePoint; LandmarkPointType targetPoint; @@ -127,7 +127,7 @@ itkLandmarkDisplacementFieldSourceTest(int argc, char * argv[]) // Write an image for regression testing using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx index 21a6b3fca2d..50fd28320ea 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingBSplineVelocityFieldTransformTest.cxx @@ -53,7 +53,7 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) itk::TimeVaryingVelocityFieldIntegrationImageFilter; - IntegratorType::Pointer integrator = IntegratorType::New(); + auto integrator = IntegratorType::New(); integrator->SetInput(timeVaryingVelocityFieldControlPointLattice); integrator->SetLowerTimeBound(0.3); integrator->SetUpperTimeBound(0.75); @@ -79,7 +79,7 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) return EXIT_FAILURE; } - IntegratorType::Pointer inverseIntegrator = IntegratorType::New(); + auto inverseIntegrator = IntegratorType::New(); inverseIntegrator->SetInput(timeVaryingVelocityFieldControlPointLattice); inverseIntegrator->SetLowerTimeBound(1.0); inverseIntegrator->SetUpperTimeBound(0.0); @@ -116,7 +116,7 @@ itkTimeVaryingBSplineVelocityFieldTransformTest(int, char *[]) timeVaryingVelocityFieldSize[3] = 5; using TransformType = itk::TimeVaryingBSplineVelocityFieldTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetLowerTimeBound(0.0); transform->SetUpperTimeBound(1.0); transform->SetSplineOrder(splineOrder); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx index d2ea7eb4449..06e82510f1c 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldIntegrationImageFilterTest.cxx @@ -37,7 +37,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[]) VectorType displacement1; displacement1.Fill(0.1); - TimeVaryingVelocityFieldType::Pointer timeVaryingVelocityField = TimeVaryingVelocityFieldType::New(); + auto timeVaryingVelocityField = TimeVaryingVelocityFieldType::New(); timeVaryingVelocityField->SetOrigin(origin); timeVaryingVelocityField->SetSpacing(spacing); @@ -48,7 +48,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[]) using IntegratorType = itk::TimeVaryingVelocityFieldIntegrationImageFilter; - IntegratorType::Pointer integrator = IntegratorType::New(); + auto integrator = IntegratorType::New(); integrator->SetInput(timeVaryingVelocityField); integrator->SetLowerTimeBound(0.3); integrator->SetUpperTimeBound(0.75); @@ -61,7 +61,7 @@ itkTimeVaryingVelocityFieldIntegrationImageFilterTest(int, char *[]) index.Fill(0); VectorType displacement; - IntegratorType::Pointer inverseIntegrator = IntegratorType::New(); + auto inverseIntegrator = IntegratorType::New(); inverseIntegrator->SetInput(timeVaryingVelocityField); inverseIntegrator->SetLowerTimeBound(1.0); inverseIntegrator->SetUpperTimeBound(0.0); diff --git a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx index 567ab32f907..a8de610a740 100644 --- a/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTimeVaryingVelocityFieldTransformTest.cxx @@ -44,7 +44,7 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) VectorType displacement1; displacement1.Fill(0.1); - TimeVaryingVelocityFieldType::Pointer timeVaryingVelocityField = TimeVaryingVelocityFieldType::New(); + auto timeVaryingVelocityField = TimeVaryingVelocityFieldType::New(); timeVaryingVelocityField->SetOrigin(origin); timeVaryingVelocityField->SetSpacing(spacing); @@ -55,7 +55,7 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) using IntegratorType = itk::TimeVaryingVelocityFieldIntegrationImageFilter; - IntegratorType::Pointer integrator = IntegratorType::New(); + auto integrator = IntegratorType::New(); integrator->SetInput(timeVaryingVelocityField); integrator->SetLowerTimeBound(0.3); integrator->SetUpperTimeBound(0.75); @@ -82,7 +82,7 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) return EXIT_FAILURE; } - IntegratorType::Pointer inverseIntegrator = IntegratorType::New(); + auto inverseIntegrator = IntegratorType::New(); inverseIntegrator->SetInput(timeVaryingVelocityField); inverseIntegrator->SetLowerTimeBound(1.0); inverseIntegrator->SetUpperTimeBound(0.0); @@ -103,7 +103,7 @@ itkTimeVaryingVelocityFieldTransformTest(int, char *[]) // Now test the transform using TransformType = itk::TimeVaryingVelocityFieldTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(transform, TimeVaryingVelocityFieldTransform, VelocityFieldTransform); diff --git a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx index a2914649e23..71b66ca2971 100644 --- a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest.cxx @@ -81,8 +81,8 @@ itkTransformToDisplacementFieldFilterTest(int argc, char * argv[]) origin.Fill(-10.0); // Create transforms. - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); - BSplineTransformType::Pointer bSplineTransform = BSplineTransformType::New(); + auto affineTransform = AffineTransformType::New(); + auto bSplineTransform = BSplineTransformType::New(); if (transformName == "Affine") { // Set the options. @@ -147,7 +147,7 @@ itkTransformToDisplacementFieldFilterTest(int argc, char * argv[]) } // Create an setup displacement field generator. - DisplacementFieldGeneratorType::Pointer defGenerator = DisplacementFieldGeneratorType::New(); + auto defGenerator = DisplacementFieldGeneratorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(defGenerator, TransformToDisplacementFieldFilter, ImageSource); @@ -179,7 +179,7 @@ itkTransformToDisplacementFieldFilterTest(int argc, char * argv[]) std::cout << "Transform: " << defGenerator->GetTransform() << std::endl; // Write displacement field to disk. - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(defGenerator->GetOutput()); writer->SetFileName(fileName.c_str()); diff --git a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx index c0cfdb6b398..0b6188ffc06 100644 --- a/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx +++ b/Modules/Filtering/DisplacementField/test/itkTransformToDisplacementFieldFilterTest1.cxx @@ -100,7 +100,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) RegionType region; region.SetSize(size); region.SetIndex(index); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); image->SetSpacing(spacing); @@ -154,7 +154,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) DirectionType outputDirection = inputDirection; // Create transforms. - TransformType::Pointer eulerTransform = TransformType::New(); + auto eulerTransform = TransformType::New(); { // Set the options. IndexType imageCenter; @@ -176,7 +176,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) // Use ResampleImageFilter to get transformed image. using ResampleImageFilter = itk::ResampleImageFilter; - ResampleImageFilter::Pointer resample = ResampleImageFilter::New(); + auto resample = ResampleImageFilter::New(); resample->SetInput(image); resample->SetTransform(eulerTransform); resample->SetSize(outputRegion.GetSize()); @@ -187,7 +187,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) resample->Update(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer1 = WriterType::New(); + auto writer1 = WriterType::New(); writer1->SetInput(resample->GetOutput()); writer1->SetFileName(resampledImageFileName); @@ -195,7 +195,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) // Create an setup deformation field generator. - DisplacementFieldGeneratorType::Pointer defGenerator = DisplacementFieldGeneratorType::New(); + auto defGenerator = DisplacementFieldGeneratorType::New(); auto useReferenceImage = static_cast(std::stoi(argv[3])); ITK_TEST_SET_GET_BOOLEAN(defGenerator, UseReferenceImage, useReferenceImage); @@ -207,7 +207,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) // Use WarpImageFilter with deformation field. - WarpImageType::Pointer warper = WarpImageType::New(); + auto warper = WarpImageType::New(); warper->SetOutputSize(outputRegion.GetSize()); warper->SetOutputStartIndex(outputRegion.GetIndex()); warper->SetOutputSpacing(outputSpacing); @@ -219,7 +219,7 @@ itkTransformToDisplacementFieldFilterTest1(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(warper->Update()); - WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(warper->GetOutput()); writer2->SetFileName(displacementFieldFileName); diff --git a/Modules/Filtering/DistanceMap/include/itkApproximateSignedDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkApproximateSignedDistanceMapImageFilter.hxx index 89b881ed608..54b5e45445b 100644 --- a/Modules/Filtering/DistanceMap/include/itkApproximateSignedDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkApproximateSignedDistanceMapImageFilter.hxx @@ -64,7 +64,7 @@ ApproximateSignedDistanceMapImageFilter::GenerateData this->AllocateOutputs(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(m_IsoContourFilter, 0.5f); progress->RegisterInternalFilter(m_ChamferFilter, 0.5f); diff --git a/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx index 5893704b593..dc673ddd81b 100644 --- a/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkContourDirectedMeanDistanceImageFilter.hxx @@ -131,7 +131,7 @@ ContourDirectedMeanDistanceImageFilter::BeforeThread // Compute Signed distance from non-zero pixels in the second image using FilterType = SignedMaurerDistanceMapImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(this->GetInput2()); filter->SetSquaredDistance(false); diff --git a/Modules/Filtering/DistanceMap/include/itkContourMeanDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkContourMeanDistanceImageFilter.hxx index c9ce510d08d..c57e88bf69f 100644 --- a/Modules/Filtering/DistanceMap/include/itkContourMeanDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkContourMeanDistanceImageFilter.hxx @@ -105,12 +105,12 @@ ContourMeanDistanceImageFilter::GenerateData() this->GraftOutput(image); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); using Filter12Type = ContourDirectedMeanDistanceImageFilter; - typename Filter12Type::Pointer filter12 = Filter12Type::New(); + auto filter12 = Filter12Type::New(); filter12->SetInput1(this->GetInput1()); filter12->SetInput2(this->GetInput2()); @@ -119,7 +119,7 @@ ContourMeanDistanceImageFilter::GenerateData() using Filter21Type = ContourDirectedMeanDistanceImageFilter; - typename Filter21Type::Pointer filter21 = Filter21Type::New(); + auto filter21 = Filter21Type::New(); filter21->SetInput1(this->GetInput2()); filter21->SetInput2(this->GetInput1()); diff --git a/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx index 0dde543ea04..0990dce1d1e 100644 --- a/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkDirectedHausdorffDistanceImageFilter.hxx @@ -118,7 +118,7 @@ DirectedHausdorffDistanceImageFilter::BeforeThreaded // Compute distance from non-zero pixels in the second image using FilterType = itk::SignedMaurerDistanceMapImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); auto input2 = InputImage2Type::New(); input2->Graft(const_cast(this->GetInput2())); diff --git a/Modules/Filtering/DistanceMap/include/itkHausdorffDistanceImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkHausdorffDistanceImageFilter.hxx index 212b3d0cb36..26d2322b81f 100644 --- a/Modules/Filtering/DistanceMap/include/itkHausdorffDistanceImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkHausdorffDistanceImageFilter.hxx @@ -106,18 +106,18 @@ HausdorffDistanceImageFilter::GenerateData() // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); using Filter12Type = DirectedHausdorffDistanceImageFilter; - typename Filter12Type::Pointer filter12 = Filter12Type::New(); + auto filter12 = Filter12Type::New(); filter12->SetInput1(this->GetInput1()); filter12->SetInput2(this->GetInput2()); filter12->SetNumberOfWorkUnits(numberOfWorkUnits); filter12->SetUseImageSpacing(m_UseImageSpacing); using Filter21Type = DirectedHausdorffDistanceImageFilter; - typename Filter21Type::Pointer filter21 = Filter21Type::New(); + auto filter21 = Filter21Type::New(); filter21->SetInput1(this->GetInput2()); filter21->SetInput2(this->GetInput1()); filter21->SetNumberOfWorkUnits(numberOfWorkUnits); diff --git a/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.hxx index 29f242d410a..d1302f75747 100644 --- a/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkSignedDanielssonDistanceMapImageFilter.hxx @@ -108,12 +108,12 @@ void SignedDanielssonDistanceMapImageFilter::GenerateData() { // Set up mini pipeline filter - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); using FilterType = DanielssonDistanceMapImageFilter; - typename FilterType::Pointer filter1 = FilterType::New(); - typename FilterType::Pointer filter2 = FilterType::New(); + auto filter1 = FilterType::New(); + auto filter2 = FilterType::New(); filter1->SetUseImageSpacing(m_UseImageSpacing); filter2->SetUseImageSpacing(m_UseImageSpacing); @@ -125,7 +125,7 @@ SignedDanielssonDistanceMapImageFilter using FunctorType = Functor::InvertIntensityFunctor; using InverterType = UnaryFunctorImageFilter; - typename InverterType::Pointer inverter = InverterType::New(); + auto inverter = InverterType::New(); inverter->SetInput(this->GetInput()); @@ -136,7 +136,7 @@ SignedDanielssonDistanceMapImageFilter using DilatorType = BinaryDilateImageFilter; - typename DilatorType::Pointer dilator = DilatorType::New(); + auto dilator = DilatorType::New(); StructuringElementType structuringElement; structuringElement.SetRadius(1); // 3x3 structuring element @@ -151,7 +151,7 @@ SignedDanielssonDistanceMapImageFilter // Subtract Distance maps results of the two Danielsson filters using SubtracterType = SubtractImageFilter; - typename SubtracterType::Pointer subtracter = SubtracterType::New(); + auto subtracter = SubtracterType::New(); if (m_InsideIsPositive) { diff --git a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx index 8e2096496de..942b2a9a37d 100644 --- a/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx +++ b/Modules/Filtering/DistanceMap/include/itkSignedMaurerDistanceMapImageFilter.hxx @@ -117,13 +117,13 @@ SignedMaurerDistanceMapImageFilter::GenerateData() // memory. using BinaryFilterType = BinaryThresholdImageFilter; - ProgressAccumulator::Pointer progressAcc = ProgressAccumulator::New(); + auto progressAcc = ProgressAccumulator::New(); progressAcc->SetMiniPipelineFilter(this); // compute the boundary of the binary object. // To do that, we erode the binary object. The eroded pixels are the ones // on the boundary. We mark them with the value 2 - typename BinaryFilterType::Pointer binaryFilter = BinaryFilterType::New(); + auto binaryFilter = BinaryFilterType::New(); binaryFilter->SetLowerThreshold(this->m_BackgroundValue); binaryFilter->SetUpperThreshold(this->m_BackgroundValue); @@ -138,7 +138,7 @@ SignedMaurerDistanceMapImageFilter::GenerateData() // Dilate the inverted image by 1 pixel to give it the same boundary // as the univerted inputPtr. using BorderFilterType = BinaryContourImageFilter; - typename BorderFilterType::Pointer borderFilter = BorderFilterType::New(); + auto borderFilter = BorderFilterType::New(); borderFilter->SetInput(binaryFilter->GetOutput()); borderFilter->SetForegroundValue(NumericTraits::ZeroValue()); borderFilter->SetBackgroundValue(NumericTraits::max()); diff --git a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx index d6052966342..8c3af0a9278 100644 --- a/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkApproximateSignedDistanceMapImageFilterTest.cxx @@ -74,7 +74,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) const InputPixelType insideValue = std::stoi(argv[1]); constexpr InputPixelType outsideValue = 0; - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::SizeType size; size.Fill(64); InputImageType::RegionType region(size); @@ -96,7 +96,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) // Set up the filter using DistanceMapFilterType = itk::ApproximateSignedDistanceMapImageFilter; - DistanceMapFilterType::Pointer signedDistanceMapFilter = DistanceMapFilterType::New(); + auto signedDistanceMapFilter = DistanceMapFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( signedDistanceMapFilter, ApproximateSignedDistanceMapImageFilter, ImageToImageFilter); @@ -114,7 +114,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) // Write the output image using RescaleFilterType = itk::ShiftScaleImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(signedDistanceMapFilter->GetOutput()); rescaler->SetScale(1000); @@ -132,7 +132,7 @@ itkApproximateSignedDistanceMapImageFilterTest(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescaler->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx index 191ca94905e..339da6f74d1 100644 --- a/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkContourDirectedMeanDistanceImageFilterTest.cxx @@ -32,8 +32,8 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) using Image1Type = itk::Image; using Image2Type = itk::Image; - Image1Type::Pointer image1 = Image1Type::New(); - Image2Type::Pointer image2 = Image2Type::New(); + auto image1 = Image1Type::New(); + auto image2 = Image2Type::New(); Image1Type::SizeType size; size.Fill(50); @@ -84,7 +84,7 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) // Compute the directed Mean distance h(image1,image2) { using FilterType = itk::ContourDirectedMeanDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ContourDirectedMeanDistanceImageFilter, ImageToImageFilter); @@ -115,7 +115,7 @@ itkContourDirectedMeanDistanceImageFilterTest(int, char *[]) // Compute the directed Mean distance h(image2,image1) { using FilterType = itk::ContourDirectedMeanDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ContourDirectedMeanDistanceImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx index fd636858b46..294aa98bd21 100644 --- a/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkContourMeanDistanceImageFilterTest.cxx @@ -33,8 +33,8 @@ itkContourMeanDistanceImageFilterTest(int, char *[]) using Image1Type = itk::Image; using Image2Type = itk::Image; - Image1Type::Pointer image1 = Image1Type::New(); - Image2Type::Pointer image2 = Image2Type::New(); + auto image1 = Image1Type::New(); + auto image2 = Image2Type::New(); Image1Type::SizeType size; size.Fill(50); @@ -84,7 +84,7 @@ itkContourMeanDistanceImageFilterTest(int, char *[]) // compute the directed Mean distance h(image1,image2) { using FilterType = itk::ContourMeanDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); filter->SetInput1(image1); @@ -112,7 +112,7 @@ itkContourMeanDistanceImageFilterTest(int, char *[]) // compute the directed Mean distance h(image2,image1) { using FilterType = itk::ContourMeanDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput1(image2); filter->SetInput2(image1); @@ -136,7 +136,7 @@ itkContourMeanDistanceImageFilterTest(int, char *[]) // compute the directed Mean distance h(image2,image1) with different pixel sizes { using FilterType = itk::ContourMeanDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); Image1Type::SpacingType spacing1 = image1->GetSpacing(); spacing1[0] = spacing1[0] / 2; spacing1[1] = spacing1[1] / 2; diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx index 73ed920b6e8..f1639c763e4 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest.cxx @@ -44,7 +44,7 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) region2D.SetSize(size2D); region2D.SetIndex(index2D); - myImageType2D1::Pointer inputImage2D = myImageType2D1::New(); + auto inputImage2D = myImageType2D1::New(); inputImage2D->SetLargestPossibleRegion(region2D); inputImage2D->SetBufferedRegion(region2D); inputImage2D->SetRequestedRegion(region2D); @@ -65,7 +65,7 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) // Create Danielsson Distance Map filter using myFilterType2D = itk::DanielssonDistanceMapImageFilter; - myFilterType2D::Pointer filter2D = myFilterType2D::New(); + auto filter2D = myFilterType2D::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter2D, DanielssonDistanceMapImageFilter, ImageToImageFilter); @@ -195,7 +195,7 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) ImageType3D::RegionType region3D; region3D.SetSize(size3D); region3D.SetIndex(index3D); - ImageType3D::Pointer inputImage3D = ImageType3D::New(); + auto inputImage3D = ImageType3D::New(); inputImage3D->SetRegions(region3D); inputImage3D->Allocate(); inputImage3D->FillBuffer(1); @@ -222,7 +222,7 @@ itkDanielssonDistanceMapImageFilterTest(int, char *[]) // Create Danielsson Distance Map filter using myFilterType3D = itk::DanielssonDistanceMapImageFilter; - myFilterType3D::Pointer filter3D = myFilterType3D::New(); + auto filter3D = myFilterType3D::New(); filter3D->SetInput(inputImage3D); diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx index 2d33562a176..019722214ef 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest1.cxx @@ -42,13 +42,13 @@ itkDanielssonDistanceMapImageFilterTest1(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::DanielssonDistanceMapImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); auto squaredDistance = static_cast(std::stoi(argv[3])); ITK_TEST_SET_GET_BOOLEAN(filter, SquaredDistance, squaredDistance); @@ -67,7 +67,7 @@ itkDanielssonDistanceMapImageFilterTest1(int argc, char * argv[]) filter->Print(std::cout); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx index e283a4114f5..e15c8ac1a27 100644 --- a/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDanielssonDistanceMapImageFilterTest2.cxx @@ -44,18 +44,18 @@ itkDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using ConnectedType = itk::ConnectedComponentImageFilter; - ConnectedType::Pointer connectedComponents = ConnectedType::New(); + auto connectedComponents = ConnectedType::New(); connectedComponents->SetInput(reader->GetOutput()); using FilterType = itk::DanielssonDistanceMapImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(connectedComponents->GetOutput()); ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); @@ -66,12 +66,12 @@ itkDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) // Extract the Voronoi map from the distance map filter, rescale it, // and write it out. using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetVoronoiMap()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescaler->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx index 4ee007f0e99..2bd4f0c5e30 100644 --- a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest1.cxx @@ -32,8 +32,8 @@ itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) using Image1Type = itk::Image; using Image2Type = itk::Image; - Image1Type::Pointer image1 = Image1Type::New(); - Image2Type::Pointer image2 = Image2Type::New(); + auto image1 = Image1Type::New(); + auto image2 = Image2Type::New(); Image1Type::SizeType size; size.Fill(50); @@ -85,7 +85,7 @@ itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) // Compute the directed Hausdorff distance h(image1,image2) { using FilterType = itk::DirectedHausdorffDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); filter->SetInput1(image1); @@ -114,7 +114,7 @@ itkDirectedHausdorffDistanceImageFilterTest1(int, char *[]) // Compute the directed Hausdorff distance h(image2,image1) { using FilterType = itk::DirectedHausdorffDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DirectedHausdorffDistanceImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx index 20038191a8a..8cd4ae4553e 100644 --- a/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkDirectedHausdorffDistanceImageFilterTest2.cxx @@ -42,8 +42,8 @@ itkDirectedHausdorffDistanceImageFilterTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader1 = ReaderType::New(); - typename ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader1->Update()); @@ -54,7 +54,7 @@ itkDirectedHausdorffDistanceImageFilterTest2(int argc, char * argv[]) using FilterType = itk::DirectedHausdorffDistanceImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DirectedHausdorffDistanceImageFilter, ImageToImageFilter); @@ -80,7 +80,7 @@ itkDirectedHausdorffDistanceImageFilterTest2(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx index fd760bccab7..f4a170654da 100644 --- a/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkFastChamferDistanceImageFilterTest.cxx @@ -75,7 +75,7 @@ FastChamferDistanceImageFilterTest(unsigned int iPositive, unsigned int iNegativ region.SetSize(size); region.SetIndex(index); - typename ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->SetRequestedRegion(region); @@ -95,7 +95,7 @@ FastChamferDistanceImageFilterTest(unsigned int iPositive, unsigned int iNegativ /* Create Fast Chamfer Distance filter */ using ChamferFilterType = itk::FastChamferDistanceImageFilter; - typename ChamferFilterType::Pointer filter = ChamferFilterType::New(); + auto filter = ChamferFilterType::New(); filter->SetInput(inputImage); @@ -117,7 +117,7 @@ FastChamferDistanceImageFilterTest(unsigned int iPositive, unsigned int iNegativ // Create NarrowBand using NarrowBandType = typename ChamferFilterType::NarrowBandType; - typename NarrowBandType::Pointer band = NarrowBandType::New(); + auto band = NarrowBandType::New(); band->SetTotalRadius(4); band->SetInnerRadius(2); filter->SetMaximumDistance(5); @@ -200,7 +200,7 @@ FastChamferDistanceImageFilterTest(unsigned int iPositive, unsigned int iNegativ } /* For debugging write the result using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName("chamferoutput.mhd"); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx index a92c37e453a..ec8e6c1b42a 100644 --- a/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkHausdorffDistanceImageFilterTest.cxx @@ -32,8 +32,8 @@ itkHausdorffDistanceImageFilterTest(int, char *[]) using Image1Type = itk::Image; using Image2Type = itk::Image; - Image1Type::Pointer image1 = Image1Type::New(); - Image2Type::Pointer image2 = Image2Type::New(); + auto image1 = Image1Type::New(); + auto image2 = Image2Type::New(); Image1Type::SizeType size; size.Fill(50); @@ -85,7 +85,7 @@ itkHausdorffDistanceImageFilterTest(int, char *[]) // Compute the Hausdorff distance H(image1,image2) { using FilterType = itk::HausdorffDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, HausdorffDistanceImageFilter, ImageToImageFilter); @@ -117,7 +117,7 @@ itkHausdorffDistanceImageFilterTest(int, char *[]) // Compute the Hausdorff distance H(image2,image1) { using FilterType = itk::HausdorffDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput1(image2); filter->SetInput2(image1); @@ -157,7 +157,7 @@ itkHausdorffDistanceImageFilterTest(int, char *[]) image2->SetSpacing(spacing2); using FilterType = itk::HausdorffDistanceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput1(image2); filter->SetInput2(image1); diff --git a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx index 99865153ed5..827033bf513 100644 --- a/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkIsoContourDistanceImageFilterTest.cxx @@ -73,7 +73,7 @@ itkIsoContourDistanceImageFilterTest(int, char *[]) using PointType = itk::Point; // Fill an input image with simple signed distance function - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(128); ImageType::RegionType region(size); @@ -95,14 +95,14 @@ itkIsoContourDistanceImageFilterTest(int, char *[]) // Squash up the level sets by mulitplying with a scalar using MultiplierType = itk::ShiftScaleImageFilter; - MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(image); multiplier->SetScale(0.5); // multiplier->SetShift( 0.0 ); // Set up image filter using IsoContourType = itk::IsoContourDistanceImageFilter; - IsoContourType::Pointer isocontour = IsoContourType::New(); + auto isocontour = IsoContourType::New(); isocontour->SetInput(multiplier->GetOutput()); isocontour->SetFarValue(10); // isocontour->SetNumberOfWorkUnits(8); @@ -121,7 +121,7 @@ itkIsoContourDistanceImageFilterTest(int, char *[]) // For debugging using CastFilterType = itk::RescaleIntensityImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(isocontour->GetOutput()); try @@ -138,7 +138,7 @@ itkIsoContourDistanceImageFilterTest(int, char *[]) using BandNodeType = IsoContourType::BandNodeType; using NarrowBandType = IsoContourType::NarrowBandType; - NarrowBandType::Pointer band = NarrowBandType::New(); + auto band = NarrowBandType::New(); // Create nodes BandNodeType node; @@ -170,13 +170,13 @@ itkIsoContourDistanceImageFilterTest(int, char *[]) // Check if inside/outside points remain the same after reinitialization using CheckerType = itk::MultiplyImageFilter; - CheckerType::Pointer checker = CheckerType::New(); + auto checker = CheckerType::New(); checker->SetInput1(image); checker->SetInput2(isocontour->GetOutput()); checker->Update(); using CalculatorType = itk::MinimumMaximumImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(checker->GetOutput()); calculator->Compute(); double minValue = calculator->GetMinimum(); diff --git a/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx b/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx index b4e343a5dcb..781e1972768 100644 --- a/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkReflectiveImageRegionIteratorTest.cxx @@ -33,7 +33,7 @@ itkReflectiveImageRegionIteratorTest(int, char *[]) using IteratorType = itk::ImageRegionIteratorWithIndex; using IteratorVisitsType = itk::ImageRegionIteratorWithIndex; - ImageType::Pointer myImage = ImageType::New(); + auto myImage = ImageType::New(); ImageType::SizeType size = { { 4, 4, 4, 4 } }; @@ -49,7 +49,7 @@ itkReflectiveImageRegionIteratorTest(int, char *[]) myImage->SetRequestedRegion(region); myImage->Allocate(); - ImageVisitsType::Pointer visitImage = ImageVisitsType::New(); + auto visitImage = ImageVisitsType::New(); visitImage->SetLargestPossibleRegion(region); visitImage->SetRequestedRegion(region); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx index d5fabc8fb95..cc24c8a8ea9 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest.cxx @@ -62,7 +62,7 @@ test(int testIdx) region2D.SetSize(size2D); region2D.SetIndex(index2D); - myImageType2D1::Pointer inputImage2D = myImageType2D1::New(); + auto inputImage2D = myImageType2D1::New(); inputImage2D->SetLargestPossibleRegion(region2D); inputImage2D->SetBufferedRegion(region2D); inputImage2D->SetRequestedRegion(region2D); @@ -108,7 +108,7 @@ test(int testIdx) /* Create Danielsson Distance Map filter */ using myFilterType2D = itk::SignedDanielssonDistanceMapImageFilter; - myFilterType2D::Pointer filter2D = myFilterType2D::New(); + auto filter2D = myFilterType2D::New(); filter2D->SetInput(inputImage2D); myImageType2D2::Pointer outputDistance2D = filter2D->GetOutput(); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest1.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest1.cxx index d7bc97bf329..88309849bb4 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest1.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest1.cxx @@ -34,13 +34,13 @@ itkSignedDanielssonDistanceMapImageFilterTest1(char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using FilterType = itk::SignedDanielssonDistanceMapImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetSquaredDistance(false); filter->SetUseImageSpacing(true); @@ -48,7 +48,7 @@ itkSignedDanielssonDistanceMapImageFilterTest1(char * argv[]) filter->Update(); filter->Print(std::cout); - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx index 8dc632392eb..0d924bb4acb 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest11.cxx @@ -41,7 +41,7 @@ itkSignedDanielssonDistanceMapImageFilterTest11(int, char *[]) region2D.SetSize(size2D); region2D.SetIndex(index2D); - myImageType2D1::Pointer inputImage2D = myImageType2D1::New(); + auto inputImage2D = myImageType2D1::New(); inputImage2D->SetLargestPossibleRegion(region2D); inputImage2D->SetBufferedRegion(region2D); inputImage2D->SetRequestedRegion(region2D); @@ -59,7 +59,7 @@ itkSignedDanielssonDistanceMapImageFilterTest11(int, char *[]) /* Create SignedDanielssonDistance Map filter */ using myFilterType2D = itk::SignedDanielssonDistanceMapImageFilter; - myFilterType2D::Pointer filter2D = myFilterType2D::New(); + auto filter2D = myFilterType2D::New(); filter2D->SetInput(inputImage2D); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx index e595f7b5853..d9c6db4f411 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedDanielssonDistanceMapImageFilterTest2.cxx @@ -44,16 +44,16 @@ itkSignedDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using ConnectedType = itk::ConnectedComponentImageFilter; - ConnectedType::Pointer connectedComponents = ConnectedType::New(); + auto connectedComponents = ConnectedType::New(); connectedComponents->SetInput(reader->GetOutput()); using FilterType = itk::SignedDanielssonDistanceMapImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(connectedComponents->GetOutput()); filter->Update(); filter->Print(std::cout); @@ -61,12 +61,12 @@ itkSignedDanielssonDistanceMapImageFilterTest2(int argc, char * argv[]) // Extract the Voronoi map from the distance map filter, rescale it, // and write it out. using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetVoronoiMap()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescaler->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest.cxx b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest.cxx index c22b3dba88e..c4996e42b68 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest.cxx @@ -34,13 +34,13 @@ itkSignedMaurerDistanceMapImageFilterTest(char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using FilterType = itk::SignedMaurerDistanceMapImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetSquaredDistance(false); filter->SetUseImageSpacing(true); @@ -48,7 +48,7 @@ itkSignedMaurerDistanceMapImageFilterTest(char * argv[]) filter->Update(); filter->Print(std::cout); - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx index 21b01bbc5a8..0b1e16239fe 100644 --- a/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx +++ b/Modules/Filtering/DistanceMap/test/itkSignedMaurerDistanceMapImageFilterTest11.cxx @@ -41,7 +41,7 @@ itkSignedMaurerDistanceMapImageFilterTest11(int, char *[]) region2D.SetSize(size2D); region2D.SetIndex(index2D); - myImageType2D1::Pointer inputImage2D = myImageType2D1::New(); + auto inputImage2D = myImageType2D1::New(); inputImage2D->SetLargestPossibleRegion(region2D); inputImage2D->SetBufferedRegion(region2D); inputImage2D->SetRequestedRegion(region2D); @@ -59,7 +59,7 @@ itkSignedMaurerDistanceMapImageFilterTest11(int, char *[]) /* Create SignedMaurerDistance Map filter */ using myFilterType2D = itk::SignedMaurerDistanceMapImageFilter; - myFilterType2D::Pointer filter2D = myFilterType2D::New(); + auto filter2D = myFilterType2D::New(); filter2D->SetInput(inputImage2D); diff --git a/Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.hxx b/Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.hxx index fc25e22d898..2c6d6a99f30 100644 --- a/Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkFFTWForwardFFTImageFilter.hxx @@ -85,7 +85,7 @@ FFTWForwardFFTImageFilter::GenerateData() typename OutputImageType::RegionType fftwOutputRegion(outputPtr->GetLargestPossibleRegion()); fftwOutputRegion.SetSize(fftwOutputSize); - typename OutputImageType::Pointer fftwOutput = OutputImageType::New(); + auto fftwOutput = OutputImageType::New(); // The information is copied to the half image so that it will then // be copied to the final output of this filter. fftwOutput->CopyInformation(inputPtr); @@ -119,7 +119,7 @@ FFTWForwardFFTImageFilter::GenerateData() // Expand the half image to the full image size using HalfToFullFilterType = HalfToFullHermitianImageFilter; - typename HalfToFullFilterType::Pointer halfToFullFilter = HalfToFullFilterType::New(); + auto halfToFullFilter = HalfToFullFilterType::New(); halfToFullFilter->SetActualXDimensionIsOdd(inputSize[0] % 2 != 0); halfToFullFilter->SetInput(fftwOutput); halfToFullFilter->GraftOutput(this->GetOutput()); diff --git a/Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.hxx b/Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.hxx index 89d442f7921..a4ec5c487ec 100644 --- a/Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.hxx +++ b/Modules/Filtering/FFT/include/itkFFTWInverseFFTImageFilter.hxx @@ -76,7 +76,7 @@ FFTWInverseFFTImageFilter::BeforeThreadedGenerateData // Cut the full complex image to just the portion needed by FFTW. using FullToHalfFilterType = FullToHalfHermitianImageFilter; - typename FullToHalfFilterType::Pointer fullToHalfFilter = FullToHalfFilterType::New(); + auto fullToHalfFilter = FullToHalfFilterType::New(); fullToHalfFilter->SetInput(this->GetInput()); fullToHalfFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); fullToHalfFilter->UpdateLargestPossibleRegion(); diff --git a/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx index 100594f9b7a..b284b162012 100644 --- a/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkComplexToComplex1DFFTImageFilterTest.cxx @@ -44,12 +44,12 @@ doTest(const char * inputRealFullImage, const char * inputImaginaryFullImage, co using ToRealFilterType = itk::ComplexToRealImageFilter; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer readerReal = ReaderType::New(); - typename ReaderType::Pointer readerImag = ReaderType::New(); - typename FFTType::Pointer fft = FFTType::New(); - typename JoinFilterType::Pointer joinFilter = JoinFilterType::New(); - typename ToRealFilterType::Pointer toReal = ToRealFilterType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto readerReal = ReaderType::New(); + auto readerImag = ReaderType::New(); + auto fft = FFTType::New(); + auto joinFilter = JoinFilterType::New(); + auto toReal = ToRealFilterType::New(); + auto writer = WriterType::New(); readerReal->SetFileName(inputRealFullImage); readerImag->SetFileName(inputImaginaryFullImage); diff --git a/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx index 60cbcda85d2..b48913bb30b 100644 --- a/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkComplexToComplexFFTImageFilterTest.cxx @@ -51,30 +51,30 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName using ComplexImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImageFileName); using ForwardFilterType = itk::ForwardFFTImageFilter; - typename ForwardFilterType::Pointer forwardFilter = ForwardFilterType::New(); + auto forwardFilter = ForwardFilterType::New(); forwardFilter->SetInput(reader->GetOutput()); using ComplexFilterType = itk::ComplexToComplexFFTImageFilter; - typename ComplexFilterType::Pointer inverseComplexFilter = ComplexFilterType::New(); + auto inverseComplexFilter = ComplexFilterType::New(); inverseComplexFilter->SetInput(forwardFilter->GetOutput()); inverseComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::INVERSE); - typename ComplexFilterType::Pointer forwardComplexFilter = ComplexFilterType::New(); + auto forwardComplexFilter = ComplexFilterType::New(); forwardComplexFilter->SetInput(inverseComplexFilter->GetOutput()); forwardComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::FORWARD); // This tests the CanUseDestructiveAlgorithm state with the FFTW version. forwardComplexFilter->ReleaseDataFlagOn(); using InverseFilterType = itk::InverseFFTImageFilter; - typename InverseFilterType::Pointer inverseFilter = InverseFilterType::New(); + auto inverseFilter = InverseFilterType::New(); inverseFilter->SetInput(forwardComplexFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputImageFileName); writer->SetInput(inverseFilter->GetOutput()); diff --git a/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx index 2184113dccd..39864b0eb2c 100644 --- a/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFT1DImageFilterTest.cxx @@ -42,19 +42,19 @@ doTest(const char * inputImage, const char * outputImage) using ImageType = typename FFTForwardType::InputImageType; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImage); - typename FFTForwardType::Pointer fftForward = FFTForwardType::New(); + auto fftForward = FFTForwardType::New(); fftForward->SetInput(reader->GetOutput()); fftForward->SetDirection(direction); - typename FFTInverseType::Pointer fftInverse = FFTInverseType::New(); + auto fftInverse = FFTInverseType::New(); fftInverse->SetInput(fftForward->GetOutput()); fftInverse->SetDirection(direction); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(fftInverse->GetOutput()); writer->SetFileName(outputImage); diff --git a/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx index cf4a7b455fa..6a51b697445 100644 --- a/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTPadImageFilterTest.cxx @@ -52,7 +52,7 @@ itkFFTPadImageFilterTest(int argc, char * argv[]) using FFTPadType = itk::FFTPadImageFilter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); itk::ZeroFluxNeumannBoundaryCondition zfnCond; @@ -60,7 +60,7 @@ itkFFTPadImageFilterTest(int argc, char * argv[]) itk::PeriodicBoundaryCondition wrapCond; // Create the filters - FFTPadType::Pointer fftpad = FFTPadType::New(); + auto fftpad = FFTPadType::New(); fftpad->SetInput(reader->GetOutput()); fftpad->SetSizeGreatestPrimeFactor(std::stoi(argv[3])); std::string padMethod = argv[4]; @@ -82,7 +82,7 @@ itkFFTPadImageFilterTest(int argc, char * argv[]) } itk::SimpleFilterWatcher watchFFTPad(fftpad, "fftpad"); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(fftpad->GetOutput()); writer->SetFileName(argv[2]); @@ -92,7 +92,7 @@ itkFFTPadImageFilterTest(int argc, char * argv[]) // Ensure we can build with a different output image type. using OutputImageType = itk::Image; using FFTPadWithOutputType = itk::FFTPadImageFilter; - FFTPadWithOutputType::Pointer fftPadWithOutput = FFTPadWithOutputType::New(); + auto fftPadWithOutput = FFTPadWithOutputType::New(); (void)fftPadWithOutput; return EXIT_SUCCESS; diff --git a/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx index 761f88127aa..f59ea4420e8 100644 --- a/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTShiftImageFilterTest.cxx @@ -43,11 +43,11 @@ itkFFTShiftImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::FFTShiftImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // test default values ITK_TEST_EXPECT_TRUE(!filter->GetInverse()); @@ -67,7 +67,7 @@ itkFFTShiftImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/FFT/test/itkFFTTest.h b/Modules/Filtering/FFT/test/itkFFTTest.h index 73c59aa4f87..28266b5220e 100644 --- a/Modules/Filtering/FFT/test/itkFFTTest.h +++ b/Modules/Filtering/FFT/test/itkFFTTest.h @@ -63,7 +63,7 @@ test_fft(unsigned int * SizeOfDimensions) region.SetSize(imageSize); region.SetIndex(imageIndex); - typename RealImageType::Pointer realImage = RealImageType::New(); + auto realImage = RealImageType::New(); // Create the Real Image. realImage->SetLargestPossibleRegion(region); realImage->SetBufferedRegion(region); @@ -120,9 +120,9 @@ test_fft(unsigned int * SizeOfDimensions) } // Real to complex pointer. This computes the forward FFT. - typename R2CType::Pointer R2C = R2CType::New(); + auto R2C = R2CType::New(); // Complex to Real pointer. This computes the Inverse FFT. - typename C2RType::Pointer C2R = C2RType::New(); + auto C2R = C2RType::New(); // Set the real image created as the input to the forward FFT // filter. @@ -299,7 +299,7 @@ test_fft_rtc(unsigned int * SizeOfDimensions) typename RealImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - typename RealImageType::Pointer realImage = RealImageType::New(); + auto realImage = RealImageType::New(); // Create the Real Image. realImage->SetLargestPossibleRegion(region); @@ -341,10 +341,10 @@ test_fft_rtc(unsigned int * SizeOfDimensions) } // Real to complex pointers. This computes the forward FFT. - typename R2CAType::Pointer R2Ca = R2CAType::New(); + auto R2Ca = R2CAType::New(); // Real to complex pointers. This computes the forward FFT. - typename R2CBType::Pointer R2Cb = R2CBType::New(); + auto R2Cb = R2CBType::New(); // Set the real image created as the input to the forward FFT // filter. diff --git a/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx index 20832e00a6d..20a3bd1d501 100644 --- a/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFFTWComplexToComplexFFTImageFilterTest.cxx @@ -50,30 +50,30 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName using ComplexImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImageFileName); using ForwardFilterType = itk::ForwardFFTImageFilter; - typename ForwardFilterType::Pointer forwardFilter = ForwardFilterType::New(); + auto forwardFilter = ForwardFilterType::New(); forwardFilter->SetInput(reader->GetOutput()); using ComplexFilterType = itk::FFTWComplexToComplexFFTImageFilter; - typename ComplexFilterType::Pointer inverseComplexFilter = ComplexFilterType::New(); + auto inverseComplexFilter = ComplexFilterType::New(); inverseComplexFilter->SetInput(forwardFilter->GetOutput()); inverseComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::INVERSE); - typename ComplexFilterType::Pointer forwardComplexFilter = ComplexFilterType::New(); + auto forwardComplexFilter = ComplexFilterType::New(); forwardComplexFilter->SetInput(inverseComplexFilter->GetOutput()); forwardComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::FORWARD); // This tests the CanUseDestructiveAlgorithm state with the FFTW version. forwardComplexFilter->ReleaseDataFlagOn(); using InverseFilterType = itk::InverseFFTImageFilter; - typename InverseFilterType::Pointer inverseFilter = InverseFilterType::New(); + auto inverseFilter = InverseFilterType::New(); inverseFilter->SetInput(forwardComplexFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputImageFileName); writer->SetInput(inverseFilter->GetOutput()); diff --git a/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx index 2da90f12afc..c3175355897 100644 --- a/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkForward1DFFTImageFilterTest.cxx @@ -43,11 +43,11 @@ doTest(const char * inputImage, const char * outputImagePrefix) using ImaginaryFilterType = itk::ComplexToImaginaryImageFilter; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename FFTType::Pointer fft = FFTType::New(); - typename RealFilterType::Pointer realFilter = RealFilterType::New(); - typename ImaginaryFilterType::Pointer imaginaryFilter = ImaginaryFilterType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto fft = FFTType::New(); + auto realFilter = RealFilterType::New(); + auto imaginaryFilter = ImaginaryFilterType::New(); + auto writer = WriterType::New(); reader->SetFileName(inputImage); fft->SetInput(reader->GetOutput()); @@ -101,7 +101,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[]) using FFTForwardType = itk::Forward1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTForwardType::Pointer fft = FFTForwardType::New(); + auto fft = FFTForwardType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, Forward1DFFTImageFilter, ImageToImageFilter); itk::SizeValueType sizeGreatestPrimeFactor = 2; @@ -114,7 +114,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[]) using FFTForwardType = itk::VnlForward1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTForwardType::Pointer fft = FFTForwardType::New(); + auto fft = FFTForwardType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, VnlForward1DFFTImageFilter, Forward1DFFTImageFilter); @@ -126,7 +126,7 @@ itkForward1DFFTImageFilterTest(int argc, char * argv[]) using FFTForwardType = itk::FFTWForward1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTForwardType::Pointer fft = FFTForwardType::New(); + auto fft = FFTForwardType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, FFTWForward1DFFTImageFilter, Forward1DFFTImageFilter); diff --git a/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h b/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h index 9848136590e..0f33f241682 100644 --- a/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h +++ b/Modules/Filtering/FFT/test/itkForwardInverseFFTTest.h @@ -28,17 +28,17 @@ ForwardInverseFullFFTTest(const char * inputFileName) double tolerance = 1.e-3; using ImageType = typename TForwardFFT::InputImageType; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); - typename TForwardFFT::Pointer fft = TForwardFFT::New(); + auto fft = TForwardFFT::New(); fft->SetInput(reader->GetOutput()); - typename TInverseFFT::Pointer ifft = TInverseFFT::New(); + auto ifft = TInverseFFT::New(); ifft->SetInput(fft->GetOutput()); using AbsDiffFilterType = itk::AbsoluteValueDifferenceImageFilter; - typename AbsDiffFilterType::Pointer diffFilter = AbsDiffFilterType::New(); + auto diffFilter = AbsDiffFilterType::New(); diffFilter->SetInput1(reader->GetOutput()); diffFilter->SetInput2(ifft->GetOutput()); diffFilter->UpdateLargestPossibleRegion(); @@ -69,20 +69,20 @@ ForwardInverseHalfFFTTest(const char * inputFileName) double tolerance = 1.e-3; using ImageType = typename TForwardFFT::InputImageType; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); reader->UpdateLargestPossibleRegion(); - typename TForwardFFT::Pointer fft = TForwardFFT::New(); + auto fft = TForwardFFT::New(); fft->SetInput(reader->GetOutput()); - typename TInverseFFT::Pointer ifft = TInverseFFT::New(); - bool xIsOdd = reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0] % 2 == 1; + auto ifft = TInverseFFT::New(); + bool xIsOdd = reader->GetOutput()->GetLargestPossibleRegion().GetSize()[0] % 2 == 1; ifft->SetActualXDimensionIsOdd(xIsOdd); ifft->SetInput(fft->GetOutput()); using AbsDiffFilterType = itk::AbsoluteValueDifferenceImageFilter; - typename AbsDiffFilterType::Pointer diffFilter = AbsDiffFilterType::New(); + auto diffFilter = AbsDiffFilterType::New(); diffFilter->SetInput1(reader->GetOutput()); diffFilter->SetInput2(ifft->GetOutput()); diffFilter->UpdateLargestPossibleRegion(); diff --git a/Modules/Filtering/FFT/test/itkFullToHalfHermitianImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkFullToHalfHermitianImageFilterTest.cxx index 86da073e4a2..0219a0f23f1 100644 --- a/Modules/Filtering/FFT/test/itkFullToHalfHermitianImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkFullToHalfHermitianImageFilterTest.cxx @@ -41,7 +41,7 @@ itkFullToHalfHermitianImageFilterTest(int argc, char * argv[]) using ComplexImageType = itk::Image, 2>; using RandomSourceType = itk::RandomImageSource; - RandomSourceType::Pointer source = RandomSourceType::New(); + auto source = RandomSourceType::New(); RandomSourceType::SizeType size; size[0] = std::stoi(argv[1]); size[1] = std::stoi(argv[2]); @@ -53,7 +53,7 @@ itkFullToHalfHermitianImageFilterTest(int argc, char * argv[]) // Change the index of the image's largest possible region to test // generality of the filters. using ChangeFilterType = itk::ChangeInformationImageFilter; - ChangeFilterType::Pointer changer = ChangeFilterType::New(); + auto changer = ChangeFilterType::New(); changer->ChangeRegionOn(); ChangeFilterType::OutputImageOffsetValueType indexShift[2]; indexShift[0] = -3; @@ -64,17 +64,17 @@ itkFullToHalfHermitianImageFilterTest(int argc, char * argv[]) // Compute frequency image, yielding the non-redundant half of the // full complex image. using FFTFilterType = itk::RealToHalfHermitianForwardFFTImageFilter; - FFTFilterType::Pointer fft = FFTFilterType::New(); + auto fft = FFTFilterType::New(); fft->SetInput(changer->GetOutput()); // Expand the non-redundant half to the full complex image. using HalfToFullFilterType = itk::HalfToFullHermitianImageFilter; - HalfToFullFilterType::Pointer halfToFullFilter = HalfToFullFilterType::New(); + auto halfToFullFilter = HalfToFullFilterType::New(); halfToFullFilter->SetActualXDimensionIsOddInput(fft->GetActualXDimensionIsOddOutput()); halfToFullFilter->SetInput(fft->GetOutput()); using FullToHalfFilterType = itk::FullToHalfHermitianImageFilter; - FullToHalfFilterType::Pointer fullToHalfFilter = FullToHalfFilterType::New(); + auto fullToHalfFilter = FullToHalfFilterType::New(); fullToHalfFilter->SetInput(halfToFullFilter->GetOutput()); fullToHalfFilter->Update(); fullToHalfFilter->Print(std::cout); diff --git a/Modules/Filtering/FFT/test/itkHalfToFullHermitianImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkHalfToFullHermitianImageFilterTest.cxx index 1300c91011f..42b37bf78a8 100644 --- a/Modules/Filtering/FFT/test/itkHalfToFullHermitianImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkHalfToFullHermitianImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHalfToFullHermitianImageFilterTest(int argc, char * argv[]) using ComplexImageType = itk::Image, 2>; using RandomSourceType = itk::RandomImageSource; - RandomSourceType::Pointer source = RandomSourceType::New(); + auto source = RandomSourceType::New(); RandomSourceType::SizeType size; size[0] = std::stoi(argv[1]); size[1] = std::stoi(argv[2]); @@ -52,7 +52,7 @@ itkHalfToFullHermitianImageFilterTest(int argc, char * argv[]) // Change the index of the image's largest possible region to test // generality of the filters. using ChangeFilterType = itk::ChangeInformationImageFilter; - ChangeFilterType::Pointer changer = ChangeFilterType::New(); + auto changer = ChangeFilterType::New(); changer->ChangeRegionOn(); ChangeFilterType::OutputImageOffsetValueType indexShift[2]; indexShift[0] = -3; @@ -63,12 +63,12 @@ itkHalfToFullHermitianImageFilterTest(int argc, char * argv[]) // Compute frequency image, yielding the non-redundant half of the // full complex image. using FFTFilter = itk::RealToHalfHermitianForwardFFTImageFilter; - FFTFilter::Pointer fft = FFTFilter::New(); + auto fft = FFTFilter::New(); fft->SetInput(changer->GetOutput()); // Expand the non-redundant half to the full complex image. using HalfToFullFilterType = itk::HalfToFullHermitianImageFilter; - HalfToFullFilterType::Pointer halfToFullFilter = HalfToFullFilterType::New(); + auto halfToFullFilter = HalfToFullFilterType::New(); halfToFullFilter->SetActualXDimensionIsOdd(fft->GetActualXDimensionIsOddOutput()); halfToFullFilter->SetInput(fft->GetOutput()); halfToFullFilter->Update(); diff --git a/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx index 53ec78e3d56..c17cc4a0639 100644 --- a/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkInverse1DFFTImageFilterTest.cxx @@ -41,11 +41,11 @@ doTest(const char * inputRealFullImage, const char * inputImaginaryFullImage, co using JoinFilterType = itk::ComposeImageFilter; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer readerReal = ReaderType::New(); - typename ReaderType::Pointer readerImag = ReaderType::New(); - typename FFTType::Pointer fft = FFTType::New(); - typename JoinFilterType::Pointer joinFilter = JoinFilterType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto readerReal = ReaderType::New(); + auto readerImag = ReaderType::New(); + auto fft = FFTType::New(); + auto joinFilter = JoinFilterType::New(); + auto writer = WriterType::New(); readerReal->SetFileName(inputRealFullImage); readerImag->SetFileName(inputImaginaryFullImage); @@ -97,7 +97,7 @@ itkInverse1DFFTImageFilterTest(int argc, char * argv[]) using FFTInverseType = itk::Inverse1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTInverseType::Pointer fft = FFTInverseType::New(); + auto fft = FFTInverseType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, Inverse1DFFTImageFilter, ImageToImageFilter); itk::SizeValueType sizeGreatestPrimeFactor = 2; @@ -111,7 +111,7 @@ itkInverse1DFFTImageFilterTest(int argc, char * argv[]) using FFTInverseType = itk::VnlInverse1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTInverseType::Pointer fft = FFTInverseType::New(); + auto fft = FFTInverseType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, VnlInverse1DFFTImageFilter, Inverse1DFFTImageFilter); @@ -123,7 +123,7 @@ itkInverse1DFFTImageFilterTest(int argc, char * argv[]) using FFTInverseType = itk::FFTWInverse1DFFTImageFilter; // Instantiate a filter to exercise basic object methods - typename FFTInverseType::Pointer fft = FFTInverseType::New(); + auto fft = FFTInverseType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fft, FFTWInverse1DFFTImageFilter, Inverse1DFFTImageFilter); diff --git a/Modules/Filtering/FFT/test/itkRealFFTTest.h b/Modules/Filtering/FFT/test/itkRealFFTTest.h index fe4de4ebf3f..125a85a6fd7 100644 --- a/Modules/Filtering/FFT/test/itkRealFFTTest.h +++ b/Modules/Filtering/FFT/test/itkRealFFTTest.h @@ -65,7 +65,7 @@ test_fft(unsigned int * SizeOfDimensions) region.SetIndex(imageIndex); // Create the Real Image. - typename RealImageType::Pointer realImage = RealImageType::New(); + auto realImage = RealImageType::New(); realImage->SetLargestPossibleRegion(region); realImage->SetBufferedRegion(region); realImage->SetRequestedRegion(region); @@ -106,10 +106,10 @@ test_fft(unsigned int * SizeOfDimensions) } // Real to complex pointer. This computes the forward FFT. - typename R2CType::Pointer R2C = R2CType::New(); + auto R2C = R2CType::New(); // Complex to Real pointer. This computes the HalfHermitianToRealInverse FFT. - typename C2RType::Pointer C2R = C2RType::New(); + auto C2R = C2RType::New(); // Set the real image created as the input to the forward FFT // filter. @@ -250,7 +250,7 @@ test_fft_rtc(unsigned int * SizeOfDimensions) typename RealImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - typename RealImageType::Pointer realImage = RealImageType::New(); + auto realImage = RealImageType::New(); // Create the Real Image. realImage->SetLargestPossibleRegion(region); @@ -292,10 +292,10 @@ test_fft_rtc(unsigned int * SizeOfDimensions) } // Real to complex pointers. This computes the forward FFT. - typename R2CAType::Pointer R2Ca = R2CAType::New(); + auto R2Ca = R2CAType::New(); // Real to complex pointers. This computes the forward FFT. - typename R2CBType::Pointer R2Cb = R2CBType::New(); + auto R2Cb = R2CBType::New(); // Set the real image created as the input to the forward FFT // filter. diff --git a/Modules/Filtering/FFT/test/itkTestCircularDependency.cxx b/Modules/Filtering/FFT/test/itkTestCircularDependency.cxx index ec2add2bf16..c5a4be99dc3 100644 --- a/Modules/Filtering/FFT/test/itkTestCircularDependency.cxx +++ b/Modules/Filtering/FFT/test/itkTestCircularDependency.cxx @@ -39,7 +39,7 @@ FFTW() using CplxImageType = itk::Image; using FFTWComplexToComplexFilterType = itk::FFTWComplexToComplexFFTImageFilter; - typename FFTWComplexToComplexFilterType::Pointer fftwCplxToCplxFFT = FFTWComplexToComplexFilterType::New(); + auto fftwCplxToCplxFFT = FFTWComplexToComplexFilterType::New(); using FFTWRealToHalfHermitianForwardFFTImageFilterType = itk::FFTWRealToHalfHermitianForwardFFTImageFilter; @@ -47,7 +47,7 @@ FFTW() FFTWRealToHalfHermitianForwardFFTImageFilterType::New(); using FFTWInverseFFTImageFilterType = itk::FFTWInverseFFTImageFilter; - typename FFTWInverseFFTImageFilterType::Pointer fNvrsFFT = FFTWInverseFFTImageFilterType::New(); + auto fNvrsFFT = FFTWInverseFFTImageFilterType::New(); using FFTWHalfHermitianToRealInverseFFTImageFilterType = itk::FFTWHalfHermitianToRealInverseFFTImageFilter; @@ -55,7 +55,7 @@ FFTW() FFTWHalfHermitianToRealInverseFFTImageFilterType::New(); using FFTWForwardFFTImageFilterType = itk::FFTWForwardFFTImageFilter; - typename FFTWForwardFFTImageFilterType::Pointer fFrwrdFFT = FFTWForwardFFTImageFilterType::New(); + auto fFrwrdFFT = FFTWForwardFFTImageFilterType::New(); } #endif @@ -69,7 +69,7 @@ Vnl() using CplxImageType = itk::Image; using VnlComplexToComplexFilterType = itk::VnlComplexToComplexFFTImageFilter; - typename VnlComplexToComplexFilterType::Pointer vnlCplxToCplxFFT = VnlComplexToComplexFilterType::New(); + auto vnlCplxToCplxFFT = VnlComplexToComplexFilterType::New(); using VnlRealToHalfHermitianForwardFFTImageFilterType = itk::VnlRealToHalfHermitianForwardFFTImageFilter; @@ -77,7 +77,7 @@ Vnl() VnlRealToHalfHermitianForwardFFTImageFilterType::New(); using VnlInverseFFTImageFilterType = itk::VnlInverseFFTImageFilter; - typename VnlInverseFFTImageFilterType::Pointer vNvrsFFT = VnlInverseFFTImageFilterType::New(); + auto vNvrsFFT = VnlInverseFFTImageFilterType::New(); using VnlHalfHermitianToRealInverseFFTImageFilterType = itk::VnlHalfHermitianToRealInverseFFTImageFilter; @@ -85,7 +85,7 @@ Vnl() VnlHalfHermitianToRealInverseFFTImageFilterType::New(); using VnlForwardFFTImageFilterType = itk::VnlForwardFFTImageFilter; - typename VnlForwardFFTImageFilterType::Pointer vFrwrdFFT = VnlForwardFFTImageFilterType::New(); + auto vFrwrdFFT = VnlForwardFFTImageFilterType::New(); } int diff --git a/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx b/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx index 784cc44b8f3..bbc0555aec1 100644 --- a/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx +++ b/Modules/Filtering/FFT/test/itkVnlComplexToComplexFFTImageFilterTest.cxx @@ -35,28 +35,28 @@ transformImage(const char * inputImageFileName, const char * outputImageFileName using ComplexImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImageFileName); using ForwardFilterType = itk::ForwardFFTImageFilter; - typename ForwardFilterType::Pointer forwardFilter = ForwardFilterType::New(); + auto forwardFilter = ForwardFilterType::New(); forwardFilter->SetInput(reader->GetOutput()); using ComplexFilterType = itk::VnlComplexToComplexFFTImageFilter; - typename ComplexFilterType::Pointer inverseComplexFilter = ComplexFilterType::New(); + auto inverseComplexFilter = ComplexFilterType::New(); inverseComplexFilter->SetInput(forwardFilter->GetOutput()); inverseComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::INVERSE); - typename ComplexFilterType::Pointer forwardComplexFilter = ComplexFilterType::New(); + auto forwardComplexFilter = ComplexFilterType::New(); forwardComplexFilter->SetInput(inverseComplexFilter->GetOutput()); forwardComplexFilter->SetTransformDirection(ComplexFilterType::TransformDirectionEnum::FORWARD); using InverseFilterType = itk::InverseFFTImageFilter; - typename InverseFilterType::Pointer inverseFilter = InverseFilterType::New(); + auto inverseFilter = InverseFilterType::New(); inverseFilter->SetInput(forwardComplexFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputImageFileName); writer->SetInput(inverseFilter->GetOutput()); diff --git a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx index a28b56e4aa5..e436b545478 100644 --- a/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx +++ b/Modules/Filtering/FastMarching/include/itkFastMarchingImageFilterBase.hxx @@ -526,11 +526,11 @@ FastMarchingImageFilterBase::InitializeOutput(OutputImageType * // are 1, 2, 3, ... using ConnectedComponentFilterType = ConnectedComponentImageFilter; - typename ConnectedComponentFilterType::Pointer connecter = ConnectedComponentFilterType::New(); + auto connecter = ConnectedComponentFilterType::New(); connecter->SetInput(m_ConnectedComponentImage); using RelabelerType = RelabelComponentImageFilter; - typename RelabelerType::Pointer relabeler = RelabelerType::New(); + auto relabeler = RelabelerType::New(); relabeler->SetInput(connecter->GetOutput()); try diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx index 003f5862aa7..c77439b5272 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingBaseTest.cxx @@ -115,10 +115,10 @@ itkFastMarchingBaseTest(int argc, char * argv[]) constexpr unsigned Dimension = 3; using ImageType = itk::Image; - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); using ImageFastMarching = itk::FastMarchingBaseTestHelper; - ImageFastMarching::Pointer fmm = ImageFastMarching::New(); + auto fmm = ImageFastMarching::New(); fmm->SetInput(input); try @@ -143,10 +143,10 @@ itkFastMarchingBaseTest(int argc, char * argv[]) { using MeshType = itk::QuadEdgeMesh>; - MeshType::Pointer input = MeshType::New(); + auto input = MeshType::New(); using MeshFastMarching = itk::FastMarchingBaseTestHelper; - MeshFastMarching::Pointer fmm = MeshFastMarching::New(); + auto fmm = MeshFastMarching::New(); fmm->SetInput(input); try diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx index 8be1b46aa61..d6509b16300 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingExtensionImageFilterTest.cxx @@ -50,12 +50,12 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) using FloatImageType = itk::Image; using CriterionType = itk::FastMarchingThresholdStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); using MarcherType = itk::FastMarchingExtensionImageFilterBase; - MarcherType::Pointer marcher = MarcherType::New(); + auto marcher = MarcherType::New(); marcher->SetStoppingCriterion(criterion); ShowProgressObject progressWatch(marcher); @@ -72,7 +72,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) using NodePairContainerType = MarcherType::NodePairContainerType; // setup alive points - NodePairContainerType::Pointer AlivePoints = NodePairContainerType::New(); + auto AlivePoints = NodePairContainerType::New(); FloatImageType::OffsetType offset0 = { { 28, 35 } }; @@ -88,7 +88,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) // setup trial points - NodePairContainerType::Pointer TrialPoints = NodePairContainerType::New(); + auto TrialPoints = NodePairContainerType::New(); index.Fill(0); index += offset0; @@ -118,7 +118,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImageType::Pointer speedImage = FloatImageType::New(); + auto speedImage = FloatImageType::New(); FloatImageType::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); @@ -154,7 +154,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) using VectorType = MarcherType::AuxValueVectorType; using AuxValueContainerType = MarcherType::AuxValueContainerType; - AuxValueContainerType::Pointer auxAliveValues = AuxValueContainerType::New(); + auto auxAliveValues = AuxValueContainerType::New(); // deliberately cause an exception setting AuxAliveValues of the wrong size marcher->SetAuxiliaryAliveValues(auxAliveValues); @@ -201,7 +201,7 @@ itkFastMarchingExtensionImageFilterTest(int, char *[]) return EXIT_FAILURE; } - AuxValueContainerType::Pointer auxTrialValues = AuxValueContainerType::New(); + auto auxTrialValues = AuxValueContainerType::New(); // deliberately cause an exception setting AuxTrialValues of the wrong size marcher->SetAuxiliaryTrialValues(auxTrialValues); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx index a800c3332a6..170ea26f851 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx @@ -34,10 +34,10 @@ FastMarchingImageFilterBaseTestFunction() using PixelType = float; using ImageType = itk::Image; - typename ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); using FastMarchingImageFilterType = itk::FastMarchingImageFilterBase; - typename FastMarchingImageFilterType::Pointer fastMarchingFilter = FastMarchingImageFilterType::New(); + auto fastMarchingFilter = FastMarchingImageFilterType::New(); bool overrideOutputInformation = true; ITK_TEST_SET_GET_BOOLEAN(fastMarchingFilter, OverrideOutputInformation, overrideOutputInformation); @@ -91,7 +91,7 @@ itkFastMarchingImageFilterBaseTest(int, char *[]) using FastMarchingImageFilterType = itk::FastMarchingImageFilterBase; - FastMarchingImageFilterType::Pointer fastMarchingFilter = FastMarchingImageFilterType::New(); + auto fastMarchingFilter = FastMarchingImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fastMarchingFilter, FastMarchingImageFilterBase, FastMarchingBase); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx index 1fff9966c29..7a0caee8bc9 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest1.cxx @@ -57,10 +57,10 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv using FastMarchingType = itk::FastMarchingImageFilterBase; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); - FastMarchingType::Pointer marcher = FastMarchingType::New(); + auto marcher = FastMarchingType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(marcher, FastMarchingImageFilterBase, FastMarchingBase); @@ -76,7 +76,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv using NodePairContainerType = FastMarchingType::NodePairContainerType; // Set up alive points - NodePairContainerType::Pointer alive = NodePairContainerType::New(); + auto alive = NodePairContainerType::New(); NodePairType node_pair; @@ -98,7 +98,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv marcher->SetAlivePoints(alive); // Set up trial points - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); node_pair.SetValue(1.0); index.Fill(0); @@ -135,7 +135,7 @@ itkFastMarchingImageFilterRealTest1(int itkNotUsed(argc), char * itkNotUsed(argv marcher->SetOutputSize(size); // Set up a speed image of ones - FloatImageType::Pointer speedImage = FloatImageType::New(); + auto speedImage = FloatImageType::New(); FloatImageType::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx index 55baa6e32d8..ad8a85172a6 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealTest2.cxx @@ -58,10 +58,10 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv using FastMarchingType = itk::FastMarchingImageFilterBase; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); - FastMarchingType::Pointer marcher = FastMarchingType::New(); + auto marcher = FastMarchingType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(marcher, FastMarchingImageFilterBase, FastMarchingBase); @@ -78,7 +78,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv marcher->SetOutputSize(size); // Set up a speed image of ones - FloatImageType::Pointer speedImage = FloatImageType::New(); + auto speedImage = FloatImageType::New(); FloatImageType::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); @@ -86,7 +86,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv speedImage->Allocate(); // Set up an 'alive image' - FloatImageType::Pointer aliveImage = FloatImageType::New(); + auto aliveImage = FloatImageType::New(); aliveImage->SetLargestPossibleRegion(region); aliveImage->SetBufferedRegion(region); aliveImage->Allocate(); @@ -101,7 +101,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv aliveImage->SetPixel(index, 1.0); // Set up a 'trial image' - FloatImageType::Pointer trialImage = FloatImageType::New(); + auto trialImage = FloatImageType::New(); trialImage->SetLargestPossibleRegion(region); trialImage->SetBufferedRegion(region); trialImage->Allocate(); @@ -123,7 +123,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv trialImage->SetPixel(index, 1.0); // Set up a binary mask image in float (to make sure it works with float) - FloatImageType::Pointer maskImage = FloatImageType::New(); + auto maskImage = FloatImageType::New(); maskImage->SetLargestPossibleRegion(region); maskImage->SetBufferedRegion(region); maskImage->Allocate(); @@ -152,7 +152,7 @@ itkFastMarchingImageFilterRealTest2(int itkNotUsed(argc), char * itkNotUsed(argv using AdaptorType = itk::FastMarchingImageToNodePairContainerAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetIsForbiddenImageBinaryMask(true); adaptor->SetAliveImage(aliveImage.GetPointer()); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx index d2888f37b6a..4a07b9ce86c 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterRealWithNumberOfElementsTest.cxx @@ -37,10 +37,10 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) using FastMarchingType = itk::FastMarchingImageFilterBase; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetTargetNumberOfElements(100); - FastMarchingType::Pointer marcher = FastMarchingType::New(); + auto marcher = FastMarchingType::New(); marcher->SetStoppingCriterion(criterion); using NodePairType = FastMarchingType::NodePairType; @@ -48,7 +48,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) using NodePairContainerType = FastMarchingType::NodePairContainerType; // setup alive points - NodePairContainerType::Pointer alive = NodePairContainerType::New(); + auto alive = NodePairContainerType::New(); NodePairType node_pair; @@ -70,7 +70,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) marcher->SetAlivePoints(alive); // setup trial points - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); node_pair.SetValue(1.0); index.Fill(0); @@ -107,7 +107,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImageType::Pointer speedImage = FloatImageType::New(); + auto speedImage = FloatImageType::New(); FloatImageType::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); @@ -140,7 +140,7 @@ itkFastMarchingImageFilterRealWithNumberOfElementsTest(int, char *[]) using ThresholdingFilterType = itk::BinaryThresholdImageFilter; - ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New(); + auto thresholder = ThresholdingFilterType::New(); thresholder->SetLowerThreshold(0.0); thresholder->SetUpperThreshold(100.0); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingImageTopologicalTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingImageTopologicalTest.cxx index 178f91cce43..8478c44a2e5 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingImageTopologicalTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingImageTopologicalTest.cxx @@ -91,7 +91,7 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) LabelType label_zero = itk::NumericTraits::ZeroValue(); using ContourFilterType = itk::LabelContourImageFilter; - typename ContourFilterType::Pointer contour = ContourFilterType::New(); + auto contour = ContourFilterType::New(); contour->SetInput(labelImageReader->GetOutput()); contour->FullyConnectedOff(); contour->SetBackgroundValue(label_zero); @@ -111,8 +111,8 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) using NodePairContainerType = typename FastMarchingType::NodePairContainerType; - typename NodePairContainerType::Pointer AlivePoints = NodePairContainerType::New(); - typename NodePairContainerType::Pointer TrialPoints = NodePairContainerType::New(); + auto AlivePoints = NodePairContainerType::New(); + auto TrialPoints = NodePairContainerType::New(); itk::ImageRegionIteratorWithIndex ItL(labelImageReader->GetOutput(), labelImageReader->GetOutput()->GetLargestPossibleRegion()); @@ -168,7 +168,7 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) } using ThresholdingFilterType = itk::BinaryThresholdImageFilter; - typename ThresholdingFilterType::Pointer thresholder = ThresholdingFilterType::New(); + auto thresholder = ThresholdingFilterType::New(); thresholder->SetLowerThreshold(0.0); thresholder->SetUpperThreshold(stoppingValue); @@ -189,7 +189,7 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(thresholder->GetOutput()); writer->SetFileName(argv[3]); @@ -209,7 +209,7 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) { std::string filename = std::string(argv[7]) + std::string("LevelSet.nii.gz"); using InternalWriterType = itk::ImageFileWriter; - typename InternalWriterType::Pointer internal_writer = InternalWriterType::New(); + auto internal_writer = InternalWriterType::New(); internal_writer->SetInput(fastMarching->GetOutput()); internal_writer->SetFileName(filename.c_str()); @@ -228,7 +228,7 @@ FastMarchingImageFilter(unsigned int argc, char * argv[]) { std::string filename = std::string(argv[7]) + std::string("LabelMap.nii.gz"); using LabelImageWriterType = itk::ImageFileWriter; - typename LabelImageWriterType::Pointer mapWriter = LabelImageWriterType::New(); + auto mapWriter = LabelImageWriterType::New(); mapWriter->SetInput(fastMarching->GetLabelImage()); mapWriter->SetFileName(filename.c_str()); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingNumberOfElementsStoppingCriterionTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingNumberOfElementsStoppingCriterionTest.cxx index 51e5abf8a6b..6cc11ae9651 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingNumberOfElementsStoppingCriterionTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingNumberOfElementsStoppingCriterionTest.cxx @@ -25,7 +25,7 @@ itkFastMarchingNumberOfElementsStoppingCriterionTest(int, char *[]) using ImageStoppingCriterionType = itk::FastMarchingNumberOfElementsStoppingCriterion; - ImageStoppingCriterionType::Pointer image_criterion = ImageStoppingCriterionType::New(); + auto image_criterion = ImageStoppingCriterionType::New(); if (image_criterion.IsNull()) { return EXIT_FAILURE; @@ -35,7 +35,7 @@ itkFastMarchingNumberOfElementsStoppingCriterionTest(int, char *[]) using MeshStoppingCriterionType = itk::FastMarchingNumberOfElementsStoppingCriterion; - MeshStoppingCriterionType::Pointer mesh_criterion = MeshStoppingCriterionType::New(); + auto mesh_criterion = MeshStoppingCriterionType::New(); if (mesh_criterion.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx index 4f7dbb3e1e8..7b66ff3225c 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest.cxx @@ -48,7 +48,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest(int, char *[]) center.Fill(0.); using SphereSourceType = itk::RegularSphereMeshSource; - SphereSourceType::Pointer sphere_filter = SphereSourceType::New(); + auto sphere_filter = SphereSourceType::New(); sphere_filter->SetCenter(center); sphere_filter->SetResolution(5); sphere_filter->Update(); @@ -70,16 +70,16 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest(int, char *[]) // using NodeContainerType = FastMarchingType::NodeContainerType; using NodePairContainerType = FastMarchingType::NodePairContainerType; - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); NodePairType node_pair(0, 0.); trial->push_back(node_pair); using CriterionType = itk::FastMarchingThresholdStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); - FastMarchingType::Pointer fmm_filter = FastMarchingType::New(); + auto fmm_filter = FastMarchingType::New(); fmm_filter->SetInput(sphere_output); fmm_filter->SetTrialPoints(trial); fmm_filter->SetStoppingCriterion(criterion); @@ -96,7 +96,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest(int, char *[]) } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(fmm_filter->GetOutput()); writer->SetFileName("itkFastMarchingQuadEdgeMeshFilterBase.vtk"); writer->Update(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest2.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest2.cxx index 71a2dd9e6f3..fcadaa91697 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest2.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest2.cxx @@ -52,7 +52,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest2(int, char *[]) using PointDataContainerPointer = PointDataContainer::Pointer; // Let's create here a plane! - MeshType::Pointer plane = MeshType::New(); + auto plane = MeshType::New(); PointsContainerPointer points = PointsContainer::New(); PointDataContainerPointer pointdata = PointDataContainer::New(); @@ -98,16 +98,16 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest2(int, char *[]) // using NodeContainerType = FastMarchingType::NodeContainerType; using NodePairContainerType = FastMarchingType::NodePairContainerType; - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); NodePairType node_pair(0, 0.); trial->push_back(node_pair); using CriterionType = itk::FastMarchingThresholdStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); - FastMarchingType::Pointer fmm_filter = FastMarchingType::New(); + auto fmm_filter = FastMarchingType::New(); fmm_filter->SetInput(plane); fmm_filter->SetTrialPoints(trial); fmm_filter->SetStoppingCriterion(criterion); @@ -151,7 +151,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest2(int, char *[]) } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("itkFastMarchingQuadEdgeMeshFilterBaseTest2.vtk"); writer->Update(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx index e87c93c7c94..995ca07dca9 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest3.cxx @@ -49,7 +49,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest3(int, char *[]) using PointDataContainerPointer = PointDataContainer::Pointer; // Let's create here a plane! - MeshType::Pointer plane = MeshType::New(); + auto plane = MeshType::New(); PointsContainerPointer points = PointsContainer::New(); PointDataContainerPointer pointdata = PointDataContainer::New(); @@ -104,16 +104,16 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest3(int, char *[]) // using NodeContainerType = FastMarchingType::NodeContainerType; using NodePairContainerType = FastMarchingType::NodePairContainerType; - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); NodePairType node_pair(0, 0.); trial->push_back(node_pair); using CriterionType = itk::FastMarchingThresholdStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(100.); - FastMarchingType::Pointer fmm_filter = FastMarchingType::New(); + auto fmm_filter = FastMarchingType::New(); fmm_filter->SetInput(plane); fmm_filter->SetTrialPoints(trial); fmm_filter->SetStoppingCriterion(criterion); @@ -162,7 +162,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest3(int, char *[]) } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(fmm_filter->GetOutput()); writer->SetFileName("itkFastMarchingQuadEdgeMeshFilterBaseTest3.vtk"); writer->Update(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest4.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest4.cxx index d61009f8dd1..0fafe91171b 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest4.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterBaseTest4.cxx @@ -52,7 +52,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest4(int, char *[]) using PointDataContainerPointer = PointDataContainer::Pointer; // Let's create here a plane! - MeshType::Pointer plane = MeshType::New(); + auto plane = MeshType::New(); PointsContainerPointer points = PointsContainer::New(); PointDataContainerPointer pointdata = PointDataContainer::New(); @@ -100,16 +100,16 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest4(int, char *[]) // using NodeContainerType = FastMarchingType::NodeContainerType; using NodePairContainerType = FastMarchingType::NodePairContainerType; - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); NodePairType node_pair(0, 0.); trial->push_back(node_pair); using CriterionType = itk::FastMarchingThresholdStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetThreshold(std::sqrt(100.0 + 182.25 * delta * delta) + 100.); - FastMarchingType::Pointer fmm_filter = FastMarchingType::New(); + auto fmm_filter = FastMarchingType::New(); fmm_filter->SetInput(plane); fmm_filter->SetTrialPoints(trial); fmm_filter->SetStoppingCriterion(criterion); @@ -153,7 +153,7 @@ itkFastMarchingQuadEdgeMeshFilterBaseTest4(int, char *[]) } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("itkFastMarchingQuadEdgeMeshFilterBaseTest4.vtk"); writer->Update(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx index 35f0e5fa021..f52ee8d4b9e 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest.cxx @@ -47,7 +47,7 @@ itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest(int, char *[]) center.Fill(0.); using SphereSourceType = itk::RegularSphereMeshSource; - SphereSourceType::Pointer sphere_filter = SphereSourceType::New(); + auto sphere_filter = SphereSourceType::New(); sphere_filter->SetCenter(center); sphere_filter->SetResolution(5); sphere_filter->Update(); @@ -69,16 +69,16 @@ itkFastMarchingQuadEdgeMeshFilterWithNumberOfElementsTest(int, char *[]) // using NodeContainerType = FastMarchingType::NodeContainerType; using NodePairContainerType = FastMarchingType::NodePairContainerType; - NodePairContainerType::Pointer trial = NodePairContainerType::New(); + auto trial = NodePairContainerType::New(); NodePairType node_pair(0, 1.); trial->push_back(node_pair); using CriterionType = itk::FastMarchingNumberOfElementsStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); criterion->SetTargetNumberOfElements(100); - FastMarchingType::Pointer fmm_filter = FastMarchingType::New(); + auto fmm_filter = FastMarchingType::New(); fmm_filter->SetInput(sphere_output); fmm_filter->SetTrialPoints(trial); fmm_filter->SetStoppingCriterion(criterion); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingStoppingCriterionBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingStoppingCriterionBaseTest.cxx index 7980923e1fd..5fe50a28ae4 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingStoppingCriterionBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingStoppingCriterionBaseTest.cxx @@ -73,7 +73,7 @@ itkFastMarchingStoppingCriterionBaseTest(int, char *[]) using ImageStoppingCriterionType = itk::FastMarchingStoppingCriterionBaseHelperTest; - ImageStoppingCriterionType::Pointer image_criterion = ImageStoppingCriterionType::New(); + auto image_criterion = ImageStoppingCriterionType::New(); if (image_criterion.IsNull()) { return EXIT_FAILURE; @@ -83,7 +83,7 @@ itkFastMarchingStoppingCriterionBaseTest(int, char *[]) using MeshStoppingCriterionType = itk::FastMarchingStoppingCriterionBaseHelperTest; - MeshStoppingCriterionType::Pointer mesh_criterion = MeshStoppingCriterionType::New(); + auto mesh_criterion = MeshStoppingCriterionType::New(); if (mesh_criterion.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx index 830a688d8a5..5b59786adc6 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingTest.cxx @@ -49,7 +49,7 @@ itkFastMarchingTest(int, char *[]) using FloatImage = itk::Image; using FloatFMType = itk::FastMarchingImageFilter; - FloatFMType::Pointer marcher = FloatFMType::New(); + auto marcher = FloatFMType::New(); ShowProgressObject progressWatch(marcher); itk::SimpleMemberCommand::Pointer command; @@ -61,7 +61,7 @@ itkFastMarchingTest(int, char *[]) using NodeContainer = FloatFMType::NodeContainer; // setup alive points - NodeContainer::Pointer alivePoints = NodeContainer::New(); + auto alivePoints = NodeContainer::New(); NodeType node; @@ -83,7 +83,7 @@ itkFastMarchingTest(int, char *[]) // setup trial points - NodeContainer::Pointer trialPoints = NodeContainer::New(); + auto trialPoints = NodeContainer::New(); node.SetValue(1.0); @@ -121,7 +121,7 @@ itkFastMarchingTest(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImage::Pointer speedImage = FloatImage::New(); + auto speedImage = FloatImage::New(); FloatImage::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx index f869148cddd..ea0ccb5ddda 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingTest2.cxx @@ -50,7 +50,7 @@ itkFastMarchingTest2(int, char *[]) using FloatImage = itk::Image; using FloatFMType = itk::FastMarchingImageFilter; - FloatFMType::Pointer marcher = FloatFMType::New(); + auto marcher = FloatFMType::New(); ShowProgressObject progressWatch(marcher); itk::SimpleMemberCommand::Pointer command; @@ -62,7 +62,7 @@ itkFastMarchingTest2(int, char *[]) using NodeContainer = FloatFMType::NodeContainer; // setup alive points - NodeContainer::Pointer alivePoints = NodeContainer::New(); + auto alivePoints = NodeContainer::New(); NodeType node; @@ -84,7 +84,7 @@ itkFastMarchingTest2(int, char *[]) // setup trial points - NodeContainer::Pointer trialPoints = NodeContainer::New(); + auto trialPoints = NodeContainer::New(); node.SetValue(1.0); @@ -122,7 +122,7 @@ itkFastMarchingTest2(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImage::Pointer speedImage = FloatImage::New(); + auto speedImage = FloatImage::New(); FloatImage::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); @@ -130,7 +130,7 @@ itkFastMarchingTest2(int, char *[]) speedImage->Allocate(); // setup a binary mask image in float (to make sure it works with float) - FloatImage::Pointer MaskImage = FloatImage::New(); + auto MaskImage = FloatImage::New(); MaskImage->SetLargestPossibleRegion(region); MaskImage->SetBufferedRegion(region); MaskImage->Allocate(); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx index a8d5e756d24..86a1e156f81 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingThresholdStoppingCriterionTest.cxx @@ -25,7 +25,7 @@ itkFastMarchingThresholdStoppingCriterionTest(int, char *[]) using ImageStoppingCriterionType = itk::FastMarchingThresholdStoppingCriterion; - ImageStoppingCriterionType::Pointer image_criterion = ImageStoppingCriterionType::New(); + auto image_criterion = ImageStoppingCriterionType::New(); if (image_criterion.IsNull()) { return EXIT_FAILURE; @@ -35,7 +35,7 @@ itkFastMarchingThresholdStoppingCriterionTest(int, char *[]) using MeshStoppingCriterionType = itk::FastMarchingThresholdStoppingCriterion; - MeshStoppingCriterionType::Pointer mesh_criterion = MeshStoppingCriterionType::New(); + auto mesh_criterion = MeshStoppingCriterionType::New(); if (mesh_criterion.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx index d22b3f1c11b..2f236a38c2a 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientBaseTest.cxx @@ -51,11 +51,11 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) using CriterionType = itk::FastMarchingReachedTargetNodesStoppingCriterion; - CriterionType::Pointer criterion = CriterionType::New(); + auto criterion = CriterionType::New(); using FloatFMType = itk::FastMarchingUpwindGradientImageFilterBase; - FloatFMType::Pointer marcher = FloatFMType::New(); + auto marcher = FloatFMType::New(); // ShowProgressObject progressWatch(marcher); // itk::SimpleMemberCommand::Pointer command; @@ -72,7 +72,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) using NodePairContainerType = FloatFMType::NodePairContainerType; // setup alive points - NodePairContainerType::Pointer AlivePoints = NodePairContainerType::New(); + auto AlivePoints = NodePairContainerType::New(); FloatImageType::OffsetType offset0 = { { 28, 35 } }; @@ -85,7 +85,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) marcher->SetAlivePoints(AlivePoints); // setup trial points - NodePairContainerType::Pointer TrialPoints = NodePairContainerType::New(); + auto TrialPoints = NodePairContainerType::New(); index.Fill(0); index += offset0; @@ -115,7 +115,7 @@ itkFastMarchingUpwindGradientBaseTest(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImageType::Pointer speedImage = FloatImageType::New(); + auto speedImage = FloatImageType::New(); FloatImageType::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); diff --git a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx index 6d22947fd8a..37847f3d56d 100644 --- a/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx +++ b/Modules/Filtering/FastMarching/test/itkFastMarchingUpwindGradientTest.cxx @@ -47,7 +47,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) using FloatImage = itk::Image; using FloatFMType = itk::FastMarchingUpwindGradientImageFilter; - FloatFMType::Pointer marcher = FloatFMType::New(); + auto marcher = FloatFMType::New(); // ShowProgressObject progressWatch(marcher); // itk::SimpleMemberCommand::Pointer command; @@ -62,7 +62,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) using NodeContainer = FloatFMType::NodeContainer; // setup alive points - NodeContainer::Pointer alivePoints = NodeContainer::New(); + auto alivePoints = NodeContainer::New(); NodeType node; @@ -84,7 +84,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) // setup trial points - NodeContainer::Pointer trialPoints = NodeContainer::New(); + auto trialPoints = NodeContainer::New(); node.SetValue(1.0); @@ -122,7 +122,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) marcher->SetOutputSize(size); // setup a speed image of ones - FloatImage::Pointer speedImage = FloatImage::New(); + auto speedImage = FloatImage::New(); FloatImage::RegionType region; region.SetSize(size); speedImage->SetLargestPossibleRegion(region); @@ -223,7 +223,7 @@ itkFastMarchingUpwindGradientTest(int, char *[]) index.Fill(0); node.SetValue(0.0); - NodeContainer::Pointer targetPoints = NodeContainer::New(); + auto targetPoints = NodeContainer::New(); for (unsigned int i = 0, _end = targetOffsets.size(); i < _end; ++i) { node.SetIndex(index + targetOffsets[i]); diff --git a/Modules/Filtering/GPUAnisotropicSmoothing/test/itkGPUGradientAnisotropicDiffusionImageFilterTest.cxx b/Modules/Filtering/GPUAnisotropicSmoothing/test/itkGPUGradientAnisotropicDiffusionImageFilterTest.cxx index 6baf253a7d1..965ebcf9d89 100644 --- a/Modules/Filtering/GPUAnisotropicSmoothing/test/itkGPUGradientAnisotropicDiffusionImageFilterTest.cxx +++ b/Modules/Filtering/GPUAnisotropicSmoothing/test/itkGPUGradientAnisotropicDiffusionImageFilterTest.cxx @@ -45,8 +45,8 @@ runGPUGradientAnisotropicDiffusionImageFilterTest(const std::string & inFile, co using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(inFile); writer->SetFileName(outFile); @@ -55,8 +55,8 @@ runGPUGradientAnisotropicDiffusionImageFilterTest(const std::string & inFile, co using CPUAnisoDiffFilterType = itk::GradientAnisotropicDiffusionImageFilter; using GPUAnisoDiffFilterType = itk::GPUGradientAnisotropicDiffusionImageFilter; - typename CPUAnisoDiffFilterType::Pointer CPUFilter = CPUAnisoDiffFilterType::New(); - typename GPUAnisoDiffFilterType::Pointer GPUFilter = GPUAnisoDiffFilterType::New(); + auto CPUFilter = CPUAnisoDiffFilterType::New(); + auto GPUFilter = GPUAnisoDiffFilterType::New(); reader->Update(); diff --git a/Modules/Filtering/GPUImageFilterBase/test/itkGPUNeighborhoodOperatorImageFilterTest.cxx b/Modules/Filtering/GPUImageFilterBase/test/itkGPUNeighborhoodOperatorImageFilterTest.cxx index 708d2426d77..162cbf0c9be 100644 --- a/Modules/Filtering/GPUImageFilterBase/test/itkGPUNeighborhoodOperatorImageFilterTest.cxx +++ b/Modules/Filtering/GPUImageFilterBase/test/itkGPUNeighborhoodOperatorImageFilterTest.cxx @@ -46,8 +46,8 @@ runGPUNeighborhoodOperatorImageFilterTest(const std::string & inFile, const std: using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(inFile); writer->SetFileName(outFile); @@ -71,7 +71,7 @@ runGPUNeighborhoodOperatorImageFilterTest(const std::string & inFile, const std: // test 1~8 work units for CPU for (int numberOfWorkUnits = 1; numberOfWorkUnits <= 8; ++numberOfWorkUnits) { - typename NeighborhoodFilterType::Pointer CPUFilter = NeighborhoodFilterType::New(); + auto CPUFilter = NeighborhoodFilterType::New(); itk::TimeProbe cputimer; cputimer.Start(); @@ -92,7 +92,7 @@ runGPUNeighborhoodOperatorImageFilterTest(const std::string & inFile, const std: if (numberOfWorkUnits == 8) { - typename GPUNeighborhoodFilterType::Pointer GPUFilter = GPUNeighborhoodFilterType::New(); + auto GPUFilter = GPUNeighborhoodFilterType::New(); itk::TimeProbe gputimer; gputimer.Start(); diff --git a/Modules/Filtering/GPUSmoothing/include/itkGPUDiscreteGaussianImageFilter.hxx b/Modules/Filtering/GPUSmoothing/include/itkGPUDiscreteGaussianImageFilter.hxx index 1c47929b294..9b4032e8eec 100644 --- a/Modules/Filtering/GPUSmoothing/include/itkGPUDiscreteGaussianImageFilter.hxx +++ b/Modules/Filtering/GPUSmoothing/include/itkGPUDiscreteGaussianImageFilter.hxx @@ -52,7 +52,7 @@ GPUDiscreteGaussianImageFilter::GPUDiscreteGaussianIm m_LastFilter = LastFilterType::New(); for (unsigned int i = 1; i < filterDimensionality - 1; ++i) { - typename IntermediateFilterType::Pointer f = IntermediateFilterType::New(); + auto f = IntermediateFilterType::New(); m_IntermediateFilters.push_back(f); } } @@ -90,8 +90,8 @@ GPUDiscreteGaussianImageFilter::GPUGenerateData() // Create an internal image to protect the input image's metadata // (e.g. RequestedRegion). The StreamingImageFilter changes the // requested region as part of its normal processing. - // typename TInputImage::Pointer localInput = TInputImage::New(); - typename GPUInputImage::Pointer localInput = GPUInputImage::New(); + // auto localInput = TInputImage::New(); + auto localInput = GPUInputImage::New(); localInput->Graft(this->GetInput()); // Determine the dimensionality to filter @@ -154,7 +154,7 @@ GPUDiscreteGaussianImageFilter::GPUGenerateData() oper.resize(filterDimensionality); // Create a process accumulator for tracking the progress of minipipeline - // ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + // auto progress = ProgressAccumulator::New(); // progress->SetMiniPipelineFilter(this); // Set up the operators diff --git a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h index a6c6b29756d..50dabce02cf 100644 --- a/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h +++ b/Modules/Filtering/GPUSmoothing/include/itkGPUMeanImageFilter.h @@ -131,7 +131,7 @@ class GPUMeanImageFilterFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GPUMeanImageFilterFactory::Pointer factory = GPUMeanImageFilterFactory::New(); + auto factory = GPUMeanImageFilterFactory::New(); ObjectFactoryBase::RegisterFactory(factory); } diff --git a/Modules/Filtering/GPUSmoothing/test/itkGPUDiscreteGaussianImageFilterTest.cxx b/Modules/Filtering/GPUSmoothing/test/itkGPUDiscreteGaussianImageFilterTest.cxx index cd215ecd909..4a419a49f4c 100644 --- a/Modules/Filtering/GPUSmoothing/test/itkGPUDiscreteGaussianImageFilterTest.cxx +++ b/Modules/Filtering/GPUSmoothing/test/itkGPUDiscreteGaussianImageFilterTest.cxx @@ -52,8 +52,8 @@ runGPUDiscreteGaussianImageFilterTest(const std::string & inFile, const std::str using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(inFile); writer->SetFileName(outFile); @@ -63,7 +63,7 @@ runGPUDiscreteGaussianImageFilterTest(const std::string & inFile, const std::str // test 1~8 threads for CPU for (int numberOfWorkUnits = 1; numberOfWorkUnits <= 8; ++numberOfWorkUnits) { - typename CPUFilterType::Pointer CPUFilter = CPUFilterType::New(); + auto CPUFilter = CPUFilterType::New(); itk::TimeProbe cputimer; cputimer.Start(); @@ -84,7 +84,7 @@ runGPUDiscreteGaussianImageFilterTest(const std::string & inFile, const std::str if (numberOfWorkUnits == 8) { - typename GPUFilterType::Pointer GPUFilter = GPUFilterType::New(); + auto GPUFilter = GPUFilterType::New(); itk::TimeProbe gputimer; gputimer.Start(); diff --git a/Modules/Filtering/GPUSmoothing/test/itkGPUMeanImageFilterTest.cxx b/Modules/Filtering/GPUSmoothing/test/itkGPUMeanImageFilterTest.cxx index fcc35646438..de1099ab5b4 100644 --- a/Modules/Filtering/GPUSmoothing/test/itkGPUMeanImageFilterTest.cxx +++ b/Modules/Filtering/GPUSmoothing/test/itkGPUMeanImageFilterTest.cxx @@ -50,8 +50,8 @@ runGPUMeanImageFilterTest(const std::string & inFile, const std::string & outFil using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(inFile); writer->SetFileName(outFile); @@ -75,7 +75,7 @@ runGPUMeanImageFilterTest(const std::string & inFile, const std::string & outFil // test 1~8 threads for CPU for (int numberOfWorkUnits = 1; numberOfWorkUnits <= 8; ++numberOfWorkUnits) { - typename MeanFilterType::Pointer CPUFilter = MeanFilterType::New(); + auto CPUFilter = MeanFilterType::New(); itk::TimeProbe cputimer; cputimer.Start(); @@ -96,7 +96,7 @@ runGPUMeanImageFilterTest(const std::string & inFile, const std::string & outFil if (numberOfWorkUnits == 8) { - typename GPUMeanFilterType::Pointer GPUFilter = GPUMeanFilterType::New(); + auto GPUFilter = GPUMeanFilterType::New(); itk::TimeProbe gputimer; gputimer.Start(); diff --git a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h index 9935ed35d2a..ce6526db010 100644 --- a/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h +++ b/Modules/Filtering/GPUThresholding/include/itkGPUBinaryThresholdImageFilter.h @@ -184,7 +184,7 @@ class GPUBinaryThresholdImageFilterFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GPUBinaryThresholdImageFilterFactory::Pointer factory = GPUBinaryThresholdImageFilterFactory::New(); + auto factory = GPUBinaryThresholdImageFilterFactory::New(); itk::ObjectFactoryBase::RegisterFactory(factory); } diff --git a/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx b/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx index 77bd4d15b65..482ce745266 100644 --- a/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx +++ b/Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx @@ -46,8 +46,8 @@ runGPUBinaryThresholdImageFilterTest(const std::string & inFile, const std::stri using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); if (!itk::IsGPUAvailable()) { @@ -69,8 +69,8 @@ runGPUBinaryThresholdImageFilterTest(const std::string & inFile, const std::stri for (int numberOfWorkUnits = 1; numberOfWorkUnits <= 8; ++numberOfWorkUnits) { - typename ThresholdFilterType::Pointer CPUFilter = ThresholdFilterType::New(); - itk::TimeProbe cputimer; + auto CPUFilter = ThresholdFilterType::New(); + itk::TimeProbe cputimer; cputimer.Start(); // build pipeline @@ -92,7 +92,7 @@ runGPUBinaryThresholdImageFilterTest(const std::string & inFile, const std::stri if (numberOfWorkUnits == 8) { - typename GPUThresholdFilterType::Pointer GPUFilter = GPUThresholdFilterType::New(); + auto GPUFilter = GPUThresholdFilterType::New(); itk::TimeProbe gputimer; gputimer.Start(); diff --git a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx index 245421d57c5..4275a44e30d 100644 --- a/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx +++ b/Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx @@ -50,8 +50,8 @@ runGPUImageFilterTest(const std::string & inFile, const std::string & outFile) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(inFile); writer->SetFileName(outFile); @@ -63,9 +63,9 @@ runGPUImageFilterTest(const std::string & inFile, const std::string & outFile) using MeanFilterType = itk::MeanImageFilter; using ThresholdFilterType = itk::BinaryThresholdImageFilter; - typename MeanFilterType::Pointer filter1 = MeanFilterType::New(); - typename MeanFilterType::Pointer filter2 = MeanFilterType::New(); - typename ThresholdFilterType::Pointer filter3 = ThresholdFilterType::New(); + auto filter1 = MeanFilterType::New(); + auto filter2 = MeanFilterType::New(); + auto filter3 = ThresholdFilterType::New(); // Mean filter kernel radius typename InputImageType::SizeType indexRadius; diff --git a/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx index 53784819da1..07e428cf621 100644 --- a/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkAbsoluteValueDifferenceImageFilterTest.cxx @@ -52,8 +52,8 @@ itkAbsoluteValueDifferenceImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create two images - myImageType1::Pointer inputImageA = myImageType1::New(); - myImageType2::Pointer inputImageB = myImageType2::New(); + auto inputImageA = myImageType1::New(); + auto inputImageB = myImageType2::New(); // Define their size, and start index mySizeType size; @@ -117,7 +117,7 @@ itkAbsoluteValueDifferenceImageFilterTest(int, char *[]) // Create a MagnitudeImageFilter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images diff --git a/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx index 53f2857a6fe..e1c1464a37a 100644 --- a/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkCheckerBoardImageFilterTest.cxx @@ -58,8 +58,8 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) using CheckerBoardPatternArrayType = CheckerBoardImageFilterType::PatternArrayType; // Create the input images - ImageType::Pointer inputImageA = ImageType::New(); - ImageType::Pointer inputImageB = ImageType::New(); + auto inputImageA = ImageType::New(); + auto inputImageB = ImageType::New(); // Define their size, and start index SizeType size; @@ -115,7 +115,7 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) } // Create the filter - CheckerBoardImageFilterType::Pointer checkerBoard = CheckerBoardImageFilterType::New(); + auto checkerBoard = CheckerBoardImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(checkerBoard, CheckerBoardImageFilter, ImageToImageFilter); @@ -140,7 +140,7 @@ itkCheckerBoardImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx index 7af49c5e50d..0138d8c5cc8 100644 --- a/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkConstrainedValueDifferenceImageFilterTest.cxx @@ -53,8 +53,8 @@ itkConstrainedValueDifferenceImageFilterTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create the two input images - InputImage1Type::Pointer inputImageA = InputImage1Type::New(); - InputImage2Type::Pointer inputImageB = InputImage2Type::New(); + auto inputImageA = InputImage1Type::New(); + auto inputImageB = InputImage2Type::New(); // Define their size and start index SizeType size; @@ -115,7 +115,7 @@ itkConstrainedValueDifferenceImageFilterTest(int argc, char * argv[]) itk::ConstrainedValueDifferenceImageFilter; // Create the filter - ConstrainedValueDifferenceImageFilterType::Pointer filter = ConstrainedValueDifferenceImageFilterType::New(); + auto filter = ConstrainedValueDifferenceImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ConstrainedValueDifferenceImageFilter, BinaryGeneratorImageFilter); @@ -133,7 +133,7 @@ itkConstrainedValueDifferenceImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx index 414d5d9e92a..3375dcfe444 100644 --- a/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkSimilarityIndexImageFilterTest.cxx @@ -34,8 +34,8 @@ itkSimilarityIndexImageFilterTest(int, char *[]) using Image1Type = itk::Image; using Image2Type = itk::Image; - Image1Type::Pointer image1 = Image1Type::New(); - Image2Type::Pointer image2 = Image2Type::New(); + auto image1 = Image1Type::New(); + auto image2 = Image2Type::New(); Image1Type::SizeType size; size.Fill(8); @@ -89,7 +89,7 @@ itkSimilarityIndexImageFilterTest(int, char *[]) } using FilterType = itk::SimilarityIndexImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SimilarityIndexImageFilter, ImageToImageFilter); @@ -114,8 +114,8 @@ itkSimilarityIndexImageFilterTest(int, char *[]) } // test case where both images are zero - Image1Type::Pointer image3 = Image1Type::New(); - Image2Type::Pointer image4 = Image2Type::New(); + auto image3 = Image1Type::New(); + auto image4 = Image2Type::New(); image3->SetRegions(image1->GetBufferedRegion()); image3->Allocate(); diff --git a/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx index 11ea4cf0302..61bc8bdc43b 100644 --- a/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkSquaredDifferenceImageFilterTest.cxx @@ -53,8 +53,8 @@ itkSquaredDifferenceImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create two images - myImageType1::Pointer inputImageA = myImageType1::New(); - myImageType2::Pointer inputImageB = myImageType2::New(); + auto inputImageA = myImageType1::New(); + auto inputImageB = myImageType2::New(); // Define their size, and start index mySizeType size; @@ -118,7 +118,7 @@ itkSquaredDifferenceImageFilterTest(int, char *[]) // Create a MagnitudeImageFilter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SquaredDifferenceImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx b/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx index cdca30de798..886bed6ada7 100644 --- a/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompare/test/itkTestingComparisonImageFilterTest.cxx @@ -50,8 +50,8 @@ itkTestingComparisonImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -59,7 +59,7 @@ itkTestingComparisonImageFilterTest(int argc, char * argv[]) // Define the filter using FilterType = itk::Testing::ComparisonImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // setup the filter filter->SetDifferenceThreshold(std::stoi(argv[4])); @@ -74,7 +74,7 @@ itkTestingComparisonImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/ImageCompose/test/itkCompose2DCovariantVectorImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkCompose2DCovariantVectorImageFilterTest.cxx index 761c745a7e7..534cfc78a8c 100644 --- a/Modules/Filtering/ImageCompose/test/itkCompose2DCovariantVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkCompose2DCovariantVectorImageFilterTest.cxx @@ -35,10 +35,10 @@ itkCompose2DCovariantVectorImageFilterTest(int, char *[]) using SizeType = InputImageType::SizeType; using IndexType = InputImageType::IndexType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer zeroImage = InputImageType::New(); - InputImageType::Pointer oneImage = InputImageType::New(); + auto zeroImage = InputImageType::New(); + auto oneImage = InputImageType::New(); SizeType size; size[0] = 2; diff --git a/Modules/Filtering/ImageCompose/test/itkCompose2DVectorImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkCompose2DVectorImageFilterTest.cxx index 0c36eacb242..06d9338bbdb 100644 --- a/Modules/Filtering/ImageCompose/test/itkCompose2DVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkCompose2DVectorImageFilterTest.cxx @@ -35,10 +35,10 @@ itkCompose2DVectorImageFilterTest(int, char *[]) using SizeType = InputImageType::SizeType; using IndexType = InputImageType::IndexType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer zeroImage = InputImageType::New(); - InputImageType::Pointer oneImage = InputImageType::New(); + auto zeroImage = InputImageType::New(); + auto oneImage = InputImageType::New(); SizeType size; size[0] = 2; diff --git a/Modules/Filtering/ImageCompose/test/itkCompose3DCovariantVectorImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkCompose3DCovariantVectorImageFilterTest.cxx index 22b04d1553d..83eb175f093 100644 --- a/Modules/Filtering/ImageCompose/test/itkCompose3DCovariantVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkCompose3DCovariantVectorImageFilterTest.cxx @@ -36,11 +36,11 @@ itkCompose3DCovariantVectorImageFilterTest(int, char *[]) using SizeType = InputImageType::SizeType; using IndexType = InputImageType::IndexType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer zeroImage = InputImageType::New(); - InputImageType::Pointer oneImage = InputImageType::New(); - InputImageType::Pointer twoImage = InputImageType::New(); + auto zeroImage = InputImageType::New(); + auto oneImage = InputImageType::New(); + auto twoImage = InputImageType::New(); SizeType size; size[0] = 2; diff --git a/Modules/Filtering/ImageCompose/test/itkCompose3DVectorImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkCompose3DVectorImageFilterTest.cxx index 8bc62963677..f2e222d2903 100644 --- a/Modules/Filtering/ImageCompose/test/itkCompose3DVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkCompose3DVectorImageFilterTest.cxx @@ -35,11 +35,11 @@ itkCompose3DVectorImageFilterTest(int, char *[]) using SizeType = InputImageType::SizeType; using IndexType = InputImageType::IndexType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer zeroImage = InputImageType::New(); - InputImageType::Pointer oneImage = InputImageType::New(); - InputImageType::Pointer twoImage = InputImageType::New(); + auto zeroImage = InputImageType::New(); + auto oneImage = InputImageType::New(); + auto twoImage = InputImageType::New(); SizeType size; size[0] = 2; diff --git a/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx index 4a06556f98e..f9f2b2ba52f 100644 --- a/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkComposeRGBAImageFilterTest.cxx @@ -65,27 +65,27 @@ itkComposeRGBAImageFilterTest(int argc, char * argv[]) using ComposeFilterType = itk::ComposeImageFilter; // Read input1 - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(Input1Filename); reader1->Update(); // Read input2 - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(Input2Filename); reader2->Update(); // Read input3 - ReaderType::Pointer reader3 = ReaderType::New(); + auto reader3 = ReaderType::New(); reader3->SetFileName(Input3Filename); reader3->Update(); // Read input4 - ReaderType::Pointer reader4 = ReaderType::New(); + auto reader4 = ReaderType::New(); reader4->SetFileName(Input4Filename); reader4->Update(); // Test ComposeRGBA filter - ComposeFilterType::Pointer filterCompose = ComposeFilterType::New(); + auto filterCompose = ComposeFilterType::New(); filterCompose->SetInput(0, reader1->GetOutput()); filterCompose->SetInput(1, reader2->GetOutput()); filterCompose->SetInput(2, reader3->GetOutput()); @@ -93,7 +93,7 @@ itkComposeRGBAImageFilterTest(int argc, char * argv[]) filterCompose->Update(); // Write output - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(OutputFilename); writer->SetInput(filterCompose->GetOutput()); writer->Update(); diff --git a/Modules/Filtering/ImageCompose/test/itkComposeRGBImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkComposeRGBImageFilterTest.cxx index 7da5c037c56..29e6f7aa3dd 100644 --- a/Modules/Filtering/ImageCompose/test/itkComposeRGBImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkComposeRGBImageFilterTest.cxx @@ -36,11 +36,11 @@ itkComposeRGBImageFilterTest(int, char *[]) using SizeType = InputImageType::SizeType; using IndexType = InputImageType::IndexType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - InputImageType::Pointer redImage = InputImageType::New(); - InputImageType::Pointer greenImage = InputImageType::New(); - InputImageType::Pointer blueImage = InputImageType::New(); + auto redImage = InputImageType::New(); + auto greenImage = InputImageType::New(); + auto blueImage = InputImageType::New(); SizeType size; size[0] = 2; diff --git a/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx b/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx index 400c7302904..1fff5e65e1e 100644 --- a/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkImageReadRealAndImaginaryWriteComplexTest.cxx @@ -56,11 +56,11 @@ itkImageReadRealAndImaginaryWriteComplexTest(int argc, char * argv[]) using RealAndImaginary2ComplexFilterType = itk::ComposeImageFilter; - ReaderType::Pointer readerReal = ReaderType::New(); - ReaderType::Pointer readerImag = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto readerReal = ReaderType::New(); + auto readerImag = ReaderType::New(); + auto writer = WriterType::New(); - RealAndImaginary2ComplexFilterType::Pointer RealAndImaginary2Complex = RealAndImaginary2ComplexFilterType::New(); + auto RealAndImaginary2Complex = RealAndImaginary2ComplexFilterType::New(); readerReal->SetFileName(argv[1]); readerImag->SetFileName(argv[2]); @@ -88,7 +88,7 @@ itkImageReadRealAndImaginaryWriteComplexTest(int argc, char * argv[]) // check that the default template parameters work using DefaultParametersFilterType = itk::ComposeImageFilter; - DefaultParametersFilterType::Pointer temp = DefaultParametersFilterType::New(); + auto temp = DefaultParametersFilterType::New(); if (temp.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/ImageCompose/test/itkImageToVectorImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkImageToVectorImageFilterTest.cxx index acd0d080180..d18da3b51e5 100644 --- a/Modules/Filtering/ImageCompose/test/itkImageToVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkImageToVectorImageFilterTest.cxx @@ -43,17 +43,17 @@ itkImageToVectorImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - FilterType::Pointer filter = FilterType::New(); - int f = 0; + auto filter = FilterType::New(); + int f = 0; for (int i = 1; i < argc - 1; ++i) { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[i]); reader->Update(); filter->SetInput(f++, reader->GetOutput()); } - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[argc - 1]); try diff --git a/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx index 75fc577b070..97783fa1440 100644 --- a/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkJoinImageFilterTest.cxx @@ -42,9 +42,9 @@ itkJoinImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create three images - myImageType1::Pointer inputImageA = myImageType1::New(); - myImageType2::Pointer inputImageB = myImageType2::New(); - myImageType3::Pointer inputImageC = myImageType3::New(); + auto inputImageA = myImageType1::New(); + auto inputImageB = myImageType2::New(); + auto inputImageC = myImageType3::New(); // Define their size, and start index mySizeType size; @@ -147,7 +147,7 @@ itkJoinImageFilterTest(int, char *[]) // // Setup a JoinImageFilter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); filter->SetInput1(inputImageA); filter->SetInput2(inputImageB); @@ -156,7 +156,7 @@ itkJoinImageFilterTest(int, char *[]) // // Setup a JoinImageFilter - myFilterType3::Pointer filter123 = myFilterType3::New(); + auto filter123 = myFilterType3::New(); filter123->SetInput1(filter->GetOutput()); filter123->SetInput2(inputImageC); filter123->Update(); // This Update will force filter to execute, then filter123 @@ -192,7 +192,7 @@ itkJoinImageFilterTest(int, char *[]) // // Setup a JoinImageFilter - myFilterType1::Pointer filter1 = myFilterType1::New(); + auto filter1 = myFilterType1::New(); filter1->SetInput1(inputImageB); filter1->SetInput2(inputImageA); filter1->Update(); @@ -215,7 +215,7 @@ itkJoinImageFilterTest(int, char *[]) // // Setup a JoinImageFilter - myFilterType2::Pointer filter2 = myFilterType2::New(); + auto filter2 = myFilterType2::New(); filter2->SetInput1(inputImageA); filter2->SetInput2(inputImageA); filter2->Update(); @@ -238,7 +238,7 @@ itkJoinImageFilterTest(int, char *[]) // // Setup a JoinImageFilter - myFilterType4::Pointer filter4 = myFilterType4::New(); + auto filter4 = myFilterType4::New(); filter4->SetInput1(inputImageB); filter4->SetInput2(inputImageB); filter4->Update(); diff --git a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterStreamingTest.cxx b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterStreamingTest.cxx index 32a0569a5a8..d87430c65ab 100644 --- a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterStreamingTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterStreamingTest.cxx @@ -46,7 +46,7 @@ itkJoinSeriesImageFilterStreamingTest(int argc, char * argv[]) std::string inputFileName = argv[1]; std::string outputFileName = argv[2]; - ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); reader->SetFileName(inputFileName); reader->UpdateOutputInformation(); @@ -60,14 +60,14 @@ itkJoinSeriesImageFilterStreamingTest(int argc, char * argv[]) std::vector savedPointers; - JoinSeriesFilterType::Pointer joinSeries = JoinSeriesFilterType::New(); + auto joinSeries = JoinSeriesFilterType::New(); joinSeries->SetOrigin(reader->GetOutput()->GetOrigin()[2]); joinSeries->SetSpacing(reader->GetOutput()->GetSpacing()[2]); for (ImageType::SizeValueType z = 0; z < numberOfSlices; ++z) { - SliceExtractorFilterType::Pointer extractor = SliceExtractorFilterType::New(); + auto extractor = SliceExtractorFilterType::New(); extractor->SetDirectionCollapseToSubmatrix(); SliceExtractorFilterType::InputImageRegionType slice(reader->GetOutput()->GetLargestPossibleRegion()); @@ -88,7 +88,7 @@ itkJoinSeriesImageFilterStreamingTest(int argc, char * argv[]) itk::PipelineMonitorImageFilter::Pointer monitor2 = itk::PipelineMonitorImageFilter::New(); monitor2->SetInput(joinSeries->GetOutput()); - ImageFileWriterType::Pointer writer = ImageFileWriterType::New(); + auto writer = ImageFileWriterType::New(); writer->SetInput(monitor2->GetOutput()); writer->SetFileName(outputFileName); writer->SetNumberOfStreamDivisions(numberOfSlices); diff --git a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx index c47ec53c4ae..eba292d9e5f 100644 --- a/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx +++ b/Modules/Filtering/ImageCompose/test/itkJoinSeriesImageFilterTest.cxx @@ -102,7 +102,7 @@ itkJoinSeriesImageFilterTest(int, char *[]) // Create the filter using JoinSeriesImageType = itk::JoinSeriesImageFilter; - JoinSeriesImageType::Pointer joinSeriesImage = JoinSeriesImageType::New(); + auto joinSeriesImage = JoinSeriesImageType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(joinSeriesImage, JoinSeriesImageFilter, ImageToImageFilter); @@ -133,13 +133,13 @@ itkJoinSeriesImageFilterTest(int, char *[]) // Test the ProgressReporter ShowProgressObject progressWatch(joinSeriesImage); using CommandType = itk::SimpleMemberCommand; - CommandType::Pointer command = CommandType::New(); + auto command = CommandType::New(); command->SetCallbackFunction(&progressWatch, &ShowProgressObject::ShowProgress); joinSeriesImage->AddObserver(itk::ProgressEvent(), command); // Test streaming using StreamingImageType = itk::StreamingImageFilter; - StreamingImageType::Pointer streamingImage = StreamingImageType::New(); + auto streamingImage = StreamingImageType::New(); streamingImage->SetInput(joinSeriesImage->GetOutput()); streamingImage->SetNumberOfStreamDivisions(streamDivisions); diff --git a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx index 97ad40f9db2..3aada608025 100644 --- a/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkCannyEdgeDetectionImageFilter.hxx @@ -197,12 +197,12 @@ CannyEdgeDetectionImageFilter::GenerateData() // Use grafting of the input and output of this filter to isolate // the mini-pipeline and other modifications from the pipeline. - typename InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->Graft(const_cast(this->GetInput())); // Allocate the output, and graft Superclass::AllocateOutputs(); - typename OutputImageType::Pointer output = OutputImageType::New(); + auto output = OutputImageType::New(); output->Graft(this->GetOutput()); this->m_OutputImage = output; diff --git a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx index cf9af2a8c89..87569451302 100644 --- a/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkDerivativeImageFilter.hxx @@ -112,7 +112,7 @@ DerivativeImageFilter::GenerateData() NeighborhoodOperatorImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Register the filter with the with progress accumulator using diff --git a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx index 4bf4fe903ac..0c25d8ee516 100644 --- a/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkDiscreteGaussianDerivativeImageFilter.hxx @@ -110,7 +110,7 @@ DiscreteGaussianDerivativeImageFilter::GenerateData() // Create an internal image to protect the input image's metdata // (e.g. RequestedRegion). The StreamingImageFilter changes the // requested region as poart of its normal provessing. - typename TInputImage::Pointer localInput = TInputImage::New(); + auto localInput = TInputImage::New(); localInput->Graft(this->GetInput()); // Type of the pixel to use for intermediate results @@ -142,7 +142,7 @@ DiscreteGaussianDerivativeImageFilter::GenerateData() oper.resize(ImageDimension); // Create a process accumulator for tracking the progress of minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Set up the operators diff --git a/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx index bd58b7a7287..e8eb09fa866 100644 --- a/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx @@ -172,7 +172,7 @@ HessianRecursiveGaussianImageFilter::GenerateData() // Create a process accumulator for tracking the progress of this // minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Compute the contribution of each filter to the total progress. diff --git a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx index dddd56170ce..e7a40ed6de1 100644 --- a/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkHoughTransform2DLinesImageFilter.hxx @@ -245,11 +245,11 @@ HoughTransform2DLinesImageFilter::GetLines() // Convert the accumulator output image type to internal image type. using CastImageFilterType = CastImageFilter; - const typename CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); + const auto castImageFilter = CastImageFilterType::New(); castImageFilter->SetInput(outputImage); using GaussianFilterType = DiscreteGaussianImageFilter; - const typename GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); + const auto gaussianFilter = GaussianFilterType::New(); // The output is the accumulator image. gaussianFilter->SetInput(castImageFilter->GetOutput()); @@ -258,7 +258,7 @@ HoughTransform2DLinesImageFilter::GetLines() const InternalImageType::Pointer postProcessImage = gaussianFilter->GetOutput(); using MinMaxCalculatorType = MinimumMaximumImageCalculator; - typename MinMaxCalculatorType::Pointer minMaxCalculator = MinMaxCalculatorType::New(); + auto minMaxCalculator = MinMaxCalculatorType::New(); itk::ImageRegionIterator it_input(postProcessImage, postProcessImage->GetLargestPossibleRegion()); diff --git a/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx index 36309e2c884..64563694360 100644 --- a/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkLaplacianImageFilter.hxx @@ -120,12 +120,12 @@ LaplacianImageFilter::GenerateData() oper.CreateOperator(); using NOIF = NeighborhoodOperatorImageFilter; - typename NOIF::Pointer filter = NOIF::New(); + auto filter = NOIF::New(); filter->OverrideBoundaryCondition(&nbc); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Register the filter with the with progress accumulator using diff --git a/Modules/Filtering/ImageFeature/include/itkLaplacianRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkLaplacianRecursiveGaussianImageFilter.hxx index 0bc7910c79c..878e95d5c41 100644 --- a/Modules/Filtering/ImageFeature/include/itkLaplacianRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkLaplacianRecursiveGaussianImageFilter.hxx @@ -141,7 +141,7 @@ LaplacianRecursiveGaussianImageFilter::GenerateData() m_DerivativeFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); // Create a process accumulator for tracking the progress of minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // dim^2 recursive gaussians + dim add filters + cast filter @@ -172,7 +172,7 @@ LaplacianRecursiveGaussianImageFilter::GenerateData() // The CastImageFilter is used because it is multithreaded and // it may perform no operation if the two images types are the same using CastFilterType = itk::CastImageFilter; - typename CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); // If the last filter is running in-place then this bulk data is not @@ -194,7 +194,7 @@ LaplacianRecursiveGaussianImageFilter::GenerateData() // allocate the add and scale image filter just for the scope of // this function! using AddFilterType = itk::BinaryGeneratorImageFilter; - typename AddFilterType::Pointer addFilter = AddFilterType::New(); + auto addFilter = AddFilterType::New(); addFilter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); // register with progress accumulator diff --git a/Modules/Filtering/ImageFeature/include/itkLaplacianSharpeningImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkLaplacianSharpeningImageFilter.hxx index 9f602650712..116f18098ad 100644 --- a/Modules/Filtering/ImageFeature/include/itkLaplacianSharpeningImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkLaplacianSharpeningImageFilter.hxx @@ -112,11 +112,11 @@ LaplacianSharpeningImageFilter::GenerateData() using NOIF = NeighborhoodOperatorImageFilter; ZeroFluxNeumannBoundaryCondition nbc; - typename NOIF::Pointer filter = NOIF::New(); + auto filter = NOIF::New(); filter->OverrideBoundaryCondition(static_cast(&nbc)); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Register the filter with the with progress accumulator using diff --git a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx index eb553ecffa0..89aa84cfcf0 100644 --- a/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkMaskFeaturePointSelectionFilter.hxx @@ -130,7 +130,7 @@ MaskFeaturePointSelectionFilter::GenerateData() // initialize selectionMap using MapPixelType = unsigned char; using SelectionMapType = Image; - typename SelectionMapType::Pointer selectionMap = SelectionMapType::New(); + auto selectionMap = SelectionMapType::New(); // The selectionMap only needs to have the same pixel grid of the input image, // but do not have to care about origin, spacing or orientation. diff --git a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx index 6f3b936a32f..c241f02b40b 100644 --- a/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkMultiScaleHessianBasedMeasureImageFilter.hxx @@ -55,8 +55,8 @@ MultiScaleHessianBasedMeasureImageFilterProcessObject::SetNumberOfRequiredOutputs(3); this->ProcessObject::SetNthOutput(1, scalesImage.GetPointer()); this->ProcessObject::SetNthOutput(2, hessianImage.GetPointer()); @@ -169,7 +169,7 @@ MultiScaleHessianBasedMeasureImageFilterSetMiniPipelineFilter(this); // prevent a divide by zero diff --git a/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx index 07a6f837bb8..ab679664624 100644 --- a/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkSobelEdgeDetectionImageFilter.hxx @@ -108,8 +108,8 @@ SobelEdgeDetectionImageFilter::GenerateData() // Setup mini-pipelines along each axis. typename OpFilter::Pointer opFilter[ImageDimension]; typename MultFilter::Pointer multFilter[ImageDimension]; - typename AddFilter::Pointer addFilter = AddFilter::New(); - typename SqrtFilter::Pointer sqrtFilter = SqrtFilter::New(); + auto addFilter = AddFilter::New(); + auto sqrtFilter = SqrtFilter::New(); for (i = 0; i < ImageDimension; ++i) { // Create the filters for this axis. diff --git a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.hxx index 8481c9ce15b..822d6ec5bad 100644 --- a/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkUnsharpMaskImageFilter.hxx @@ -71,9 +71,9 @@ template ::GenerateData() { - typename TInputImage::Pointer input = TInputImage::New(); + auto input = TInputImage::New(); input->Graft(const_cast(this->GetInput())); - typename GaussianType::Pointer gaussianF = GaussianType::New(); + auto gaussianF = GaussianType::New(); gaussianF->SetInput(input); gaussianF->SetSigmaArray(m_Sigmas); gaussianF->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -81,14 +81,14 @@ UnsharpMaskImageFilter::GenerateD using USMType = UnsharpMaskingFunctor; using BinaryFunctorType = BinaryGeneratorImageFilter; - typename BinaryFunctorType::Pointer functorF = BinaryFunctorType::New(); + auto functorF = BinaryFunctorType::New(); functorF->SetInput1(this->GetInput()); functorF->SetInput2(gaussianF->GetOutput()); USMType usmT(m_Amount, m_Threshold, m_Clamp); functorF->SetFunctor(usmT); functorF->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(gaussianF, 0.7); progress->RegisterInternalFilter(functorF, 0.3); diff --git a/Modules/Filtering/ImageFeature/include/itkZeroCrossingBasedEdgeDetectionImageFilter.hxx b/Modules/Filtering/ImageFeature/include/itkZeroCrossingBasedEdgeDetectionImageFilter.hxx index 45c7cebc670..ced9729e946 100644 --- a/Modules/Filtering/ImageFeature/include/itkZeroCrossingBasedEdgeDetectionImageFilter.hxx +++ b/Modules/Filtering/ImageFeature/include/itkZeroCrossingBasedEdgeDetectionImageFilter.hxx @@ -52,7 +52,7 @@ ZeroCrossingBasedEdgeDetectionImageFilter::GenerateDa ZeroCrossingImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Construct the mini-pipeline diff --git a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx index ced5952074c..615ae0fa252 100644 --- a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest2.cxx @@ -40,7 +40,7 @@ itkBilateralImageFilterTest2(int ac, char * av[]) // Create a filter using FilterType = itk::BilateralImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); filter->SetInput(input->GetOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest3.cxx b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest3.cxx index fb6042ec52c..31717cdef01 100644 --- a/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest3.cxx +++ b/Modules/Filtering/ImageFeature/test/itkBilateralImageFilterTest3.cxx @@ -39,11 +39,11 @@ itkBilateralImageFilterTest3(int ac, char * av[]) // Create a filter using FilterType = itk::BilateralImageFilter; - FilterType::Pointer filter1 = FilterType::New(); + auto filter1 = FilterType::New(); filter1->SetInput(input->GetOutput()); - FilterType::Pointer filter2 = FilterType::New(); + auto filter2 = FilterType::New(); filter2->SetInput(filter1->GetOutput()); - FilterType::Pointer filter3 = FilterType::New(); + auto filter3 = FilterType::New(); filter3->SetInput(filter2->GetOutput()); // Instead of using a single aggressive smoothing filter, use 3 diff --git a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx index f362a99fe5e..b680278351a 100644 --- a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest.cxx @@ -47,7 +47,7 @@ itkCannyEdgeDetectionImageFilterTest(int argc, char * argv[]) reader->SetFileName(argv[1]); // Set up the filter - CannyEdgeDetectionImageFilterType::Pointer filter = CannyEdgeDetectionImageFilterType::New(); + auto filter = CannyEdgeDetectionImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, CannyEdgeDetectionImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx index 5b30a872592..47e82ebd38e 100644 --- a/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFeature/test/itkCannyEdgeDetectionImageFilterTest2.cxx @@ -46,7 +46,7 @@ itkCannyEdgeDetectionImageFilterTest2(int argc, char * argv[]) reader->SetFileName(argv[1]); // Set up the filter - CannyEdgeDetectionImageFilterType::Pointer filter = CannyEdgeDetectionImageFilterType::New(); + auto filter = CannyEdgeDetectionImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, CannyEdgeDetectionImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx index 8a29df406f8..4b5f62b3481 100644 --- a/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDerivativeImageFilterTest.cxx @@ -48,13 +48,13 @@ itkDerivativeImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Define the filter using FilterType = itk::DerivativeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DerivativeImageFilter, ImageToImageFilter); @@ -93,8 +93,8 @@ itkDerivativeImageFilterTest(int argc, char * argv[]) using NormalizedWriterType = itk::ImageFileWriter; - NormalizeFilterType::Pointer normalizer = NormalizeFilterType::New(); - NormalizedWriterType::Pointer normalizedWriter = NormalizedWriterType::New(); + auto normalizer = NormalizeFilterType::New(); + auto normalizedWriter = NormalizedWriterType::New(); normalizer->SetInput(filter->GetOutput()); normalizedWriter->SetInput(normalizer->GetOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx index 91dd4198aa1..6c7d93103c6 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterScaleSpaceTest.cxx @@ -43,7 +43,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac double expectedMax = std::pow(double(order), order * 0.5) * std::exp(-0.5 * order); using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(imageSize); @@ -71,7 +71,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac } using GaussianFilterType = itk::DiscreteGaussianDerivativeImageFilter; - GaussianFilterType::Pointer filter = GaussianFilterType::New(); + auto filter = GaussianFilterType::New(); filter->SetInput(image); filter->SetVariance(itk::Math::sqr(sigmaMax)); diff --git a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx index 1f5e7f2056b..d3185de5476 100644 --- a/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkDiscreteGaussianDerivativeImageFilterTest.cxx @@ -57,14 +57,14 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using DerivativeFilterType = itk::DiscreteGaussianDerivativeImageFilter; - DerivativeFilterType::Pointer derivativeFilter = DerivativeFilterType::New(); + auto derivativeFilter = DerivativeFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(derivativeFilter, DiscreteGaussianDerivativeImageFilter, ImageToImageFilter); @@ -124,7 +124,7 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(itk::NumericTraits::min()); rescaler->SetOutputMaximum(itk::NumericTraits::max()); rescaler->SetInput(derivativeFilter->GetOutput()); @@ -132,7 +132,7 @@ itkDiscreteGaussianDerivativeImageFilterTest(int argc, char * argv[]) // Write the output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx index 5d3eb3b8420..267f4e4a10e 100644 --- a/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkGradientVectorFlowImageFilterTest.cxx @@ -51,9 +51,9 @@ itkGradientVectorFlowImageFilterTest(int, char *[]) using myVectorMagnitudeFilterType = itk::VectorMagnitudeImageFilter; // Create the image - myImageType::Pointer inputImage = myImageType::New(); - myImageType::Pointer interImage = myImageType::New(); - myImageType::Pointer inter1Image = myImageType::New(); + auto inputImage = myImageType::New(); + auto interImage = myImageType::New(); + auto inter1Image = myImageType::New(); // Define their size, and start index @@ -123,10 +123,10 @@ itkGradientVectorFlowImageFilterTest(int, char *[]) using myFilterType = itk::GradientRecursiveGaussianImageFilter; // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); - myGFilterType::Pointer gfilter = myGFilterType::New(); - myVectorMagnitudeFilterType::Pointer gtomfilter = myVectorMagnitudeFilterType::New(); + auto gfilter = myGFilterType::New(); + auto gtomfilter = myVectorMagnitudeFilterType::New(); // Connect the input images filter->SetInput(inputImage); @@ -139,8 +139,8 @@ itkGradientVectorFlowImageFilterTest(int, char *[]) std::cout << "Filter: " << filter; - myLaplacianFilterType::Pointer m_LFilter = myLaplacianFilterType::New(); - myGVFFilterType::Pointer m_GVFFilter = myGVFFilterType::New(); + auto m_LFilter = myLaplacianFilterType::New(); + auto m_GVFFilter = myGVFFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(m_GVFFilter, GradientVectorFlowImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx index 52dc4e3836c..ff558d0dc4f 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessian3DToVesselnessMeasureImageFilterTest.cxx @@ -40,7 +40,7 @@ itkHessian3DToVesselnessMeasureImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -105,10 +105,10 @@ itkHessian3DToVesselnessMeasureImageFilterTest(int, char *[]) // Create a Hessian Filter - myHessianFilterType::Pointer filterHessian = myHessianFilterType::New(); + auto filterHessian = myHessianFilterType::New(); // Create a vesselness Filter - myVesselnessFilterType::Pointer filterVesselness = myVesselnessFilterType::New(); + auto filterVesselness = myVesselnessFilterType::New(); // Connect the input images diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx index bbadb6b7d91..f7fd4b82751 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterScaleSpaceTest.cxx @@ -36,7 +36,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) using PointType = ImageType::PointType; using SpacingType = ImageType::SpacingType; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); SizeType size; size.Fill(21); @@ -96,7 +96,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) using HessianImageType = FilterType::OutputImageType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputImage); filter->SetSigma(objectSize); filter->SetNormalizeAcrossScale(true); @@ -153,7 +153,7 @@ itkHessianRecursiveGaussianFilterScaleSpaceTest(int, char *[]) using HessianImageType = FilterType::OutputImageType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputImage); filter->SetSigma(objectSize); filter->SetNormalizeAcrossScale(true); diff --git a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx index 6eb04ec4d2b..9460dc4b926 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianRecursiveGaussianFilterTest.cxx @@ -38,7 +38,7 @@ itkHessianRecursiveGaussianFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -100,7 +100,7 @@ itkHessianRecursiveGaussianFilterTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -138,7 +138,7 @@ itkHessianRecursiveGaussianFilterTest(int, char *[]) // the following just tests for warnings in 2D using my2DImageType = itk::Image; using my2DFilterType = itk::HessianRecursiveGaussianImageFilter; - my2DFilterType::Pointer test = my2DFilterType::New(); + auto test = my2DFilterType::New(); if (test.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx index 6cee3e74a11..34505ac982e 100644 --- a/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHessianToObjectnessMeasureImageFilterTest.cxx @@ -54,17 +54,17 @@ itkHessianToObjectnessMeasureImageFilterTest(int argc, char * argv[]) using ObjectnessFilterType = itk::HessianToObjectnessMeasureImageFilter; - FileReaderType::Pointer imageReader = FileReaderType::New(); + auto imageReader = FileReaderType::New(); imageReader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(imageReader->Update()); // Create a Gaussian filter - GaussianImageFilterType::Pointer gaussianFilter = GaussianImageFilterType::New(); + auto gaussianFilter = GaussianImageFilterType::New(); // Create an objectness filter - ObjectnessFilterType::Pointer objectnessFilter = ObjectnessFilterType::New(); + auto objectnessFilter = ObjectnessFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(objectnessFilter, HessianToObjectnessMeasureImageFilter, ImageToImageFilter); @@ -120,7 +120,7 @@ itkHessianToObjectnessMeasureImageFilterTest(int argc, char * argv[]) // Write the output image using FileWriterType = itk::ImageFileWriter; - FileWriterType::Pointer writer = FileWriterType::New(); + auto writer = FileWriterType::New(); writer->SetFileName(argv[2]); writer->UseCompressionOn(); writer->SetInput(objectnessFilter->GetOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx index 8f6f835b8b2..774629de631 100644 --- a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DCirclesImageTest.cxx @@ -55,7 +55,7 @@ Test_GetCircles_should_return_empty_list_when_NumberOfCircles_is_set_to_zero() using ImageType = itk::Image; // Create an image that has at least one circle. - const ImageType::Pointer image = ImageType::New(); + const auto image = ImageType::New(); const ImageType::SizeType size = { { 64, 64 } }; image->SetRegions(size); image->Allocate(true); @@ -65,7 +65,7 @@ Test_GetCircles_should_return_empty_list_when_NumberOfCircles_is_set_to_zero() using FilterType = itk::HoughTransform2DCirclesImageFilter; - const FilterType::Pointer filter = FilterType::New(); + const auto filter = FilterType::New(); filter->SetInput(image); filter->SetNumberOfCircles(0); @@ -89,10 +89,10 @@ Test_GetCircles_should_return_empty_list_when_input_image_is_uniform() using FilterType = itk::HoughTransform2DCirclesImageFilter; - const FilterType::Pointer filter = FilterType::New(); + const auto filter = FilterType::New(); // Create an input image for the filter. - const ImageType::Pointer image = ImageType::New(); + const auto image = ImageType::New(); const ImageType::SizeType size = { { 32, 32 } }; image->SetRegions(size); image->Allocate(); @@ -129,7 +129,7 @@ Test_RadiusImage_and_OutputImage_may_have_different_types() using InputImageType = itk::Image; // Create an image that has at least one circle. - const InputImageType::Pointer inputImage = InputImageType::New(); + const auto inputImage = InputImageType::New(); const InputImageType::SizeType size = { { 64, 64 } }; inputImage->SetRegions(size); inputImage->Allocate(); @@ -144,8 +144,8 @@ Test_RadiusImage_and_OutputImage_may_have_different_types() using FilterType1 = itk::HoughTransform2DCirclesImageFilter; using FilterType2 = itk::HoughTransform2DCirclesImageFilter; - const FilterType1::Pointer filter1 = FilterType1::New(); - const FilterType2::Pointer filter2 = FilterType2::New(); + const auto filter1 = FilterType1::New(); + const auto filter2 = FilterType2::New(); filter1->SetInput(inputImage); filter2->SetInput(inputImage); @@ -312,7 +312,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) using ImageType = itk::Image; // Create a black image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; @@ -352,21 +352,21 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) } // Allocate Hough Space image (accumulator) - ImageType::Pointer m_HoughSpaceImage = ImageType::New(); + auto m_HoughSpaceImage = ImageType::New(); m_HoughSpaceImage->SetRegions(region); m_HoughSpaceImage->Allocate(true); // initialize buffer to zero // Apply gradient filter to the input image using CastingFilterType = itk::CastImageFilter; - CastingFilterType::Pointer caster = CastingFilterType::New(); + auto caster = CastingFilterType::New(); caster->SetInput(image); // Define the HoughTransform filter using HoughTransformFilterType = itk::HoughTransform2DCirclesImageFilter; - HoughTransformFilterType::Pointer houghFilter = HoughTransformFilterType::New(); + auto houghFilter = HoughTransformFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(houghFilter, HoughTransform2DCirclesImageFilter, ImageToImageFilter); @@ -460,7 +460,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) // Blur the accumulator in order to find the maximum using GaussianFilterType = itk::DiscreteGaussianImageFilter; - GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); + auto gaussianFilter = GaussianFilterType::New(); gaussianFilter->SetInput(accumulator); double gaussianFilterVariance[Dimension]; gaussianFilterVariance[0] = variance; @@ -473,7 +473,7 @@ itkHoughTransform2DCirclesImageTest(int, char *[]) HoughImageType::Pointer postProcessImage = gaussianFilter->GetOutput(); using MinMaxCalculatorType = itk::MinimumMaximumImageCalculator; - MinMaxCalculatorType::Pointer minMaxCalculator = MinMaxCalculatorType::New(); + auto minMaxCalculator = MinMaxCalculatorType::New(); itk::ImageRegionIterator it_output(m_HoughSpaceImage, m_HoughSpaceImage->GetLargestPossibleRegion()); diff --git a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx index 0af02d47373..4e2b1b84c85 100644 --- a/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkHoughTransform2DLinesImageTest.cxx @@ -47,12 +47,12 @@ Test_GetLines_should_return_empty_list_when_input_image_is_entirely_black() using FilterType = itk::HoughTransform2DLinesImageFilter; // Create a black input image for the filter. - const ImageType::Pointer image = ImageType::New(); + const auto image = ImageType::New(); const ImageType::SizeType size = { { 32, 32 } }; image->SetRegions(size); image->Allocate(true); - const FilterType::Pointer filter = FilterType::New(); + const auto filter = FilterType::New(); filter->SetInput(image); filter->Update(); @@ -73,7 +73,7 @@ Test_GetLines_should_return_empty_list_when_NumberOfLines_is_set_to_zero() using ImageType = itk::Image; // Create an image. - const ImageType::Pointer image = ImageType::New(); + const auto image = ImageType::New(); enum { sizeX = 32, @@ -92,7 +92,7 @@ Test_GetLines_should_return_empty_list_when_NumberOfLines_is_set_to_zero() using FilterType = itk::HoughTransform2DLinesImageFilter; - const FilterType::Pointer filter = FilterType::New(); + const auto filter = FilterType::New(); filter->SetInput(image); filter->SetNumberOfLines(0); @@ -136,7 +136,7 @@ itkHoughTransform2DLinesImageTest(int, char *[]) // Create a line image with one line - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; @@ -178,27 +178,27 @@ itkHoughTransform2DLinesImageTest(int, char *[]) } // Allocate Hough Space image (accumulator) - HoughImageType::Pointer m_HoughSpaceImage = HoughImageType::New(); + auto m_HoughSpaceImage = HoughImageType::New(); m_HoughSpaceImage->SetRegions(region); m_HoughSpaceImage->Allocate(); // Apply gradient filter to the input image using CastingFilterType = itk::CastImageFilter; - CastingFilterType::Pointer caster = CastingFilterType::New(); + auto caster = CastingFilterType::New(); caster->SetInput(image); using GradientFilterType = itk::GradientMagnitudeImageFilter; - GradientFilterType::Pointer gradFilter = GradientFilterType::New(); + auto gradFilter = GradientFilterType::New(); gradFilter->SetInput(caster->GetOutput()); gradFilter->Update(); /// Apply a threshold to the Grad(InputImage) using ThresholdFilterType = itk::ThresholdImageFilter; - ThresholdFilterType::Pointer threshFilter = ThresholdFilterType::New(); + auto threshFilter = ThresholdFilterType::New(); threshFilter->SetInput(gradFilter->GetOutput()); threshFilter->SetOutsideValue(0); unsigned char lowerThreshold = 10; @@ -210,7 +210,7 @@ itkHoughTransform2DLinesImageTest(int, char *[]) // Define the HoughTransform filter using HoughTransformFilterType = itk::HoughTransform2DLinesImageFilter; - HoughTransformFilterType::Pointer houghFilter = HoughTransformFilterType::New(); + auto houghFilter = HoughTransformFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(houghFilter, HoughTransform2DLinesImageFilter, ImageToImageFilter); @@ -250,7 +250,7 @@ itkHoughTransform2DLinesImageTest(int, char *[]) // Blur the accumulator in order to find the maximum using GaussianFilterType = itk::DiscreteGaussianImageFilter; - GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); + auto gaussianFilter = GaussianFilterType::New(); gaussianFilter->SetInput(accumulator); double gaussianFilterVariance[Dimension]; gaussianFilterVariance[0] = variance; @@ -263,7 +263,7 @@ itkHoughTransform2DLinesImageTest(int, char *[]) HoughImageType::Pointer postProcessImage = gaussianFilter->GetOutput(); using MinMaxCalculatorType = itk::MinimumMaximumImageCalculator; - MinMaxCalculatorType::Pointer minMaxCalculator = MinMaxCalculatorType::New(); + auto minMaxCalculator = MinMaxCalculatorType::New(); itk::ImageRegionIterator it_output(m_HoughSpaceImage, m_HoughSpaceImage->GetLargestPossibleRegion()); diff --git a/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx index 84af037e555..ca02f18a523 100644 --- a/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkLaplacianImageFilterTest.cxx @@ -53,7 +53,7 @@ itkLaplacianImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -93,13 +93,13 @@ itkLaplacianImageFilterTest(int argc, char * argv[]) using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetOutput()); rescaler->SetOutputMinimum(itk::NumericTraits::min()); rescaler->SetOutputMaximum(itk::NumericTraits::max()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx index 4d8f19a3c62..de6b4ce4c2c 100644 --- a/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkLaplacianRecursiveGaussianImageFilterTest.cxx @@ -58,24 +58,24 @@ itkLaplacianRecursiveGaussianImageFilterTest(int argc, char * argv[]) { // Instantiate a 6D image for testing purposes using HighDImageType = itk::Image; using LaplacianFilterHighDType = itk::LaplacianRecursiveGaussianImageFilter; - LaplacianFilterHighDType::Pointer nDTest = LaplacianFilterHighDType::New(); + auto nDTest = LaplacianFilterHighDType::New(); } using ZeroCrossingFilter = itk::ZeroCrossingImageFilter; // Setting the IO - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); - CastToRealFilterType::Pointer toReal = CastToRealFilterType::New(); - CastToCharFilterType::Pointer toChar = CastToCharFilterType::New(); - RescaleFilter::Pointer rescale = RescaleFilter::New(); + auto toReal = CastToRealFilterType::New(); + auto toChar = CastToCharFilterType::New(); + auto rescale = RescaleFilter::New(); // Setting the ITK pipeline filter - LaplacianFilter::Pointer lapFilter = LaplacianFilter::New(); - itk::SimpleFilterWatcher watcher(lapFilter); - ZeroCrossingFilter::Pointer zeroFilter = ZeroCrossingFilter::New(); + auto lapFilter = LaplacianFilter::New(); + itk::SimpleFilterWatcher watcher(lapFilter); + auto zeroFilter = ZeroCrossingFilter::New(); reader->SetFileName(inputFilename); writer->SetFileName(outputFilename); diff --git a/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx index 41943eed68d..4ee24d3efe3 100644 --- a/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkMaskFeaturePointSelectionFilterTest.cxx @@ -52,11 +52,11 @@ itkMaskFeaturePointSelectionFilterTest(int argc, char * argv[]) using FilterType = itk::MaskFeaturePointSelectionFilter; // Set up the reader - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Set up filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); @@ -77,13 +77,13 @@ itkMaskFeaturePointSelectionFilterTest(int argc, char * argv[]) // Set up the writer using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using InputIteratorType = itk::ImageRegionConstIterator; InputIteratorType inputIterator(reader->GetOutput(), reader->GetOutput()->GetBufferedRegion()); using OutputIteratorType = itk::ImageRegionIterator; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->CopyInformation(reader->GetOutput()); outputImage->SetBufferedRegion(reader->GetOutput()->GetBufferedRegion()); outputImage->SetRequestedRegion(reader->GetOutput()->GetRequestedRegion()); diff --git a/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx index a51084bdc85..40c1efefb06 100644 --- a/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkMultiScaleHessianBasedMeasureImageFilterTest.cxx @@ -62,7 +62,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) using MultiScaleEnhancementFilterType = itk::MultiScaleHessianBasedMeasureImageFilter; - FileReaderType::Pointer imageReader = FileReaderType::New(); + auto imageReader = FileReaderType::New(); imageReader->SetFileName(argv[1]); try { @@ -74,7 +74,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - ObjectnessFilterType::Pointer objectnessFilter = ObjectnessFilterType::New(); + auto objectnessFilter = ObjectnessFilterType::New(); objectnessFilter->SetScaleObjectnessMeasure(false); objectnessFilter->SetBrightObject(true); objectnessFilter->SetAlpha(0.5); @@ -82,7 +82,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) objectnessFilter->SetGamma(5.0); - MultiScaleEnhancementFilterType::Pointer multiScaleEnhancementFilter = MultiScaleEnhancementFilterType::New(); + auto multiScaleEnhancementFilter = MultiScaleEnhancementFilterType::New(); multiScaleEnhancementFilter->SetInput(imageReader->GetOutput()); multiScaleEnhancementFilter->SetHessianToMeasureFilter(objectnessFilter); multiScaleEnhancementFilter->SetSigmaStepMethodToLogarithmic(); @@ -175,7 +175,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) std::cerr << e << std::endl; } - FileWriterType::Pointer writer = FileWriterType::New(); + auto writer = FileWriterType::New(); writer->SetFileName(argv[2]); writer->UseCompressionOn(); writer->SetInput(multiScaleEnhancementFilter->GetOutput()); @@ -225,7 +225,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) std::cerr << e << std::endl; } - FileWriterType::Pointer writer2 = FileWriterType::New(); + auto writer2 = FileWriterType::New(); writer2->SetFileName(argv[9]); writer2->UseCompressionOn(); writer2->SetInput(multiScaleEnhancementFilter->GetOutput()); @@ -256,7 +256,7 @@ itkMultiScaleHessianBasedMeasureImageFilterTest(int argc, char * argv[]) std::cerr << e << std::endl; } - FileWriterType::Pointer writer3 = FileWriterType::New(); + auto writer3 = FileWriterType::New(); writer3->SetFileName(argv[10]); writer3->UseCompressionOn(); writer3->SetInput(multiScaleEnhancementFilter->GetScalesOutput()); diff --git a/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx index 2c284e08227..28a83107b52 100644 --- a/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkSimpleContourExtractorImageFilterTest.cxx @@ -52,14 +52,14 @@ itkSimpleContourExtractorImageFilterTest(int argc, char * argv[]) using FilterType = itk::SimpleContourExtractorImageFilter; // Create the reader and writer - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SimpleContourExtractorImageFilter, BoxImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx index 877df9ea33f..ccf3d07656e 100644 --- a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTest.cxx @@ -34,7 +34,7 @@ RunTest(int argc, char * argv[]) using InImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -42,11 +42,11 @@ RunTest(int argc, char * argv[]) using OutImageType = itk::Image; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); using FilterType = itk::UnsharpMaskImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // this does not work from within a templated method (GCC gives an error) // ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, UnsharpMaskImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx index 01906f51f85..aafab454d59 100644 --- a/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx +++ b/Modules/Filtering/ImageFeature/test/itkUnsharpMaskImageFilterTestSimple.cxx @@ -42,7 +42,7 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -89,7 +89,7 @@ itkUnsharpMaskImageFilterTestSimple(int, char *[]) using GradientImageType = UnsharpMaskImageFilterFilterType::OutputImageType; // Create the filter - UnsharpMaskImageFilterFilterType::Pointer filter = UnsharpMaskImageFilterFilterType::New(); + auto filter = UnsharpMaskImageFilterFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, UnsharpMaskImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx index 554b0321b40..4634f6a727b 100644 --- a/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkZeroCrossingBasedEdgeDetectionImageFilterTest.cxx @@ -37,7 +37,7 @@ itkZeroCrossingBasedEdgeDetectionImageFilterTest(int argc, char * argv[]) // Set up filter using FilterType = itk::ZeroCrossingBasedEdgeDetectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ZeroCrossingBasedEdgeDetectionImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx b/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx index ba671090955..0034c0f6f16 100644 --- a/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx +++ b/Modules/Filtering/ImageFeature/test/itkZeroCrossingImageFilterTest.cxx @@ -39,7 +39,7 @@ itkZeroCrossingImageFilterTest(int, char *[]) using FilterType = itk::ZeroCrossingImageFilter; // Set up filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ZeroCrossingImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageFilterBase/include/itkBinaryFunctorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkBinaryFunctorImageFilter.hxx index 4efada58e10..3348b720325 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkBinaryFunctorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkBinaryFunctorImageFilter.hxx @@ -57,7 +57,7 @@ void BinaryFunctorImageFilter::SetInput1( const Input1ImagePixelType & input1) { - typename DecoratedInput1ImagePixelType::Pointer newInput = DecoratedInput1ImagePixelType::New(); + auto newInput = DecoratedInput1ImagePixelType::New(); newInput->Set(input1); this->SetInput1(newInput); } @@ -105,7 +105,7 @@ void BinaryFunctorImageFilter::SetInput2( const Input2ImagePixelType & input2) { - typename DecoratedInput2ImagePixelType::Pointer newInput = DecoratedInput2ImagePixelType::New(); + auto newInput = DecoratedInput2ImagePixelType::New(); newInput->Set(input2); this->SetInput2(newInput); } diff --git a/Modules/Filtering/ImageFilterBase/include/itkBinaryGeneratorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkBinaryGeneratorImageFilter.hxx index e15440a04e5..17ea05f505a 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkBinaryGeneratorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkBinaryGeneratorImageFilter.hxx @@ -56,7 +56,7 @@ template void BinaryGeneratorImageFilter::SetInput1(const Input1ImagePixelType & input1) { - typename DecoratedInput1ImagePixelType::Pointer newInput = DecoratedInput1ImagePixelType::New(); + auto newInput = DecoratedInput1ImagePixelType::New(); newInput->Set(input1); this->SetInput1(newInput); } @@ -102,7 +102,7 @@ template void BinaryGeneratorImageFilter::SetInput2(const Input2ImagePixelType & input2) { - typename DecoratedInput2ImagePixelType::Pointer newInput = DecoratedInput2ImagePixelType::New(); + auto newInput = DecoratedInput2ImagePixelType::New(); newInput->Set(input2); this->SetInput2(newInput); } diff --git a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx index 880b2323c47..ef3d4d23fcf 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkMovingHistogramImageFilterBase.hxx @@ -49,7 +49,7 @@ MovingHistogramImageFilterBase::SetKernel(co // transform the structuring element in an image for an easier // access to the data using BoolImageType = Image; - typename BoolImageType::Pointer tmpSEImage = BoolImageType::New(); + auto tmpSEImage = BoolImageType::New(); tmpSEImage->SetRegions(kernel.GetSize()); tmpSEImage->Allocate(); RegionType tmpSEImageRegion = tmpSEImage->GetRequestedRegion(); diff --git a/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx b/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx index 4c4ba777b6c..fbe6ff08131 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkNullImageToImageFilterDriver.hxx @@ -138,7 +138,7 @@ NullImageToImageFilterDriver::Execute() }; // Set up input images - typename TInputImage::Pointer ip = TInputImage::New(); + auto ip = TInputImage::New(); typename TOutputImage::IndexType index; typename TOutputImage::RegionType region; diff --git a/Modules/Filtering/ImageFilterBase/include/itkTernaryGeneratorImageFilter.hxx b/Modules/Filtering/ImageFilterBase/include/itkTernaryGeneratorImageFilter.hxx index 74bee8457a8..cb78a5bcf67 100644 --- a/Modules/Filtering/ImageFilterBase/include/itkTernaryGeneratorImageFilter.hxx +++ b/Modules/Filtering/ImageFilterBase/include/itkTernaryGeneratorImageFilter.hxx @@ -56,7 +56,7 @@ void TernaryGeneratorImageFilter::SetInput1( const Input1ImagePixelType & input1) { - typename DecoratedInput1ImagePixelType::Pointer newInput = DecoratedInput1ImagePixelType::New(); + auto newInput = DecoratedInput1ImagePixelType::New(); newInput->Set(input1); this->SetInput1(newInput); } @@ -106,7 +106,7 @@ void TernaryGeneratorImageFilter::SetInput2( const Input2ImagePixelType & input2) { - typename DecoratedInput2ImagePixelType::Pointer newInput = DecoratedInput2ImagePixelType::New(); + auto newInput = DecoratedInput2ImagePixelType::New(); newInput->Set(input2); this->SetInput2(newInput); } @@ -157,7 +157,7 @@ void TernaryGeneratorImageFilter::SetInput3( const Input3ImagePixelType & input3) { - typename DecoratedInput3ImagePixelType::Pointer newInput = DecoratedInput3ImagePixelType::New(); + auto newInput = DecoratedInput3ImagePixelType::New(); newInput->Set(input3); this->SetInput3(newInput); } diff --git a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx index 5eb5a94e6d9..9f428eb025c 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx @@ -145,7 +145,7 @@ TestCastFromTo() using FilterType = itk::CastImageFilter; using SourceType = itk::RandomImageSource; - typename SourceType::Pointer randomValuesImageSource = SourceType::New(); + auto randomValuesImageSource = SourceType::New(); { typename InputImageType::SizeValueType randomSize[3] = { 18, 17, 23 }; randomValuesImageSource->SetSize(randomSize); @@ -179,7 +179,7 @@ TestCastFromTo() randomSourceImagePtr->SetPixel(Index400, std::numeric_limits::round_error()); } - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(randomSourceImagePtr); filter->UpdateLargestPossibleRegion(); @@ -283,7 +283,7 @@ TestVectorImageCast1() using FloatVectorImageType = itk::VectorImage; // Create a 1x3 image of 2D vectors - FloatVectorImageType::Pointer image = FloatVectorImageType::New(); + auto image = FloatVectorImageType::New(); const itk::Size<2> size{ { 1, 3 } }; const itk::Index<2> start{ { 0, 0 } }; @@ -300,7 +300,7 @@ TestVectorImageCast1() image->FillBuffer(vec); using CastImageFilterType = itk::CastImageFilter; - CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); + auto castImageFilter = CastImageFilterType::New(); castImageFilter->SetInput(image); castImageFilter->Update(); @@ -350,7 +350,7 @@ TestVectorImageCast2() using FloatVectorImageType = itk::VectorImage; // Create a 1x3 image of 2D vectors - FloatVectorImageType::Pointer image = FloatVectorImageType::New(); + auto image = FloatVectorImageType::New(); const itk::Size<2> size{ { 1, 3 } }; const itk::Index<2> start{ { 0, 0 } }; @@ -367,7 +367,7 @@ TestVectorImageCast2() image->FillBuffer(vec); using CastImageFilterType = itk::CastImageFilter; - CastImageFilterType::Pointer castImageFilter = CastImageFilterType::New(); + auto castImageFilter = CastImageFilterType::New(); castImageFilter->SetInput(image); castImageFilter->Update(); diff --git a/Modules/Filtering/ImageFilterBase/test/itkGeneratorImageFilterGTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkGeneratorImageFilterGTest.cxx index 4b4a885a589..723ecc4162f 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkGeneratorImageFilterGTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkGeneratorImageFilterGTest.cxx @@ -40,7 +40,7 @@ struct Utilities static typename ImageType::Pointer CreateImage() { - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(5); @@ -104,7 +104,7 @@ TEST(UnaryGeneratorImageFilter, SetGetBasic) using FilterType = itk::UnaryGeneratorImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); FilterType::ConstPointer constFilter = (const FilterType *)(filter.GetPointer()); @@ -122,7 +122,7 @@ TEST(BinaryGeneratorImageFilter, SetGetBasic) using FilterType = itk::BinaryGeneratorImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); @@ -151,7 +151,7 @@ TEST(TernaryGeneratorImageFilter, SetGetBasic) using FilterType = itk::TernaryGeneratorImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); diff --git a/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx index 90959f4fa99..352e9478b49 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkImageToImageFilterTest.cxx @@ -50,12 +50,12 @@ itkImageToImageFilterTest(int, char *[]) using FilterType = itk::ImageToImageFilterTestHelper; - InputImageType::Pointer inputImage1 = InputImageType::New(); - InputImageType::Pointer inputImage2 = InputImageType::New(); - InputImageType::Pointer inputImage3 = InputImageType::New(); - InputImageType::Pointer inputImage4 = InputImageType::New(); + auto inputImage1 = InputImageType::New(); + auto inputImage2 = InputImageType::New(); + auto inputImage3 = InputImageType::New(); + auto inputImage4 = InputImageType::New(); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->Print(std::cout); std::cout << "Name of Class = " << filter->GetNameOfClass() << std::endl; diff --git a/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx index 0c5dacb30e9..6dfb360d882 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkMaskNeighborhoodOperatorImageFilterTest.cxx @@ -46,8 +46,8 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[]) // create a mask the size of the input file using MaskImageType = itk::Image; - MaskImageType::Pointer mask1 = MaskImageType::New(); - MaskImageType::Pointer mask2 = MaskImageType::New(); + auto mask1 = MaskImageType::New(); + auto mask2 = MaskImageType::New(); MaskImageType::RegionType region; MaskImageType::SizeType size; MaskImageType::IndexType index; @@ -99,7 +99,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[]) sobelVertical.SetDirection(1); sobelVertical.CreateDirectional(); - FilterType::Pointer filter1 = FilterType::New(); + auto filter1 = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter1, MaskNeighborhoodOperatorImageFilter, NeighborhoodOperatorImageFilter); @@ -108,7 +108,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[]) filter1->SetOperator(sobelHorizontal); filter1->UseDefaultValueOff(); - FilterType::Pointer filter2 = FilterType::New(); + auto filter2 = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter2, MaskNeighborhoodOperatorImageFilter, NeighborhoodOperatorImageFilter); @@ -118,7 +118,7 @@ itkMaskNeighborhoodOperatorImageFilterTest(int ac, char * av[]) filter2->UseDefaultValueOff(); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); rescaler->SetInput(filter2->GetOutput()); diff --git a/Modules/Filtering/ImageFusion/include/itkLabelMapContourOverlayImageFilter.hxx b/Modules/Filtering/ImageFusion/include/itkLabelMapContourOverlayImageFilter.hxx index 3f96ff43961..f1d21d64528 100644 --- a/Modules/Filtering/ImageFusion/include/itkLabelMapContourOverlayImageFilter.hxx +++ b/Modules/Filtering/ImageFusion/include/itkLabelMapContourOverlayImageFilter.hxx @@ -108,7 +108,7 @@ void LabelMapContourOverlayImageFilter::BeforeThreadedGenerateData() { using OBOType = ObjectByObjectLabelMapFilter; - typename OBOType::Pointer obo = OBOType::New(); + auto obo = OBOType::New(); obo->SetInput(this->GetInput()); SizeType rad = m_DilationRadius; for (unsigned int i = 0; i < ImageDimension; ++i) @@ -122,37 +122,37 @@ LabelMapContourOverlayImageFilter::Befor using InternalImageType = typename OBOType::InternalInputImageType; using KernelType = FlatStructuringElement; using DilateType = BinaryDilateImageFilter; - typename DilateType::Pointer dilate = DilateType::New(); + auto dilate = DilateType::New(); dilate->SetKernel(KernelType::Ball(m_DilationRadius)); obo->SetInputFilter(dilate); // using CastType = typename CastImageFilter< InternalImageType, InternalImageType, KernelType >; - // typename CastType::Pointer cast = CastType::New(); + // auto cast = CastType::New(); // cast->SetInPlace( false ); using ErodeType = BinaryErodeImageFilter; - typename ErodeType::Pointer erode = ErodeType::New(); + auto erode = ErodeType::New(); erode->SetKernel(KernelType::Ball(m_ContourThickness)); erode->SetInput(dilate->GetOutput()); using SubtractType = SubtractImageFilter; - typename SubtractType::Pointer sub = SubtractType::New(); + auto sub = SubtractType::New(); sub->SetInput(0, dilate->GetOutput()); sub->SetInput(1, erode->GetOutput()); using SliceType = SliceBySliceImageFilter; using SliceInternalImageType = typename SliceType::InternalInputImageType; - typename SliceType::Pointer slice = SliceType::New(); + auto slice = SliceType::New(); using SliceCastType = CastImageFilter; - typename SliceCastType::Pointer scast = SliceCastType::New(); + auto scast = SliceCastType::New(); scast->SetInPlace(false); slice->SetInputFilter(scast); using SliceKernelType = FlatStructuringElement; using SliceErodeType = BinaryErodeImageFilter; - typename SliceErodeType::Pointer serode = SliceErodeType::New(); + auto serode = SliceErodeType::New(); using RadiusType = typename SliceKernelType::RadiusType; RadiusType srad; srad.Fill(NumericTraits::ZeroValue()); @@ -168,7 +168,7 @@ LabelMapContourOverlayImageFilter::Befor serode->SetInput(scast->GetOutput()); using SliceSubtractType = SubtractImageFilter; - typename SliceSubtractType::Pointer ssub = SliceSubtractType::New(); + auto ssub = SliceSubtractType::New(); ssub->SetInput(0, scast->GetOutput()); ssub->SetInput(1, serode->GetOutput()); slice->SetOutputFilter(ssub); @@ -182,7 +182,7 @@ LabelMapContourOverlayImageFilter::Befor else if (m_Type == CONTOUR) { // using ContourType = BinaryContourImageFilter< InternalImageType, InternalImageType >; - // typename ContourType::Pointer contour = ContourType::New(); + // auto contour = ContourType::New(); // contour->SetInput( dilate->GetOutput() ); // obo->SetOutputFilter( contour ); obo->SetOutputFilter(sub); @@ -195,7 +195,7 @@ LabelMapContourOverlayImageFilter::Befor // using SliceInternalType = typename SliceType::InternalInputImageType; // using SliceContourType = BinaryContourImageFilter< SliceInternalType, SliceInternalType >; - // typename SliceContourType::Pointer slice_contour = SliceContourType::New(); + // auto slice_contour = SliceContourType::New(); // slice->SetFilter( slice_contour ); } else @@ -205,7 +205,7 @@ LabelMapContourOverlayImageFilter::Befor // choose which labels will be on top of the oters using UniqueType = LabelUniqueLabelMapFilter; - typename UniqueType::Pointer uniq = UniqueType::New(); + auto uniq = UniqueType::New(); uniq->SetInput(obo->GetOutput()); uniq->SetReverseOrdering(m_Priority == LOW_LABEL_ON_TOP); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx index b8353d9e640..e858596bb03 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest1.cxx @@ -39,18 +39,18 @@ itkLabelMapContourOverlayImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ColorizerType = itk::LabelMapContourOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); colorizer->SetOpacity(std::stod(argv[4])); @@ -66,7 +66,7 @@ itkLabelMapContourOverlayImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx index fb4ecc17059..b8edf47b763 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest2.cxx @@ -40,21 +40,21 @@ itkLabelMapContourOverlayImageFilterTest2(int argc, char * argv[]) using OType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // using RGBPixelType = itk::RGBPixel< unsigned char >; // using RGBImageType = itk::Image< RGBPixelType, dim >; using ColorizerType = itk::LabelMapContourOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); colorizer->SetOpacity(std::stod(argv[4])); @@ -70,7 +70,7 @@ itkLabelMapContourOverlayImageFilterTest2(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx index 2fb727b55de..009dc5180b1 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapContourOverlayImageFilterTest3.cxx @@ -39,18 +39,18 @@ itkLabelMapContourOverlayImageFilterTest3(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ColorizerType = itk::LabelMapContourOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); colorizer->SetOpacity(std::stod(argv[4])); @@ -74,7 +74,7 @@ itkLabelMapContourOverlayImageFilterTest3(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx index 0ad6bfcf446..c3f264c80f4 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest1.cxx @@ -40,21 +40,21 @@ itkLabelMapOverlayImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // using RGBPixelType = itk::RGBPixel< unsigned char >; // using RGBImageType = itk::Image< RGBPixelType, dim >; using ColorizerType = itk::LabelMapOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); @@ -65,7 +65,7 @@ itkLabelMapOverlayImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx index 1ff3ca5d4ec..4129669453b 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest2.cxx @@ -41,19 +41,19 @@ itkLabelMapOverlayImageFilterTest2(int argc, char * argv[]) using OType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ColorizerType = itk::LabelMapOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); colorizer->SetOpacity(std::stod(argv[4])); @@ -61,7 +61,7 @@ itkLabelMapOverlayImageFilterTest2(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx index 1ec44f0e5b5..738c66fa1f9 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapOverlayImageFilterTest3.cxx @@ -40,18 +40,18 @@ itkLabelMapOverlayImageFilterTest3(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ColorizerType = itk::LabelMapOverlayImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); colorizer->SetFeatureImage(reader2->GetOutput()); colorizer->SetOpacity(std::stod(argv[4])); @@ -68,7 +68,7 @@ itkLabelMapOverlayImageFilterTest3(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx index 5acf6b08181..a6200ab23b1 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest1.cxx @@ -40,24 +40,24 @@ itkLabelMapToRGBImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); // using RGBPixelType = itk::RGBPixel< unsigned char >; // using RGBImageType = itk::Image< RGBPixelType, dim >; using ColorizerType = itk::LabelMapToRGBImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx index ea74e823201..7e3ee737c63 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelMapToRGBImageFilterTest2.cxx @@ -41,21 +41,21 @@ itkLabelMapToRGBImageFilterTest2(int argc, char * argv[]) using OType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ConverterType = itk::LabelImageToLabelMapFilter; - ConverterType::Pointer converter = ConverterType::New(); + auto converter = ConverterType::New(); converter->SetInput(reader->GetOutput()); using ColorizerType = itk::LabelMapToRGBImageFilter; - ColorizerType::Pointer colorizer = ColorizerType::New(); + auto colorizer = ColorizerType::New(); colorizer->SetInput(converter->GetOutput()); itk::SimpleFilterWatcher watcher(colorizer, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(colorizer->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx b/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx index 5a2b73a8b94..105ae37e62b 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelOverlayImageFilterTest.cxx @@ -45,16 +45,16 @@ itkLabelOverlayImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; // Read in the input image - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Read in the label image - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // Instantiate the filter using FilterType = itk::LabelOverlayImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Exercising Background Value methods filter->SetBackgroundValue(10); @@ -91,7 +91,7 @@ itkLabelOverlayImageFilterTest(int argc, char * argv[]) // Instantiate output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[4]); diff --git a/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx b/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx index 2cef5a1f074..ddb9748c9fe 100644 --- a/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx +++ b/Modules/Filtering/ImageFusion/test/itkLabelToRGBImageFilterTest.cxx @@ -45,12 +45,12 @@ itkLabelToRGBImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; // Read in the input image - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Instantiate the filter using FilterType = itk::LabelToRGBImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, LabelToRGBImageFilter, UnaryFunctorImageFilter); @@ -77,7 +77,7 @@ itkLabelToRGBImageFilterTest(int argc, char * argv[]) // Instantiate output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeRecursiveGaussianImageFilter.hxx index 4b54ef6d43a..5f739ea332b 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkGradientMagnitudeRecursiveGaussianImageFilter.hxx @@ -189,7 +189,7 @@ GradientMagnitudeRecursiveGaussianImageFilter::Genera typename TOutputImage::Pointer outputImage(this->GetOutput()); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // If the last filter is running in-place then this bulk data is not @@ -200,7 +200,7 @@ GradientMagnitudeRecursiveGaussianImageFilter::Genera } - typename CumulativeImageType::Pointer cumulativeImage = CumulativeImageType::New(); + auto cumulativeImage = CumulativeImageType::New(); cumulativeImage->SetRegions(inputImage->GetBufferedRegion()); cumulativeImage->Allocate(); cumulativeImage->FillBuffer(NumericTraits::ZeroValue()); diff --git a/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx b/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx index 90566134a89..a0101d98a6e 100644 --- a/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/ImageGradient/include/itkGradientRecursiveGaussianImageFilter.hxx @@ -193,7 +193,7 @@ GradientRecursiveGaussianImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this // minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Compute the contribution of each filter to the total progress. diff --git a/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx b/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx index 87fe6b2c465..d95cb931ef5 100644 --- a/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkDifferenceOfGaussiansGradientTest.cxx @@ -49,7 +49,7 @@ itkDifferenceOfGaussiansGradientTest(int, char *[]) TImageType::PointValueType sourceImageOrigin[] = { 0, 0, 0 }; // Creates the sourceImage (but doesn't set the size or allocate memory) - TImageType::Pointer sourceImage = TImageType::New(); + auto sourceImage = TImageType::New(); sourceImage->SetOrigin(sourceImageOrigin); sourceImage->SetSpacing(sourceImageSpacing); @@ -91,7 +91,7 @@ itkDifferenceOfGaussiansGradientTest(int, char *[]) // Create and initialize a new sphere function - TFunctionType::Pointer spatialFunc = TFunctionType::New(); + auto spatialFunc = TFunctionType::New(); spatialFunc->SetRadius(5); TFunctionPositionType center; @@ -151,7 +151,7 @@ itkDifferenceOfGaussiansGradientTest(int, char *[]) // Create a differennce of gaussians gradient filter using TDOGFilterType = itk::DifferenceOfGaussiansGradientImageFilter; - TDOGFilterType::Pointer DOGFilter = TDOGFilterType::New(); + auto DOGFilter = TDOGFilterType::New(); itk::SimpleFilterWatcher watcher(DOGFilter); // We're filtering the output of the binomial filter @@ -171,7 +171,7 @@ itkDifferenceOfGaussiansGradientTest(int, char *[]) //-------------Test vector magnitude------------- using VectorMagType = itk::VectorMagnitudeImageFilter>; - VectorMagType::Pointer vectorMagFilter = VectorMagType::New(); + auto vectorMagFilter = VectorMagType::New(); vectorMagFilter->SetInput(gradientImage); vectorMagFilter->Update(); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest.cxx index ce92a06e3d6..a154ba011c4 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest.cxx @@ -47,7 +47,7 @@ itkGradientImageFilterTest(int argc, char * argv[]) // Set up filter - FilterType1::Pointer filter1 = FilterType1::New(); + auto filter1 = FilterType1::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter1, GradientImageFilter, ImageToImageFilter); @@ -85,7 +85,7 @@ itkGradientImageFilterTest(int argc, char * argv[]) using FilterType2 = itk::GradientImageFilter; - FilterType2::Pointer filter2 = FilterType2::New(); + auto filter2 = FilterType2::New(); using PeriodicBoundaryType = itk::PeriodicBoundaryCondition; // Test the OverrideBoundaryCondition setting; diff --git a/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest2.cxx b/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest2.cxx index 3895296b4dd..4737efa0651 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientImageFilterTest2.cxx @@ -36,17 +36,17 @@ DoIt(const std::string & infname, const std::string & outfname) using InputPixelType = typename InputImageType::PixelType; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(infname); using FilterType = itk::GradientImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); using OutputImageType = typename FilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(outfname); writer->SetNumberOfStreamDivisions(5); @@ -57,7 +57,7 @@ DoIt(const std::string & infname, const std::string & outfname) using VectorImageType = itk::VectorImage; using VectorFilterType = itk::GradientImageFilter; - typename VectorFilterType::Pointer vectorFilter = VectorFilterType::New(); + auto vectorFilter = VectorFilterType::New(); vectorFilter->SetInput(reader->GetOutput()); vectorFilter->Update(); @@ -120,7 +120,7 @@ itkGradientImageFilterTest2(int argc, char * argv[]) using TestImageType = itk::Image; using FilterType = itk::GradientImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, GradientImageFilter, ImageToImageFilter); const unsigned int dimension = iobase->GetNumberOfDimensions(); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx index 8ebc42cff43..cc8aed0f2d7 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientMagnitudeRecursiveGaussianFilterTest.cxx @@ -62,7 +62,7 @@ itkGradientMagnitudeRecursiveGaussianFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -142,7 +142,7 @@ itkGradientMagnitudeRecursiveGaussianFilterTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx index 7dcf174ad91..86a14019001 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterSpeedTest.cxx @@ -49,7 +49,7 @@ itkGradientRecursiveGaussianFilterSpeedTest(int argc, char * argv[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -110,7 +110,7 @@ itkGradientRecursiveGaussianFilterSpeedTest(int argc, char * argv[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx index 30d3aa1002b..031be9fbe3d 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest.cxx @@ -39,7 +39,7 @@ itkGradientRecursiveGaussianFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -102,7 +102,7 @@ itkGradientRecursiveGaussianFilterTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter); // Connect the input images @@ -148,7 +148,7 @@ itkGradientRecursiveGaussianFilterTest(int, char *[]) inputImage->SetDirection(direction); // Create a Filter - myFilterType::Pointer filter2 = myFilterType::New(); + auto filter2 = myFilterType::New(); filter2->SetInput(inputImage); filter2->SetSigma(2.5); filter2->Update(); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx index 7c78c30c5d5..1aa058da230 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest2.cxx @@ -42,7 +42,7 @@ itkGradientRecursiveGaussianFilterTest2(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -98,7 +98,7 @@ itkGradientRecursiveGaussianFilterTest2(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx index e147b42124e..caccb66d896 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest3.cxx @@ -56,7 +56,7 @@ itkGradientRecursiveGaussianFilterTest3Run(typename TImageType::PixelType & my using myRegionType = itk::ImageRegion; // Create the image - typename myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -116,7 +116,7 @@ itkGradientRecursiveGaussianFilterTest3Run(typename TImageType::PixelType & my using myGradientImageType = typename myFilterType::OutputImageType; // Create a Filter - typename myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images filter->SetInput(inputImage); @@ -136,7 +136,7 @@ itkGradientRecursiveGaussianFilterTest3Run(typename TImageType::PixelType & my // Write the output to file using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); writer->SetInput(outputImage); writer->Update(); diff --git a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx index 50272a5afc7..c02a94539bc 100644 --- a/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx +++ b/Modules/Filtering/ImageGradient/test/itkGradientRecursiveGaussianFilterTest4.cxx @@ -47,17 +47,17 @@ itkGradientRecursiveGaussianFilterTest4(int argc, char * argv[]) using myGradientImageType = itk::VectorImage; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); using myReaderType = itk::ImageFileReader; - myReaderType::Pointer reader = myReaderType::New(); + auto reader = myReaderType::New(); reader->SetFileName(inFileName); // Declare the type for the using myFilterType = itk::GradientRecursiveGaussianImageFilter; // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images filter->SetInput(reader->GetOutput()); @@ -66,7 +66,7 @@ itkGradientRecursiveGaussianFilterTest4(int argc, char * argv[]) filter->SetSigma(2.5); using myWriterType = itk::ImageFileWriter; - myWriterType::Pointer writer = myWriterType::New(); + auto writer = myWriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(outFileName); writer->Update(); diff --git a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx index bcf1004b041..8d6e2d9e614 100644 --- a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx +++ b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest1.cxx @@ -47,15 +47,15 @@ itkVectorGradientMagnitudeImageFilterTest1(int argc, char * argv[]) // Create a reader and filter using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using AdaptorType = itk::RGBToVectorImageAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetImage(reader->GetOutput()); using FilterType = itk::VectorGradientMagnitudeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, VectorGradientMagnitudeImageFilter, ImageToImageFilter); @@ -101,13 +101,13 @@ itkVectorGradientMagnitudeImageFilterTest1(int argc, char * argv[]) ITK_TEST_SET_GET_BOOLEAN(filter, UsePrincipleComponents, mode); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescale = RescaleFilterType::New(); + auto rescale = RescaleFilterType::New(); rescale->SetOutputMinimum(0); rescale->SetOutputMaximum(255); rescale->SetInput(filter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescale->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest2.cxx b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest2.cxx index 6cb0f80b968..acb06fa2323 100644 --- a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest2.cxx @@ -46,11 +46,11 @@ itkVectorGradientMagnitudeImageFilterTest2(int ac, char * av[]) } // Create a reader and filter - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetImage(reader->GetOutput()); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(adaptor); auto mode = static_cast(std::stoi(av[3])); @@ -66,12 +66,12 @@ itkVectorGradientMagnitudeImageFilterTest2(int ac, char * av[]) #endif ITK_TEST_SET_GET_BOOLEAN(filter, UsePrincipleComponents, mode); - RescaleFilterType::Pointer rescale = RescaleFilterType::New(); + auto rescale = RescaleFilterType::New(); rescale->SetOutputMinimum(0); rescale->SetOutputMaximum(255); rescale->SetInput(filter->GetOutput()); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(av[2]); try @@ -83,7 +83,7 @@ itkVectorGradientMagnitudeImageFilterTest2(int ac, char * av[]) extractedRegion.SetSize(2, 1); extractedRegion.SetIndex(2, ::std::stoi(av[4])); - CharImage2Type::Pointer extractedImage = CharImage2Type::New(); + auto extractedImage = CharImage2Type::New(); CharImage2Type::RegionType reg; reg.SetSize(0, extractedRegion.GetSize()[0]); reg.SetSize(1, extractedRegion.GetSize()[1]); diff --git a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest3.cxx b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest3.cxx index c9c342edaf9..ba183d23380 100644 --- a/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest3.cxx +++ b/Modules/Filtering/ImageGradient/test/itkVectorGradientMagnitudeImageFilterTest3.cxx @@ -42,17 +42,17 @@ itkVectorGradientMagnitudeImageFilterTest3(int ac, char * av[]) } // Create a reader and filter - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); - Monitor1Filter::Pointer monitor1 = Monitor1Filter::New(); + auto monitor1 = Monitor1Filter::New(); monitor1->SetInput(reader->GetOutput()); monitor1->ClearPipelineOnGenerateOutputInformationOff(); - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetImage(monitor1->GetOutput()); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(adaptor); auto mode = static_cast(std::stoi(av[3])); @@ -68,10 +68,10 @@ itkVectorGradientMagnitudeImageFilterTest3(int ac, char * av[]) #endif ITK_TEST_SET_GET_BOOLEAN(filter, UsePrincipleComponents, mode); - Monitor2Filter::Pointer monitor2 = Monitor2Filter::New(); + auto monitor2 = Monitor2Filter::New(); monitor2->SetInput(filter->GetOutput()); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(av[2]); writer->SetInput(monitor2->GetOutput()); writer->SetNumberOfStreamDivisions(4); diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx index 1ada0f90423..6b8b0402358 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.hxx @@ -199,7 +199,7 @@ BSplineControlPointImageFilter::DynamicThreadedGenera collapsedPhiLattices[i]->Allocate(); } using ImageDuplicatorType = ImageDuplicator; - typename ImageDuplicatorType::Pointer duplicator = ImageDuplicatorType::New(); + auto duplicator = ImageDuplicatorType::New(); duplicator->SetInputImage(inputPtr); duplicator->Update(); @@ -388,11 +388,11 @@ BSplineControlPointImageFilter::RefineControlPoi this->SetNumberOfLevels(numberOfLevels); using ImageDuplicatorType = ImageDuplicator; - typename ImageDuplicatorType::Pointer duplicator = ImageDuplicatorType::New(); + auto duplicator = ImageDuplicatorType::New(); duplicator->SetInputImage(this->GetInput()); duplicator->Update(); - typename ControlPointLatticeType::Pointer psiLattice = ControlPointLatticeType::New(); + auto psiLattice = ControlPointLatticeType::New(); psiLattice = duplicator->GetOutput(); for (unsigned int m = 1; m < this->m_MaximumNumberOfLevels; ++m) @@ -422,7 +422,7 @@ BSplineControlPointImageFilter::RefineControlPoi } } - typename ControlPointLatticeType::Pointer refinedLattice = ControlPointLatticeType::New(); + auto refinedLattice = ControlPointLatticeType::New(); refinedLattice->SetRegions(size); refinedLattice->Allocate(); PixelType data; @@ -541,7 +541,7 @@ BSplineControlPointImageFilter::RefineControlPoi } } } - typename ImageDuplicatorType::Pointer duplicator2 = ImageDuplicatorType::New(); + auto duplicator2 = ImageDuplicatorType::New(); duplicator2->SetInputImage(refinedLattice); duplicator2->Update(); psiLattice = duplicator2->GetOutput(); diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineDownsampleImageFilter.h b/Modules/Filtering/ImageGrid/include/itkBSplineDownsampleImageFilter.h index a35c4be8e48..81fe9897098 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineDownsampleImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkBSplineDownsampleImageFilter.h @@ -49,7 +49,7 @@ namespace itk * using DownsamplerType2D = itk::BSplineDownsampleImageFilter; * using UpsamplerType2D = itk::BSplineUpsampleImageFilter; * - * DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); + * auto downSampler = DownsamplerType2D::New(); * UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); * int splineOrder = 3; * downSampler->SetSplineOrder(splineOrder); diff --git a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx index 18231eb6707..ef2549e14a5 100644 --- a/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkBSplineScatteredDataPointSetToImageFilter.hxx @@ -343,7 +343,7 @@ BSplineScatteredDataPointSetToImageFilter::Generat } using ImageDuplicatorType = ImageDuplicator; - typename ImageDuplicatorType::Pointer duplicator = ImageDuplicatorType::New(); + auto duplicator = ImageDuplicatorType::New(); duplicator->SetInputImage(this->m_PsiLattice); duplicator->Update(); this->m_PhiLattice = duplicator->GetOutput(); @@ -598,7 +598,7 @@ BSplineScatteredDataPointSetToImageFilter::Threade collapsedPhiLattices[i]->Allocate(); } using ImageDuplicatorType = ImageDuplicator; - typename ImageDuplicatorType::Pointer duplicator = ImageDuplicatorType::New(); + auto duplicator = ImageDuplicatorType::New(); duplicator->SetInputImage(this->m_PhiLattice); duplicator->Update(); @@ -900,7 +900,7 @@ BSplineScatteredDataPointSetToImageFilter::RefineC } using ImageDuplicatorType = ImageDuplicator; - typename ImageDuplicatorType::Pointer duplicator = ImageDuplicatorType::New(); + auto duplicator = ImageDuplicatorType::New(); duplicator->SetInputImage(refinedLattice); duplicator->Update(); this->m_PsiLattice = duplicator->GetOutput(); diff --git a/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx index f3469cab569..3f0cc4fc2c3 100644 --- a/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkExpandImageFilter.hxx @@ -35,7 +35,7 @@ ExpandImageFilter::ExpandImageFilter() } // Setup the default interpolator - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_Interpolator = static_cast(interp.GetPointer()); this->DynamicMultiThreadingOn(); diff --git a/Modules/Filtering/ImageGrid/include/itkInterpolateImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkInterpolateImageFilter.hxx index c849fa0ecf8..6c786a57b41 100644 --- a/Modules/Filtering/ImageGrid/include/itkInterpolateImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkInterpolateImageFilter.hxx @@ -33,7 +33,7 @@ InterpolateImageFilter::InterpolateImageFilter() // Set default interpolator to linear using LinearInterpolatorType = LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); m_Interpolator = static_cast(interpolator.GetPointer()); diff --git a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.h b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.h index 55e49dfcee6..7af6b9ea3ea 100644 --- a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.h +++ b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.h @@ -86,7 +86,7 @@ namespace itk ImageType::Pointer ReadAnalyzeFile(const char *path) { itk::AnalyzeImageIO::Pointer io = itk::AnalyzeImageIO::New(); - ImageReaderType::Pointer fileReader = ImageReaderType::New(); + auto fileReader = ImageReaderType::New(); fileReader->SetImageIO(io); fileReader->SetFileName(path); fileReader->Update(); @@ -119,7 +119,7 @@ namespace itk ImageType::Pointer ReadAnalyzeFile(const char *path) { itk::AnalyzeImageIO::Pointer io = itk::AnalyzeImageIO::New(); - ImageReaderType::Pointer fileReader = ImageReaderType::New(); + auto fileReader = ImageReaderType::New(); fileReader->SetImageIO(io); fileReader->SetFileName(path); fileReader->Update(); diff --git a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx index 9f9bf8d4164..2aa12c2915d 100644 --- a/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkOrientImageFilter.hxx @@ -157,9 +157,9 @@ OrientImageFilter::GenerateInputRequestedRegion() using FlipFilterType = FlipImageFilter; using CastToOutputFilterType = CastImageFilter; - typename PermuteFilterType::Pointer permute = PermuteFilterType::New(); - typename FlipFilterType::Pointer flip = FlipFilterType::New(); - typename CastToOutputFilterType::Pointer cast = CastToOutputFilterType::New(); + auto permute = PermuteFilterType::New(); + auto flip = FlipFilterType::New(); + auto cast = CastToOutputFilterType::New(); permute->SetInput(inputPtr); permute->SetOrder(m_PermuteOrder); @@ -470,7 +470,7 @@ void OrientImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // No need to allocate the output since the minipipeline does it @@ -480,9 +480,9 @@ OrientImageFilter::GenerateData() using FlipFilterType = FlipImageFilter; using CastToOutputFilterType = CastImageFilter; - typename PermuteFilterType::Pointer permute = PermuteFilterType::New(); - typename FlipFilterType::Pointer flip = FlipFilterType::New(); - typename CastToOutputFilterType::Pointer cast = CastToOutputFilterType::New(); + auto permute = PermuteFilterType::New(); + auto flip = FlipFilterType::New(); + auto cast = CastToOutputFilterType::New(); progress->RegisterInternalFilter(permute, .3333333f); progress->RegisterInternalFilter(flip, .3333333f); @@ -566,9 +566,9 @@ OrientImageFilter::GenerateOutputInformation() using FlipFilterType = FlipImageFilter; using CastToOutputFilterType = CastImageFilter; - typename PermuteFilterType::Pointer permute = PermuteFilterType::New(); - typename FlipFilterType::Pointer flip = FlipFilterType::New(); - typename CastToOutputFilterType::Pointer cast = CastToOutputFilterType::New(); + auto permute = PermuteFilterType::New(); + auto flip = FlipFilterType::New(); + auto cast = CastToOutputFilterType::New(); permute->SetInput(inputPtr); permute->SetOrder(m_PermuteOrder); diff --git a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx index ea6087503f5..f0f6772f9ce 100644 --- a/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkResampleImageFilter.hxx @@ -84,7 +84,7 @@ ResampleImageFilter; - typename DecoratorType::Pointer decoratedInput = DecoratorType::New(); + auto decoratedInput = DecoratorType::New(); decoratedInput->Set(defaultTransform); this->ProcessObject::SetInput( "Transform", const_cast *>(decoratedInput.GetPointer())); diff --git a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx index c1ea4dace50..046a46b0077 100644 --- a/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkTileImageFilter.hxx @@ -43,7 +43,7 @@ template void TileImageFilter::GenerateData() { - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); TOutputImage * output = this->GetOutput(); @@ -96,7 +96,7 @@ TileImageFilter::GenerateData() // output image. The additional dimensions are set to 1. The // temporary image will use the same container as the input // image. This way we avoid copying the data. - typename TempImageType::Pointer tempImage = TempImageType::New(); + auto tempImage = TempImageType::New(); tempImage->CopyInformation(output); OutputSizeType tempSize; diff --git a/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx index 20391fd19f6..6eaf5a495a9 100644 --- a/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkWarpImageFilter.hxx @@ -46,7 +46,7 @@ WarpImageFilter::WarpImageFilter( m_EdgePaddingValue = NumericTraits::ZeroValue(m_EdgePaddingValue); m_OutputStartIndex.Fill(0); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_Interpolator = static_cast(interp.GetPointer()); m_DefFieldSameInformation = false; diff --git a/Modules/Filtering/ImageGrid/include/itkWarpVectorImageFilter.hxx b/Modules/Filtering/ImageGrid/include/itkWarpVectorImageFilter.hxx index 4c42acb9406..87190839a6d 100644 --- a/Modules/Filtering/ImageGrid/include/itkWarpVectorImageFilter.hxx +++ b/Modules/Filtering/ImageGrid/include/itkWarpVectorImageFilter.hxx @@ -42,7 +42,7 @@ WarpVectorImageFilter::WarpVector } // Setup default interpolator - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_Interpolator = static_cast(interp.GetPointer()); this->DynamicMultiThreadingOn(); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx index 31ce7bc3adb..620fe624bd0 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFilterTest.cxx @@ -33,7 +33,7 @@ BSpline(int argc, char * argv[]) using ScalarFieldType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); if (argc > 2) { reader->SetFileName(argv[2]); @@ -55,7 +55,7 @@ BSpline(int argc, char * argv[]) spacing.Fill(1.0); using BSplinerType = itk::BSplineControlPointImageFilter; - typename BSplinerType::Pointer bspliner = BSplinerType::New(); + auto bspliner = BSplinerType::New(); bspliner->SetInput(reader->GetOutput()); @@ -88,7 +88,7 @@ BSpline(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(bspliner->GetOutput()); writer->Update(); @@ -104,7 +104,7 @@ BSpline(int argc, char * argv[]) typename BSplinerType::ControlPointLatticeType::Pointer refinedControlPointLattice = bspliner->RefineControlPointLattice(numberOfRefinementLevels); - typename BSplinerType::Pointer bspliner2 = BSplinerType::New(); + auto bspliner2 = BSplinerType::New(); bspliner2->SetInput(refinedControlPointLattice); bspliner2->SetSplineOrder(3); bspliner2->SetSize(size); @@ -123,7 +123,7 @@ BSpline(int argc, char * argv[]) return EXIT_FAILURE; } - typename WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetFileName(argv[4]); writer2->SetInput(bspliner2->GetOutput()); writer2->Update(); @@ -148,7 +148,7 @@ itkBSplineControlPointImageFilterTest(int argc, char * argv[]) using ScalarFieldType = itk::Image; using BSplinerType = itk::BSplineControlPointImageFilter; - BSplinerType::Pointer bspliner = BSplinerType::New(); + auto bspliner = BSplinerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(bspliner, BSplineControlPointImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx index 28a0ba079a8..f6e0b5c84d8 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineControlPointImageFunctionTest.cxx @@ -33,7 +33,7 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) using VectorType = itk::Vector; using VectorImageType = itk::Image; - VectorImageType::Pointer phiLattice = VectorImageType::New(); + auto phiLattice = VectorImageType::New(); VectorImageType::SizeType size; VectorImageType::SpacingType spacing; @@ -61,7 +61,7 @@ itkBSplineControlPointImageFunctionTest(int, char *[]) phiLattice->SetPixel(index, value); using BSplinerType = itk::BSplineControlPointImageFunction; - BSplinerType::Pointer bspliner = BSplinerType::New(); + auto bspliner = BSplinerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(bspliner, BSplineControlPointImageFunction, ImageFunction); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx index daf48d51428..49c898d4ea1 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineDownsampleImageFilterTest.cxx @@ -53,15 +53,15 @@ itkBSplineDownsampleImageFilterTest(int argc, char * argv[]) using DownsamplerFilterType = itk::BSplineDownsampleImageFilter; - DownsamplerFilterType::Pointer filter = DownsamplerFilterType::New(); + auto filter = DownsamplerFilterType::New(); itk::SimpleFilterWatcher watcher(filter, "BSplineDownsampleImageFilter"); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx index 97d31f2711f..da81cf97baa 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineResampleImageFilterTest.cxx @@ -273,10 +273,10 @@ test2D_Standard_l2_NthOrderSpline_filter(unsigned int splineOrder) using DownsamplerType2D = itk::BSplineDownsampleImageFilter; using UpsamplerType2D = itk::BSplineUpsampleImageFilter; - DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); - itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Standard_l2_filter"); + auto downSampler = DownsamplerType2D::New(); + itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Standard_l2_filter"); - UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); + auto upSampler = UpsamplerType2D::New(); itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Standard_l2_filter"); downSampler->SetSplineOrder(splineOrder); @@ -343,10 +343,10 @@ test2D_Standard_L2_NthOrderSpline_filter(unsigned int splineOrder) using DownsamplerType2D = itk::BSplineDownsampleImageFilter; using UpsamplerType2D = itk::BSplineUpsampleImageFilter; - DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); - itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Standard_L2_filter"); + auto downSampler = DownsamplerType2D::New(); + itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Standard_L2_filter"); - UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); + auto upSampler = UpsamplerType2D::New(); itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Standard_L2_filter"); downSampler->SetSplineOrder(splineOrder); @@ -412,10 +412,10 @@ test2D_Centered_l2_NthOrderSpline_filter(unsigned int splineOrder) using DownsamplerType2D = itk::BSplineDownsampleImageFilter; using UpsamplerType2D = itk::BSplineUpsampleImageFilter; - DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); - itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Centered_l2_filter"); - UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); - itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Centered_l2_filter"); + auto downSampler = DownsamplerType2D::New(); + itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Centered_l2_filter"); + auto upSampler = UpsamplerType2D::New(); + itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Centered_l2_filter"); downSampler->SetSplineOrder(splineOrder); upSampler->SetSplineOrder(splineOrder); @@ -486,9 +486,9 @@ testIntInputDoubleOutput() using UpsamplerType2D = itk::BSplineUpsampleImageFilter; - DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); - UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); - int splineOrder = 3; + auto downSampler = DownsamplerType2D::New(); + auto upSampler = UpsamplerType2D::New(); + int splineOrder = 3; downSampler->SetSplineOrder(splineOrder); upSampler->SetSplineOrder(splineOrder); @@ -536,10 +536,10 @@ test2D_Centered_L2_NthOrderSpline_filter(unsigned int splineOrder) using DownsamplerType2D = itk::BSplineDownsampleImageFilter; using UpsamplerType2D = itk::BSplineUpsampleImageFilter; - DownsamplerType2D::Pointer downSampler = DownsamplerType2D::New(); - itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Centered_L2_filter"); - UpsamplerType2D::Pointer upSampler = UpsamplerType2D::New(); - itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Centered_L2_filter"); + auto downSampler = DownsamplerType2D::New(); + itk::SimpleFilterWatcher downWatcher(downSampler, "test2D_Centered_L2_filter"); + auto upSampler = UpsamplerType2D::New(); + itk::SimpleFilterWatcher upWatcher(upSampler, "test2D_Centered_L2_filter"); // int splineOrder = 2; downSampler->SetSplineOrder(splineOrder); upSampler->SetSplineOrder(splineOrder); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx index 23f75170755..f1d6b9adb0c 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest.cxx @@ -48,10 +48,10 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) using VectorImageType = itk::Image; using PointSetType = itk::PointSet; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -84,7 +84,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) // Instantiate the B-spline filter and set the desired parameters. using FilterType = itk::BSplineScatteredDataPointSetToImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); @@ -151,7 +151,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) // Write the output to an image. using RealImageType = itk::Image; - RealImageType::Pointer image = RealImageType::New(); + auto image = RealImageType::New(); image->SetRegions(reader->GetOutput()->GetLargestPossibleRegion()); image->Allocate(); itk::ImageRegionIteratorWithIndex Itt(image, image->GetLargestPossibleRegion()); @@ -162,7 +162,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx index 1cfe7e7d98a..fcc9185ed0f 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest2.cxx @@ -50,7 +50,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) using PointSetType = itk::PointSet; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); // Sample the helix for (RealType t = 0.0; t <= 1.0 + 1e-10; t += 0.05) @@ -72,7 +72,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) // Instantiate the filter and set the parameters using FilterType = itk::BSplineScatteredDataPointSetToImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); @@ -125,12 +125,12 @@ itkBSplineScatteredDataPointSetToImageFilterTest2(int argc, char * argv[]) // Cast the PhiLattice using CastImageFilterType = itk::CastImageFilter; - CastImageFilterType::Pointer caster = CastImageFilterType::New(); + auto caster = CastImageFilterType::New(); caster->SetInput(filter->GetPhiLattice()); // Write the PhiLattice using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx index d3c850bf2c4..0bf10ce17d5 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest3.cxx @@ -53,7 +53,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) using PointSetType = itk::PointSet; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); // Read the input points std::ifstream inputFile; @@ -89,7 +89,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) // Instantiate the filter and set the parameters using FilterType = itk::BSplineScatteredDataPointSetToImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); @@ -135,14 +135,14 @@ itkBSplineScatteredDataPointSetToImageFilterTest3(int argc, char * argv[]) // Cast the output image using CastImageFilterType = itk::CastImageFilter; - CastImageFilterType::Pointer caster = CastImageFilterType::New(); + auto caster = CastImageFilterType::New(); caster->SetInput(outputImage); // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx index ea21d87354c..b8eabe5bb0a 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest4.cxx @@ -58,11 +58,11 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) // Instantiate example corresponding points with relative weighting - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); pointSet->Initialize(); using WeightsContainerType = FilterType::WeightsContainerType; - WeightsContainerType::Pointer weights = WeightsContainerType::New(); + auto weights = WeightsContainerType::New(); weights->Initialize(); // Create first landmark pair and weights @@ -136,7 +136,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) // Now fit the displacement - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); @@ -175,7 +175,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) // Instantiate the BSpline transform using TransformType = itk::BSplineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); using CoefficientImageType = TransformType::ImageType; @@ -183,7 +183,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) for (unsigned int j = 0; j < DataDimension; ++j) { using SelectorType = itk::VectorIndexSelectionCastImageFilter; - SelectorType::Pointer selector = SelectorType::New(); + auto selector = SelectorType::New(); selector->SetInput(filter->GetPhiLattice()); selector->SetIndex(j); @@ -206,7 +206,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest4(int, char *[]) // the transform should produce using InterpolatorType = itk::VectorLinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(filter->GetOutput()); VectorImageType::PointType testPoint; diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx index 4b95aedc8f0..4bdf212c9ca 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineScatteredDataPointSetToImageFilterTest5.cxx @@ -53,7 +53,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) using PointSetType = itk::PointSet; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); // Sample the trefoil knot. // The first parametric dimension, u, is doing the knot part @@ -80,7 +80,7 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) // Instantiate the filter and set the parameters using FilterType = itk::BSplineScatteredDataPointSetToImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BSplineScatteredDataPointSetToImageFilter, PointSetToImageFilter); @@ -120,12 +120,12 @@ itkBSplineScatteredDataPointSetToImageFilterTest5(int argc, char * argv[]) // Cast the PhiLattice using CastImageFilterType = itk::CastImageFilter; - CastImageFilterType::Pointer caster = CastImageFilterType::New(); + auto caster = CastImageFilterType::New(); caster->SetInput(filter->GetPhiLattice()); // Write the PhiLattice using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx index 7d25ecc840b..878076e84a8 100644 --- a/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBSplineUpsampleImageFilterTest.cxx @@ -53,15 +53,15 @@ itkBSplineUpsampleImageFilterTest(int argc, char * argv[]) using UpsamplerFilterType = itk::BSplineUpsampleImageFilter; - UpsamplerFilterType::Pointer filter = UpsamplerFilterType::New(); + auto filter = UpsamplerFilterType::New(); itk::SimpleFilterWatcher watcher(filter, "BSplineUpsampleImageFilter"); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest1.cxx b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest1.cxx index 8c28bf629f5..e62098c5f90 100644 --- a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest1.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest1.cxx @@ -29,7 +29,7 @@ itkBinShrinkImageFilterTest1(int, char *[]) // type alias to simplify the syntax using InputImageType = itk::Image; using OutputImageType = itk::Image; - InputImageType::Pointer sourceImage = InputImageType::New(); + auto sourceImage = InputImageType::New(); // fill in an image InputImageType::IndexType index = { { 100, 100 } }; @@ -51,11 +51,11 @@ itkBinShrinkImageFilterTest1(int, char *[]) // assemple pipeline using InputMonitorFilterType = itk::PipelineMonitorImageFilter; - InputMonitorFilterType::Pointer monitor1 = InputMonitorFilterType::New(); + auto monitor1 = InputMonitorFilterType::New(); monitor1->SetInput(sourceImage); using BinShrinkFilterType = itk::BinShrinkImageFilter; - BinShrinkFilterType::Pointer bin = BinShrinkFilterType::New(); + auto bin = BinShrinkFilterType::New(); // Exercise some methods for coverage ITK_EXERCISE_BASIC_OBJECT_METHODS(bin, BinShrinkImageFilter, ImageToImageFilter); @@ -89,7 +89,7 @@ itkBinShrinkImageFilterTest1(int, char *[]) using OutputMonitorFilterType = itk::PipelineMonitorImageFilter; - OutputMonitorFilterType::Pointer monitor2 = OutputMonitorFilterType::New(); + auto monitor2 = OutputMonitorFilterType::New(); monitor2->SetInput(bin->GetOutput()); bool failed = false; diff --git a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx index 205b648213c..85186e2c156 100644 --- a/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkBinShrinkImageFilterTest2.cxx @@ -73,7 +73,7 @@ itkBinShrinkImageFilterTest2(int, char *[]) using ImageType = itk::Image; using SourceType = itk::PhysicalPointImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); SourceType::SizeValueType size[] = { 512, 509 }; source->SetSize(size); @@ -94,7 +94,7 @@ itkBinShrinkImageFilterTest2(int, char *[]) std::cout << "Testing with shrink factors:" << xf << " " << yf << std::endl; using FilterType = itk::BinShrinkImageFilter; - FilterType::Pointer shrink = FilterType::New(); + auto shrink = FilterType::New(); shrink->SetInput(source->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx index 17842e01684..754dbe84571 100644 --- a/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkChangeInformationImageFilterTest.cxx @@ -112,9 +112,9 @@ itkChangeInformationImageFilterTest(int, char *[]) using FilterType = itk::ChangeInformationImageFilter; using ArrayType = itk::FixedArray; - ImageType::Pointer inputImage = ImageType::New(); - ImageType::Pointer referenceImage = ImageType::New(); - FilterType::Pointer filter = FilterType::New(); + auto inputImage = ImageType::New(); + auto referenceImage = ImageType::New(); + auto filter = FilterType::New(); itk::SpacePrecisionType spacing[ImageDimension] = { 1, 2, 3 }; itk::SpacePrecisionType origin[ImageDimension] = { -100, -200, -300 }; diff --git a/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx index 5333b15e89e..1d67ece5bc0 100644 --- a/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkConstantPadImageTest.cxx @@ -30,7 +30,7 @@ itkConstantPadImageTest(int, char *[]) using FloatImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer image = ShortImage::New(); + auto image = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; @@ -53,7 +53,7 @@ itkConstantPadImageTest(int, char *[]) // Create a filter using PadFilterType = itk::ConstantPadImageFilter; - PadFilterType::Pointer constantPad = PadFilterType::New(); + auto constantPad = PadFilterType::New(); itk::SimpleFilterWatcher watch(constantPad); constantPad->SetInput(image); @@ -147,7 +147,7 @@ itkConstantPadImageTest(int, char *[]) // Create a stream using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer stream = StreamingFilter::New(); + auto stream = StreamingFilter::New(); stream->SetInput(constantPad->GetOutput()); stream->SetNumberOfStreamDivisions(2); diff --git a/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest.cxx b/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest.cxx index 36562647b33..fd07c0bcb7c 100644 --- a/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest.cxx @@ -26,7 +26,7 @@ int itkCoxDeBoorBSplineKernelFunctionTest(int, char *[]) { using KernelType = itk::CoxDeBoorBSplineKernelFunction<3>; - KernelType::Pointer kernel = KernelType::New(); + auto kernel = KernelType::New(); KernelType::MatrixType coefficients; /** diff --git a/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest2.cxx b/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest2.cxx index a563e271f23..4bcd3f2735e 100644 --- a/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCoxDeBoorBSplineKernelFunctionTest2.cxx @@ -25,9 +25,9 @@ int itkCoxDeBoorBSplineKernelFunctionTest2(int, char *[]) { using KernelType = itk::CoxDeBoorBSplineKernelFunction<3>; - KernelType::Pointer kernel = KernelType::New(); + auto kernel = KernelType::New(); - KernelType::Pointer kernelOrderMinus1 = KernelType::New(); + auto kernelOrderMinus1 = KernelType::New(); for (unsigned int order = 2; order <= 10; ++order) { diff --git a/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx b/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx index df65bfca716..0631657e926 100644 --- a/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCropImageFilter3DTest.cxx @@ -40,7 +40,7 @@ itkCropImageFilter3DTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx index fc2b2ebd20d..6aca0686a46 100644 --- a/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCropImageFilterTest.cxx @@ -34,7 +34,7 @@ itkCropImageFilterTest(int, char *[]) // Declare the types of the images using ImageType = itk::Image; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); // Fill in the image ImageType::IndexType index = { { 0, 0 } }; diff --git a/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx index aeaadfdc98e..8c753643deb 100644 --- a/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkCyclicShiftImageFilterTest.cxx @@ -40,7 +40,7 @@ itkCyclicShiftImageFilterTest(int argc, char * argv[]) using ChangeInfoFilterType = itk::ChangeInformationImageFilter; using CyclicShiftFilterType = itk::CyclicShiftImageFilter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Change the origin of the image to make sure we can handle that case. @@ -48,7 +48,7 @@ itkCyclicShiftImageFilterTest(int argc, char * argv[]) newOrigin[0] = -52; newOrigin[1] = 37; - ChangeInfoFilterType::Pointer changeInfoFilter = ChangeInfoFilterType::New(); + auto changeInfoFilter = ChangeInfoFilterType::New(); changeInfoFilter->ChangeRegionOn(); changeInfoFilter->SetOutputOffset(newOrigin); changeInfoFilter->SetInput(reader->GetOutput()); @@ -57,7 +57,7 @@ itkCyclicShiftImageFilterTest(int argc, char * argv[]) shift[0] = std::stoi(argv[2]); shift[1] = std::stoi(argv[3]); - CyclicShiftFilterType::Pointer shiftFilter = CyclicShiftFilterType::New(); + auto shiftFilter = CyclicShiftFilterType::New(); shiftFilter->SetShift(shift); shiftFilter->SetInput(changeInfoFilter->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx index 838a1ac82d5..5cf5980a023 100644 --- a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest.cxx @@ -90,7 +90,7 @@ itkExpandImageFilterTest(int, char *[]) ImageType::SizeType size = { { 64, 64 } }; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetLargestPossibleRegion(region); input->SetBufferedRegion(region); input->Allocate(); @@ -117,10 +117,10 @@ itkExpandImageFilterTest(int, char *[]) std::cout << "Run ExpandImageFilter in standalone mode with progress."; std::cout << std::endl; using ExpanderType = itk::ExpandImageFilter; - ExpanderType::Pointer expander = ExpanderType::New(); + auto expander = ExpanderType::New(); using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); expander->SetInterpolator(interpolator); std::cout << "Interpolator: " << expander->GetInterpolator() << std::endl; @@ -197,12 +197,12 @@ itkExpandImageFilterTest(int, char *[]) std::cout << std::endl; using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(expander->GetInput()); - ExpanderType::Pointer expander2 = ExpanderType::New(); + auto expander2 = ExpanderType::New(); expander2->SetInput(caster->GetOutput()); expander2->SetExpandFactors(expander->GetExpandFactors()); @@ -210,7 +210,7 @@ itkExpandImageFilterTest(int, char *[]) expander2->SetInterpolator(interpolator); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(expander2->GetOutput()); streamer->SetNumberOfStreamDivisions(3); streamer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx index c05a743ab9e..1e9b6a99bbe 100644 --- a/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkExpandImageFilterTest2.cxx @@ -148,7 +148,7 @@ typename TVectorImage::Pointer GetVectorTestImage(const typename TVectorImage::SizeType & size, const typename TVectorImage::VectorLengthType & nImages) { - typename TVectorImage::Pointer ans = TVectorImage::New(); + auto ans = TVectorImage::New(); typename TVectorImage::RegionType region; region.SetSize(size); @@ -200,10 +200,10 @@ itkExpandImageFilterTest2(int, char *[]) std::cout << PrintTestImage1D(input1D) << std::endl; using Expander1DType = itk::ExpandImageFilter; - Expander1DType::Pointer expander1D = Expander1DType::New(); + auto expander1D = Expander1DType::New(); using Interpolator1DType = itk::NearestNeighborInterpolateImageFunction; - Interpolator1DType::Pointer interpolator1D = Interpolator1DType::New(); + auto interpolator1D = Interpolator1DType::New(); expander1D->SetInterpolator(interpolator1D); unsigned int factors1[1] = { 2 }; @@ -248,10 +248,10 @@ itkExpandImageFilterTest2(int, char *[]) std::cout << PrintTestImage3D(input3D) << std::endl; using Expander3DType = itk::ExpandImageFilter; - Expander3DType::Pointer expander3D = Expander3DType::New(); + auto expander3D = Expander3DType::New(); using Interpolator3DType = itk::NearestNeighborInterpolateImageFunction; - Interpolator3DType::Pointer interpolator3D = Interpolator3DType::New(); + auto interpolator3D = Interpolator3DType::New(); expander3D->SetInterpolator(interpolator3D); unsigned int factors3[3] = { 1, 2, 1 }; diff --git a/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx index 7f02987458a..5e14002e953 100644 --- a/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkFlipImageFilterTest.cxx @@ -56,7 +56,7 @@ itkFlipImageFilterTest(int argc, char * argv[]) origin[1] = 0.4; origin[2] = 0.3; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->Allocate(); @@ -77,7 +77,7 @@ itkFlipImageFilterTest(int argc, char * argv[]) // Flip the image - FlipperType::Pointer flipper = FlipperType::New(); + auto flipper = FlipperType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(flipper, FlipImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageGrid/test/itkInterpolateImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkInterpolateImageFilterTest.cxx index a023fe52e4b..4c5bc7c7b38 100644 --- a/Modules/Filtering/ImageGrid/test/itkInterpolateImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkInterpolateImageFilterTest.cxx @@ -37,12 +37,12 @@ itkInterpolateImageFilterTest(int, char *[]) SizeType size; size.Fill(5); - InputImageType::Pointer image1 = InputImageType::New(); + auto image1 = InputImageType::New(); image1->SetRegions(size); image1->Allocate(); image1->FillBuffer(100); - InputImageType::Pointer image2 = InputImageType::New(); + auto image2 = InputImageType::New(); image2->SetRegions(size); image2->Allocate(); @@ -58,7 +58,7 @@ itkInterpolateImageFilterTest(int, char *[]) } using FilterType = itk::InterpolateImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput1(image1); filter->SetInput2(image2); diff --git a/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx index bb8b15fae9d..56aa610d215 100644 --- a/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkInterpolateImagePointsFilterTest.cxx @@ -142,7 +142,7 @@ test2DInterpolateImagePointsFilter() } // Initialize InterpolateImagePointsFilter - InterpolatorType2D::Pointer resamp = InterpolatorType2D::New(); + auto resamp = InterpolatorType2D::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(resamp, InterpolateImagePointsFilter, ImageToImageFilter); @@ -200,7 +200,7 @@ test3DInterpolateImagePointsFilter() ImageTypePtr3D image = set3DData(); // Initialize InterpolateImagePointsFilter and set input image - InterpolatorType3D::Pointer resamp = InterpolatorType3D::New(); + auto resamp = InterpolatorType3D::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(resamp, InterpolateImagePointsFilter, ImageToImageFilter); @@ -348,7 +348,7 @@ set3DData() { // Create a Gaussian image source using GaussianSourceType = itk::GaussianImageSource; - GaussianSourceType::Pointer pSource = GaussianSourceType::New(); + auto pSource = GaussianSourceType::New(); ImageType3D::SpacingValueType spacing[] = { 1.2f, 1.3f, 1.4f }; ImageType3D::PointValueType origin[] = { 1.0f, 4.0f, 2.0f }; diff --git a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx index fd560b74c96..d70b5195fe5 100644 --- a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageFilterTest.cxx @@ -33,17 +33,17 @@ RunTest(int argc, char * argv[]) using InImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using OutImageType = itk::Image; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); using Mirror = itk::MirrorPadImageFilter; - typename Mirror::Pointer filter = Mirror::New(); + auto filter = Mirror::New(); if (argc > 4) { diff --git a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageTest.cxx index ba60bfeb6be..97183b3168d 100644 --- a/Modules/Filtering/ImageGrid/test/itkMirrorPadImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkMirrorPadImageTest.cxx @@ -92,7 +92,7 @@ itkMirrorPadImageTest(int, char *[]) // type alias to simplify the syntax using SimpleImage = itk::Image; - SimpleImage::Pointer simpleImage = SimpleImage::New(); + auto simpleImage = SimpleImage::New(); std::cout << "Simple image spacing: " << simpleImage->GetSpacing()[0] << ", " << simpleImage->GetSpacing()[1] << std::endl; @@ -100,7 +100,7 @@ itkMirrorPadImageTest(int, char *[]) using ShortImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer if2 = ShortImage::New(); + auto if2 = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx index 09b7c713a3e..30e19242165 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest.cxx @@ -31,7 +31,7 @@ CreateRandomImage() ImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); img->SetLargestPossibleRegion(region); img->SetBufferedRegion(region); img->SetRequestedRegion(region); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx index f2b4c5e0c09..f86c386bac8 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientImageFilterTest2.cxx @@ -54,7 +54,7 @@ CreateAxialImage() ImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); img->SetLargestPossibleRegion(region); img->SetBufferedRegion(region); img->SetRequestedRegion(region); @@ -108,7 +108,7 @@ CreateCoronalImage() ImageType::RegionType region; region.SetSize(imageSize); region.SetIndex(imageIndex); - ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); img->SetLargestPossibleRegion(region); img->SetBufferedRegion(region); img->SetRequestedRegion(region); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImage2DTest.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImage2DTest.cxx index 5bbfb367da3..daa3969d396 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImage2DTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImage2DTest.cxx @@ -44,7 +44,7 @@ itkOrientedImage2DTest(int ac, char * av[]) using PointType = ImageType::PointType; using IndexValueType = IndexType::IndexValueType; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); @@ -123,7 +123,7 @@ itkOrientedImage2DTest(int ac, char * av[]) using CentralDifferenceImageFunctionType = itk::CentralDifferenceImageFunction; - CentralDifferenceImageFunctionType::Pointer gradientHelper1 = CentralDifferenceImageFunctionType::New(); + auto gradientHelper1 = CentralDifferenceImageFunctionType::New(); gradientHelper1->SetInputImage(image); std::cout << std::endl; diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImage3DTest.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImage3DTest.cxx index 66a034f10b0..18f2d483f61 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImage3DTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImage3DTest.cxx @@ -44,7 +44,7 @@ itkOrientedImage3DTest(int ac, char * av[]) using IndexType = ImageType::IndexType; using IndexValueType = IndexType::IndexValueType; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); @@ -131,7 +131,7 @@ itkOrientedImage3DTest(int ac, char * av[]) using CentralDifferenceImageFunctionType = itk::CentralDifferenceImageFunction; - CentralDifferenceImageFunctionType::Pointer gradientHelper1 = CentralDifferenceImageFunctionType::New(); + auto gradientHelper1 = CentralDifferenceImageFunctionType::New(); gradientHelper1->SetInputImage(image); std::cout << std::endl; diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImageAdaptorTest.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImageAdaptorTest.cxx index f93728b3aff..570820d51e8 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImageAdaptorTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImageAdaptorTest.cxx @@ -71,7 +71,7 @@ itkOrientedImageAdaptorTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - myImageType::Pointer myImage = myImageType::New(); + auto myImage = myImageType::New(); myImage->SetLargestPossibleRegion(region); @@ -105,7 +105,7 @@ itkOrientedImageAdaptorTest(int, char *[]) ++it1; } - myRedAdaptorType::Pointer myAdaptor = myRedAdaptorType::New(); + auto myAdaptor = myRedAdaptorType::New(); myAdaptor->SetImage(myImage); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest1.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest1.cxx index 21a2cf4fa7f..a66a32dea04 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest1.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest1.cxx @@ -45,7 +45,7 @@ itkOrientedImageProfileTest1(int, char *[]) region.SetIndex(start); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest2.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest2.cxx index 32850cd4bb0..e4de8651153 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest2.cxx @@ -49,7 +49,7 @@ itkOrientedImageProfileTest2(int, char *[]) region.SetIndex(start); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); diff --git a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest3.cxx b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest3.cxx index 9300858f3ae..45e96c5f3b9 100644 --- a/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkOrientedImageProfileTest3.cxx @@ -50,7 +50,7 @@ itkOrientedImageProfileTest3(int, char *[]) region.SetIndex(start); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetVectorLength(2); image->SetRegions(region); diff --git a/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx index 33ba29f6a5c..a2f6ac7cb06 100644 --- a/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPadImageFilterTest.cxx @@ -27,7 +27,7 @@ itkPadImageFilterTest(int, char *[]) using SizeValueType = ShortImage::SizeValueType; using FilterType = itk::PadImageFilter; - FilterType::Pointer padFilter = FilterType::New(); + auto padFilter = FilterType::New(); SizeType lowerBound = { { 1, 2 } }; SizeType upperBound = { { 3, 4 } }; @@ -98,7 +98,7 @@ itkPadImageFilterTest(int, char *[]) } // Fill in a test image - ShortImage::Pointer inputImage = ShortImage::New(); + auto inputImage = ShortImage::New(); ShortImage::SizeType inputSize = { { 1, 1 } }; ShortImage::RegionType inputRegion(inputSize); inputImage->SetRegions(inputRegion); diff --git a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx index 75478d216c2..e142353cb91 100644 --- a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterGTest.cxx @@ -45,7 +45,7 @@ class PasteFixture : public ::testing::Test { using HashFilter = itk::Testing::HashImageFilter; - typename HashFilter::Pointer hasher = HashFilter::New(); + auto hasher = HashFilter::New(); hasher->SetInput(image); hasher->InPlaceOff(); hasher->Update(); @@ -78,7 +78,7 @@ class PasteFixture : public ::testing::Test static typename TImage::Pointer CreateImageT(unsigned int size = 100) { - typename TImage::Pointer image = TImage::New(); + auto image = TImage::New(); typename TImage::SizeType imageSize; imageSize.Fill(size); diff --git a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx index 23f0ca7ca69..0ffd7ec23b1 100644 --- a/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPasteImageFilterTest.cxx @@ -51,7 +51,7 @@ itkPasteImageFilterTest(int argc, char * argv[]) // Create the filter using FilterType = itk::PasteImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PasteImageFilter, InPlaceImageFilter); @@ -84,10 +84,10 @@ itkPasteImageFilterTest(int argc, char * argv[]) // We'll tie this to a streamer to really exercise the paste code using SplitterType = itk::ImageRegionSplitterMultidimensional; - SplitterType::Pointer splitter = SplitterType::New(); + auto splitter = SplitterType::New(); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(filter->GetOutput()); streamer->SetNumberOfStreamDivisions(25); streamer->SetRegionSplitter(splitter); diff --git a/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx index 108f03251fd..04addabba70 100644 --- a/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPermuteAxesImageFilterTest.cxx @@ -60,7 +60,7 @@ itkPermuteAxesImageFilterTest(int, char *[]) double spacing[ImageDimension] = { 1.1, 1.2, 1.3, 1.4 }; double origin[ImageDimension] = { 0.5, 0.4, 0.3, 0.2 }; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->Allocate(); @@ -81,7 +81,7 @@ itkPermuteAxesImageFilterTest(int, char *[]) // permute the image - PermuterType::Pointer permuter = PermuterType::New(); + auto permuter = PermuterType::New(); unsigned int order[ImageDimension] = { 2, 0, 3, 1 }; permuter->SetOrder(order); diff --git a/Modules/Filtering/ImageGrid/test/itkPushPopTileImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkPushPopTileImageFilterTest.cxx index 5fb5351600b..fd4caf78df0 100644 --- a/Modules/Filtering/ImageGrid/test/itkPushPopTileImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkPushPopTileImageFilterTest.cxx @@ -53,11 +53,11 @@ itkPushPopTileImageFilterTest(int argc, char * argv[]) layout[1] = 1; // Tile the input images - TilerType::Pointer tiler1 = TilerType::New(); - TilerType::Pointer tiler2 = TilerType::New(); - TilerType::Pointer tiler3 = TilerType::New(); - TilerType::Pointer tiler4 = TilerType::New(); - TilerType::Pointer tiler = TilerType::New(); + auto tiler1 = TilerType::New(); + auto tiler2 = TilerType::New(); + auto tiler3 = TilerType::New(); + auto tiler4 = TilerType::New(); + auto tiler = TilerType::New(); unsigned char yellow[3] = { 255, 255, 127 }; itk::RGBPixel fillPixel = yellow; @@ -74,7 +74,7 @@ itkPushPopTileImageFilterTest(int argc, char * argv[]) int f = 0; for (int i = 1; i < argc - 1; ++i) { - ImageReaderType::Pointer reader = ImageReaderType::New(); + auto reader = ImageReaderType::New(); reader->SetFileName(argv[i]); reader->Update(); tiler1->SetInput(f, reader->GetOutput()); @@ -105,7 +105,7 @@ itkPushPopTileImageFilterTest(int argc, char * argv[]) tiler->PushBackInput(tiler3->GetOutput()); tiler->PushBackInput(tiler4->GetOutput()); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[argc - 1]); diff --git a/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx index 142fee14e61..f18a07df56d 100644 --- a/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkRegionOfInterestImageFilterTest.cxx @@ -40,11 +40,11 @@ itkRegionOfInterestImageFilterTest(int, char *[]) using IteratorType = itk::ImageRegionIterator; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RegionOfInterestImageFilter, ImageToImageFilter); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); IndexType start; start.Fill(0); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx index 026f8d8280c..a0a33be1dee 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest.cxx @@ -64,11 +64,11 @@ itkResampleImageTest(int, char *[]) } // Create an affine transformation - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->Scale(0.5); // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); // Create and configure a resampling filter diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx index a238d4a5dcc..edab35b2dd6 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2.cxx @@ -91,13 +91,13 @@ itkResampleImageTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); - WriterType::Pointer writer1 = WriterType::New(); - WriterType::Pointer writer2 = WriterType::New(); - WriterType::Pointer writer3 = WriterType::New(); - WriterType::Pointer writer4 = WriterType::New(); + auto writer1 = WriterType::New(); + auto writer2 = WriterType::New(); + auto writer3 = WriterType::New(); + auto writer4 = WriterType::New(); reader1->SetFileName(argv[1]); @@ -107,19 +107,19 @@ itkResampleImageTest2(int argc, char * argv[]) writer4->SetFileName(argv[6]); // Create an affine transformation - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->Scale(2.0); // Create a linear interpolation image function - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); // Create a nearest neighbor extrapolate image function - ExtrapolatorType::Pointer extrapolator = ExtrapolatorType::New(); + auto extrapolator = ExtrapolatorType::New(); // Create and configure a resampling filter using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(resample, ResampleImageFilter, ImageToImageFilter); @@ -221,7 +221,7 @@ itkResampleImageTest2(int argc, char * argv[]) // instead of LinearThreadedGenerateData. This will test that // we get the same results for both methods. std::cout << "Test with NonlinearAffineTransform." << std::endl; - NonlinearAffineTransformType::Pointer nonlinearAffineTransform = NonlinearAffineTransformType::New(); + auto nonlinearAffineTransform = NonlinearAffineTransformType::New(); nonlinearAffineTransform->Scale(2.0); resample->SetTransform(nonlinearAffineTransform); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx index e5f37809ac3..197445d695e 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest2Streaming.cxx @@ -88,13 +88,13 @@ itkResampleImageTest2Streaming(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); - WriterType::Pointer writer1 = WriterType::New(); - WriterType::Pointer writer2 = WriterType::New(); - WriterType::Pointer writer3 = WriterType::New(); - WriterType::Pointer writer4 = WriterType::New(); + auto writer1 = WriterType::New(); + auto writer2 = WriterType::New(); + auto writer3 = WriterType::New(); + auto writer4 = WriterType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -105,21 +105,21 @@ itkResampleImageTest2Streaming(int argc, char * argv[]) writer4->SetFileName(argv[6]); // Create an affine transformation - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->Scale(2.0); // Create a linear interpolation image function - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); // Create a nearest neighbor extrapolate image function - ExtrapolatorType::Pointer extrapolator = ExtrapolatorType::New(); + auto extrapolator = ExtrapolatorType::New(); // Create and configure a resampling filter using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); using MonitorFilterType = itk::PipelineMonitorImageFilter; - MonitorFilterType::Pointer monitor = MonitorFilterType::New(); + auto monitor = MonitorFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(resample, ResampleImageFilter, ImageToImageFilter); @@ -171,7 +171,7 @@ itkResampleImageTest2Streaming(int argc, char * argv[]) // instead of LinearThreadedGenerateData. This will test that // we get the same results for both methods. std::cout << "Test with NonlinearAffineTransform." << std::endl; - NonlinearAffineTransformType::Pointer nonlinearAffineTransform = NonlinearAffineTransformType::New(); + auto nonlinearAffineTransform = NonlinearAffineTransformType::New(); nonlinearAffineTransform->Scale(2.0); resample->SetTransform(nonlinearAffineTransform); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx index c43c0e1ef8f..81a9602f0a8 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest3.cxx @@ -57,15 +57,15 @@ itkResampleImageTest3(int argc, char * argv[]) using ChangeInfoType = itk::ChangeInformationImageFilter; using ResampleFilterType = itk::ResampleImageFilter; - ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); reader1->Update(); // Create an identity transformation - TransformType::Pointer identityTransform = TransformType::New(); + auto identityTransform = TransformType::New(); // Create a linear interpolation image function - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); // Create an image with flipped directions ImageType::DirectionType direction; @@ -78,7 +78,7 @@ itkResampleImageTest3(int argc, char * argv[]) origin[0] = inputRegion.GetSize()[0]; origin[1] = inputRegion.GetSize()[1]; - ChangeInfoType::Pointer changeInfo = ChangeInfoType::New(); + auto changeInfo = ChangeInfoType::New(); changeInfo->ChangeDirectionOn(); changeInfo->SetOutputDirection(direction); changeInfo->ChangeOriginOn(); @@ -86,7 +86,7 @@ itkResampleImageTest3(int argc, char * argv[]) changeInfo->SetInput(reader1->GetOutput()); // Create and configure a resampling filter - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(resample, ResampleImageFilter, ImageToImageFilter); @@ -105,7 +105,7 @@ itkResampleImageTest3(int argc, char * argv[]) resample->SetInterpolator(interpolator); ITK_TEST_SET_GET_VALUE(interpolator, resample->GetInterpolator()); - WriterType::Pointer writer1 = WriterType::New(); + auto writer1 = WriterType::New(); writer1->SetFileName(argv[2]); writer1->SetInput(resample->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx index 29399cff77c..db2928af59a 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest4.cxx @@ -78,11 +78,11 @@ itkResampleImageTest4(int argc, char * argv[]) } // Create an affine transformation - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->Scale(0.9); // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); // Create and configure a resampling filter diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx index e4ddaecb53e..5be77abd41a 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest5.cxx @@ -85,11 +85,11 @@ itkResampleImageTest5(int argc, char * argv[]) } // Create an affine transformation - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->Scale(0.9); // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); // Create and configure a resampling filter @@ -130,7 +130,7 @@ itkResampleImageTest5(int argc, char * argv[]) std::cout << "Resampling from " << size << " to " << osize << " took " << clock.GetMean() << " s" << std::endl; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(resample->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx index 83990b53ddb..9ecdf2bf181 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest6.cxx @@ -94,11 +94,11 @@ itkResampleImageTest6(int argc, char * argv[]) std::cout << "Done." << std::endl; // Create an affine transformation - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->Scale(0.9); // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); // Create and configure a resampling filter @@ -141,7 +141,7 @@ itkResampleImageTest6(int argc, char * argv[]) std::cout << "Resampling from " << size << " to " << osize << " took " << clock.GetMean() << " s" << std::endl; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(resample->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx index 4b0b84a3f9d..a1c54ad75a8 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest7.cxx @@ -68,11 +68,11 @@ itkResampleImageTest7(int, char *[]) } // Create an affine transformation - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->Scale(0.9); // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(image); // Create and configure a resampling filter @@ -109,7 +109,7 @@ itkResampleImageTest7(int, char *[]) ITK_TEST_SET_GET_VALUE(spacing, resample->GetOutputSpacing()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); std::cout << "Test with normal AffineTransform." << std::endl; streamer->SetInput(resample->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx index 3aafea5d947..242d3eea41b 100644 --- a/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx +++ b/Modules/Filtering/ImageGrid/test/itkResampleImageTest8.cxx @@ -165,7 +165,7 @@ itkResampleImageTest8(int, char *[]) } // Create an Project transformation - TransformType::Pointer tform = TransformType::New(); + auto tform = TransformType::New(); // OutputImagePointerType outputImage = OutputImageType::New(); OutputImageIndexType outputIndex = { { 0, 0, 0 } }; @@ -173,7 +173,7 @@ itkResampleImageTest8(int, char *[]) OutputImageRegionType outputRegion; // Create a linear interpolation image function - InterpolatorType::Pointer interp = InterpolatorType::New(); + auto interp = InterpolatorType::New(); interp->SetInputImage(inputImage); // Create and configure a resampling filter diff --git a/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx b/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx index 71d239875ff..af507ae45d5 100644 --- a/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkShrinkImageStreamingTest.cxx @@ -31,7 +31,7 @@ itkShrinkImageStreamingTest(int, char *[]) // type alias to simplify the syntax using ShortImage = itk::Image; - ShortImage::Pointer sourceImage = ShortImage::New(); + auto sourceImage = ShortImage::New(); using MonitorFilter = itk::PipelineMonitorImageFilter; @@ -60,7 +60,7 @@ itkShrinkImageStreamingTest(int, char *[]) caster->SetInput(sourceImage); - MonitorFilter::Pointer monitor1 = MonitorFilter::New(); + auto monitor1 = MonitorFilter::New(); monitor1->SetInput(caster->GetOutput()); // Create a filter, shrink by 2,3 @@ -72,7 +72,7 @@ itkShrinkImageStreamingTest(int, char *[]) shrink->SetShrinkFactors(factors); - MonitorFilter::Pointer monitor2 = MonitorFilter::New(); + auto monitor2 = MonitorFilter::New(); monitor2->SetInput(shrink->GetOutput()); itk::StreamingImageFilter::Pointer streamer; diff --git a/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx index 18ce25c765a..16edf292289 100644 --- a/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkShrinkImageTest.cxx @@ -32,7 +32,7 @@ itkShrinkImageTest(int, char *[]) // type alias to simplify the syntax using SimpleImage = itk::Image; - SimpleImage::Pointer simpleImage = SimpleImage::New(); + auto simpleImage = SimpleImage::New(); std::cout << "Simple image spacing: " << simpleImage->GetSpacing()[0] << ", " << simpleImage->GetSpacing()[1] << std::endl; std::cout << std::flush; @@ -41,7 +41,7 @@ itkShrinkImageTest(int, char *[]) using ShortImage = itk::Image; // Test the creation of an image with native type - ShortImage::Pointer if2 = ShortImage::New(); + auto if2 = ShortImage::New(); // fill in an image ShortImage::IndexType index = { { 0, 0 } }; diff --git a/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx index 7fdfa22969b..a25df8487d0 100644 --- a/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkSliceBySliceImageFilterTest.cxx @@ -66,23 +66,23 @@ itkSliceBySliceImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::SliceBySliceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->DebugOn(); filter->SetInput(reader->GetOutput()); using MedianType = itk::MedianImageFilter; - MedianType::Pointer median = MedianType::New(); + auto median = MedianType::New(); filter->SetFilter(median); using MonitorType = itk::PipelineMonitorImageFilter; - MonitorType::Pointer monitor = MonitorType::New(); + auto monitor = MonitorType::New(); itk::CStyleCommand::Pointer command = itk::CStyleCommand::New(); command->SetCallback(*sliceCallBack); @@ -93,7 +93,7 @@ itkSliceBySliceImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); @@ -157,7 +157,7 @@ itkSliceBySliceImageFilterTest(int argc, char * argv[]) // spacing. We are setting the input image to have a non-zero // starting index. // - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); { ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); region.SetIndex(0, 10); @@ -201,8 +201,8 @@ itkSliceBySliceImageFilterTest(int argc, char * argv[]) // // Exercise exceptions // - bool caughtException; - FilterType::Pointer badFilter = FilterType::New(); + bool caughtException; + auto badFilter = FilterType::New(); std::cout << "Testing with no filter set..." << std::endl; badFilter->SetInput(reader->GetOutput()); diff --git a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx index 6e054c5832e..3dfde436aa1 100644 --- a/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkSliceImageFilterTest.cxx @@ -69,7 +69,7 @@ RunFilter(const TImageType * img, int step[TImageType::ImageDimension]) { using FilterType = itk::SliceImageFilter; - typename FilterType::Pointer sliceFilter = FilterType::New(); + auto sliceFilter = FilterType::New(); sliceFilter->SetInput(img); sliceFilter->SetStart(start); @@ -90,7 +90,7 @@ TEST(SliceImageFilterTests, PhysicalPoint1) using ImageType = itk::Image; using SourceType = itk::PhysicalPointImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); // these size are chosen as a power of two and a prime number. @@ -130,7 +130,7 @@ TEST(SliceImageFilterTests, PhysicalPoint2) using ImageType = itk::Image; using SourceType = itk::PhysicalPointImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); // these size are chosen as a power of two and a prime number. @@ -172,7 +172,7 @@ TEST(SliceImageFilterTests, PhysicalPoint3) using ImageType = itk::Image; using SourceType = itk::PhysicalPointImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); // these size are chosen as a power of two and a prime number. @@ -210,7 +210,7 @@ TEST(SliceImageFilterTests, Empty) using ImageType = itk::Image; using SourceType = itk::PhysicalPointImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); // these size are chosen as a power of two and a prime number. @@ -252,7 +252,7 @@ TEST(SliceImageFilterTests, Coverage) using FilterType = itk::SliceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << filter; FilterType::IndexType idx; @@ -289,7 +289,7 @@ TEST(SliceImageFilterTests, Sizes) using ImageType = itk::Image; using SourceType = itk::GaussianImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); SourceType::SizeType size = { { 64, 64, 64 } }; source->SetSize(size); @@ -297,7 +297,7 @@ TEST(SliceImageFilterTests, Sizes) using FilterType = itk::SliceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(source->GetOutput()); // check with default start, stop, step EXPECT_NO_THROW(filter->Update()); @@ -343,12 +343,12 @@ TEST(SliceImageFilterTests, ExceptionalCases) using ImageType = itk::Image; using SourceType = itk::GaussianImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); using FilterType = itk::SliceImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(source->GetOutput()); filter->SetStep(0); diff --git a/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx b/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx index 12f473c47f8..317c5304426 100644 --- a/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkTileImageFilterGTest.cxx @@ -48,7 +48,7 @@ class TileImageFixture : public ::testing::Test { using HashFilter = itk::Testing::HashImageFilter; - typename HashFilter::Pointer hasher = HashFilter::New(); + auto hasher = HashFilter::New(); hasher->SetInput(image); hasher->Update(); return hasher->GetHash(); @@ -71,7 +71,7 @@ class TileImageFixture : public ::testing::Test static typename InputImageType::Pointer CreateImage(unsigned int size = 100) { - typename InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); typename InputImageType::SizeType imageSize; imageSize.Fill(size); diff --git a/Modules/Filtering/ImageGrid/test/itkTileImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkTileImageFilterTest.cxx index 4247e784021..2823f50c4f6 100644 --- a/Modules/Filtering/ImageGrid/test/itkTileImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkTileImageFilterTest.cxx @@ -56,12 +56,12 @@ itkTileImageFilterTest(int argc, char * argv[]) layout[2] = std::stoi(argv[3]); // Tile the input images - TilerType::Pointer tiler = TilerType::New(); + auto tiler = TilerType::New(); itk::SimpleFilterWatcher tileWatcher(tiler, "Tiler"); int f = 0; for (int i = 4; i < argc - 1; ++i) { - ImageReaderType::Pointer reader = ImageReaderType::New(); + auto reader = ImageReaderType::New(); reader->SetFileName(argv[i]); reader->Update(); tiler->SetInput(f++, reader->GetOutput()); @@ -75,7 +75,7 @@ itkTileImageFilterTest(int argc, char * argv[]) tiler->Print(std::cout); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetSeriesFormat(argv[argc - 1]); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx index b5a496e2b88..9e73cb96f9d 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest.cxx @@ -113,7 +113,7 @@ itkWarpImageFilterTest(int, char *[]) ImageType::SizeType size = { { 64, 64 } }; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetLargestPossibleRegion(region); input->SetBufferedRegion(region); input->Allocate(); @@ -151,7 +151,7 @@ itkWarpImageFilterTest(int, char *[]) } fieldRegion.SetSize(fieldSize); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetLargestPossibleRegion(fieldRegion); field->SetBufferedRegion(fieldRegion); field->Allocate(); @@ -174,13 +174,13 @@ itkWarpImageFilterTest(int, char *[]) std::cout << std::endl; using WarpVectorImageFilterType = itk::WarpImageFilter; - WarpVectorImageFilterType::Pointer warpVectorImageFilter = WarpVectorImageFilterType::New(); + auto warpVectorImageFilter = WarpVectorImageFilterType::New(); //============================================================= std::cout << "Run WarpImageFilter in standalone mode with progress."; std::cout << std::endl; using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); warper->SetInput(input); warper->SetDisplacementField(field); @@ -307,18 +307,18 @@ itkWarpImageFilterTest(int, char *[]) std::cout << std::endl; using VectorCasterType = itk::CastImageFilter; - VectorCasterType::Pointer vcaster = VectorCasterType::New(); + auto vcaster = VectorCasterType::New(); vcaster->SetInput(warper->GetDisplacementField()); - WarperType::Pointer warper2 = WarperType::New(); + auto warper2 = WarperType::New(); warper2->SetInput(warper->GetInput()); warper2->SetDisplacementField(vcaster->GetOutput()); warper2->SetEdgePaddingValue(warper->GetEdgePaddingValue()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(warper2->GetOutput()); streamer->SetNumberOfStreamDivisions(3); streamer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx index 3a1a25cc2e5..8ff8bd07af6 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpImageFilterTest2.cxx @@ -109,7 +109,7 @@ itkWarpImageFilterTest2(int, char *[]) // make half-res displacement field DisplacementFieldType::Pointer defField2 = MakeDisplacementField<8u>(); - WarpFilterType::Pointer filter = WarpFilterType::New(); + auto filter = WarpFilterType::New(); // test with full res filter->SetDisplacementField(defField1); filter->SetInput(image); @@ -141,20 +141,20 @@ itkWarpImageFilterTest2(int, char *[]) } // // try streaming - MonitorFilter::Pointer monitor1 = MonitorFilter::New(); + auto monitor1 = MonitorFilter::New(); monitor1->SetInput(image); - WarpFilterType::Pointer filter2 = WarpFilterType::New(); + auto filter2 = WarpFilterType::New(); filter2->SetDisplacementField(defField2); filter2->SetInput(monitor1->GetOutput()); filter2->SetOutputParametersFromImage(image); - MonitorFilter::Pointer monitor2 = MonitorFilter::New(); + auto monitor2 = MonitorFilter::New(); monitor2->SetInput(filter2->GetOutput()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(monitor2->GetOutput()); streamer->SetNumberOfStreamDivisions(4); streamer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx index 3782b7a7d97..3cceba15726 100644 --- a/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWarpVectorImageFilterTest.cxx @@ -109,7 +109,7 @@ itkWarpVectorImageFilterTest(int, char *[]) ImageType::SizeType size = { { 64, 64 } }; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetLargestPossibleRegion(region); input->SetBufferedRegion(region); input->Allocate(); @@ -146,7 +146,7 @@ itkWarpVectorImageFilterTest(int, char *[]) } fieldRegion.SetSize(fieldSize); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetLargestPossibleRegion(fieldRegion); field->SetBufferedRegion(fieldRegion); field->Allocate(); @@ -169,7 +169,7 @@ itkWarpVectorImageFilterTest(int, char *[]) std::cout << "Run WarpVectorImageFilter in standalone mode with progress."; std::cout << std::endl; using WarperType = itk::WarpVectorImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); warper->SetInput(input); warper->SetDisplacementField(field); @@ -296,18 +296,18 @@ itkWarpVectorImageFilterTest(int, char *[]) std::cout << std::endl; using VectorCasterType = itk::CastImageFilter; - VectorCasterType::Pointer vcaster = VectorCasterType::New(); + auto vcaster = VectorCasterType::New(); vcaster->SetInput(warper->GetDisplacementField()); - WarperType::Pointer warper2 = WarperType::New(); + auto warper2 = WarperType::New(); warper2->SetInput(warper->GetInput()); warper2->SetDisplacementField(vcaster->GetOutput()); warper2->SetEdgePaddingValue(warper->GetEdgePaddingValue()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(warper2->GetOutput()); streamer->SetNumberOfStreamDivisions(3); streamer->Update(); diff --git a/Modules/Filtering/ImageGrid/test/itkWrapPadImageTest.cxx b/Modules/Filtering/ImageGrid/test/itkWrapPadImageTest.cxx index 3745a8da91d..7140d45f839 100644 --- a/Modules/Filtering/ImageGrid/test/itkWrapPadImageTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkWrapPadImageTest.cxx @@ -59,14 +59,14 @@ itkWrapPadImageTest(int, char *[]) using VectorImage = itk::VectorImage; // Test the creation of an image with native type - ShortImage::Pointer image = ShortImage::New(); + auto image = ShortImage::New(); ShortImage::IndexType index = { { 0, 0 } }; ShortImage::SizeType size = { { 8, 12 } }; ShortImage::RegionType region(index, size); image->SetRegions(region); image->Allocate(); - VectorImage::Pointer vectorImage = VectorImage::New(); + auto vectorImage = VectorImage::New(); vectorImage->SetRegions(region); vectorImage->SetNumberOfComponentsPerPixel(3); vectorImage->Allocate(); @@ -86,7 +86,7 @@ itkWrapPadImageTest(int, char *[]) // Create a filter using PadFilterType = itk::WrapPadImageFilter; - PadFilterType::Pointer wrapPad = PadFilterType::New(); + auto wrapPad = PadFilterType::New(); wrapPad->SetInput(image); itk::WrapPadImageFilter::Pointer vectorWrapPad; @@ -251,7 +251,7 @@ itkWrapPadImageTest(int, char *[]) // Create a stream using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer stream = StreamingFilter::New(); + auto stream = StreamingFilter::New(); stream->SetInput(wrapPad->GetOutput()); stream->SetNumberOfStreamDivisions(3); diff --git a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx index 53611a4f9ea..147d9dfdb37 100644 --- a/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx +++ b/Modules/Filtering/ImageGrid/test/itkZeroFluxNeumannPadImageFilterTest.cxx @@ -149,7 +149,7 @@ VerifyFilter(const ShortImage * inputImage, // Create a streaming filter using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer stream = StreamingFilter::New(); + auto stream = StreamingFilter::New(); stream->SetInput(padFilter->GetOutput()); stream->SetNumberOfStreamDivisions(3); stream->UpdateLargestPossibleRegion(); @@ -171,7 +171,7 @@ int itkZeroFluxNeumannPadImageFilterTest(int, char *[]) { // Test the creation of an image with native type - ShortImage::Pointer inputImage = ShortImage::New(); + auto inputImage = ShortImage::New(); // Fill in a test image ShortImage::IndexType inputIndex = { { 0, 0 } }; @@ -192,7 +192,7 @@ itkZeroFluxNeumannPadImageFilterTest(int, char *[]) } // Create a filter - FilterType::Pointer padFilter = FilterType::New(); + auto padFilter = FilterType::New(); padFilter->SetInput(inputImage); // itk::SimpleFilterWatcher watcher( padFilter ); diff --git a/Modules/Filtering/ImageIntensity/include/itkNormalizeImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkNormalizeImageFilter.hxx index 625933de934..c315c197b66 100644 --- a/Modules/Filtering/ImageIntensity/include/itkNormalizeImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkNormalizeImageFilter.hxx @@ -57,7 +57,7 @@ template void NormalizeImageFilter::GenerateData() { - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); diff --git a/Modules/Filtering/ImageIntensity/include/itkNormalizeToConstantImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkNormalizeToConstantImageFilter.hxx index 82a550d3b7b..3fe198cf4f3 100644 --- a/Modules/Filtering/ImageIntensity/include/itkNormalizeToConstantImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkNormalizeToConstantImageFilter.hxx @@ -59,18 +59,18 @@ NormalizeToConstantImageFilter::GenerateData() OutputImageType * output0 = this->GetOutput(0); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); using StatType = typename itk::StatisticsImageFilter; - typename StatType::Pointer stat = StatType::New(); + auto stat = StatType::New(); stat->SetInput(input0); progress->RegisterInternalFilter(stat, 0.5f); stat->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); stat->Update(); using DivType = typename itk::DivideImageFilter; - typename DivType::Pointer div = DivType::New(); + auto div = DivType::New(); div->SetInput(input0); div->SetConstant2(static_cast(stat->GetSum()) / m_Constant); div->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); diff --git a/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx index 0620e6bf1f7..355afab2eaf 100644 --- a/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkPolylineMaskImageFilter.hxx @@ -214,10 +214,10 @@ PolylineMaskImageFilter::Generate using BoundingBoxType = BoundingBox; using CornerPointProjectionContainer = BoundingBoxType::PointsContainer; - CornerPointProjectionContainer::Pointer cornerPointProjectionlist = CornerPointProjectionContainer::New(); - CornerPointType cornerPoint; - CornerPointType originPoint; - CornerPointProjectionType cornerProjectionPoint; + auto cornerPointProjectionlist = CornerPointProjectionContainer::New(); + CornerPointType cornerPoint; + CornerPointType originPoint; + CornerPointProjectionType cornerProjectionPoint; originPoint[0] = 0.0; originPoint[1] = 0.0; @@ -285,7 +285,7 @@ PolylineMaskImageFilter::Generate cornerPointProjectionlist->push_back(cornerProjectionPoint); // Compute the bounding box of the projected points - BoundingBoxType::Pointer boundingBox = BoundingBoxType::New(); + auto boundingBox = BoundingBoxType::New(); boundingBox->SetPoints(cornerPointProjectionlist); @@ -312,7 +312,7 @@ PolylineMaskImageFilter::Generate projectionRegion.SetIndex(projectionStart); projectionRegion.SetSize(projectionSize); - typename ProjectionImageType::Pointer projectionImagePtr = ProjectionImageType::New(); + auto projectionImagePtr = ProjectionImageType::New(); ProjectionImagePointType origin; origin[0] = bounds[0]; diff --git a/Modules/Filtering/ImageIntensity/include/itkRescaleIntensityImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkRescaleIntensityImageFilter.hxx index 7c96aad83dd..3b9371ee9ac 100644 --- a/Modules/Filtering/ImageIntensity/include/itkRescaleIntensityImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkRescaleIntensityImageFilter.hxx @@ -57,7 +57,7 @@ RescaleIntensityImageFilter::BeforeThreadedGenerateDa using CalculatorType = MinimumMaximumImageCalculator; - typename CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(this->GetInput()); diff --git a/Modules/Filtering/ImageIntensity/include/itkTernaryOperatorImageFilter.h b/Modules/Filtering/ImageIntensity/include/itkTernaryOperatorImageFilter.h index 4586ec19adb..0f786e8f5ed 100644 --- a/Modules/Filtering/ImageIntensity/include/itkTernaryOperatorImageFilter.h +++ b/Modules/Filtering/ImageIntensity/include/itkTernaryOperatorImageFilter.h @@ -51,7 +51,7 @@ namespace itk \code using TernaryType = itk::TernaryOperatorImageFilter< MaskType, ImageType >; - TernaryType::Pointer ternaryFilter = TernaryType::New(); + auto ternaryFilter = TernaryType::New(); ternaryFilter->SetInput1( maskImage ); ternaryFilter->SetInput2( foregroundImage ); diff --git a/Modules/Filtering/ImageIntensity/include/itkVectorExpandImageFilter.hxx b/Modules/Filtering/ImageIntensity/include/itkVectorExpandImageFilter.hxx index 911b642fdba..a6b40692b83 100644 --- a/Modules/Filtering/ImageIntensity/include/itkVectorExpandImageFilter.hxx +++ b/Modules/Filtering/ImageIntensity/include/itkVectorExpandImageFilter.hxx @@ -38,7 +38,7 @@ VectorExpandImageFilter::VectorExpandImageFilter() } // Setup the default interpolator - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_Interpolator = static_cast(interp.GetPointer()); this->DynamicMultiThreadingOn(); diff --git a/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx index 8536a558c2e..36a88e36900 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAbsImageFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -91,7 +91,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::AbsImageFilter; // Create an Abs Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AbsImageFilter, UnaryGeneratorImageFilter); @@ -139,7 +139,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::AbsImageAdaptor; - AdaptorType::Pointer absAdaptor = AdaptorType::New(); + auto absAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(absAdaptor, AbsImageAdaptor, ImageAdaptor); @@ -147,7 +147,7 @@ itkAbsImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(absAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx index ad3560e9877..c2d39349464 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAcosImageFilterAndAdaptorTest.cxx @@ -53,7 +53,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -91,7 +91,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::AcosImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AcosImageFilter, UnaryGeneratorImageFilter); @@ -139,7 +139,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::AcosImageAdaptor; - AdaptorType::Pointer acosAdaptor = AdaptorType::New(); + auto acosAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(acosAdaptor, AcosImageAdaptor, ImageAdaptor); @@ -147,7 +147,7 @@ itkAcosImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(acosAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest.cxx index 5b960695310..40abf69107e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest.cxx @@ -76,7 +76,7 @@ itkAdaptImageFilterTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - myRGBImageType::Pointer myImage = myRGBImageType::New(); + auto myImage = myRGBImageType::New(); myImage->SetRegions(region); diff --git a/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest2.cxx index 43aab5bfba6..66ac61ab28d 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAdaptImageFilterTest2.cxx @@ -71,7 +71,7 @@ itkAdaptImageFilterTest2(int, char *[]) region.SetIndex(index); region.SetSize(size); - myVectorImageType::Pointer myImage = myVectorImageType::New(); + auto myImage = myVectorImageType::New(); myImage->SetLargestPossibleRegion(region); @@ -113,7 +113,7 @@ itkAdaptImageFilterTest2(int, char *[]) // Get the first element using AdaptFilterType = itk::AdaptImageFilter; - AdaptFilterType::Pointer adaptImage = AdaptFilterType::New(); + auto adaptImage = AdaptFilterType::New(); myAccessorType accessor; accessor.SetElementNumber(0); diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx index 20a14fa8a5c..55393f4fc32 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageAdaptorTest.cxx @@ -43,7 +43,7 @@ itkAddImageAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create input image - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); // Define their size, and start index SizeType size; @@ -89,7 +89,7 @@ itkAddImageAdaptorTest(int, char *[]) using AdaptorType = itk::AddImageAdaptor; - AdaptorType::Pointer addAdaptor = AdaptorType::New(); + auto addAdaptor = AdaptorType::New(); PixelType additiveConstant = 19; @@ -98,7 +98,7 @@ itkAddImageAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(addAdaptor); diffFilter->SetInput2(inputImage); diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx index 8a1204783b3..5014eabe0d4 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest.cxx @@ -51,8 +51,8 @@ itkAddImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -95,7 +95,7 @@ itkAddImageFilterTest(int, char *[]) // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AddImageFilter, BinaryGeneratorImageFilter); @@ -139,7 +139,7 @@ itkAddImageFilterTest(int, char *[]) using ImageType2 = itk::Image; using FilterType2 = itk::AddImageFilter; - FilterType2::Pointer filter2 = FilterType2::New(); + auto filter2 = FilterType2::New(); ITK_TEST_EXPECT_TRUE(!filter2.IsNull()); } @@ -153,7 +153,7 @@ itkAddImageFilterTest(int, char *[]) using FilterType3 = itk::AddImageFilter; - FilterType3::Pointer filter3 = FilterType3::New(); + auto filter3 = FilterType3::New(); ITK_TEST_EXPECT_TRUE(!filter3.IsNull()); } diff --git a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx index d218d5b772b..4fd05a7df9e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAddImageFilterTest2.cxx @@ -46,33 +46,33 @@ itkAddImageFilterTest2(int argc, char * argv[]) using IntegerImageType = itk::Image; using FloatReaderType = itk::ImageFileReader; - FloatReaderType::Pointer floatReader = FloatReaderType::New(); + auto floatReader = FloatReaderType::New(); floatReader->SetFileName(inputImage); floatReader->SetUseStreaming(true); using IntegerReaderType = itk::ImageFileReader; - IntegerReaderType::Pointer integerReader = IntegerReaderType::New(); + auto integerReader = IntegerReaderType::New(); integerReader->SetFileName(inputImage); integerReader->SetUseStreaming(true); constexpr unsigned int streams = 4; using IntegerMonitorFilterType = itk::PipelineMonitorImageFilter; - IntegerMonitorFilterType::Pointer integerMonitorFilter = IntegerMonitorFilterType::New(); + auto integerMonitorFilter = IntegerMonitorFilterType::New(); integerMonitorFilter->SetInput(integerReader->GetOutput()); // Test with different input types. using AddFilterType = itk::AddImageFilter; - AddFilterType::Pointer addFilter = AddFilterType::New(); + auto addFilter = AddFilterType::New(); addFilter->SetInput1(floatReader->GetOutput()); addFilter->SetInput2(integerMonitorFilter->GetOutput()); using MonitorFilterType = itk::PipelineMonitorImageFilter; - MonitorFilterType::Pointer monitorFilter = MonitorFilterType::New(); + auto monitorFilter = MonitorFilterType::New(); monitorFilter->SetInput(addFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(monitorFilter->GetOutput()); writer->SetNumberOfStreamDivisions(streams); writer->SetFileName(outputImage); diff --git a/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx index 05100d72d41..5f33d5616cd 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAndImageFilterTest.cxx @@ -51,8 +51,8 @@ itkAndImageFilterTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create the two input images - InputImage1Type::Pointer inputImageA = InputImage1Type::New(); - InputImage2Type::Pointer inputImageB = InputImage2Type::New(); + auto inputImageA = InputImage1Type::New(); + auto inputImageB = InputImage2Type::New(); // Define their size and start index SizeType size; @@ -112,7 +112,7 @@ itkAndImageFilterTest(int argc, char * argv[]) using AndImageFilterType = itk::AndImageFilter; // Create the filter - AndImageFilterType::Pointer filter = AndImageFilterType::New(); + auto filter = AndImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AndImageFilter, BinaryGeneratorImageFilter); @@ -130,7 +130,7 @@ itkAndImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx index 0a026dd8c79..1eea581d188 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAsinImageFilterAndAdaptorTest.cxx @@ -51,7 +51,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -91,7 +91,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::AsinImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AsinImageFilter, UnaryGeneratorImageFilter); @@ -137,7 +137,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::AsinImageAdaptor; - AdaptorType::Pointer asinAdaptor = AdaptorType::New(); + auto asinAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(asinAdaptor, AsinImageAdaptor, ImageAdaptor); @@ -145,7 +145,7 @@ itkAsinImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(asinAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx index d2a98ab37aa..9cd02360210 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAtan2ImageFilterTest.cxx @@ -51,8 +51,8 @@ itkAtan2ImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer sinImage = InputImageType::New(); - InputImageType::Pointer cosImage = InputImageType::New(); + auto sinImage = InputImageType::New(); + auto cosImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -105,7 +105,7 @@ itkAtan2ImageFilterTest(int, char *[]) using FilterType = itk::Atan2ImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, Atan2ImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx index cbde6ae404a..25afdd41301 100644 --- a/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkAtanImageFilterAndAdaptorTest.cxx @@ -51,7 +51,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -90,7 +90,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::AtanImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AtanImageFilter, UnaryGeneratorImageFilter); @@ -136,7 +136,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::AtanImageAdaptor; - AdaptorType::Pointer atanAdaptor = AdaptorType::New(); + auto atanAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(atanAdaptor, AtanImageAdaptor, ImageAdaptor); @@ -144,7 +144,7 @@ itkAtanImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(atanAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx index f225b3b0fd7..38a554460a5 100644 --- a/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkBinaryMagnitudeImageFilterTest.cxx @@ -47,8 +47,8 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -112,7 +112,7 @@ itkBinaryMagnitudeImageFilterTest(int, char *[]) using FilterType = itk::BinaryMagnitudeImageFilter; // Create the BinaryMagnitudeImageFilter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryMagnitudeImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx index b034a09f719..b0ab90ab72a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx @@ -64,12 +64,12 @@ TestClampFromTo() using FilterType = itk::ClampImageFilter; using SourceType = itk::RandomImageSource; - typename SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); typename InputImageType::SizeType randomSize = { { 18, 17, 23 } }; source->SetSize(randomSize); source->UpdateLargestPossibleRegion(); - typename InputImageType::Pointer sourceCopy = InputImageType::New(); + auto sourceCopy = InputImageType::New(); typename InputImageType::RegionType region; region.SetSize(randomSize); sourceCopy->SetRegions(region); @@ -78,7 +78,7 @@ TestClampFromTo() itk::ImageAlgorithm::Copy(source->GetOutput(), sourceCopy.GetPointer(), region, region); - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(source->GetOutput()); if (std::is_same::ValueType>::value) @@ -175,14 +175,14 @@ TestClampFromToWithCustomBounds() using FilterType = itk::ClampImageFilter; using SourceType = itk::RandomImageSource; - typename SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); source->SetMin(static_cast(0)); source->SetMax(static_cast(20)); typename InputImageType::SizeType randomSize = { { 18, 17, 23 } }; source->SetSize(randomSize); source->UpdateLargestPossibleRegion(); - typename InputImageType::Pointer sourceCopy = InputImageType::New(); + auto sourceCopy = InputImageType::New(); typename InputImageType::RegionType region; region.SetSize(randomSize); sourceCopy->SetRegions(region); @@ -190,7 +190,7 @@ TestClampFromToWithCustomBounds() // Create a copy to use when InPlaceOn is set itk::ImageAlgorithm::Copy(source->GetOutput(), sourceCopy.GetPointer(), region, region); - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetBounds(static_cast(5), static_cast(15)); filter->SetInput(source->GetOutput()); @@ -288,7 +288,7 @@ itkClampImageFilterTest(int, char *[]) using ImageType = itk::Image; using FilterType = itk::ClampImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ClampImageFilter, UnaryFunctorImageFilter); bool success = TestClampFrom() && TestClampFrom() && TestClampFrom() && diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx index ba6e1835ac0..abef77bac15 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToImaginaryFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) using FilterType = itk::ComplexToImaginaryImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ComplexToImaginaryImageFilter, UnaryGeneratorImageFilter); @@ -132,7 +132,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ComplexToImaginaryImageAdaptor; - AdaptorType::Pointer imaginaryAdaptor = AdaptorType::New(); + auto imaginaryAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imaginaryAdaptor, ComplexToImaginaryImageAdaptor, ImageAdaptor); @@ -140,7 +140,7 @@ itkComplexToImaginaryFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(imaginaryAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx index 25c0d23fc4e..192d6994384 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToModulusFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -92,7 +92,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) using FilterType = itk::ComplexToModulusImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ComplexToModulusImageFilter, UnaryGeneratorImageFilter); @@ -140,7 +140,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ComplexToModulusImageAdaptor; - AdaptorType::Pointer imaginaryAdaptor = AdaptorType::New(); + auto imaginaryAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imaginaryAdaptor, ComplexToModulusImageAdaptor, ImageAdaptor); @@ -148,7 +148,7 @@ itkComplexToModulusFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(imaginaryAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx index 894879d7357..9431f860fd9 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToPhaseFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) using FilterType = itk::ComplexToPhaseImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ComplexToPhaseImageFilter, UnaryGeneratorImageFilter); @@ -136,7 +136,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ComplexToPhaseImageAdaptor; - AdaptorType::Pointer imaginaryAdaptor = AdaptorType::New(); + auto imaginaryAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imaginaryAdaptor, ComplexToPhaseImageAdaptor, ImageAdaptor); @@ -144,7 +144,7 @@ itkComplexToPhaseFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(imaginaryAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx index 0252a1e2753..7e66d71f0ea 100644 --- a/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkComplexToRealFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) using FilterType = itk::ComplexToRealImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ComplexToRealImageFilter, UnaryGeneratorImageFilter); @@ -132,7 +132,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ComplexToRealImageAdaptor; - AdaptorType::Pointer realAdaptor = AdaptorType::New(); + auto realAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(realAdaptor, ComplexToRealImageAdaptor, ImageAdaptor); @@ -140,7 +140,7 @@ itkComplexToRealFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(realAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx index 9f23334542a..5d96b71189b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkConstrainedValueAdditionImageFilterTest.cxx @@ -53,8 +53,8 @@ itkConstrainedValueAdditionImageFilterTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create the input images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -116,7 +116,7 @@ itkConstrainedValueAdditionImageFilterTest(int argc, char * argv[]) itk::ConstrainedValueAdditionImageFilter; // Create the filter - ConstrainedValueAdditionImageFilterType::Pointer filter = ConstrainedValueAdditionImageFilterType::New(); + auto filter = ConstrainedValueAdditionImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ConstrainedValueAdditionImageFilter, BinaryGeneratorImageFilter); @@ -133,7 +133,7 @@ itkConstrainedValueAdditionImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx index 953e432014b..0a35fcd5fd4 100644 --- a/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkCosImageFilterAndAdaptorTest.cxx @@ -51,7 +51,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -90,7 +90,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::CosImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, CosImageFilter, UnaryGeneratorImageFilter); @@ -136,7 +136,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::CosImageAdaptor; - AdaptorType::Pointer cosAdaptor = AdaptorType::New(); + auto cosAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(cosAdaptor, CosImageAdaptor, ImageAdaptor); @@ -144,7 +144,7 @@ itkCosImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(cosAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx index 7d6345812c3..bdbf0f5dc0c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest.cxx @@ -50,8 +50,8 @@ itkDivideImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -93,7 +93,7 @@ itkDivideImageFilterTest(int, char *[]) using FilterType = itk::DivideImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DivideImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx index 59583debc03..bab27fd7900 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideImageFilterTest2.cxx @@ -51,8 +51,8 @@ itkDivideImageFilterTest2(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -97,7 +97,7 @@ itkDivideImageFilterTest2(int, char *[]) using FilterType = itk::DivideImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DivideImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx index 025039da9f7..58362f4da51 100644 --- a/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkDivideOrZeroOutImageFilterTest.cxx @@ -31,12 +31,12 @@ itkDivideOrZeroOutImageFilterTest(int, char *[]) ImageType::SizeType size = { { 10, 12, 14 } }; - ImageType::Pointer numeratorImage = ImageType::New(); + auto numeratorImage = ImageType::New(); numeratorImage->SetRegions(size); numeratorImage->Allocate(); numeratorImage->FillBuffer(1.0f); - ImageType::Pointer denominatorImage = ImageType::New(); + auto denominatorImage = ImageType::New(); denominatorImage->SetRegions(size); denominatorImage->Allocate(); @@ -46,7 +46,7 @@ itkDivideOrZeroOutImageFilterTest(int, char *[]) denominatorImage->SetPixel(zeroIndex, 0.0f); // Instantiate and run the filter - DivideFilterType::Pointer divider = DivideFilterType::New(); + auto divider = DivideFilterType::New(); divider->SetInput1(numeratorImage); divider->SetInput2(denominatorImage); divider->InPlaceOn(); diff --git a/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx index c3388ea6f9f..56f05d83839 100644 --- a/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkEdgePotentialImageFilterTest.cxx @@ -47,7 +47,7 @@ itkEdgePotentialImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -91,7 +91,7 @@ itkEdgePotentialImageFilterTest(int, char *[]) // create an EdgePotentialImageFilter using FilterType = itk::EdgePotentialImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); // Connect the input images diff --git a/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx b/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx index 740e6d7adc6..e4127836b96 100644 --- a/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkEqualTest.cxx @@ -252,7 +252,7 @@ itkEqualTest(int, char *[]) { // BinaryImageFilter using iFIB = itk::BinaryFunctorImageFilter, itk::Image, itk::Image, Bogus>; - iFIB::Pointer FIB = iFIB::New(); + auto FIB = iFIB::New(); if (FIB.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx index f9d2203ee08..0bf18c8cc17 100644 --- a/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkExpImageFilterAndAdaptorTest.cxx @@ -46,7 +46,7 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -87,7 +87,7 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) // Create an ADD Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the input images @@ -135,13 +135,13 @@ itkExpImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ExpImageAdaptor; - AdaptorType::Pointer expAdaptor = AdaptorType::New(); + auto expAdaptor = AdaptorType::New(); expAdaptor->SetImage(inputImage); using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(expAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx index 74e0572f9fc..8f15ba1530c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkExpNegativeImageFilterAndAdaptorTest.cxx @@ -46,7 +46,7 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -87,7 +87,7 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) // Create an ADD Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the input images @@ -135,13 +135,13 @@ itkExpNegativeImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::ExpNegativeImageAdaptor; - AdaptorType::Pointer expAdaptor = AdaptorType::New(); + auto expAdaptor = AdaptorType::New(); expAdaptor->SetImage(inputImage); using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(expAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx index 6aa5bf2d8fd..2f0fa759519 100644 --- a/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkHistogramMatchingImageFilterTest.cxx @@ -168,8 +168,8 @@ itkHistogramMatchingImageFilterTest() typename ImageType::RegionType region; region.SetSize(size); - typename ImageType::Pointer reference = ImageType::New(); - typename ImageType::Pointer source = ImageType::New(); + auto reference = ImageType::New(); + auto source = ImageType::New(); reference->SetLargestPossibleRegion(region); reference->SetBufferedRegion(region); @@ -208,7 +208,7 @@ itkHistogramMatchingImageFilterTest() // Test with historical reference image input, and then capture the histogram as cached // value for other tests { - typename FilterType::Pointer filterWithReferenceImage = FilterType::New(); + auto filterWithReferenceImage = FilterType::New(); filterWithReferenceImage->SetReferenceImage(reference); filterWithReferenceImage->SetSourceImage(source); @@ -261,7 +261,7 @@ itkHistogramMatchingImageFilterTest() std::cout << "===================================================================================" << std::endl; { // Test SourceHistogram same size (50) as ReferenceHistogram - typename FilterType::Pointer filterWithSameSizeHistogram = FilterType::New(); + auto filterWithSameSizeHistogram = FilterType::New(); filterWithSameSizeHistogram->SetReferenceHistogram(refHistogram); filterWithSameSizeHistogram->GenerateReferenceHistogramFromImageOff(); @@ -288,7 +288,7 @@ itkHistogramMatchingImageFilterTest() } // Test SourceHistogram smaller than (31) ReferenceHistogram { - typename FilterType::Pointer filterWithSmallerHistogram = FilterType::New(); + auto filterWithSmallerHistogram = FilterType::New(); filterWithSmallerHistogram->SetReferenceHistogram(refHistogram); filterWithSmallerHistogram->SetGenerateReferenceHistogramFromImage(false); @@ -316,7 +316,7 @@ itkHistogramMatchingImageFilterTest() // Test SourceHistogram larger than (93) ReferenceHistogram { - typename FilterType::Pointer filterWithLargerHistogram = FilterType::New(); + auto filterWithLargerHistogram = FilterType::New(); filterWithLargerHistogram->SetReferenceHistogram(refHistogram); filterWithLargerHistogram->SetGenerateReferenceHistogramFromImage(false); @@ -344,7 +344,7 @@ itkHistogramMatchingImageFilterTest() // Incorrect input setting failures for ReferenceHistogram { - typename FilterType::Pointer mismatchReferenceChoice = FilterType::New(); + auto mismatchReferenceChoice = FilterType::New(); try { mismatchReferenceChoice->SetReferenceHistogram(refHistogram); @@ -365,7 +365,7 @@ itkHistogramMatchingImageFilterTest() } // Incorrect input setting failures for ReferenceImage { - typename FilterType::Pointer mismatchReferenceChoice = FilterType::New(); + auto mismatchReferenceChoice = FilterType::New(); try { mismatchReferenceChoice->SetReferenceImage(reference); diff --git a/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx b/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx index b9cbba9fcd5..d600b3d28bf 100644 --- a/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkImageAdaptorNthElementTest.cxx @@ -94,7 +94,7 @@ itkImageAdaptorNthElementTest(int, char *[]) // Create and Initialize the RGBPixel image //------------------------------------------------------------- - myContainerPixelImageType::Pointer myContainerPixelImage = myContainerPixelImageType::New(); + auto myContainerPixelImage = myContainerPixelImageType::New(); myContainerPixelImage->SetLargestPossibleRegion(region); myContainerPixelImage->SetBufferedRegion(region); @@ -143,7 +143,7 @@ itkImageAdaptorNthElementTest(int, char *[]) // Create and Initialize the Float image //------------------------------------------------------------- - myFloatImageType::Pointer myFloatImage = myFloatImageType::New(); + auto myFloatImage = myFloatImageType::New(); myFloatImage->SetLargestPossibleRegion(region); myFloatImage->SetBufferedRegion(region); @@ -185,7 +185,7 @@ itkImageAdaptorNthElementTest(int, char *[]) // Create the adaptor and connect the image //------------------------------------------------------------- - myAdaptorType::Pointer myAdaptor = myAdaptorType::New(); + auto myAdaptor = myAdaptorType::New(); myAdaptor->SetImage(myContainerPixelImage); @@ -193,7 +193,7 @@ itkImageAdaptorNthElementTest(int, char *[]) // Create the filter and connect the inputs //------------------------------------------------------------- - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); filter->SetInput1(myAdaptor); filter->SetInput2(myFloatImage); diff --git a/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx index 5ca59acff58..99d404ad01a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkIntensityWindowingImageFilterTest.cxx @@ -46,13 +46,13 @@ itkIntensityWindowingImageFilterTest(int, char *[]) using FilterType = itk::IntensityWindowingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, IntensityWindowingImageFilter, UnaryFunctorImageFilter); // Generate a real image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); TestInputImage::SizeValueType randomSize[3] = { 17, 8, 20 }; // Set up source @@ -98,7 +98,7 @@ itkIntensityWindowingImageFilterTest(int, char *[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->SetFunctor(filter->GetFunctor())); using CalculatorType = itk::MinimumMaximumImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(filter->GetOutput()); diff --git a/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx index 3d14080ce81..f0ec4be2b8c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkInvertIntensityImageFilterTest.cxx @@ -41,11 +41,11 @@ itkInvertIntensityImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::InvertIntensityImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, InvertIntensityImageFilter, UnaryFunctorImageFilter); @@ -60,7 +60,7 @@ itkInvertIntensityImageFilterTest(int argc, char * argv[]) filter->SetInput(reader->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx index 732e7940100..c809b5fca1e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLog10ImageFilterAndAdaptorTest.cxx @@ -49,7 +49,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::Log10ImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, Log10ImageFilter, UnaryGeneratorImageFilter); @@ -134,7 +134,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::Log10ImageAdaptor; - AdaptorType::Pointer log10Adaptor = AdaptorType::New(); + auto log10Adaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(log10Adaptor, Log10ImageAdaptor, ImageAdaptor); @@ -142,7 +142,7 @@ itkLog10ImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(log10Adaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx index 92e56074ccf..c0e468b5d3f 100644 --- a/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkLogImageFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -89,7 +89,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::LogImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, LogImageFilter, UnaryGeneratorImageFilter); @@ -135,7 +135,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::LogImageAdaptor; - AdaptorType::Pointer logAdaptor = AdaptorType::New(); + auto logAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(logAdaptor, LogImageAdaptor, ImageAdaptor); @@ -143,7 +143,7 @@ itkLogImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(logAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx index 576403d7a7f..21ccc022379 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMagnitudeAndPhaseToComplexImageFilterTest.cxx @@ -57,8 +57,8 @@ itkMagnitudeAndPhaseToComplexImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer magnitudeReader = ReaderType::New(); - ReaderType::Pointer phaseReader = ReaderType::New(); + auto magnitudeReader = ReaderType::New(); + auto phaseReader = ReaderType::New(); magnitudeReader->SetFileName(magnitudeImageFileName); phaseReader->SetFileName(phaseImageFileName); @@ -75,7 +75,7 @@ itkMagnitudeAndPhaseToComplexImageFilterTest(int argc, char * argv[]) magnitudeAndPhaseToComplexFilter->SetInput2(phaseReader->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(complexImageFileName); writer->SetInput(magnitudeAndPhaseToComplexFilter->GetOutput()); @@ -83,7 +83,7 @@ itkMagnitudeAndPhaseToComplexImageFilterTest(int argc, char * argv[]) // Check that the default template parameters work using DefaultParametersFilterType = itk::MagnitudeAndPhaseToComplexImageFilter; - DefaultParametersFilterType::Pointer temp = DefaultParametersFilterType::New(); + auto temp = DefaultParametersFilterType::New(); if (temp.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx index 7f9fd2ffb5a..43c573a67e7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaskImageFilterTest.cxx @@ -43,8 +43,8 @@ itkMaskImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create two images - myImageType1::Pointer inputImageA = myImageType1::New(); - myImageType2::Pointer inputImageB = myImageType2::New(); + auto inputImageA = myImageType1::New(); + auto inputImageB = myImageType2::New(); // Define their size, and start index mySizeType size; @@ -121,7 +121,7 @@ itkMaskImageFilterTest(int, char *[]) // Create a mask Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images @@ -153,7 +153,7 @@ itkMaskImageFilterTest(int, char *[]) // Vector image tests using myVectorImageType = itk::VectorImage; - myVectorImageType::Pointer inputVectorImage = myVectorImageType::New(); + auto inputVectorImage = myVectorImageType::New(); inputVectorImage->SetLargestPossibleRegion(region); inputVectorImage->SetBufferedRegion(region); inputVectorImage->SetRequestedRegion(region); @@ -162,7 +162,7 @@ itkMaskImageFilterTest(int, char *[]) using myVectorFilterType = itk::MaskImageFilter; - myVectorFilterType::Pointer vectorFilter = myVectorFilterType::New(); + auto vectorFilter = myVectorFilterType::New(); vectorFilter->SetInput1(inputVectorImage); vectorFilter->SetMaskImage(inputImageB); diff --git a/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx index 949071461a9..9d602c42f46 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaskNegatedImageFilterTest.cxx @@ -42,8 +42,8 @@ itkMaskNegatedImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); - MaskImageType::Pointer inputMask = MaskImageType::New(); + auto inputImage = InputImageType::New(); + auto inputMask = MaskImageType::New(); // Define their size, and start index mySizeType size; @@ -120,7 +120,7 @@ itkMaskNegatedImageFilterTest(int, char *[]) // Create an MaskNegated Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images diff --git a/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx index af73a66d84b..1f9b4682e68 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMatrixIndexSelectionImageFilterTest.cxx @@ -44,7 +44,7 @@ itkMatrixIndexSelectionImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; // Create a matrix image - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::RegionType region; InputImageType::SizeType size; @@ -110,7 +110,7 @@ itkMatrixIndexSelectionImageFilterTest(int argc, char * argv[]) using SelectionFilterType = itk::MatrixIndexSelectionImageFilter; - SelectionFilterType::Pointer filter = SelectionFilterType::New(); + auto filter = SelectionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MatrixIndexSelectionImageFilter, UnaryFunctorImageFilter); @@ -136,7 +136,7 @@ itkMatrixIndexSelectionImageFilterTest(int argc, char * argv[]) filter->SetFunctor(filter->GetFunctor()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx index 6c08deaf8e6..904d2e45f19 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMaximumImageFilterTest.cxx @@ -46,8 +46,8 @@ itkMaximumImageFilterTest(int, char *[]) using MaximumImageFilterType = itk::MaximumImageFilter; // Create two images - ImageType::Pointer inputImageA = ImageType::New(); - ImageType::Pointer inputImageB = ImageType::New(); + auto inputImageA = ImageType::New(); + auto inputImageB = ImageType::New(); // Define their size, and start index SizeType size; @@ -104,7 +104,7 @@ itkMaximumImageFilterTest(int, char *[]) } // Create the filter - MaximumImageFilterType::Pointer maximumImageFilter = MaximumImageFilterType::New(); + auto maximumImageFilter = MaximumImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(maximumImageFilter, MaximumImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx index 8b8abe1ea8f..8e04be33652 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMinimumImageFilterTest.cxx @@ -46,8 +46,8 @@ itkMinimumImageFilterTest(int, char *[]) using MinimumFilterType = itk::MinimumImageFilter; // Create two images - ImageType::Pointer inputImageA = ImageType::New(); - ImageType::Pointer inputImageB = ImageType::New(); + auto inputImageA = ImageType::New(); + auto inputImageB = ImageType::New(); // Define their size, and start index SizeType size; @@ -104,7 +104,7 @@ itkMinimumImageFilterTest(int, char *[]) } // Create the filter - MinimumFilterType::Pointer minimumImageFilter = MinimumFilterType::New(); + auto minimumImageFilter = MinimumFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(minimumImageFilter, MinimumImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx index b3b3af43d2b..e452e1e5e8a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkModulusImageFilterTest.cxx @@ -41,17 +41,17 @@ itkModulusImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // get the distance map inside the spots // spot are already black so there is no need to invert the image using DistanceFilter = itk::DanielssonDistanceMapImageFilter; - DistanceFilter::Pointer distance = DistanceFilter::New(); + auto distance = DistanceFilter::New(); distance->SetInput(reader->GetOutput()); using FilterType = itk::ModulusImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ModulusImageFilter, BinaryGeneratorImageFilter); @@ -66,13 +66,13 @@ itkModulusImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter); using ThresholdType = itk::RescaleIntensityImageFilter; - ThresholdType::Pointer rescale = ThresholdType::New(); + auto rescale = ThresholdType::New(); rescale->SetInput(filter->GetOutput()); rescale->SetOutputMaximum(itk::NumericTraits::max()); rescale->SetOutputMinimum(itk::NumericTraits::NonpositiveMin()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescale->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx index 9c6bd3512cf..e866002be00 100644 --- a/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkMultiplyImageFilterTest.cxx @@ -50,8 +50,8 @@ itkMultiplyImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -93,7 +93,7 @@ itkMultiplyImageFilterTest(int, char *[]) using FilterType = itk::MultiplyImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MultiplyImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx index 2fc2bdd1770..37c6f969676 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNaryAddImageFilterTest.cxx @@ -67,9 +67,9 @@ itkNaryAddImageFilterTest(int, char *[]) using OutputImageType = itk::Image; // Create some images - InputImageType::Pointer inputImageA = InputImageType::New(); - InputImageType::Pointer inputImageB = InputImageType::New(); - InputImageType::Pointer inputImageC = InputImageType::New(); + auto inputImageA = InputImageType::New(); + auto inputImageB = InputImageType::New(); + auto inputImageC = InputImageType::New(); constexpr InputImageType::PixelType valueA = 12; @@ -84,7 +84,7 @@ itkNaryAddImageFilterTest(int, char *[]) using FilterType = itk::NaryAddImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, NaryAddImageFilter, NaryFunctorImageFilter); @@ -175,9 +175,9 @@ itkNaryAddImageFilterTest(int, char *[]) using VectorPixelType = itk::Vector; using VectorImageType = itk::Image; - VectorImageType::Pointer vectorImageA = VectorImageType::New(); - VectorImageType::Pointer vectorImageB = VectorImageType::New(); - VectorImageType::Pointer vectorImageC = VectorImageType::New(); + auto vectorImageA = VectorImageType::New(); + auto vectorImageB = VectorImageType::New(); + auto vectorImageC = VectorImageType::New(); VectorPixelType vectorImageValueA, vectorImageValueB, vectorImageValueC; @@ -201,7 +201,7 @@ itkNaryAddImageFilterTest(int, char *[]) // Create an ADD Filter using VectorAdderType = itk::NaryAddImageFilter; - VectorAdderType::Pointer vectorFilter = VectorAdderType::New(); + auto vectorFilter = VectorAdderType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(vectorFilter, NaryAddImageFilter, NaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx index ceef1aa2b13..6d512ac7f13 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNaryMaximumImageFilterTest.cxx @@ -115,8 +115,8 @@ itkNaryMaximumImageFilterTest(int, char *[]) using namespace NaryMaximumImageFilterTest; // Create two images - InputImageType::Pointer inputImageA = InputImageType::New(); - InputImageType::Pointer inputImageB = InputImageType::New(); + auto inputImageA = InputImageType::New(); + auto inputImageB = InputImageType::New(); static constexpr int minValue = 12; static constexpr int maxValue = 13; @@ -127,7 +127,7 @@ itkNaryMaximumImageFilterTest(int, char *[]) PrintImage(inputImageB, "Input image B"); // Create the itk::NaryMaximumImageFilter filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, NaryMaximumImageFilter, NaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx index 3a2528aa5ef..f802b98edef 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNormalizeImageFilterTest.cxx @@ -33,7 +33,7 @@ itkNormalizeImageFilterTest(int, char *[]) // Generate a real image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ShortImage::SizeValueType randomSize[3] = { 18, 17, 67 }; source->SetSize(randomSize); @@ -44,13 +44,13 @@ itkNormalizeImageFilterTest(int, char *[]) source->SetMax(static_cast(maxValue)); using NormalizeType = itk::NormalizeImageFilter; - NormalizeType::Pointer normalize = NormalizeType::New(); + auto normalize = NormalizeType::New(); itk::SimpleFilterWatcher watch(normalize, "Streaming"); normalize->SetInput(source->GetOutput()); using StreamingType = itk::StreamingImageFilter; - StreamingType::Pointer streaming = StreamingType::New(); + auto streaming = StreamingType::New(); streaming->SetNumberOfStreamDivisions(5); streaming->SetInput(normalize->GetOutput()); @@ -60,7 +60,7 @@ itkNormalizeImageFilterTest(int, char *[]) source->Modified(); using StatisticsType = itk::StatisticsImageFilter; - StatisticsType::Pointer statistics = StatisticsType::New(); + auto statistics = StatisticsType::New(); statistics->SetInput(streaming->GetOutput()); statistics->UpdateLargestPossibleRegion(); diff --git a/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx index b326d5c99db..a7a08eb6520 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNormalizeToConstantImageFilterTest.cxx @@ -36,7 +36,7 @@ itkNormalizeToConstantImageFilterTest(int, char *[]) // Generate a random image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); IntImage::SizeValueType randomSize[3] = { 18, 17, 67 }; @@ -48,7 +48,7 @@ itkNormalizeToConstantImageFilterTest(int, char *[]) source->SetMax(maxValue); using NormalizeType = itk::NormalizeToConstantImageFilter; - NormalizeType::Pointer normalize = NormalizeType::New(); + auto normalize = NormalizeType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(normalize, NormalizeToConstantImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx index 05d8bfed100..3a0b9e232f2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNotImageFilterTest.cxx @@ -47,7 +47,7 @@ itkNotImageFilterTest(int, char *[]) using NotImageFilterType = itk::NotImageFilter; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -86,7 +86,7 @@ itkNotImageFilterTest(int, char *[]) } // Create the filter - NotImageFilterType::Pointer filter = NotImageFilterType::New(); + auto filter = NotImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, NotImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx b/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx index 0c4ead092c6..7f32457047d 100644 --- a/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkNthElementPixelAccessorTest2.cxx @@ -72,7 +72,7 @@ itkNthElementPixelAccessorTest2(int, char *[]) region.SetIndex(index); region.SetSize(size); - VectorImageType::Pointer vectorImage = VectorImageType::New(); + auto vectorImage = VectorImageType::New(); vectorImage->SetLargestPossibleRegion(region); vectorImage->SetBufferedRegion(region); @@ -104,7 +104,7 @@ itkNthElementPixelAccessorTest2(int, char *[]) AccessorType accessor; accessor.SetElementNumber(0); - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetInput(vectorImage); adaptor->SetAccessor(accessor); adaptor->Update(); diff --git a/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx index aea9ba8fe21..5bd071d83ec 100644 --- a/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkOrImageFilterTest.cxx @@ -55,8 +55,8 @@ itkOrImageFilterTest(int argc, char * argv[]) using OrImageFilterType = itk::OrImageFilter; // Create the two input images - InputImage1Type::Pointer inputImageA = InputImage1Type::New(); - InputImage2Type::Pointer inputImageB = InputImage2Type::New(); + auto inputImageA = InputImage1Type::New(); + auto inputImageB = InputImage2Type::New(); // Define their size, and start index SizeType size; @@ -114,7 +114,7 @@ itkOrImageFilterTest(int argc, char * argv[]) } // Create the filter - OrImageFilterType::Pointer filter = OrImageFilterType::New(); + auto filter = OrImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, OrImageFilter, BinaryGeneratorImageFilter); @@ -132,7 +132,7 @@ itkOrImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx index 53469312c10..d94e07f2b14 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPolylineMask2DImageFilterTest.cxx @@ -44,7 +44,7 @@ itkPolylineMask2DImageFilterTest(int argc, char * argv[]) // Read input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); std::cout << "Input filename = " << argv[1] << std::endl; @@ -64,7 +64,7 @@ itkPolylineMask2DImageFilterTest(int argc, char * argv[]) InputImageType::ConstPointer inputImage = reader->GetOutput(); // Create polyline - InputPolylineType::Pointer inputPolyline = InputPolylineType::New(); + auto inputPolyline = InputPolylineType::New(); // We expect as input an image of 256 x 256 pixels with spacing 1,1. @@ -98,7 +98,7 @@ itkPolylineMask2DImageFilterTest(int argc, char * argv[]) // Create a mask Filter - InputFilterType::Pointer filter = InputFilterType::New(); + auto filter = InputFilterType::New(); // Connect the input image filter->SetInput1(inputImage); @@ -108,7 +108,7 @@ itkPolylineMask2DImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); std::cout << "Output filename = " << argv[2] << std::endl; diff --git a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx index eb37b1764fe..69516a43a6e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPolylineMaskImageFilterTest.cxx @@ -53,12 +53,12 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) inputVectorType inputUpVector, inputViewVector; // Create polyline - inputPolylineType::Pointer inputPolyline = inputPolylineType::New(); + auto inputPolyline = inputPolylineType::New(); std::cout << "Generating the synthetic object..." << std::endl; // Generate a synthetic ellipse image using EllipseType = itk::EllipseSpatialObject<2>; - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); EllipseType::PointType center; center.Fill(20); ellipse->SetCenterInObjectSpace(center); @@ -68,7 +68,7 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) std::cout << "Generating the image of the object..." << std::endl; using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SpatialObjectToImageFilterType::Pointer imageGenerationFilter = SpatialObjectToImageFilterType::New(); + auto imageGenerationFilter = SpatialObjectToImageFilterType::New(); inputImageType::SizeType size; inputImageType::PointType origin; @@ -140,7 +140,7 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) std::cout << "Generating the filter..." << std::endl; // Create the mask filter - PolylineMaskImageFilterType::Pointer polylineMaskFilter = PolylineMaskImageFilterType::New(); + auto polylineMaskFilter = PolylineMaskImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(polylineMaskFilter, PolylineMaskImageFilter, ImageToImageFilter); @@ -189,7 +189,7 @@ itkPolylineMaskImageFilterTest(int argc, char * argv[]) // Write out the output image using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer outputWriter = OutputWriterType::New(); + auto outputWriter = OutputWriterType::New(); outputWriter->SetFileName(argv[1]); outputWriter->SetInput(polylineMaskFilter->GetOutput()); outputWriter->Update(); diff --git a/Modules/Filtering/ImageIntensity/test/itkPowImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPowImageFilterTest.cxx index 7ff971a9c61..a34cba79259 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPowImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPowImageFilterTest.cxx @@ -43,8 +43,8 @@ itkPowImageFilterTest(int, char *[]) using SizeType = itk::Size<1>; using IndexType = itk::Index<1>; - ImageType::Pointer inputImageA = ImageType::New(); - ImageType::Pointer inputImageB = ImageType::New(); + auto inputImageA = ImageType::New(); + auto inputImageB = ImageType::New(); SizeType size; size[0] = 2; @@ -69,7 +69,7 @@ itkPowImageFilterTest(int, char *[]) } // Create a PowFilter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PowImageFilter, BinaryGeneratorImageFilter); @@ -114,7 +114,7 @@ itkPowImageFilterTest(int, char *[]) { using complexFloatFilterType = itk::PowImageFilter, itk::Image>, itk::Image>>; - complexFloatFilterType::Pointer tFilter = complexFloatFilterType::New(); + auto tFilter = complexFloatFilterType::New(); ITK_TEST_EXPECT_TRUE(!tFilter.IsNull()); } diff --git a/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx b/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx index 2cf2dc22c82..67c066f0498 100644 --- a/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkPromoteDimensionImageTest.cxx @@ -54,12 +54,12 @@ itkPromoteDimensionImageTest(int argc, char * argv[]) using RescaleFilter = itk::RescaleIntensityImageFilter; // Setting the IO - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); - CastToRealFilterType::Pointer toReal = CastToRealFilterType::New(); - CastToCharFilterType::Pointer toChar = CastToCharFilterType::New(); - RescaleFilter::Pointer rescale = RescaleFilter::New(); + auto toReal = CastToRealFilterType::New(); + auto toChar = CastToCharFilterType::New(); + auto rescale = RescaleFilter::New(); // Setting the ITK pipeline filter diff --git a/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx index 9c40c70e5ce..1a7af4d682b 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRGBToLuminanceImageFilterAndAdaptorTest.cxx @@ -54,7 +54,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -97,7 +97,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::RGBToLuminanceImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RGBToLuminanceImageFilter, UnaryGeneratorImageFilter); @@ -144,7 +144,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::RGBToLuminanceImageAdaptor; - AdaptorType::Pointer luminanceAdaptor = AdaptorType::New(); + auto luminanceAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(luminanceAdaptor, RGBToLuminanceImageAdaptor, ImageAdaptor); @@ -152,7 +152,7 @@ itkRGBToLuminanceImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(luminanceAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkRGBToVectorAdaptImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRGBToVectorAdaptImageFilterTest.cxx index 76b6344b33a..db1104017e8 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRGBToVectorAdaptImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRGBToVectorAdaptImageFilterTest.cxx @@ -74,7 +74,7 @@ itkRGBToVectorAdaptImageFilterTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - RGBImageType::Pointer myImage = RGBImageType::New(); + auto myImage = RGBImageType::New(); myImage->SetRegions(region); @@ -100,7 +100,7 @@ itkRGBToVectorAdaptImageFilterTest(int, char *[]) // Convert to a Vector image using AdaptFilterType = itk::AdaptImageFilter; - AdaptFilterType::Pointer adaptImageToVector = AdaptFilterType::New(); + auto adaptImageToVector = AdaptFilterType::New(); adaptImageToVector->SetInput(myImage); adaptImageToVector->UpdateLargestPossibleRegion(); diff --git a/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx index 41cec155d2e..54c2cf9fcb4 100644 --- a/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkRescaleIntensityImageFilterTest.cxx @@ -52,14 +52,14 @@ itkRescaleIntensityImageFilterTest(int, char *[]) using FilterType = itk::RescaleIntensityImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RescaleIntensityImageFilter, UnaryFunctorImageFilter); // Now generate a real image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); TestInputImage::SizeValueType randomSize[3] = { 17, 8, 20 }; @@ -86,7 +86,7 @@ itkRescaleIntensityImageFilterTest(int, char *[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->UpdateLargestPossibleRegion()); using CalculatorType = itk::MinimumMaximumImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(filter->GetOutput()); diff --git a/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx index 389cc1ad2bc..1af40fbf0ed 100644 --- a/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkShiftScaleImageFilterTest.cxx @@ -32,7 +32,7 @@ itkShiftScaleImageFilterTest(int, char *[]) using TestOutputImage = itk::Image; using RealType = itk::NumericTraits::RealType; - TestInputImage::Pointer inputImage = TestInputImage::New(); + auto inputImage = TestInputImage::New(); TestInputImage::RegionType region; TestInputImage::SizeType size; size.Fill(64); @@ -49,7 +49,7 @@ itkShiftScaleImageFilterTest(int, char *[]) inputImage->FillBuffer(static_cast(fillValue)); using FilterType = itk::ShiftScaleImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Set up Start, End and Progress callbacks itk::SimpleFilterWatcher filterWatch(filter); @@ -61,7 +61,7 @@ itkShiftScaleImageFilterTest(int, char *[]) // Now generate a real image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); TestInputImage::SizeValueType randomSize[3] = { 17, 8, 20 }; // Set up Start, End and Progress callbacks diff --git a/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx index 0d59103c1ba..6909bdb0806 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSigmoidImageFilterTest.cxx @@ -49,7 +49,7 @@ itkSigmoidImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkSigmoidImageFilterTest(int, char *[]) using FilterType = itk::SigmoidImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SigmoidImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx index 1068e89fd34..e4072adab2c 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSinImageFilterAndAdaptorTest.cxx @@ -51,7 +51,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -90,7 +90,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::SinImageFilter; // Create the Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SinImageFilter, UnaryGeneratorImageFilter); @@ -136,7 +136,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::SinImageAdaptor; - AdaptorType::Pointer sinAdaptor = AdaptorType::New(); + auto sinAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(sinAdaptor, SinImageAdaptor, ImageAdaptor); @@ -144,7 +144,7 @@ itkSinImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(sinAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx index fcb4b4bd69d..c79364e4ef2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSqrtImageFilterAndAdaptorTest.cxx @@ -51,7 +51,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -90,7 +90,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::SqrtImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SqrtImageFilter, UnaryGeneratorImageFilter); @@ -135,7 +135,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::SqrtImageAdaptor; - AdaptorType::Pointer sqrtAdaptor = AdaptorType::New(); + auto sqrtAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(sqrtAdaptor, SqrtImageAdaptor, ImageAdaptor); @@ -143,7 +143,7 @@ itkSqrtImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(sqrtAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx index 2e7dcd46460..d34acb545c2 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSquareImageFilterTest.cxx @@ -48,7 +48,7 @@ itkSquareImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define their size, and start index SizeType size; @@ -88,7 +88,7 @@ itkSquareImageFilterTest(int, char *[]) using FilterType = itk::SquareImageFilter; // Create a Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SquareImageFilter, UnaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx index aee933ed8e5..60be43e95a7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSubtractImageFilterTest.cxx @@ -51,8 +51,8 @@ itkSubtractImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); // Define their size, and start index SizeType size; @@ -94,7 +94,7 @@ itkSubtractImageFilterTest(int, char *[]) using FilterType = itk::SubtractImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SubtractImageFilter, BinaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx index 2a7178c2183..165ea3d7eaa 100644 --- a/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkSymmetricEigenAnalysisImageFilterTest.cxx @@ -62,7 +62,7 @@ class SymmetricEigenAnalysisImageFilterHelper : public SymmetricEigenAnalysisIma using RegionType = itk::ImageRegion; // Create the input image - typename InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -109,7 +109,7 @@ class SymmetricEigenAnalysisImageFilterHelper : public SymmetricEigenAnalysisIma // Create the filter - typename SymmetricEigenAnalysisImageFilterType::Pointer filter = SymmetricEigenAnalysisImageFilterType::New(); + auto filter = SymmetricEigenAnalysisImageFilterType::New(); // Dimension should be initialized to the input image dimension ITK_TEST_EXPECT_EQUAL(filter->GetDimension(), InputImageType::ImageDimension); @@ -136,7 +136,7 @@ class SymmetricEigenAnalysisImageFilterHelper : public SymmetricEigenAnalysisIma // Get the output image to a writable format using CastImageFilterType = itk::CastImageFilter; - typename CastImageFilterType::Pointer roundImageFilter = CastImageFilterType::New(); + auto roundImageFilter = CastImageFilterType::New(); roundImageFilter->SetInput(internalImage); @@ -145,7 +145,7 @@ class SymmetricEigenAnalysisImageFilterHelper : public SymmetricEigenAnalysisIma // Write the result image using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); @@ -196,7 +196,7 @@ class SymmetricEigenAnalysisFixedDimensionImageFilterHelper using RegionType = itk::ImageRegion; // Create the input image - typename InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -264,7 +264,7 @@ class SymmetricEigenAnalysisFixedDimensionImageFilterHelper // Get the output image to a writable format using CastImageFilterType = itk::CastImageFilter; - typename CastImageFilterType::Pointer roundImageFilter = CastImageFilterType::New(); + auto roundImageFilter = CastImageFilterType::New(); roundImageFilter->SetInput(internalImage); @@ -273,7 +273,7 @@ class SymmetricEigenAnalysisFixedDimensionImageFilterHelper // Write the result image using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); @@ -326,7 +326,7 @@ itkSymmetricEigenAnalysisImageFilterTest(int argc, char * argv[]) using FilterType = itk::SymmetricEigenAnalysisImageFilter; // Create an instance to exercise basic object methods - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SymmetricEigenAnalysisImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx index ab20b654b89..35b60154e5a 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTanImageFilterAndAdaptorTest.cxx @@ -50,7 +50,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define its size, and start index SizeType size; @@ -89,7 +89,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) using FilterType = itk::TanImageFilter; // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, TanImageFilter, UnaryGeneratorImageFilter); @@ -133,7 +133,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) using AdaptorType = itk::TanImageAdaptor; - AdaptorType::Pointer tanAdaptor = AdaptorType::New(); + auto tanAdaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(tanAdaptor, TanImageAdaptor, ImageAdaptor); @@ -141,7 +141,7 @@ itkTanImageFilterAndAdaptorTest(int, char *[]) using DiffFilterType = itk::SubtractImageFilter; - DiffFilterType::Pointer diffFilter = DiffFilterType::New(); + auto diffFilter = DiffFilterType::New(); diffFilter->SetInput1(outputImage); diffFilter->SetInput2(tanAdaptor); diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx index faa5194af8b..9ea7236bf54 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeImageFilterTest.cxx @@ -52,9 +52,9 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create the input images - InputImage1Type::Pointer inputImageA = InputImage1Type::New(); - InputImage2Type::Pointer inputImageB = InputImage2Type::New(); - InputImage3Type::Pointer inputImageC = InputImage3Type::New(); + auto inputImageA = InputImage1Type::New(); + auto inputImageB = InputImage2Type::New(); + auto inputImageC = InputImage3Type::New(); // Define their size and start index SizeType size; @@ -131,7 +131,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) itk::TernaryMagnitudeImageFilter; // Create the filter - TernaryMagnitudeImageFilterType::Pointer filter = TernaryMagnitudeImageFilterType::New(); + auto filter = TernaryMagnitudeImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, TernaryMagnitudeImageFilter, TernaryGeneratorImageFilter); @@ -149,7 +149,7 @@ itkTernaryMagnitudeImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx index fbca25c5a71..2cb4155f2be 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryMagnitudeSquaredImageFilterTest.cxx @@ -46,9 +46,9 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create the input images - InputImageType1::Pointer inputImageA = InputImageType1::New(); - InputImageType2::Pointer inputImageB = InputImageType2::New(); - InputImageType3::Pointer inputImageC = InputImageType3::New(); + auto inputImageA = InputImageType1::New(); + auto inputImageB = InputImageType2::New(); + auto inputImageC = InputImageType3::New(); // Define their size, and start index SizeType size; @@ -129,7 +129,7 @@ itkTernaryMagnitudeSquaredImageFilterTest(int, char *[]) // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, TernaryMagnitudeSquaredImageFilter, TernaryGeneratorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx index 77915289613..0e84844ed13 100644 --- a/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkTernaryOperatorImageFilterTest.cxx @@ -73,7 +73,7 @@ itkTernaryOperatorImageFilterTest(int, char *[]) size.Fill(20); MaskImageType::RegionType region(origin, size); - MaskImageType::Pointer mask = MaskImageType::New(); + auto mask = MaskImageType::New(); mask->SetRegions(region); mask->Allocate(); mask->FillBuffer(false); @@ -87,20 +87,20 @@ itkTernaryOperatorImageFilterTest(int, char *[]) maskIt.Set(true); } - constexpr short val1 = 25; - GrayImageType::Pointer image1 = GrayImageType::New(); + constexpr short val1 = 25; + auto image1 = GrayImageType::New(); image1->SetRegions(region); image1->Allocate(); image1->FillBuffer(val1); - constexpr short val2 = 123; - GrayImageType::Pointer image2 = GrayImageType::New(); + constexpr short val2 = 123; + auto image2 = GrayImageType::New(); image2->SetRegions(region); image2->Allocate(); image2->FillBuffer(val2); using TernaryType = itk::TernaryOperatorImageFilter; - TernaryType::Pointer tern = TernaryType::New(); + auto tern = TernaryType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(tern, TernaryOperatorImageFilter, TernaryGeneratorImageFilter); @@ -109,7 +109,7 @@ itkTernaryOperatorImageFilterTest(int, char *[]) tern->SetInput3(image2); tern->Update(); - GrayImageType::Pointer output = GrayImageType::New(); + auto output = GrayImageType::New(); output->Graft(tern->GetOutput()); // Even indices should be equal to val1 (the value of the second input) diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx index a7ffc20e932..f9de199fcba 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorExpandImageFilterTest.cxx @@ -96,7 +96,7 @@ itkVectorExpandImageFilterTest(int, char *[]) ImageType::SizeType size = { { 64, 64 } }; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetLargestPossibleRegion(region); input->SetBufferedRegion(region); input->Allocate(); @@ -132,12 +132,12 @@ itkVectorExpandImageFilterTest(int, char *[]) std::cout << "Run ExpandImageFilter in standalone mode with progress."; std::cout << std::endl; using ExpanderType = itk::VectorExpandImageFilter; - ExpanderType::Pointer expander = ExpanderType::New(); + auto expander = ExpanderType::New(); expander->SetInput(input); using InterpolatorType = itk::VectorNearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); expander->SetInterpolator(interpolator); std::cout << "Interpolator: " << expander->GetInterpolator() << std::endl; @@ -227,11 +227,11 @@ itkVectorExpandImageFilterTest(int, char *[]) std::cout << std::endl; using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(expander->GetInput()); - ExpanderType::Pointer expander2 = ExpanderType::New(); + auto expander2 = ExpanderType::New(); expander2->SetInput(caster->GetOutput()); expander2->SetExpandFactors(expander->GetExpandFactors()); @@ -239,7 +239,7 @@ itkVectorExpandImageFilterTest(int, char *[]) expander2->SetInterpolator(expander->GetModifiableInterpolator()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(expander2->GetOutput()); streamer->SetNumberOfStreamDivisions(3); streamer->Update(); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx index 4b99781a781..490a29fde1e 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorIndexSelectionCastImageFilterTest.cxx @@ -45,15 +45,15 @@ itkVectorIndexSelectionCastImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); using FilterType = itk::VectorIndexSelectionCastImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorMagnitudeImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorMagnitudeImageFilterTest.cxx index d8d29fe9e54..2a4fec5da32 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorMagnitudeImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorMagnitudeImageFilterTest.cxx @@ -39,7 +39,7 @@ itkVectorMagnitudeImageFilterTest(int, char *[]) VectorImageType::RegionType region(start, size); // Construct an image - VectorImageType::Pointer image = VectorImageType::New(); + auto image = VectorImageType::New(); image->SetRegions(region); image->Allocate(); @@ -60,7 +60,7 @@ itkVectorMagnitudeImageFilterTest(int, char *[]) using myMagnitudeFilterType = itk::VectorMagnitudeImageFilter; // Create the filter - myMagnitudeFilterType::Pointer magnitude = myMagnitudeFilterType::New(); + auto magnitude = myMagnitudeFilterType::New(); magnitude->SetInput(image); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx index cce7983fcb0..dbc4c40a8da 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorRescaleIntensityImageFilterTest.cxx @@ -36,7 +36,7 @@ itkVectorRescaleIntensityImageFilterTest(int, char *[]) using InputImageType = itk::Image; using OutputImageType = itk::Image; - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); InputImageType::RegionType region; InputImageType::SizeType size; InputImageType::IndexType index; @@ -58,7 +58,7 @@ itkVectorRescaleIntensityImageFilterTest(int, char *[]) using FilterType = itk::VectorRescaleIntensityImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, VectorRescaleIntensityImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx b/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx index a82d99830a0..34323c060f6 100644 --- a/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkVectorToRGBImageAdaptorTest.cxx @@ -68,7 +68,7 @@ itkVectorToRGBImageAdaptorTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetLargestPossibleRegion(region); @@ -104,7 +104,7 @@ itkVectorToRGBImageAdaptorTest(int, char *[]) ++it1; } - ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New(); + auto adaptor = ImageAdaptorType::New(); adaptor->SetImage(image); diff --git a/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx index a902ca37ae1..5dcb5758182 100644 --- a/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkXorImageFilterTest.cxx @@ -53,8 +53,8 @@ itkXorImageFilterTest(int argc, char * argv[]) using XorImageFilterType = itk::XorImageFilter; // Create the input images - InputImage1Type::Pointer inputImageA = InputImage1Type::New(); - InputImage2Type::Pointer inputImageB = InputImage2Type::New(); + auto inputImageA = InputImage1Type::New(); + auto inputImageB = InputImage2Type::New(); // Define their size, and start index SizeType size; @@ -112,7 +112,7 @@ itkXorImageFilterTest(int argc, char * argv[]) } // Create the filter - XorImageFilterType::Pointer filter = XorImageFilterType::New(); + auto filter = XorImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, XorImageFilter, BinaryGeneratorImageFilter); @@ -130,7 +130,7 @@ itkXorImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx index 92d427ec7e9..8bd4a08ade2 100644 --- a/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkBinaryContourImageFilterTest.cxx @@ -41,11 +41,11 @@ itkBinaryContourImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::BinaryContourImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryContourImageFilter, InPlaceImageFilter); @@ -89,7 +89,7 @@ itkBinaryContourImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx index f3f4cdfd681..279ee5e5d9e 100644 --- a/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkChangeLabelImageFilterTest.cxx @@ -40,7 +40,7 @@ itkChangeLabelImageFilterTest(int, char *[]) // Use a random image source as input using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); InputImageType::SizeValueType sizeArray[ImageDimension] = { 3, 3, 3 }; @@ -55,7 +55,7 @@ itkChangeLabelImageFilterTest(int, char *[]) // Create a filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Eliminate most labels InputPixelType background = 0; diff --git a/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx b/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx index 25f6618ef66..c3f37fca2a3 100644 --- a/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx +++ b/Modules/Filtering/ImageLabel/test/itkLabelContourImageFilterTest.cxx @@ -41,11 +41,11 @@ itkLabelContourImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::LabelContourImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // test default values if (filter->GetFullyConnected() != false) @@ -76,7 +76,7 @@ itkLabelContourImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx index 369ed96c26f..31426112c3a 100644 --- a/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkAdditiveGaussianNoiseImageFilterTest.cxx @@ -39,12 +39,12 @@ itkAdditiveGaussianNoiseImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using AdditiveGaussianNoiseFilterType = itk::AdditiveGaussianNoiseImageFilter; - AdditiveGaussianNoiseFilterType::Pointer additiveGaussianNoiseFilter = AdditiveGaussianNoiseFilterType::New(); + auto additiveGaussianNoiseFilter = AdditiveGaussianNoiseFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( additiveGaussianNoiseFilter, AdditiveGaussianNoiseImageFilter, NoiseBaseImageFilter); @@ -70,7 +70,7 @@ itkAdditiveGaussianNoiseImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(additiveGaussianNoiseFilter, "AdditiveGaussianNoiseImageFilter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(additiveGaussianNoiseFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx b/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx index 3b8244b4196..37e2ec61c49 100644 --- a/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkPeakSignalToNoiseRatioCalculatorTest.cxx @@ -41,16 +41,16 @@ itkPeakSignalToNoiseRatioCalculatorTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); reader2->Update(); using CalculatorType = itk::PeakSignalToNoiseRatioCalculator; - CalculatorType::Pointer psnr = CalculatorType::New(); + auto psnr = CalculatorType::New(); psnr->SetImage(reader->GetOutput()); psnr->SetNoisyImage(reader2->GetOutput()); psnr->Compute(); diff --git a/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx index 5fb4c653a30..ed2c7de3066 100644 --- a/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkSaltAndPepperNoiseImageFilterTest.cxx @@ -41,11 +41,11 @@ itkSaltAndPepperNoiseImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using SaltAndPepperNoiseImageFilterType = itk::SaltAndPepperNoiseImageFilter; - SaltAndPepperNoiseImageFilterType::Pointer saltAndPepperNoiseImageFilter = SaltAndPepperNoiseImageFilterType::New(); + auto saltAndPepperNoiseImageFilter = SaltAndPepperNoiseImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(saltAndPepperNoiseImageFilter, SaltAndPepperNoiseImageFilter, NoiseBaseImageFilter); @@ -73,7 +73,7 @@ itkSaltAndPepperNoiseImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(saltAndPepperNoiseImageFilter, "SaltAndPepperNoiseImageFilter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(saltAndPepperNoiseImageFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx index 6e1af302937..60a14ec9f7b 100644 --- a/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkShotNoiseImageFilterTest.cxx @@ -39,11 +39,11 @@ itkShotNoiseImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ShotNoiseImageFilterType = itk::ShotNoiseImageFilter; - ShotNoiseImageFilterType::Pointer shotNoiseImageFilter = ShotNoiseImageFilterType::New(); + auto shotNoiseImageFilter = ShotNoiseImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(shotNoiseImageFilter, ShotNoiseImageFilter, NoiseBaseImageFilter); @@ -61,7 +61,7 @@ itkShotNoiseImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(shotNoiseImageFilter, "ShotNoiseImageFilter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(shotNoiseImageFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx b/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx index 0f34a070615..05321e6f6c0 100644 --- a/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx +++ b/Modules/Filtering/ImageNoise/test/itkSpeckleNoiseImageFilterTest.cxx @@ -39,11 +39,11 @@ itkSpeckleNoiseImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using SpeckleNoiseImageFilterType = itk::SpeckleNoiseImageFilter; - SpeckleNoiseImageFilterType::Pointer speckleNoiseImageFilter = SpeckleNoiseImageFilterType::New(); + auto speckleNoiseImageFilter = SpeckleNoiseImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(speckleNoiseImageFilter, SpeckleNoiseImageFilter, NoiseBaseImageFilter); @@ -60,7 +60,7 @@ itkSpeckleNoiseImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(speckleNoiseImageFilter, "SpeckleNoiseImageFilter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(speckleNoiseImageFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageSources/include/itkGaborImageSource.hxx b/Modules/Filtering/ImageSources/include/itkGaborImageSource.hxx index a585899ad74..4100a3bbeeb 100644 --- a/Modules/Filtering/ImageSources/include/itkGaborImageSource.hxx +++ b/Modules/Filtering/ImageSources/include/itkGaborImageSource.hxx @@ -49,7 +49,7 @@ GaborImageSource::GenerateData() // Create and initialize a new Gaussian function using KernelFunctionType = GaborKernelFunction; - typename KernelFunctionType::Pointer gabor = KernelFunctionType::New(); + auto gabor = KernelFunctionType::New(); gabor->SetSigma(this->m_Sigma[0]); gabor->SetFrequency(this->m_Frequency); diff --git a/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx b/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx index 17ce9304246..6d4cbc29443 100644 --- a/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx +++ b/Modules/Filtering/ImageSources/include/itkGaussianImageSource.hxx @@ -89,7 +89,7 @@ GaussianImageSource::GenerateData() // Create and initialize a new Gaussian function using FunctionType = GaussianSpatialFunction; - typename FunctionType::Pointer gaussian = FunctionType::New(); + auto gaussian = FunctionType::New(); gaussian->SetSigma(m_Sigma); gaussian->SetMean(m_Mean); diff --git a/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx index c0ebd9c0fb3..c3cf0a0ddf1 100644 --- a/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaborImageSourceTest.cxx @@ -30,7 +30,7 @@ itkGaborImageSourceTestHelper(char * outputFilename, bool calculcateImaginaryPar // Instantiate the filter using GaborSourceType = itk::GaborImageSource; - typename GaborSourceType::Pointer gaborImage = GaborSourceType::New(); + auto gaborImage = GaborSourceType::New(); if (ImageDimension == 2) { @@ -78,7 +78,7 @@ itkGaborImageSourceTestHelper(char * outputFilename, bool calculcateImaginaryPar ITK_TRY_EXPECT_NO_EXCEPTION(gaborImage->Update()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); writer->SetInput(gaborImage->GetOutput()); @@ -104,7 +104,7 @@ itkGaborImageSourceTest(int argc, char * argv[]) // Instantiate the filter using GaborSourceType = itk::GaborImageSource; - GaborSourceType::Pointer gaborImage = GaborSourceType::New(); + auto gaborImage = GaborSourceType::New(); // Exercise basic object methods // Done outside the helper function in the test because GCC is limited diff --git a/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx b/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx index 9b1e883a762..ddbb6b799ac 100644 --- a/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaborKernelFunctionTest.cxx @@ -24,7 +24,7 @@ int itkGaborKernelFunctionTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) { using KernelFunctionType = itk::GaborKernelFunction; - KernelFunctionType::Pointer gabor = KernelFunctionType::New(); + auto gabor = KernelFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(gabor, GaborKernelFunction, KernelFunctionBase); diff --git a/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx index e26324ba407..72f572e0314 100644 --- a/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGaussianImageSourceTest.cxx @@ -38,7 +38,7 @@ itkGaussianImageSourceTest(int argc, char * argv[]) // Create a Gaussian image source using GaussianSourceType = itk::GaussianImageSource; - GaussianSourceType::Pointer gaussianImage = GaussianSourceType::New(); + auto gaussianImage = GaussianSourceType::New(); ImageType::SpacingValueType spacing[] = { 1.2f, 1.3f, 1.4f }; ImageType::PointValueType origin[] = { 1.0f, 4.0f, 2.0f }; @@ -78,7 +78,7 @@ itkGaussianImageSourceTest(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(direction, gaussianImage->GetDirection()); // Test SetReferenceImage from GenerateImageSource base class. - ImageType::Pointer referenceImage = ImageType::New(); + auto referenceImage = ImageType::New(); ImageType::IndexType startIndex; startIndex.Fill(0); ImageType::SizeType referenceSize; @@ -186,7 +186,7 @@ itkGaussianImageSourceTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); diff --git a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx index 8ca80e7ba89..3ea7d9ed5fa 100644 --- a/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkGridImageSourceTest.cxx @@ -49,7 +49,7 @@ itkGridImageSourceTest(int argc, char * argv[]) // Instantiate the filter using GridSourceType = itk::GridImageSource; - GridSourceType::Pointer gridImage = GridSourceType::New(); + auto gridImage = GridSourceType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(gridImage, GridImageSource, GenerateImageSource); @@ -142,13 +142,13 @@ itkGridImageSourceTest(int argc, char * argv[]) if (bSplineOrder == 3) { using KernelType = itk::BSplineKernelFunction<3>; - KernelType::Pointer kernel = KernelType::New(); + auto kernel = KernelType::New(); gridImage->SetKernelFunction(kernel); } else { using KernelType = itk::BSplineKernelFunction<0>; - KernelType::Pointer kernel = KernelType::New(); + auto kernel = KernelType::New(); gridImage->SetKernelFunction(kernel); } } @@ -159,7 +159,7 @@ itkGridImageSourceTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(gridImage->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(gridImage->GetOutput()); diff --git a/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx b/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx index b781ab5a0f3..f64fca13556 100644 --- a/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx +++ b/Modules/Filtering/ImageSources/test/itkPhysicalPointImageSourceTest.cxx @@ -40,7 +40,7 @@ itkPhysicalPointImageSourceTest(const std::string & fname, using PhysicalPointImageSourceType = itk::PhysicalPointImageSource; - typename PhysicalPointImageSourceType::Pointer physicalPointImageSource = PhysicalPointImageSourceType::New(); + auto physicalPointImageSource = PhysicalPointImageSourceType::New(); ITK_TRY_EXPECT_NO_EXCEPTION(physicalPointImageSource->UpdateLargestPossibleRegion()); @@ -55,12 +55,12 @@ itkPhysicalPointImageSourceTest(const std::string & fname, itk::Image::ValueType, ImageType::ImageDimension>; using ValueImageCastFilter = itk::VectorIndexSelectionCastImageFilter; - typename ValueImageCastFilter::Pointer vif = ValueImageCastFilter::New(); + auto vif = ValueImageCastFilter::New(); vif->SetInput(physicalPointImageSource->GetOutput()); vif->SetIndex(0); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(fname); writer->SetInput(vif->GetOutput()); @@ -99,7 +99,7 @@ itkPhysicalPointImageSourceTest(int argc, char * argv[]) itk::PhysicalPointImageSource, ImageDimension>>; // Instantiate the filter - PhysicalPointImageSourceType::Pointer physicalPointImageSource = PhysicalPointImageSourceType::New(); + auto physicalPointImageSource = PhysicalPointImageSourceType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(physicalPointImageSource, PhysicalPointImageSource, GenerateImageSource); diff --git a/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.hxx b/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.hxx index e7416703586..5095244795f 100644 --- a/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.hxx +++ b/Modules/Filtering/ImageStatistics/include/itkAdaptiveHistogramEqualizationImageFilter.hxx @@ -37,14 +37,14 @@ template void AdaptiveHistogramEqualizationImageFilter::BeforeThreadedGenerateData() { - typename ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->Graft(const_cast(this->GetInput())); // Calculate min and max gray level of an input image // NOTE: This computation of min/max means that this filter should // not be able to stream. using MinMaxFilter = MinimumMaximumImageFilter; - typename MinMaxFilter::Pointer minmax = MinMaxFilter::New(); + auto minmax = MinMaxFilter::New(); minmax->SetInput(input); minmax->Update(); diff --git a/Modules/Filtering/ImageStatistics/test/itkAccumulateImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkAccumulateImageFilterTest.cxx index 67f591aef6c..32f99bbf497 100644 --- a/Modules/Filtering/ImageStatistics/test/itkAccumulateImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkAccumulateImageFilterTest.cxx @@ -46,14 +46,14 @@ itkAccumulateImageFilterTest(int argc, char * argv[]) } // Get the input filenames - SeriesFileNames::Pointer names = SeriesFileNames::New(); + auto names = SeriesFileNames::New(); // Get the DICOM filenames from the directory names->SetInputDirectory(argv[1]); // Create the reader - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto gdcmIO = ImageIOType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(gdcmIO); try { @@ -68,7 +68,7 @@ itkAccumulateImageFilterTest(int argc, char * argv[]) } // Accumulate the input images - AccumulaterType::Pointer accumulate = AccumulaterType::New(); + auto accumulate = AccumulaterType::New(); accumulate->SetInput(reader->GetOutput()); accumulate->SetAccumulateDimension(2); @@ -90,7 +90,7 @@ itkAccumulateImageFilterTest(int argc, char * argv[]) accumulate->AverageOff(); try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(accumulate->GetOutput()); @@ -109,7 +109,7 @@ itkAccumulateImageFilterTest(int argc, char * argv[]) try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(accumulate->GetOutput()); diff --git a/Modules/Filtering/ImageStatistics/test/itkAdaptiveHistogramEqualizationImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkAdaptiveHistogramEqualizationImageFilterTest.cxx index d41a9a4c4e6..5af5421745d 100644 --- a/Modules/Filtering/ImageStatistics/test/itkAdaptiveHistogramEqualizationImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkAdaptiveHistogramEqualizationImageFilterTest.cxx @@ -43,13 +43,13 @@ itkAdaptiveHistogramEqualizationImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using FilterType = itk::AdaptiveHistogramEqualizationImageFilter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); FilterType::ImageSizeType radius; radius.Fill(std::stoi(argv[3])); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AdaptiveHistogramEqualizationImageFilter, MovingHistogramImageFilter); @@ -78,7 +78,7 @@ itkAdaptiveHistogramEqualizationImageFilterTest(int argc, char * argv[]) using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); rescaler->SetInput(filter->GetOutput()); @@ -86,7 +86,7 @@ itkAdaptiveHistogramEqualizationImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx index 0d4ee0232e5..7de0b56f0b3 100644 --- a/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkBinaryProjectionImageFilterTest.cxx @@ -41,13 +41,13 @@ itkBinaryProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // produce an image with 3 labels: 0 (background), 100 and 200 using LabelerType = itk::ThresholdLabelerImageFilter; - LabelerType::Pointer labeler = LabelerType::New(); + auto labeler = LabelerType::New(); labeler->SetInput(reader->GetOutput()); LabelerType::RealThresholdVector thresholds; thresholds.push_back(100); @@ -55,13 +55,13 @@ itkBinaryProjectionImageFilterTest(int argc, char * argv[]) labeler->SetRealThresholds(thresholds); using ChangeType = itk::ChangeLabelImageFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(labeler->GetOutput()); change->SetChange(1, 100); change->SetChange(2, 200); using FilterType = itk::BinaryProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(change->GetOutput()); // Exercise Set/Get methods for Foreground Value @@ -89,7 +89,7 @@ itkBinaryProjectionImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkGetAverageSliceImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkGetAverageSliceImageFilterTest.cxx index 088d3ad54c9..4ce3dac697c 100644 --- a/Modules/Filtering/ImageStatistics/test/itkGetAverageSliceImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkGetAverageSliceImageFilterTest.cxx @@ -46,14 +46,14 @@ itkGetAverageSliceImageFilterTest(int argc, char * argv[]) } // Get the input filenames - SeriesFileNames::Pointer names = SeriesFileNames::New(); + auto names = SeriesFileNames::New(); // Get the DICOM filenames from the directory names->SetInputDirectory(argv[1]); // Create the reader - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto gdcmIO = ImageIOType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(gdcmIO); try { @@ -68,7 +68,7 @@ itkGetAverageSliceImageFilterTest(int argc, char * argv[]) } // GetAverage the input images - GetAveragerType::Pointer average = GetAveragerType::New(); + auto average = GetAveragerType::New(); average->SetInput(reader->GetOutput()); average->SetAveragedOutDimension(2); @@ -88,7 +88,7 @@ itkGetAverageSliceImageFilterTest(int argc, char * argv[]) try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(average->GetOutput()); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx index 48b7e127ea6..97a6d2583d4 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest1.cxx @@ -41,7 +41,7 @@ itkHistogramToEntropyImageFilterTest1(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -56,7 +56,7 @@ itkHistogramToEntropyImageFilterTest1(int argc, char * argv[]) using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); const int NumberOfBins = static_cast(imageMax - imageMin + 1); @@ -74,14 +74,14 @@ itkHistogramToEntropyImageFilterTest1(int argc, char * argv[]) using HistogramToImageFilterType = itk::HistogramToEntropyImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx index b37b96bd6a4..f78fcf657da 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToEntropyImageFilterTest2.cxx @@ -43,8 +43,8 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -55,7 +55,7 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) using JoinFilterType = itk::JoinImageFilter; - JoinFilterType::Pointer joinFilter = JoinFilterType::New(); + auto joinFilter = JoinFilterType::New(); using ArrayImageType = JoinFilterType::OutputImageType; @@ -88,7 +88,7 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) imageMax[1] = minmaxFilter->GetMaximum(); - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(joinFilter->GetOutput()); @@ -111,14 +111,14 @@ itkHistogramToEntropyImageFilterTest2(int argc, char * argv[]) const HistogramType * histogram = histogramFilter->GetOutput(); using HistogramToImageFilterType = itk::HistogramToEntropyImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx index 4ecc7844197..5143dc8c9ce 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest1.cxx @@ -41,7 +41,7 @@ itkHistogramToIntensityImageFilterTest1(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -59,7 +59,7 @@ itkHistogramToIntensityImageFilterTest1(int argc, char * argv[]) using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); const int NumberOfBins = static_cast(imageMax - imageMin + 1); @@ -76,14 +76,14 @@ itkHistogramToIntensityImageFilterTest1(int argc, char * argv[]) const HistogramType * histogram = histogramGenerator->GetOutput(); using HistogramToImageFilterType = itk::HistogramToIntensityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx index be41338fd8e..35ca38b94d1 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToIntensityImageFilterTest2.cxx @@ -43,8 +43,8 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -55,7 +55,7 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) using JoinFilterType = itk::JoinImageFilter; - JoinFilterType::Pointer joinFilter = JoinFilterType::New(); + auto joinFilter = JoinFilterType::New(); using ArrayImageType = JoinFilterType::OutputImageType; @@ -89,7 +89,7 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) imageMax[1] = minmaxFilter->GetMaximum(); - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(joinFilter->GetOutput()); @@ -112,14 +112,14 @@ itkHistogramToIntensityImageFilterTest2(int argc, char * argv[]) const HistogramType * histogram = histogramFilter->GetOutput(); using HistogramToImageFilterType = itk::HistogramToIntensityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx index 9995890e482..266ac79216a 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest1.cxx @@ -41,7 +41,7 @@ itkHistogramToLogProbabilityImageFilterTest1(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -59,7 +59,7 @@ itkHistogramToLogProbabilityImageFilterTest1(int argc, char * argv[]) using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); const int NumberOfBins = static_cast(imageMax - imageMin + 1); @@ -77,14 +77,14 @@ itkHistogramToLogProbabilityImageFilterTest1(int argc, char * argv[]) using HistogramToImageFilterType = itk::HistogramToLogProbabilityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx index 7f42af0d72c..b6f7010780f 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToLogProbabilityImageFilterTest2.cxx @@ -43,8 +43,8 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -55,7 +55,7 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) using JoinFilterType = itk::JoinImageFilter; - JoinFilterType::Pointer joinFilter = JoinFilterType::New(); + auto joinFilter = JoinFilterType::New(); using ArrayImageType = JoinFilterType::OutputImageType; @@ -88,7 +88,7 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) imageMax[1] = minmaxFilter->GetMaximum(); - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(joinFilter->GetOutput()); @@ -111,14 +111,14 @@ itkHistogramToLogProbabilityImageFilterTest2(int argc, char * argv[]) const HistogramType * histogram = histogramFilter->GetOutput(); using HistogramToImageFilterType = itk::HistogramToLogProbabilityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx index fce1016c817..32ede43f7e9 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest1.cxx @@ -41,7 +41,7 @@ itkHistogramToProbabilityImageFilterTest1(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -56,7 +56,7 @@ itkHistogramToProbabilityImageFilterTest1(int argc, char * argv[]) using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); const int NumberOfBins = static_cast(imageMax - imageMin + 1); @@ -75,14 +75,14 @@ itkHistogramToProbabilityImageFilterTest1(int argc, char * argv[]) using HistogramToImageFilterType = itk::HistogramToProbabilityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx index 076608e1568..a21e9c969df 100644 --- a/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkHistogramToProbabilityImageFilterTest2.cxx @@ -43,8 +43,8 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -63,7 +63,7 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) using JoinFilterType = itk::JoinImageFilter; - JoinFilterType::Pointer joinFilter = JoinFilterType::New(); + auto joinFilter = JoinFilterType::New(); using ArrayImageType = JoinFilterType::OutputImageType; @@ -95,7 +95,7 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) imageMax[1] = minmaxFilter->GetMaximum(); - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(joinFilter->GetOutput()); @@ -118,14 +118,14 @@ itkHistogramToProbabilityImageFilterTest2(int argc, char * argv[]) const HistogramType * histogram = histogramFilter->GetOutput(); using HistogramToImageFilterType = itk::HistogramToProbabilityImageFilter; - HistogramToImageFilterType::Pointer histogramToImageFilter = HistogramToImageFilterType::New(); + auto histogramToImageFilter = HistogramToImageFilterType::New(); histogramToImageFilter->SetInput(histogram); using OutputImageType = HistogramToImageFilterType::OutputImageType; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx index cef67b7a4bc..a01fa4a1623 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImageMomentsTest.cxx @@ -87,7 +87,7 @@ itkImageMomentsTest(int argc, char * argv[]) tpa.GetVnlMatrix().set((double *)pad); /* Allocate a simple test image */ - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); @@ -113,14 +113,14 @@ itkImageMomentsTest(int argc, char * argv[]) } /* Compute the moments */ - CalculatorType::Pointer moments = CalculatorType::New(); + auto moments = CalculatorType::New(); moments->SetImage(image); if (maskCondition == std::string("mask")) { // Test the mask spatial object for masked ImageMomentsTest // Make a mask that covers the entire image space using MaskImageType = itk::Image; - MaskImageType::Pointer maskimg = MaskImageType::New(); + auto maskimg = MaskImageType::New(); maskimg->CopyInformation(image); maskimg->SetRegions(image->GetLargestPossibleRegion()); maskimg->Allocate(); @@ -129,7 +129,7 @@ itkImageMomentsTest(int argc, char * argv[]) // convert mask image to mask using LFFImageMaskSpatialObjectType = typename itk::ImageMaskSpatialObject; - typename LFFImageMaskSpatialObjectType::Pointer mask = LFFImageMaskSpatialObjectType::New(); + auto mask = LFFImageMaskSpatialObjectType::New(); mask->SetImage(maskimg.GetPointer()); mask->Update(); // Purposefully use the base class type @@ -210,7 +210,7 @@ itkImageMomentsTest(int argc, char * argv[]) /* Do some error checking on the transforms */ double dist = pa2p->Metric(pa2p); std::cout << "Distance from self to self = " << dist << std::endl; - AffineTransformType::Pointer p2pa2p = AffineTransformType::New(); + auto p2pa2p = AffineTransformType::New(); p2pa2p->Compose(p2pa); p2pa2p->Compose(pa2p); double trerr = p2pa2p->Metric(); diff --git a/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx index 9728b4741e2..7aa82c5d5c0 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImagePCADecompositionCalculatorTest.cxx @@ -58,21 +58,21 @@ itkImagePCADecompositionCalculatorTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image1 = InputImageType::New(); + auto image1 = InputImageType::New(); - InputImageType::Pointer image2 = InputImageType::New(); + auto image2 = InputImageType::New(); - InputImageType::Pointer image3 = InputImageType::New(); + auto image3 = InputImageType::New(); - InputImageType::Pointer image4 = InputImageType::New(); + auto image4 = InputImageType::New(); - InputImageType::Pointer image5 = InputImageType::New(); + auto image5 = InputImageType::New(); - InputImageType::Pointer image6 = InputImageType::New(); + auto image6 = InputImageType::New(); - InputImageType::Pointer image7 = InputImageType::New(); + auto image7 = InputImageType::New(); - InputImageType::Pointer image8 = InputImageType::New(); + auto image8 = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -264,7 +264,7 @@ itkImagePCADecompositionCalculatorTest(int, char *[]) //---------------------------------------------------------------------- using ImagePCAShapeModelEstimatorType = itk::ImagePCADecompositionCalculator; - ImagePCAShapeModelEstimatorType::Pointer decomposer = ImagePCAShapeModelEstimatorType::New(); + auto decomposer = ImagePCAShapeModelEstimatorType::New(); //---------------------------------------------------------------------- // Set the parameters of the clusterer diff --git a/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx b/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx index 78a3140dbdd..3636681c754 100644 --- a/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkImagePCAShapeModelEstimatorTest.cxx @@ -61,11 +61,11 @@ itkImagePCAShapeModelEstimatorTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; using OutputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image1 = InputImageType::New(); + auto image1 = InputImageType::New(); - InputImageType::Pointer image2 = InputImageType::New(); + auto image2 = InputImageType::New(); - InputImageType::Pointer image3 = InputImageType::New(); + auto image3 = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -136,7 +136,7 @@ itkImagePCAShapeModelEstimatorTest(int, char *[]) // Set the image model estimator using ImagePCAShapeModelEstimatorType = itk::ImagePCAShapeModelEstimator; - ImagePCAShapeModelEstimatorType::Pointer applyPCAShapeEstimator = ImagePCAShapeModelEstimatorType::New(); + auto applyPCAShapeEstimator = ImagePCAShapeModelEstimatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(applyPCAShapeEstimator, ImagePCAShapeModelEstimator, ImageShapeModelEstimatorBase); diff --git a/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx index dbd65dea679..d9e913731a9 100644 --- a/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkLabelOverlapMeasuresImageFilterTest.cxx @@ -30,13 +30,13 @@ LabelOverlapMeasures(int, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[2]); - typename ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[3]); using FilterType = itk::LabelOverlapMeasuresImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetSourceImage(reader1->GetOutput()); filter->SetTargetImage(reader2->GetOutput()); filter->Update(); diff --git a/Modules/Filtering/ImageStatistics/test/itkLabelStatisticsImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkLabelStatisticsImageFilterTest.cxx index df6f4011682..14cd24e0bd4 100644 --- a/Modules/Filtering/ImageStatistics/test/itkLabelStatisticsImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkLabelStatisticsImageFilterTest.cxx @@ -41,8 +41,8 @@ itkLabelStatisticsImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader1 = ReaderType::New(); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader1 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader1->SetFileName(argv[1]); reader2->SetFileName(argv[2]); @@ -57,7 +57,7 @@ itkLabelStatisticsImageFilterTest(int argc, char * argv[]) using FilterType = itk::LabelStatisticsImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); diff --git a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx index c0d5ea282d1..2e9ce9dfaa9 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest.cxx @@ -40,17 +40,17 @@ itkMaximumProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::MaximumProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest2.cxx b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest2.cxx index 2eddd9205f4..e27cc509d77 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest2.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest2.cxx @@ -43,11 +43,11 @@ itkMaximumProjectionImageFilterTest2(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[2]); using FilterType = itk::MaximumProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetProjectionDimension(dim); // to be sure that the result is ok with several threads, even on a single @@ -57,7 +57,7 @@ itkMaximumProjectionImageFilterTest2(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest3.cxx b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest3.cxx index 2f4aeb3079d..c208a91d70e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest3.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMaximumProjectionImageFilterTest3.cxx @@ -42,19 +42,19 @@ itkMaximumProjectionImageFilterTest3(int argc, char * argv[]) using Image2DType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[2]); using FilterType = itk::MaximumProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetProjectionDimension(dim); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx index 5521d1e8737..f8827564bef 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMeanProjectionImageFilterTest.cxx @@ -39,17 +39,17 @@ itkMeanProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::MeanProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx index bab824ccaa4..e9bd3923065 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMedianProjectionImageFilterTest.cxx @@ -40,17 +40,17 @@ itkMedianProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::MedianProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterGTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterGTest.cxx index 9261bcbcf7e..e9b8fc5b983 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterGTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterGTest.cxx @@ -52,7 +52,7 @@ class MinimumMaximumFixture : public ::testing::Test // Create an image of all 1s with a random 0, and 2 valued pixel // - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(m_ImageSize); diff --git a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx index 7fb6a826482..464de9abf78 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMinimumMaximumImageFilterTest.cxx @@ -38,7 +38,7 @@ itkMinimumMaximumImageFilterTest(int, char *[]) std::cout << "Testing Minimum and Maximum Image Calulator:\n"; // Allocate a simple test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; region.SetSize(size); image->SetLargestPossibleRegion(region); @@ -77,8 +77,8 @@ itkMinimumMaximumImageFilterTest(int, char *[]) image->SetPixel(index, maximum); // Create and initialize the filter - MinMaxFilterType::Pointer filter = MinMaxFilterType::New(); - itk::SimpleFilterWatcher watcher(filter); + auto filter = MinMaxFilterType::New(); + itk::SimpleFilterWatcher watcher(filter); filter->SetInput(image); filter->Update(); diff --git a/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx index a90fea92637..bde14fc7973 100644 --- a/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkMinimumProjectionImageFilterTest.cxx @@ -39,17 +39,17 @@ itkMinimumProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::MinimumProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx index 030698d845d..44029e3bd3a 100644 --- a/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkProjectionImageFilterTest.cxx @@ -92,13 +92,13 @@ itkProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // produce an image with 3 labels: 0 (background), 100 and 200 using LabelerType = itk::ThresholdLabelerImageFilter; - LabelerType::Pointer labeler = LabelerType::New(); + auto labeler = LabelerType::New(); labeler->SetInput(reader->GetOutput()); LabelerType::RealThresholdVector thresholds; thresholds.push_back(100); @@ -106,7 +106,7 @@ itkProjectionImageFilterTest(int argc, char * argv[]) labeler->SetRealThresholds(thresholds); using ChangeType = itk::ChangeLabelImageFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(labeler->GetOutput()); change->SetChange(1, 100); change->SetChange(2, 200); @@ -115,7 +115,7 @@ itkProjectionImageFilterTest(int argc, char * argv[]) using FilterType = itk::ProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ProjectionImageFilter, ImageToImageFilter); @@ -130,7 +130,7 @@ itkProjectionImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx index aba054ec009..a9f427a31ad 100644 --- a/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkStandardDeviationProjectionImageFilterTest.cxx @@ -40,17 +40,17 @@ itkStandardDeviationProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::StandardDeviationProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx index 7c493e2c16a..e4dc40160ca 100644 --- a/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkStatisticsImageFilterTest.cxx @@ -46,7 +46,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) itk::Statistics::MersenneTwisterRandomVariateGenerator::GetInstance()->SetSeed(987); - FloatImage::Pointer image = FloatImage::New(); + auto image = FloatImage::New(); FloatImage::RegionType region; FloatImage::SizeType size; size.Fill(64); @@ -66,7 +66,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) float sumOfSquares = std::pow(fillValue, 2.0) * static_cast(region.GetNumberOfPixels()); using FilterType = itk::StatisticsImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); @@ -112,7 +112,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) // Now generate a real image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); FloatImage::SizeValueType randomSize[3] = { 17, 8, 241 }; @@ -142,7 +142,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) double knownVariance = 10.0; using DoubleImage = itk::Image; - DoubleImage::Pointer dImage = DoubleImage::New(); + auto dImage = DoubleImage::New(); DoubleImage::SizeType dsize; DoubleImage::IndexType dindex; DoubleImage::RegionType dregion; @@ -159,7 +159,7 @@ itkStatisticsImageFilterTest(int argc, char * argv[]) ++it; } using DFilterType = itk::StatisticsImageFilter; - DFilterType::Pointer dfilter = DFilterType::New(); + auto dfilter = DFilterType::New(); dfilter->SetInput(dImage); dfilter->SetNumberOfStreamDivisions(numberOfStreamDivisions); ITK_TRY_EXPECT_NO_EXCEPTION(dfilter->UpdateLargestPossibleRegion()); diff --git a/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx b/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx index 790be21ac66..392236f3e8e 100644 --- a/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx +++ b/Modules/Filtering/ImageStatistics/test/itkSumProjectionImageFilterTest.cxx @@ -42,17 +42,17 @@ itkSumProjectionImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::SumProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx index 32aed75fcde..71fc32f064d 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryFillholeImageFilter.hxx @@ -75,14 +75,14 @@ BinaryFillholeImageFilter::GenerateData() } // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); using NotType = BinaryNotImageFilter; - typename NotType::Pointer notInput = NotType::New(); + auto notInput = NotType::New(); notInput->SetInput(this->GetInput()); notInput->SetForegroundValue(m_ForegroundValue); notInput->SetBackgroundValue(backgroundValue); @@ -91,7 +91,7 @@ BinaryFillholeImageFilter::GenerateData() progress->RegisterInternalFilter(notInput, .2f); using LabelizerType = typename itk::BinaryImageToShapeLabelMapFilter; - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(notInput->GetOutput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(backgroundValue); @@ -101,7 +101,7 @@ BinaryFillholeImageFilter::GenerateData() using LabelMapType = typename LabelizerType::OutputImageType; using OpeningType = typename itk::ShapeOpeningLabelMapFilter; - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(labelizer->GetOutput()); opening->SetAttribute(LabelMapType::LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER); opening->SetLambda(1); @@ -110,7 +110,7 @@ BinaryFillholeImageFilter::GenerateData() // invert the image during the binarization using BinarizerType = typename itk::LabelMapMaskImageFilter; - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetLabel(backgroundValue); binarizer->SetNegated(true); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryGrindPeakImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryGrindPeakImageFilter.hxx index e575d8bdf65..354e3ec2bb7 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryGrindPeakImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryGrindPeakImageFilter.hxx @@ -61,14 +61,14 @@ void BinaryGrindPeakImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); using LabelizerType = typename itk::BinaryImageToShapeLabelMapFilter; - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -78,7 +78,7 @@ BinaryGrindPeakImageFilter::GenerateData() using LabelMapType = typename LabelizerType::OutputImageType; using OpeningType = typename itk::ShapeOpeningLabelMapFilter; - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(labelizer->GetOutput()); opening->SetAttribute(LabelMapType::LabelObjectType::NUMBER_OF_PIXELS_ON_BORDER); opening->SetLambda(1); @@ -86,7 +86,7 @@ BinaryGrindPeakImageFilter::GenerateData() progress->RegisterInternalFilter(opening, .1f); using BinarizerType = typename itk::LabelMapToBinaryImageFilter; - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryImageToShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryImageToShapeLabelMapFilter.hxx index e2d8924111a..eb68725197a 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryImageToShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryImageToShapeLabelMapFilter.hxx @@ -61,14 +61,14 @@ void BinaryImageToShapeLabelMapFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_InputForegroundValue); labelizer->SetOutputBackgroundValue(m_OutputBackgroundValue); @@ -76,7 +76,7 @@ BinaryImageToShapeLabelMapFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .5f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); valuator->SetComputePerimeter(m_ComputePerimeter); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryImageToStatisticsLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryImageToStatisticsLabelMapFilter.hxx index ec49dea7495..12a31c12745 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryImageToStatisticsLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryImageToStatisticsLabelMapFilter.hxx @@ -64,14 +64,14 @@ void BinaryImageToStatisticsLabelMapFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_InputForegroundValue); labelizer->SetOutputBackgroundValue(m_OutputBackgroundValue); @@ -79,7 +79,7 @@ BinaryImageToStatisticsLabelMapFilter: labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .5f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByDilationImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByDilationImageFilter.hxx index 0c825f830e4..7ba6d997c96 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByDilationImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByDilationImageFilter.hxx @@ -70,13 +70,13 @@ void BinaryReconstructionByDilationImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetMaskImage()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -84,20 +84,20 @@ BinaryReconstructionByDilationImageFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .25f); - typename ReconstructionType::Pointer reconstruction = ReconstructionType::New(); + auto reconstruction = ReconstructionType::New(); reconstruction->SetInput(labelizer->GetOutput()); reconstruction->SetMarkerImage(this->GetMarkerImage()); reconstruction->SetForegroundValue(m_ForegroundValue); reconstruction->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(reconstruction, .25f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(reconstruction->GetOutput()); opening->SetLambda(true); opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .25f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByErosionImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByErosionImageFilter.hxx index 5acf3044c22..03e03446e25 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByErosionImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryReconstructionByErosionImageFilter.hxx @@ -70,27 +70,27 @@ void BinaryReconstructionByErosionImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename NotType::Pointer notMask = NotType::New(); + auto notMask = NotType::New(); notMask->SetInput(this->GetMaskImage()); notMask->SetForegroundValue(m_ForegroundValue); notMask->SetBackgroundValue(m_BackgroundValue); notMask->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(notMask, .1f); - typename NotType::Pointer notMarker = NotType::New(); + auto notMarker = NotType::New(); notMarker->SetInput(this->GetMarkerImage()); notMarker->SetForegroundValue(m_ForegroundValue); notMarker->SetBackgroundValue(m_BackgroundValue); notMarker->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(notMarker, .1f); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(notMask->GetOutput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -98,21 +98,21 @@ BinaryReconstructionByErosionImageFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .2f); - typename ReconstructionType::Pointer reconstruction = ReconstructionType::New(); + auto reconstruction = ReconstructionType::New(); reconstruction->SetInput(labelizer->GetOutput()); reconstruction->SetMarkerImage(notMarker->GetOutput()); reconstruction->SetForegroundValue(m_ForegroundValue); reconstruction->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(reconstruction, .2f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(reconstruction->GetOutput()); opening->SetLambda(true); opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); // invert the image during the binarization - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetLabel(m_BackgroundValue); binarizer->SetNegated(true); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryShapeKeepNObjectsImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryShapeKeepNObjectsImageFilter.hxx index 159cb1f6179..bd821d2f1eb 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryShapeKeepNObjectsImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryShapeKeepNObjectsImageFilter.hxx @@ -57,14 +57,14 @@ void BinaryShapeKeepNObjectsImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -72,7 +72,7 @@ BinaryShapeKeepNObjectsImageFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); if (m_Attribute != LabelObjectType::PERIMETER && m_Attribute != LabelObjectType::ROUNDNESS) @@ -85,7 +85,7 @@ BinaryShapeKeepNObjectsImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename KeepNObjectsType::Pointer opening = KeepNObjectsType::New(); + auto opening = KeepNObjectsType::New(); opening->SetInput(valuator->GetOutput()); opening->SetNumberOfObjects(m_NumberOfObjects); opening->SetReverseOrdering(m_ReverseOrdering); @@ -93,7 +93,7 @@ BinaryShapeKeepNObjectsImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryShapeOpeningImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryShapeOpeningImageFilter.hxx index 3c3b8d1a36f..043a5b18f39 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryShapeOpeningImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryShapeOpeningImageFilter.hxx @@ -61,14 +61,14 @@ void BinaryShapeOpeningImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -76,7 +76,7 @@ BinaryShapeOpeningImageFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); if (m_Attribute != LabelObjectType::PERIMETER && m_Attribute != LabelObjectType::ROUNDNESS) @@ -89,7 +89,7 @@ BinaryShapeOpeningImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(valuator->GetOutput()); opening->SetLambda(m_Lambda); opening->SetReverseOrdering(m_ReverseOrdering); @@ -97,7 +97,7 @@ BinaryShapeOpeningImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryStatisticsKeepNObjectsImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryStatisticsKeepNObjectsImageFilter.hxx index b14b98ae920..ed4d3a6901a 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryStatisticsKeepNObjectsImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryStatisticsKeepNObjectsImageFilter.hxx @@ -59,14 +59,14 @@ void BinaryStatisticsKeepNObjectsImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -74,7 +74,7 @@ BinaryStatisticsKeepNObjectsImageFilter::GenerateDat labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -89,7 +89,7 @@ BinaryStatisticsKeepNObjectsImageFilter::GenerateDat } progress->RegisterInternalFilter(valuator, .3f); - typename KeepNObjectsType::Pointer opening = KeepNObjectsType::New(); + auto opening = KeepNObjectsType::New(); opening->SetInput(valuator->GetOutput()); opening->SetNumberOfObjects(m_NumberOfObjects); opening->SetReverseOrdering(m_ReverseOrdering); @@ -97,7 +97,7 @@ BinaryStatisticsKeepNObjectsImageFilter::GenerateDat opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkBinaryStatisticsOpeningImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkBinaryStatisticsOpeningImageFilter.hxx index 13e88ba3ef1..ee2c3ce7d2a 100644 --- a/Modules/Filtering/LabelMap/include/itkBinaryStatisticsOpeningImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkBinaryStatisticsOpeningImageFilter.hxx @@ -62,14 +62,14 @@ void BinaryStatisticsOpeningImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetInputForegroundValue(m_ForegroundValue); labelizer->SetOutputBackgroundValue(m_BackgroundValue); @@ -77,7 +77,7 @@ BinaryStatisticsOpeningImageFilter::GenerateData() labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -92,7 +92,7 @@ BinaryStatisticsOpeningImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(valuator->GetOutput()); opening->SetLambda(m_Lambda); opening->SetReverseOrdering(m_ReverseOrdering); @@ -100,7 +100,7 @@ BinaryStatisticsOpeningImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetForegroundValue(m_ForegroundValue); binarizer->SetBackgroundValue(m_BackgroundValue); diff --git a/Modules/Filtering/LabelMap/include/itkChangeRegionLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkChangeRegionLabelMapFilter.hxx index 7322f1ed09c..590113a601e 100644 --- a/Modules/Filtering/LabelMap/include/itkChangeRegionLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkChangeRegionLabelMapFilter.hxx @@ -93,7 +93,7 @@ template void ChangeRegionLabelMapFilter::ThreadedProcessLabelObject(LabelObjectType * labelObject) { - typename LabelObjectType::Pointer tmp = LabelObjectType::New(); + auto tmp = LabelObjectType::New(); tmp->template CopyAllFrom(labelObject); labelObject->Clear(); diff --git a/Modules/Filtering/LabelMap/include/itkConvertLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkConvertLabelMapFilter.hxx index 685a3788164..7b6562f634e 100644 --- a/Modules/Filtering/LabelMap/include/itkConvertLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkConvertLabelMapFilter.hxx @@ -40,8 +40,8 @@ ConvertLabelMapFilter::GenerateData() for (typename TInputImage::ConstIterator it(inputImage); !it.IsAtEnd(); ++it) { - const LabelObjectType * labelObject = it.GetLabelObject(); - typename OutputLabelObjectType::Pointer newLabelObject = OutputLabelObjectType::New(); + const LabelObjectType * labelObject = it.GetLabelObject(); + auto newLabelObject = OutputLabelObjectType::New(); newLabelObject->template CopyAllFrom(labelObject); outputImage->AddLabelObject(newLabelObject); progress.CompletedPixel(); diff --git a/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx index 1d27632b4c5..e620f95d79d 100644 --- a/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkInPlaceLabelMapFilter.hxx @@ -111,7 +111,7 @@ InPlaceLabelMapFilter::AllocateOutputs() itkAssertInDebugAndIgnoreInReleaseMacro(labelObject != nullptr); itkAssertInDebugAndIgnoreInReleaseMacro(labelObject->GetLabel() == it.GetLabel()); - typename LabelObjectType::Pointer newLabelObject = LabelObjectType::New(); + auto newLabelObject = LabelObjectType::New(); newLabelObject->template CopyAllFrom(labelObject); output->AddLabelObject(newLabelObject); diff --git a/Modules/Filtering/LabelMap/include/itkLabelImageToShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelImageToShapeLabelMapFilter.hxx index 7ab22ceec28..c278e00fd4c 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelImageToShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelImageToShapeLabelMapFilter.hxx @@ -59,20 +59,20 @@ void LabelImageToShapeLabelMapFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .5f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); valuator->SetComputePerimeter(m_ComputePerimeter); diff --git a/Modules/Filtering/LabelMap/include/itkLabelImageToStatisticsLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelImageToStatisticsLabelMapFilter.hxx index 31649d642a0..4d43f46dc5a 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelImageToStatisticsLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelImageToStatisticsLabelMapFilter.hxx @@ -62,20 +62,20 @@ void LabelImageToStatisticsLabelMapFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .5f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); diff --git a/Modules/Filtering/LabelMap/include/itkLabelShapeKeepNObjectsImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelShapeKeepNObjectsImageFilter.hxx index f343106ff47..c4289885399 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelShapeKeepNObjectsImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelShapeKeepNObjectsImageFilter.hxx @@ -59,20 +59,20 @@ void LabelShapeKeepNObjectsImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetLabelImage(this->GetInput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -86,7 +86,7 @@ LabelShapeKeepNObjectsImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename KeepNObjectsType::Pointer opening = KeepNObjectsType::New(); + auto opening = KeepNObjectsType::New(); opening->SetInput(valuator->GetOutput()); opening->SetNumberOfObjects(m_NumberOfObjects); opening->SetReverseOrdering(m_ReverseOrdering); @@ -94,7 +94,7 @@ LabelShapeKeepNObjectsImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/include/itkLabelShapeOpeningImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelShapeOpeningImageFilter.hxx index ae48033cbc0..db08bf68f0e 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelShapeOpeningImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelShapeOpeningImageFilter.hxx @@ -59,20 +59,20 @@ void LabelShapeOpeningImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetLabelImage(this->GetInput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -86,7 +86,7 @@ LabelShapeOpeningImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(valuator->GetOutput()); opening->SetLambda(m_Lambda); opening->SetReverseOrdering(m_ReverseOrdering); @@ -94,7 +94,7 @@ LabelShapeOpeningImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/include/itkLabelStatisticsKeepNObjectsImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelStatisticsKeepNObjectsImageFilter.hxx index 58236b3c22f..0774d0732be 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelStatisticsKeepNObjectsImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelStatisticsKeepNObjectsImageFilter.hxx @@ -60,20 +60,20 @@ void LabelStatisticsKeepNObjectsImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetLabelImage(this->GetInput()); @@ -89,7 +89,7 @@ LabelStatisticsKeepNObjectsImageFilter::GenerateData } progress->RegisterInternalFilter(valuator, .3f); - typename KeepNObjectsType::Pointer opening = KeepNObjectsType::New(); + auto opening = KeepNObjectsType::New(); opening->SetInput(valuator->GetOutput()); opening->SetNumberOfObjects(m_NumberOfObjects); opening->SetReverseOrdering(m_ReverseOrdering); @@ -97,7 +97,7 @@ LabelStatisticsKeepNObjectsImageFilter::GenerateData opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/include/itkLabelStatisticsOpeningImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkLabelStatisticsOpeningImageFilter.hxx index ceeea3178d0..ef97bf17257 100644 --- a/Modules/Filtering/LabelMap/include/itkLabelStatisticsOpeningImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkLabelStatisticsOpeningImageFilter.hxx @@ -60,20 +60,20 @@ void LabelStatisticsOpeningImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetLabelImage(this->GetInput()); @@ -89,7 +89,7 @@ LabelStatisticsOpeningImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(valuator->GetOutput()); opening->SetLambda(m_Lambda); opening->SetReverseOrdering(m_ReverseOrdering); @@ -97,7 +97,7 @@ LabelStatisticsOpeningImageFilter::GenerateData() opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx index d7bc136901b..066b5adb493 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx @@ -56,7 +56,7 @@ ShapeLabelMapFilter::BeforeThreadedGenerateData() { // generate an image of the labelized image using LCI2IType = LabelMapToLabelImageFilter; - typename LCI2IType::Pointer lci2i = LCI2IType::New(); + auto lci2i = LCI2IType::New(); lci2i->SetInput(this->GetOutput()); // Respect the number of threads of the filter lci2i->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -504,7 +504,7 @@ ShapeLabelMapFilter::ComputePerimeter(LabelObjectType * lab // store the lines in a N-1D image of vectors using VectorLineType = std::deque; using LineImageType = itk::Image; - typename LineImageType::Pointer lineImage = LineImageType::New(); + auto lineImage = LineImageType::New(); typename LineImageType::IndexType lIdx; typename LineImageType::SizeType lSize; RegionType boundingBox = labelObject->GetBoundingBox(); diff --git a/Modules/Filtering/LabelMap/include/itkShapeRelabelImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkShapeRelabelImageFilter.hxx index 35024f612f0..2f316f22e1a 100644 --- a/Modules/Filtering/LabelMap/include/itkShapeRelabelImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkShapeRelabelImageFilter.hxx @@ -58,20 +58,20 @@ void ShapeRelabelImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetLabelImage(this->GetInput()); valuator->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); @@ -85,14 +85,14 @@ ShapeRelabelImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename RelabelType::Pointer opening = RelabelType::New(); + auto opening = RelabelType::New(); opening->SetInput(valuator->GetOutput()); opening->SetReverseOrdering(m_ReverseOrdering); opening->SetAttribute(m_Attribute); opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx index c6d6071a5c7..9b3724ea462 100644 --- a/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkStatisticsLabelMapFilter.hxx @@ -44,7 +44,7 @@ StatisticsLabelMapFilter::BeforeThreadedGenerateData() // of our // histograms using MinMaxCalculatorType = MinimumMaximumImageCalculator; - typename MinMaxCalculatorType::Pointer minMax = MinMaxCalculatorType::New(); + auto minMax = MinMaxCalculatorType::New(); minMax->SetImage(this->GetFeatureImage()); minMax->Compute(); @@ -86,7 +86,7 @@ StatisticsLabelMapFilter::ThreadedProcessLabelObject(Labe featureImageMax.Fill(m_Maximum); } - typename HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); histogram->SetMeasurementVectorSize(1); histogram->SetClipBinsAtEnds(false); histogram->Initialize(histogramSize, featureImageMin, featureImageMax); diff --git a/Modules/Filtering/LabelMap/include/itkStatisticsRelabelImageFilter.hxx b/Modules/Filtering/LabelMap/include/itkStatisticsRelabelImageFilter.hxx index 394c8e5e44a..c90ac571542 100644 --- a/Modules/Filtering/LabelMap/include/itkStatisticsRelabelImageFilter.hxx +++ b/Modules/Filtering/LabelMap/include/itkStatisticsRelabelImageFilter.hxx @@ -59,20 +59,20 @@ void StatisticsRelabelImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Allocate the output this->AllocateOutputs(); - typename LabelizerType::Pointer labelizer = LabelizerType::New(); + auto labelizer = LabelizerType::New(); labelizer->SetInput(this->GetInput()); labelizer->SetBackgroundValue(m_BackgroundValue); labelizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(labelizer, .3f); - typename LabelObjectValuatorType::Pointer valuator = LabelObjectValuatorType::New(); + auto valuator = LabelObjectValuatorType::New(); valuator->SetInput(labelizer->GetOutput()); valuator->SetFeatureImage(this->GetFeatureImage()); valuator->SetLabelImage(this->GetInput()); @@ -88,14 +88,14 @@ StatisticsRelabelImageFilter::GenerateData() } progress->RegisterInternalFilter(valuator, .3f); - typename RelabelType::Pointer opening = RelabelType::New(); + auto opening = RelabelType::New(); opening->SetInput(valuator->GetOutput()); opening->SetReverseOrdering(m_ReverseOrdering); opening->SetAttribute(m_Attribute); opening->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(opening, .2f); - typename BinarizerType::Pointer binarizer = BinarizerType::New(); + auto binarizer = BinarizerType::New(); binarizer->SetInput(opening->GetOutput()); binarizer->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); progress->RegisterInternalFilter(binarizer, .2f); diff --git a/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx index 1d2973a6ee6..b2119104c97 100644 --- a/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkAggregateLabelMapFilterTest.cxx @@ -44,24 +44,24 @@ itkAggregateLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::AggregateLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx index eb0f9e1c1ad..99bb8c63b66 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeKeepNObjectsLabelMapFilterTest1.cxx @@ -49,11 +49,11 @@ itkAttributeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); @@ -73,7 +73,7 @@ itkAttributeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) using LabelKeepNObjectsType = itk::AttributeKeepNObjectsLabelMapFilter; - LabelKeepNObjectsType::Pointer opening = LabelKeepNObjectsType::New(); + auto opening = LabelKeepNObjectsType::New(); // testing get and set macros for NumberOfObjects unsigned long nbOfObjects = std::stoi(argv[3]); @@ -97,12 +97,12 @@ itkAttributeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx index 898624a4fa7..e5d5d9369e8 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeLabelObjectAccessorsTest1.cxx @@ -48,15 +48,15 @@ itkAttributeLabelObjectAccessorsTest1(int argc, char * argv[]) // We read the input image. using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // And convert it to a LabelMap using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); // The next step is made outside the pipeline model, so we call Update() now. i2l->Update(); diff --git a/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx index a57ed6d0e4d..a7e4337aa47 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeOpeningLabelMapFilterTest1.cxx @@ -49,11 +49,11 @@ itkAttributeOpeningLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ImageToLabelType = itk::LabelImageToLabelMapFilter; - ImageToLabelType::Pointer imageToLabel = ImageToLabelType::New(); + auto imageToLabel = ImageToLabelType::New(); imageToLabel->SetInput(reader->GetOutput()); @@ -73,7 +73,7 @@ itkAttributeOpeningLabelMapFilterTest1(int argc, char * argv[]) using LabelOpeningType = itk::AttributeOpeningLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); // testing get and set macros for Lambda auto lambda = static_cast(std::stod(argv[3])); @@ -97,12 +97,12 @@ itkAttributeOpeningLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using LabelToImageType = itk::LabelMapToLabelImageFilter; - LabelToImageType::Pointer labelToImage = LabelToImageType::New(); + auto labelToImage = LabelToImageType::New(); labelToImage->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(labelToImage->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx index cce4ef86345..1d91e2d28a2 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributePositionLabelMapFilterTest1.cxx @@ -61,31 +61,31 @@ itkAttributePositionLabelMapFilterTest1(int argc, char * argv[]) // We read the input image. using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // And convert it to a LabelMap, with the shape attribute computed. // We use the default label object type. using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using OpeningType = itk::AttributePositionLabelMapFilter, true>; - OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(i2l->GetOutput()); itk::SimpleFilterWatcher watcher(opening, "filter"); // the label map is then converted back to an label image. using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); // write the result using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx index 35e8bb0aa41..5e6c2a3b721 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeRelabelLabelMapFilterTest1.cxx @@ -49,11 +49,11 @@ itkAttributeRelabelLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); @@ -73,7 +73,7 @@ itkAttributeRelabelLabelMapFilterTest1(int argc, char * argv[]) using LabelRelabelType = itk::AttributeRelabelLabelMapFilter; - LabelRelabelType::Pointer relabel = LabelRelabelType::New(); + auto relabel = LabelRelabelType::New(); // testing get and set macros for ReverseOrdering // testing boolean macro for ReverseOrdering @@ -92,12 +92,12 @@ itkAttributeRelabelLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(relabel, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(relabel->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx index 848bea4ecaf..3b0043a3531 100644 --- a/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAttributeUniqueLabelMapFilterTest1.cxx @@ -49,39 +49,39 @@ itkAttributeUniqueLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using KernelType = itk::FlatStructuringElement; using DilateType = itk::BinaryDilateImageFilter; - DilateType::Pointer dilate = DilateType::New(); + auto dilate = DilateType::New(); KernelType::SizeType rad; rad.Fill(15); dilate->SetKernel(KernelType::Ball(rad)); using OIType = itk::ObjectByObjectLabelMapFilter; - OIType::Pointer oi = OIType::New(); + auto oi = OIType::New(); oi->SetInput(i2l->GetOutput()); oi->SetFilter(dilate); oi->SetPadSize(rad); using UniqueType = itk::AttributeUniqueLabelMapFilter>; - UniqueType::Pointer unique = UniqueType::New(); + auto unique = UniqueType::New(); unique->SetInput(oi->GetOutput()); unique->SetReverseOrdering(std::stoi(argv[3])); itk::SimpleFilterWatcher watcher(unique, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(unique->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx index e0af28fd9c5..c302c34ed32 100644 --- a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest1.cxx @@ -56,11 +56,11 @@ itkAutoCropLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; - ImageToLabelMapFilterType::Pointer imageToLabelMapFilter = ImageToLabelMapFilterType::New(); + auto imageToLabelMapFilter = ImageToLabelMapFilterType::New(); imageToLabelMapFilter->SetInput(reader->GetOutput()); PixelType backgroundValue = std::stoi(argv[3]); @@ -68,7 +68,7 @@ itkAutoCropLabelMapFilterTest1(int argc, char * argv[]) imageToLabelMapFilter->SetBackgroundValue(backgroundValue); using AutoCropLabelMapFilterType = itk::AutoCropLabelMapFilter; - AutoCropLabelMapFilterType::Pointer autoCropFilter = AutoCropLabelMapFilterType::New(); + auto autoCropFilter = AutoCropLabelMapFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(autoCropFilter, AutoCropLabelMapFilter, ChangeRegionLabelMapFilter); @@ -83,11 +83,11 @@ itkAutoCropLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(autoCropFilter, "AutoCropLabelMapFilter"); using LabelMapToLabelImageFilterType = itk::LabelMapToLabelImageFilter; - LabelMapToLabelImageFilterType::Pointer labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); + auto labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); labelMapToLabelImageFilter->SetInput(autoCropFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(labelMapToLabelImageFilter->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx index d28616c9d0d..9b7cc59257a 100644 --- a/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkAutoCropLabelMapFilterTest2.cxx @@ -57,21 +57,21 @@ itkAutoCropLabelMapFilterTest2(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; - ImageToLabelMapFilterType::Pointer imageToLabelMapFilter = ImageToLabelMapFilterType::New(); + auto imageToLabelMapFilter = ImageToLabelMapFilterType::New(); imageToLabelMapFilter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(imageToLabelMapFilter, "LabelImageToLabelMapFilter"); using SelectionType = itk::LabelSelectionLabelMapFilter; - SelectionType::Pointer select = SelectionType::New(); + auto select = SelectionType::New(); select->SetInput(imageToLabelMapFilter->GetOutput()); itk::SimpleFilterWatcher watcher2(select, "LabelSelectionLabelMapFilter"); using AutoCropLabelMapFilterType = itk::AutoCropLabelMapFilter; - AutoCropLabelMapFilterType::Pointer autoCropFilter = AutoCropLabelMapFilterType::New(); + auto autoCropFilter = AutoCropLabelMapFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(autoCropFilter, AutoCropLabelMapFilter, ChangeRegionLabelMapFilter); @@ -79,11 +79,11 @@ itkAutoCropLabelMapFilterTest2(int argc, char * argv[]) itk::SimpleFilterWatcher watcher3(autoCropFilter, "AutoCropLabelMapFilter"); using LabelMapToLabelImageFilterType = itk::LabelMapToLabelImageFilter; - LabelMapToLabelImageFilterType::Pointer labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); + auto labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); labelMapToLabelImageFilter->SetInput(autoCropFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(labelMapToLabelImageFilter->GetOutput()); // First label diff --git a/Modules/Filtering/LabelMap/test/itkBinaryFillholeImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryFillholeImageFilterTest1.cxx index 0130ba66e42..a16facf2887 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryFillholeImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryFillholeImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkBinaryFillholeImageFilterTest1(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::BinaryFillholeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryFillholeImageFilter, ImageToImageFilter); @@ -66,7 +66,7 @@ itkBinaryFillholeImageFilterTest1(int argc, char * argv[]) filter->SetInput(reader->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx index 86e3aef4d60..08bf25269b7 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryGrindPeakImageFilterTest1.cxx @@ -41,13 +41,13 @@ itkBinaryGrindPeakImageFilterTest1(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using BinaryGrindPeakImageFilterType = itk::BinaryGrindPeakImageFilter; - BinaryGrindPeakImageFilterType::Pointer binaryGrindPeakImageFilter = BinaryGrindPeakImageFilterType::New(); + auto binaryGrindPeakImageFilter = BinaryGrindPeakImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(binaryGrindPeakImageFilter, BinaryGrindPeakImageFilter, ImageToImageFilter); @@ -80,7 +80,7 @@ itkBinaryGrindPeakImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(binaryGrindPeakImageFilter, "BinaryGrindPeakImageFilter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(binaryGrindPeakImageFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx index 7d9feda575b..5edbdb75f0a 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest.cxx @@ -48,11 +48,11 @@ itkBinaryImageToLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ImageToLabelType = itk::BinaryImageToLabelMapFilter; - ImageToLabelType::Pointer imageToLabel = ImageToLabelType::New(); + auto imageToLabel = ImageToLabelType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(imageToLabel, BinaryImageToLabelMapFilter, ImageToImageFilter); @@ -76,10 +76,10 @@ itkBinaryImageToLabelMapFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(imageToLabel); using LabelToImageType = itk::LabelMapToLabelImageFilter; - LabelToImageType::Pointer labelToImage = LabelToImageType::New(); + auto labelToImage = LabelToImageType::New(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx index 6e5ca3c22a9..b88308359ec 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToLabelMapFilterTest2.cxx @@ -47,11 +47,11 @@ itkBinaryImageToLabelMapFilterTest2(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using ImageToLabelType = itk::BinaryImageToLabelMapFilter; - ImageToLabelType::Pointer imageToLabel = ImageToLabelType::New(); + auto imageToLabel = ImageToLabelType::New(); imageToLabel->SetInput(reader->GetOutput()); imageToLabel->SetFullyConnected(true); @@ -65,11 +65,11 @@ itkBinaryImageToLabelMapFilterTest2(int argc, char * argv[]) ITK_TEST_EXPECT_EQUAL(imageToLabel->GetOutput()->GetNumberOfLabelObjects(), imageToLabel->GetNumberOfObjects()); using LabelToImageType = itk::LabelMapToLabelImageFilter; - LabelToImageType::Pointer labelToImage = LabelToImageType::New(); + auto labelToImage = LabelToImageType::New(); labelToImage->SetInput(imageToLabel->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(labelToImage->GetOutput()); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx index 21169c3a130..00b301524e6 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToShapeLabelMapFilterTest1.cxx @@ -47,12 +47,12 @@ itkBinaryImageToShapeLabelMapFilterTest1(int argc, char * argv[]) // reading image to file using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // converting binary image to shape label map using I2LType = itk::BinaryImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); itk::SimpleFilterWatcher watcher1(i2l); i2l->SetInput(reader->GetOutput()); @@ -108,13 +108,13 @@ itkBinaryImageToShapeLabelMapFilterTest1(int argc, char * argv[]) using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); itk::SimpleFilterWatcher watcher2(l2i); l2i->SetInput(i2l->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx index 0cbe1e0a508..387411c3d39 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryImageToStatisticsLabelMapFilterTest1.cxx @@ -44,16 +44,16 @@ itkBinaryImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) // reading image to file using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // converting binary image to Statistics label map // don't set the output type to test the default value of the template parameter using I2LType = itk::BinaryImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); itk::SimpleFilterWatcher watcher1(i2l); i2l->SetInput(reader->GetOutput()); @@ -128,13 +128,13 @@ itkBinaryImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(numberOfBins, i2l->GetNumberOfBins()); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); itk::SimpleFilterWatcher watcher2(l2i); l2i->SetInput(i2l->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx index 689fa044ae1..f19f3781bb7 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryNotImageFilterTest.cxx @@ -38,20 +38,20 @@ itkBinaryNotImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader1 = ReaderType::New(); + auto reader1 = ReaderType::New(); reader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader1->Update()); - typename ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader2->Update()); using FilterType = itk::BinaryNotImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryNotImageFilter, UnaryFunctorImageFilter); @@ -73,7 +73,7 @@ itkBinaryNotImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx index 8ba79554031..535d58d7dc6 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByDilationImageFilterTest.cxx @@ -41,14 +41,14 @@ itkBinaryReconstructionByDilationImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using LabelReconstructionType = itk::BinaryReconstructionByDilationImageFilter; - LabelReconstructionType::Pointer reconstruction = LabelReconstructionType::New(); + auto reconstruction = LabelReconstructionType::New(); // testing get and set macros for Lambda int fg = std::stoi(argv[4]); @@ -68,7 +68,7 @@ itkBinaryReconstructionByDilationImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reconstruction->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx index b2a5997cad6..80c1c70d895 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionByErosionImageFilterTest.cxx @@ -40,14 +40,14 @@ itkBinaryReconstructionByErosionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using LabelReconstructionType = itk::BinaryReconstructionByErosionImageFilter; - LabelReconstructionType::Pointer reconstruction = LabelReconstructionType::New(); + auto reconstruction = LabelReconstructionType::New(); // testing get and set macros for Lambda int fg = std::stoi(argv[4]); @@ -67,7 +67,7 @@ itkBinaryReconstructionByErosionImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reconstruction->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx index 875e580b4ed..5526e8c8bfb 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryReconstructionLabelMapFilterTest.cxx @@ -49,18 +49,18 @@ itkBinaryReconstructionLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using LabelReconstructionType = itk::BinaryReconstructionLabelMapFilter; - LabelReconstructionType::Pointer reconstruction = LabelReconstructionType::New(); + auto reconstruction = LabelReconstructionType::New(); // testing get and set macros for Lambda int fg = std::stoi(argv[4]); @@ -75,17 +75,17 @@ itkBinaryReconstructionLabelMapFilterTest(int argc, char * argv[]) reconstruction->GetOutput()->PrintLabelObjects(); using LabelOpeningType = itk::AttributeSelectionLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); opening->SetInput(reconstruction->GetOutput()); opening->SetAttribute(true); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx index 4e6020f744a..28192ce5218 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryShapeKeepNObjectsImageFilterTest1.cxx @@ -42,11 +42,11 @@ itkBinaryShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using BinaryKeepNObjectsType = itk::BinaryShapeKeepNObjectsImageFilter; - BinaryKeepNObjectsType::Pointer KeepNObjects = BinaryKeepNObjectsType::New(); + auto KeepNObjects = BinaryKeepNObjectsType::New(); KeepNObjects->SetInput(reader->GetOutput()); @@ -102,7 +102,7 @@ itkBinaryShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(KeepNObjects->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx index 6a5c1aee01c..a52cccb8a30 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryShapeOpeningImageFilterTest1.cxx @@ -42,11 +42,11 @@ itkBinaryShapeOpeningImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using BinaryOpeningType = itk::BinaryShapeOpeningImageFilter; - BinaryOpeningType::Pointer opening = BinaryOpeningType::New(); + auto opening = BinaryOpeningType::New(); opening->SetInput(reader->GetOutput()); @@ -97,7 +97,7 @@ itkBinaryShapeOpeningImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(opening->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx index ef6e5a2e9b0..d7010123262 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsKeepNObjectsImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkBinaryStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using BinaryKeepNObjectsType = itk::BinaryStatisticsKeepNObjectsImageFilter; - BinaryKeepNObjectsType::Pointer KeepNObjects = BinaryKeepNObjectsType::New(); + auto KeepNObjects = BinaryKeepNObjectsType::New(); KeepNObjects->SetInput(reader->GetOutput()); KeepNObjects->SetFeatureImage(reader2->GetOutput()); @@ -101,7 +101,7 @@ itkBinaryStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(KeepNObjects->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx index 1421e2367a3..02a33fe235b 100644 --- a/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkBinaryStatisticsOpeningImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkBinaryStatisticsOpeningImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using BinaryOpeningType = itk::BinaryStatisticsOpeningImageFilter; - BinaryOpeningType::Pointer opening = BinaryOpeningType::New(); + auto opening = BinaryOpeningType::New(); opening->SetInput(reader->GetOutput()); opening->SetFeatureImage(reader2->GetOutput()); @@ -101,7 +101,7 @@ itkBinaryStatisticsOpeningImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(opening->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx index 4d32a00f8c7..82745391495 100644 --- a/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkChangeLabelLabelMapFilterTest.cxx @@ -50,15 +50,15 @@ itkChangeLabelLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeLabelFilterType = itk::ChangeLabelLabelMapFilter; - ChangeLabelFilterType::Pointer changeFilter = ChangeLabelFilterType::New(); + auto changeFilter = ChangeLabelFilterType::New(); changeFilter->SetInput(i2l->GetOutput()); @@ -81,11 +81,11 @@ itkChangeLabelLabelMapFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher6(changeFilter, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(changeFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx index 4f7080e13ae..c4f4dda4a62 100644 --- a/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkChangeRegionLabelMapFilterTest1.cxx @@ -45,15 +45,15 @@ itkChangeRegionLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::ChangeRegionLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); ChangeType::IndexType idx; idx[0] = std::stoi(argv[3]); @@ -68,11 +68,11 @@ itkChangeRegionLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx index 88ec9fea235..247bd21e63c 100644 --- a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest1.cxx @@ -43,27 +43,27 @@ itkConvertLabelMapFilterTest1(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using L2SType = itk::LabelImageToShapeLabelMapFilter; - L2SType::Pointer l2s = L2SType::New(); + auto l2s = L2SType::New(); l2s->SetInput(reader->GetOutput()); using LabelObjectType = itk::LabelObject; using LabelMapType = itk::LabelMap; using CastType = itk::ConvertLabelMapFilter; - CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(l2s->GetOutput()); itk::SimpleFilterWatcher watcher(cast, "cast"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(cast->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx index c7adc775cf5..0763a4a9bb5 100644 --- a/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkConvertLabelMapFilterTest2.cxx @@ -46,7 +46,7 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ////////////////////////////////////////////////////////////////////////////////// @@ -54,14 +54,14 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) ////////////////////////////////////////////////////////////////////////////////// // convert label image to ShapeLabelMap using L2SType = itk::LabelImageToShapeLabelMapFilter; - L2SType::Pointer l2s = L2SType::New(); + auto l2s = L2SType::New(); l2s->SetInput(reader->GetOutput()); l2s->Update(); // convert ShapeLabelMap from unsigned char type to unsigned short type using InputShapeLabelMapType = L2SType::OutputImageType; using OutputShapeLabelMapType = itk::LabelMap>; using CastShapeType = itk::ConvertLabelMapFilter; - CastShapeType::Pointer castShape = CastShapeType::New(); + auto castShape = CastShapeType::New(); castShape->SetInput(l2s->GetOutput()); castShape->Update(); // verify ShapeLabelMap contains equivalent information after conversion @@ -136,7 +136,7 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) ////////////////////////////////////////////////////////////////////////////////// // convert label image to StatisticsLabelMap using L2StatType = itk::LabelImageToStatisticsLabelMapFilter; - L2StatType::Pointer l2stat = L2StatType::New(); + auto l2stat = L2StatType::New(); l2stat->SetInput(reader->GetOutput()); l2stat->SetFeatureImage(reader->GetOutput()); // use input label image itself as the feature image l2stat->Update(); @@ -144,7 +144,7 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) using InputStatisticsLabelMapType = L2StatType::OutputImageType; using OutputStatisticsLabelMapType = itk::LabelMap>; using CastStatType = itk::ConvertLabelMapFilter; - CastStatType::Pointer castStatistics = CastStatType::New(); + auto castStatistics = CastStatType::New(); castStatistics->SetInput(l2stat->GetOutput()); castStatistics->Update(); // verify StatisticsLabelMap contains equivalent information after conversion @@ -241,7 +241,7 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) ////////////////////////////////////////////////////////////////////////////////// // convert label image to label map using L2MType = itk::LabelImageToLabelMapFilter; - L2MType::Pointer l2m = L2MType::New(); + auto l2m = L2MType::New(); l2m->SetInput(reader->GetOutput()); using LabelObjectType = itk::LabelObject; @@ -249,16 +249,16 @@ itkConvertLabelMapFilterTest2(int argc, char * argv[]) // convert label map from unsigned char to unsigned short type using CastType = itk::ConvertLabelMapFilter; - CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(l2m->GetOutput()); itk::SimpleFilterWatcher watcher(cast, "cast"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(cast->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx index 211f1ac7863..17ccd118c32 100644 --- a/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkCropLabelMapFilterTest1.cxx @@ -55,15 +55,15 @@ itkCropLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using CropType = itk::CropLabelMapFilter; - CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); // test the behavior without input ITK_TRY_EXPECT_EXCEPTION(crop->Update()); crop->ResetPipeline(); @@ -80,11 +80,11 @@ itkCropLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher6(crop, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(crop->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx index 928bc223a72..5a50621a3f1 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToLabelMapFilterTest.cxx @@ -50,7 +50,7 @@ itkLabelImageToLabelMapFilterTest(int, char *[]) using LabelImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); SizeType sizeIn; sizeIn[0] = 11; @@ -86,7 +86,7 @@ itkLabelImageToLabelMapFilterTest(int, char *[]) idxHorizontal[0] = 7; image->SetPixel(idxHorizontal, 3); - LabelImageToLabelMapFilterType::Pointer conversion = LabelImageToLabelMapFilterType::New(); + auto conversion = LabelImageToLabelMapFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(conversion, LabelImageToLabelMapFilter, ImageToImageFilter); diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx index f43f94172db..be4a9f76113 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToShapeLabelMapFilterTest1.cxx @@ -44,11 +44,11 @@ itkLabelImageToShapeLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using L2SType = itk::LabelImageToShapeLabelMapFilter; - L2SType::Pointer l2s = L2SType::New(); + auto l2s = L2SType::New(); l2s->SetInput(reader->GetOutput()); const PixelType backgroundValue = std::stoi(argv[3]); @@ -65,11 +65,11 @@ itkLabelImageToShapeLabelMapFilterTest1(int argc, char * argv[]) using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(l2s->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx index c848d134617..cb9ef911be4 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelImageToStatisticsLabelMapFilterTest1.cxx @@ -44,16 +44,16 @@ itkLabelImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) // reading image to file using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // converting Label image to Statistics label map // don't set the output type to test the default value of the template parameter using I2LType = itk::LabelImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); itk::SimpleFilterWatcher watcher1(i2l); i2l->SetInput(reader->GetOutput()); @@ -111,13 +111,13 @@ itkLabelImageToStatisticsLabelMapFilterTest1(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(numberOfBins, i2l->GetNumberOfBins()); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); itk::SimpleFilterWatcher watcher2(l2i); l2i->SetInput(i2l->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx index 93f8e2185c5..c0af7b4ffa0 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapFilterTest.cxx @@ -43,7 +43,7 @@ itkLabelMapFilterTest(int argc, char * argv[]) using LabelMapFilterType = itk::LabelMapFilter; - LabelMapType::Pointer map = LabelMapType::New(); + auto map = LabelMapType::New(); SizeType sizeIn; sizeIn[0] = 11; @@ -69,7 +69,7 @@ itkLabelMapFilterTest(int argc, char * argv[]) map->SetPixel(idxVertical, 1); } - LabelMapFilterType::Pointer conversion = LabelMapFilterType::New(); + auto conversion = LabelMapFilterType::New(); conversion->SetInput(map); conversion->GenerateInputRequestedRegion(); conversion->EnlargeOutputRequestedRegion(nullptr); diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx index aaab748a4a0..f1961e40dcf 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapMaskImageFilterTest.cxx @@ -52,15 +52,15 @@ itkLabelMapMaskImageFilterTest(int argc, char * argv[]) // Read the label image and the input image to be masked. using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // Convert the label image to a label collection image. using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); // i2l->SetUseBackground( true ); @@ -75,7 +75,7 @@ itkLabelMapMaskImageFilterTest(int argc, char * argv[]) // image is not cropped by default. using MaskFilterType = itk::LabelMapMaskImageFilter; - MaskFilterType::Pointer maskFilter = MaskFilterType::New(); + auto maskFilter = MaskFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(maskFilter, LabelMapMaskImageFilter, LabelMapFilter); @@ -128,7 +128,7 @@ itkLabelMapMaskImageFilterTest(int argc, char * argv[]) // Finally, save the output image. using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(maskFilter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx index ba04685d1d9..e74af25e9ea 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapTest.cxx @@ -41,7 +41,7 @@ itkLabelMapTest(int argc, char * argv[]) using LabelObjectVectorType = LabelMapType::LabelObjectVectorType; using LabelVectorType = LabelMapType::LabelVectorType; - LabelMapType::Pointer map = LabelMapType::New(); + auto map = LabelMapType::New(); SizeType sizeIn; sizeIn[0] = 10; @@ -75,7 +75,7 @@ itkLabelMapTest(int argc, char * argv[]) regionOut = map->GetRequestedRegion(); itkAssertOrThrowMacro((regionOut == regionIn), "SetRegions (region) failed"); - LabelMapType::Pointer mapGraft = LabelMapType::New(); + auto mapGraft = LabelMapType::New(); mapGraft->Graft(map); regionOut = mapGraft->GetRequestedRegion(); itkAssertOrThrowMacro((regionOut == regionIn), "Graft failed"); @@ -83,7 +83,7 @@ itkLabelMapTest(int argc, char * argv[]) mapGraft->SetBackgroundValue(255); itkAssertOrThrowMacro((mapGraft->GetBackgroundValue() == 255), "Set/GetBackground failed."); - LabelObjectType::Pointer lo = LabelObjectType::New(); + auto lo = LabelObjectType::New(); lo->SetLabel(1); IndexType idx; @@ -134,7 +134,7 @@ itkLabelMapTest(int argc, char * argv[]) loLabels = map->GetLabels(); itkAssertOrThrowMacro((loLabels[0] == 1), "GetLabels failed"); - LabelObjectType::Pointer lo2 = LabelObjectType::New(); + auto lo2 = LabelObjectType::New(); idx[0] = 1; idx[1] = 21; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx index 89f70628d14..1256770f650 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapTest2.cxx @@ -32,7 +32,7 @@ itkLabelMapTest2(int, char *[]) using RegionType = LabelMapType::RegionType; using SizeType = LabelMapType::SizeType; - LabelMapType::Pointer map = LabelMapType::New(); + auto map = LabelMapType::New(); SizeType sizeIn; sizeIn[0] = 10; @@ -65,7 +65,7 @@ itkLabelMapTest2(int, char *[]) map->SetBackgroundValue(255); - LabelObjectType::Pointer lo = LabelObjectType::New(); + auto lo = LabelObjectType::New(); lo->SetLabel(1); IndexType idx; @@ -104,7 +104,7 @@ itkLabelMapTest2(int, char *[]) map->AddLabelObject(lo); - LabelObjectType::Pointer lo2 = LabelObjectType::New(); + auto lo2 = LabelObjectType::New(); idx[0] = 1; idx[1] = 21; diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx index 3bea6eefe03..1fd4c8d7c40 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToAttributeImageFilterTest1.cxx @@ -49,25 +49,25 @@ itkLabelMapToAttributeImageFilterTest1(int argc, char * argv[]) // Reading Image File using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Converting LabelImage to ShapeLabelMap using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using L2ImageType = itk::LabelMapToAttributeImageFilter>; - L2ImageType::Pointer l2i = L2ImageType::New(); + auto l2i = L2ImageType::New(); l2i->SetInput(i2l->GetOutput()); itk::SimpleFilterWatcher watcher(l2i, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx index 607d68e5724..c038238c65e 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToBinaryImageFilterTest.cxx @@ -50,14 +50,14 @@ itkLabelMapToBinaryImageFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); using L2IType = itk::LabelMapToBinaryImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetForegroundValue(std::stoi(argv[3])); ITK_TEST_SET_GET_VALUE(std::stoi(argv[3]), l2i->GetForegroundValue()); @@ -68,7 +68,7 @@ itkLabelMapToBinaryImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(l2i); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx index af4df16891e..bd17ab25b7a 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelMapToLabelImageFilterTest.cxx @@ -42,7 +42,7 @@ itkLabelMapToLabelImageFilterTest(int argc, char * argv[]) using LabelMapToLabelImageFilterType = itk::LabelMapToLabelImageFilter; - LabelMapType::Pointer map = LabelMapType::New(); + auto map = LabelMapType::New(); SizeType sizeIn; sizeIn[0] = 11; @@ -68,7 +68,7 @@ itkLabelMapToLabelImageFilterTest(int argc, char * argv[]) map->SetPixel(idxVertical, 1); } - LabelMapToLabelImageFilterType::Pointer conversion = LabelMapToLabelImageFilterType::New(); + auto conversion = LabelMapToLabelImageFilterType::New(); conversion->SetInput(map); conversion->Update(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx index 0ab76aa3f41..5ac614c5109 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelObjectTest.cxx @@ -37,7 +37,7 @@ itkLabelObjectTest(int argc, char * argv[]) // testing AddLine(), GetNumberOfLines(), GetLineContainer() const and Optimize() - LabelObjectType::Pointer lo = LabelObjectType::New(); + auto lo = LabelObjectType::New(); IndexType idx; idx[0] = 1; @@ -77,7 +77,7 @@ itkLabelObjectTest(int argc, char * argv[]) lo->Optimize(); // the expected result after Optimize() - LabelObjectType::Pointer ref = LabelObjectType::New(); + auto ref = LabelObjectType::New(); idx[0] = 5; idx[1] = 0; diff --git a/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx index a0ca7ef5493..4b8310adc7b 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelSelectionLabelMapFilterTest.cxx @@ -45,26 +45,26 @@ itkLabelSelectionLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::LabelSelectionLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); change->SetExclude(std::stoi(argv[3])); change->SetLabel(std::stoi(argv[4])); itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx index 78b65532c24..d35e2e01d7c 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelShapeKeepNObjectsImageFilterTest1.cxx @@ -42,11 +42,11 @@ itkLabelShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using LabelKeepNObjectsType = itk::LabelShapeKeepNObjectsImageFilter; - LabelKeepNObjectsType::Pointer KeepNObjects = LabelKeepNObjectsType::New(); + auto KeepNObjects = LabelKeepNObjectsType::New(); KeepNObjects->SetInput(reader->GetOutput()); @@ -84,7 +84,7 @@ itkLabelShapeKeepNObjectsImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(KeepNObjects->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx index 23bc2a78063..4709032fb3e 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelShapeOpeningImageFilterTest1.cxx @@ -42,11 +42,11 @@ itkLabelShapeOpeningImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using LabelOpeningType = itk::LabelShapeOpeningImageFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); opening->SetInput(reader->GetOutput()); @@ -80,7 +80,7 @@ itkLabelShapeOpeningImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(opening->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx index 8f0dfe922e5..27ce6b1e7a9 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelStatisticsKeepNObjectsImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkLabelStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using LabelKeepNObjectsType = itk::LabelStatisticsKeepNObjectsImageFilter; - LabelKeepNObjectsType::Pointer KeepNObjects = LabelKeepNObjectsType::New(); + auto KeepNObjects = LabelKeepNObjectsType::New(); KeepNObjects->SetInput(reader->GetOutput()); KeepNObjects->SetFeatureImage(reader2->GetOutput()); @@ -84,7 +84,7 @@ itkLabelStatisticsKeepNObjectsImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(KeepNObjects, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(KeepNObjects->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx index 3dbf0e896f6..e5c4b457c5a 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelStatisticsOpeningImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkLabelStatisticsOpeningImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using LabelOpeningType = itk::LabelStatisticsOpeningImageFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); // set the input image opening->SetInput1(reader->GetOutput()); @@ -91,7 +91,7 @@ itkLabelStatisticsOpeningImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(opening->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx index 7215ba90a2a..7a8b5a9f5e5 100644 --- a/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkLabelUniqueLabelMapFilterTest1.cxx @@ -48,38 +48,38 @@ itkLabelUniqueLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using KernelType = itk::FlatStructuringElement; using DilateType = itk::BinaryDilateImageFilter; - DilateType::Pointer dilate = DilateType::New(); + auto dilate = DilateType::New(); KernelType::SizeType rad; rad.Fill(15); dilate->SetKernel(KernelType::Ball(rad)); using OIType = itk::ObjectByObjectLabelMapFilter; - OIType::Pointer oi = OIType::New(); + auto oi = OIType::New(); oi->SetInput(i2l->GetOutput()); oi->SetFilter(dilate); oi->SetPadSize(rad); using UniqueType = itk::LabelUniqueLabelMapFilter; - UniqueType::Pointer unique = UniqueType::New(); + auto unique = UniqueType::New(); unique->SetInput(oi->GetOutput()); unique->SetReverseOrdering(std::stoi(argv[3])); itk::SimpleFilterWatcher watcher(unique, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(unique->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx index 38ed56ee1a6..79fe4cbc41b 100644 --- a/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkMergeLabelMapFilterTest1.cxx @@ -45,20 +45,20 @@ itkMergeLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); const PixelType background1 = std::stoi(argv[4]); i2l->SetBackgroundValue(background1); ITK_TEST_SET_GET_VALUE(background1, i2l->GetBackgroundValue()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); - I2LType::Pointer i2l2 = I2LType::New(); + auto i2l2 = I2LType::New(); i2l2->SetInput(reader2->GetOutput()); const PixelType background2 = std::stoi(argv[5]); @@ -66,7 +66,7 @@ itkMergeLabelMapFilterTest1(int argc, char * argv[]) ITK_TEST_SET_GET_VALUE(background2, i2l2->GetBackgroundValue()); using ChangeType = itk::MergeLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); change->SetInput(1, i2l2->GetOutput()); std::cout << "======" << change->GetInputNames()[0] << std::endl; @@ -84,11 +84,11 @@ itkMergeLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx b/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx index 5d06ef93d1d..4ab78e1a8b1 100644 --- a/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkObjectByObjectLabelMapFilterTest.cxx @@ -45,22 +45,22 @@ itkObjectByObjectLabelMapFilterTest(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using KernelType = itk::FlatStructuringElement; using DilateType = itk::BinaryDilateImageFilter; - DilateType::Pointer dilate = DilateType::New(); + auto dilate = DilateType::New(); KernelType::SizeType rad; rad.Fill(3); dilate->SetKernel(KernelType::Ball(rad)); using ObOType = itk::ObjectByObjectLabelMapFilter; - ObOType::Pointer obo = ObOType::New(); + auto obo = ObOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(obo, ObjectByObjectLabelMapFilter, LabelMapFilter); @@ -88,11 +88,11 @@ itkObjectByObjectLabelMapFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(obo, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(obo->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx index 3c8a9e2c8b5..cf6490c8822 100644 --- a/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkPadLabelMapFilterTest1.cxx @@ -56,17 +56,17 @@ itkPadLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using PadLabelMapFilterType = itk::PadLabelMapFilter; - PadLabelMapFilterType::Pointer padLabelMapFilter = PadLabelMapFilterType::New(); + auto padLabelMapFilter = PadLabelMapFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(padLabelMapFilter, PadLabelMapFilter, ChangeRegionLabelMapFilter); @@ -92,12 +92,12 @@ itkPadLabelMapFilterTest1(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(padLabelMapFilter->Update()); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(padLabelMapFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx index 7ccf2fdab78..589b8a0ff98 100644 --- a/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkRegionFromReferenceLabelMapFilterTest1.cxx @@ -55,29 +55,29 @@ itkRegionFromReferenceLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::RegionFromReferenceLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); change->SetReferenceImage(reader2->GetOutput()); itk::SimpleFilterWatcher watcher6(change, "filter"); change->UpdateLargestPossibleRegion(); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx index 358aed0557f..e8cf134a2a6 100644 --- a/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkRelabelLabelMapFilterTest1.cxx @@ -46,24 +46,24 @@ itkRelabelLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::RelabelLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx index 0107fa9b8b0..feb1bd1477a 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeKeepNObjectsLabelMapFilterTest1.cxx @@ -48,15 +48,15 @@ itkShapeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using LabelOpeningType = itk::ShapeKeepNObjectsLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); // testing boolean macro for ReverseOrdering opening->ReverseOrderingOn(); @@ -88,12 +88,12 @@ itkShapeKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx index e401d9856ce..3b498013204 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx @@ -56,7 +56,7 @@ class ShapeLabelMapFixture : public ::testing::Test static typename ImageType::Pointer CreateImage() { - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(25); @@ -73,7 +73,7 @@ class ShapeLabelMapFixture : public ::testing::Test { using L2SType = itk::LabelImageToShapeLabelMapFilter; - typename L2SType::Pointer l2s = L2SType::New(); + auto l2s = L2SType::New(); l2s->SetInput(image); l2s->ComputeFeretDiameterOn(); l2s->ComputePerimeterOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx index 6360cad937e..32e753f128d 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx @@ -80,11 +80,11 @@ itkShapeLabelObjectAccessorsTest1(int argc, char * argv[]) status = EXIT_FAILURE; } } - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); i2l->SetComputePerimeter(true); i2l->SetComputeOrientedBoundingBox(true); diff --git a/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx index f91a29d37e1..038f687352c 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeOpeningLabelMapFilterTest1.cxx @@ -48,15 +48,15 @@ itkShapeOpeningLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using LabelOpeningType = itk::ShapeOpeningLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); // testing get and set macros for Lambda double lambda = std::stod(argv[3]); @@ -85,12 +85,12 @@ itkShapeOpeningLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx index be9bbf627be..03786bdbd50 100644 --- a/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapePositionLabelMapFilterTest1.cxx @@ -42,29 +42,29 @@ itkShapePositionLabelMapFilterTest1(int argc, char * argv[]) // We read the input image. using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // And convert it to a LabelMap, with the shape attribute computed. // We use the default label object type. using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using OpeningType = itk::ShapePositionLabelMapFilter; - OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(i2l->GetOutput()); opening->SetAttribute(argv[3]); itk::SimpleFilterWatcher watcher(opening, "filter"); // the label map is then converted back to an label image. using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); // write the result using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx index 15c6927a6e4..10850e1a1b9 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx @@ -41,11 +41,11 @@ itkShapeRelabelImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using RelabelType = itk::ShapeRelabelImageFilter; - RelabelType::Pointer opening = RelabelType::New(); + auto opening = RelabelType::New(); opening->SetInput(reader->GetOutput()); @@ -78,7 +78,7 @@ itkShapeRelabelImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(opening->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx index dee71883fb1..9f58b65f665 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeRelabelLabelMapFilterTest1.cxx @@ -49,16 +49,16 @@ itkShapeRelabelLabelMapFilterTest1(int argc, char * argv[]) // Reading Image File using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Converting LabelImage to ShapeLabelMap using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using RelabelType = itk::ShapeRelabelLabelMapFilter; - RelabelType::Pointer relabel = RelabelType::New(); + auto relabel = RelabelType::New(); // testing get and set macros for ReverseOrdering bool reverseOrdering = std::stoi(argv[3]); @@ -85,12 +85,12 @@ itkShapeRelabelLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(relabel, "filter"); using L2ImageType = itk::LabelMapToLabelImageFilter; - L2ImageType::Pointer l2i = L2ImageType::New(); + auto l2i = L2ImageType::New(); l2i->SetInput(relabel->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx index a3cb49b8609..55818af99af 100644 --- a/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShapeUniqueLabelMapFilterTest1.cxx @@ -48,15 +48,15 @@ itkShapeUniqueLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToShapeLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using LabelUniqueType = itk::ShapeUniqueLabelMapFilter; - LabelUniqueType::Pointer Unique = LabelUniqueType::New(); + auto Unique = LabelUniqueType::New(); // testing get and set macros for ReverseOrdering bool reverseOrdering = std::stoi(argv[3]); @@ -80,12 +80,12 @@ itkShapeUniqueLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(Unique, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(Unique->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx b/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx index 30db629d10b..08873a4592d 100644 --- a/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkShiftLabelObjectTest.cxx @@ -41,7 +41,7 @@ itkShiftLabelObjectTest(int argc, char * argv[]) using LabelImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); SizeType sizeIn; sizeIn[0] = 12; @@ -63,7 +63,7 @@ itkShiftLabelObjectTest(int argc, char * argv[]) image->SetPixel(idxVertical, 1); } - LabelImageToLabelMapFilterType::Pointer conversion = LabelImageToLabelMapFilterType::New(); + auto conversion = LabelImageToLabelMapFilterType::New(); conversion->SetInput(image); conversion->Update(); diff --git a/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx index fe7f4f50381..79feb70284f 100644 --- a/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkShiftScaleLabelMapFilterTest1.cxx @@ -56,15 +56,15 @@ itkShiftScaleLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using I2LType = itk::LabelImageToLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); using ChangeType = itk::ShiftScaleLabelMapFilter; - ChangeType::Pointer change = ChangeType::New(); + auto change = ChangeType::New(); change->SetInput(i2l->GetOutput()); change->SetShift(std::stod(argv[3])); @@ -90,11 +90,11 @@ itkShiftScaleLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher6(change, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(change->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[2]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx index 0b186367e10..a93afd0788c 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsKeepNObjectsLabelMapFilterTest1.cxx @@ -48,19 +48,19 @@ itkStatisticsKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using I2LType = itk::LabelImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); i2l->SetFeatureImage(reader2->GetOutput()); using LabelOpeningType = itk::StatisticsKeepNObjectsLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); // testing boolean macro for ReverseOrdering opening->ReverseOrderingOn(); @@ -85,12 +85,12 @@ itkStatisticsKeepNObjectsLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx index 1d23c83f423..c238da2c482 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsLabelMapFilterGTest.cxx @@ -59,7 +59,7 @@ class StatisticsLabelMapFixture : public ::testing::Test static typename ImageType::Pointer CreateImage() { - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(25); @@ -73,7 +73,7 @@ class StatisticsLabelMapFixture : public ::testing::Test static typename ImageType::Pointer CreateImageRandom(PixelType randMax = 500, unsigned int randSeed = 0) { - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(25); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx index 7c248117a34..826787aec22 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsOpeningLabelMapFilterTest1.cxx @@ -49,19 +49,19 @@ itkStatisticsOpeningLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using I2LType = itk::LabelImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); i2l->SetFeatureImage(reader2->GetOutput()); using LabelOpeningType = itk::StatisticsOpeningLabelMapFilter; - LabelOpeningType::Pointer opening = LabelOpeningType::New(); + auto opening = LabelOpeningType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(opening, StatisticsOpeningLabelMapFilter, ShapeOpeningLabelMapFilter); @@ -92,12 +92,12 @@ itkStatisticsOpeningLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(opening, "filter"); using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx index baa311a09c4..7d3baace3ca 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsPositionLabelMapFilterTest1.cxx @@ -43,33 +43,33 @@ itkStatisticsPositionLabelMapFilterTest1(int argc, char * argv[]) // We read the input image. using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // And convert it to a LabelMap, with the shape attribute computed. // We use the default label object type. using I2LType = itk::LabelImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); i2l->SetFeatureImage(reader2->GetOutput()); using OpeningType = itk::StatisticsPositionLabelMapFilter; - OpeningType::Pointer opening = OpeningType::New(); + auto opening = OpeningType::New(); opening->SetInput(i2l->GetOutput()); opening->SetAttribute(argv[4]); itk::SimpleFilterWatcher watcher(opening, "filter"); // the label map is then converted back to an label image. using L2IType = itk::LabelMapToLabelImageFilter; - L2IType::Pointer l2i = L2IType::New(); + auto l2i = L2IType::New(); l2i->SetInput(opening->GetOutput()); // write the result using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx index 9feeebc8fe7..e62e0aa1ed0 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelImageFilterTest1.cxx @@ -42,14 +42,14 @@ itkStatisticsRelabelImageFilterTest1(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using RelabelType = itk::StatisticsRelabelImageFilter; - RelabelType::Pointer statisticsRelabel = RelabelType::New(); + auto statisticsRelabel = RelabelType::New(); statisticsRelabel->SetInput(reader->GetOutput()); statisticsRelabel->SetFeatureImage(reader2->GetOutput()); @@ -79,7 +79,7 @@ itkStatisticsRelabelImageFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(statisticsRelabel, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(statisticsRelabel->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx index 5e2f235ae9c..df60b8d0280 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsRelabelLabelMapFilterTest1.cxx @@ -48,20 +48,20 @@ itkStatisticsRelabelLabelMapFilterTest1(int argc, char * argv[]) // Reading Image File using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); // Converting LabelImage to StatisticsLabelMap using I2LType = itk::LabelImageToStatisticsLabelMapFilter; - I2LType::Pointer i2l = I2LType::New(); + auto i2l = I2LType::New(); i2l->SetInput(reader->GetOutput()); i2l->SetFeatureImage(reader2->GetOutput()); using RelabelType = itk::StatisticsRelabelLabelMapFilter; - RelabelType::Pointer relabel = RelabelType::New(); + auto relabel = RelabelType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(relabel, StatisticsRelabelLabelMapFilter, ShapeRelabelLabelMapFilter); @@ -82,12 +82,12 @@ itkStatisticsRelabelLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(relabel, "filter"); using L2ImageType = itk::LabelMapToLabelImageFilter; - L2ImageType::Pointer l2i = L2ImageType::New(); + auto l2i = L2ImageType::New(); l2i->SetInput(relabel->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(l2i->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx index e7790396376..a14429ee9be 100644 --- a/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx +++ b/Modules/Filtering/LabelMap/test/itkStatisticsUniqueLabelMapFilterTest1.cxx @@ -59,10 +59,10 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) using LabelMapType = itk::LabelMap; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImage); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(featureImage); @@ -70,7 +70,7 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) constexpr unsigned int radiusValue = 5; using LabelImageToLabelMapFilterType = itk::LabelImageToLabelMapFilter; - LabelImageToLabelMapFilterType::Pointer labelMapConverter = LabelImageToLabelMapFilterType::New(); + auto labelMapConverter = LabelImageToLabelMapFilterType::New(); labelMapConverter->SetInput(reader->GetOutput()); labelMapConverter->SetBackgroundValue(itk::NumericTraits::ZeroValue()); @@ -81,23 +81,23 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) StructuringElementType structuringElement = StructuringElementType::Box(radius); using MorphologicalFilterType = itk::GrayscaleDilateImageFilter; - MorphologicalFilterType::Pointer grayscaleDilateFilter = MorphologicalFilterType::New(); + auto grayscaleDilateFilter = MorphologicalFilterType::New(); grayscaleDilateFilter->SetInput(reader->GetOutput()); grayscaleDilateFilter->SetKernel(structuringElement); using ObjectByObjectLabelMapFilterType = itk::ObjectByObjectLabelMapFilter; - ObjectByObjectLabelMapFilterType::Pointer objectByObjectLabelMapFilter = ObjectByObjectLabelMapFilterType::New(); + auto objectByObjectLabelMapFilter = ObjectByObjectLabelMapFilterType::New(); objectByObjectLabelMapFilter->SetInput(labelMapConverter->GetOutput()); objectByObjectLabelMapFilter->SetBinaryInternalOutput(false); objectByObjectLabelMapFilter->SetFilter(grayscaleDilateFilter); using StatisticsFilterType = itk::StatisticsLabelMapFilter; - StatisticsFilterType::Pointer statisticsFilter = StatisticsFilterType::New(); + auto statisticsFilter = StatisticsFilterType::New(); statisticsFilter->SetInput1(objectByObjectLabelMapFilter->GetOutput()); statisticsFilter->SetFeatureImage(reader2->GetOutput()); using LabelUniqueType = itk::StatisticsUniqueLabelMapFilter; - LabelUniqueType::Pointer unique = LabelUniqueType::New(); + auto unique = LabelUniqueType::New(); // testing boolean macro for ReverseOrdering unique->ReverseOrderingOn(); @@ -124,11 +124,11 @@ itkStatisticsUniqueLabelMapFilterTest1(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(unique, "filter"); using LabelMapToImageFilterType = itk::LabelMapToLabelImageFilter; - LabelMapToImageFilterType::Pointer labelMapToImageFilter = LabelMapToImageFilterType::New(); + auto labelMapToImageFilter = LabelMapToImageFilterType::New(); labelMapToImageFilter->SetInput(unique->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(labelMapToImageFilter->GetOutput()); writer->SetFileName(outputImage); writer->UseCompressionOn(); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkAnchorErodeDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkAnchorErodeDilateImageFilter.hxx index b5b17e16a1b..e4b6b650a65 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkAnchorErodeDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkAnchorErodeDilateImageFilter.hxx @@ -60,7 +60,7 @@ AnchorErodeDilateImageFilter::DynamicThreadedGenera IReg.Crop(this->GetInput()->GetRequestedRegion()); // allocate an internal buffer - typename InputImageType::Pointer internalbuffer = InputImageType::New(); + auto internalbuffer = InputImageType::New(); internalbuffer->SetRegions(IReg); internalbuffer->Allocate(); InputImagePointer output = internalbuffer; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseImageFilter.hxx index a4d6ee8b5c0..67b7a759d96 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkAnchorOpenCloseImageFilter.hxx @@ -68,7 +68,7 @@ AnchorOpenCloseImageFilter::DynamicThread IReg.Crop(this->GetInput()->GetRequestedRegion()); // allocate an internal buffer - typename InputImageType::Pointer internalbuffer = InputImageType::New(); + auto internalbuffer = InputImageType::New(); internalbuffer->SetRegions(IReg); internalbuffer->Allocate(); InputImagePointer output = internalbuffer; @@ -188,7 +188,7 @@ AnchorOpenCloseImageFilter::DoFaceOpen( // using ItType = ImageRegionConstIteratorWithIndex; // ItType it(input, face); - typename TImage::Pointer dumbImg = TImage::New(); + auto dumbImg = TImage::New(); dumbImg->SetRegions(face); KernelLType NormLine = line; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkAnchorUtilities.hxx b/Modules/Filtering/MathematicalMorphology/include/itkAnchorUtilities.hxx index 2e29609b13d..226d79293d6 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkAnchorUtilities.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkAnchorUtilities.hxx @@ -57,7 +57,7 @@ DoAnchorFace(const TImage * input, // using ItType = ImageRegionConstIteratorWithIndex; // ItType it(input, face); - typename TImage::Pointer dumbImg = TImage::New(); + auto dumbImg = TImage::New(); dumbImg->SetRegions(face); TLine NormLine = line; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkBlackTopHatImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkBlackTopHatImageFilter.hxx index 85e13d4ae71..d10099f5d84 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkBlackTopHatImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkBlackTopHatImageFilter.hxx @@ -39,7 +39,7 @@ void BlackTopHatImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -48,7 +48,7 @@ BlackTopHatImageFilter::GenerateData() // Delegate to a closing filter. using ClosingFilterType = GrayscaleMorphologicalClosingImageFilter; - typename ClosingFilterType::Pointer close = ClosingFilterType::New(); + auto close = ClosingFilterType::New(); close->SetInput(this->GetInput()); close->SetKernel(this->GetKernel()); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkClosingByReconstructionImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkClosingByReconstructionImageFilter.hxx index bec3a1a7c03..886f54d4e77 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkClosingByReconstructionImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkClosingByReconstructionImageFilter.hxx @@ -61,7 +61,7 @@ void ClosingByReconstructionImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -89,7 +89,7 @@ ClosingByReconstructionImageFilter::Generate { progress->RegisterInternalFilter(erode, .25); erode->Update(); - typename TInputImage::Pointer tempImage = TInputImage::New(); + auto tempImage = TInputImage::New(); tempImage->SetRegions(dilate->GetOutput()->GetBufferedRegion()); tempImage->CopyInformation(this->GetInput()); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkDoubleThresholdImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkDoubleThresholdImageFilter.hxx index eb798c0021b..d49b15220ff 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkDoubleThresholdImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkDoubleThresholdImageFilter.hxx @@ -74,10 +74,10 @@ DoubleThresholdImageFilter::GenerateData() using ThresholdFilterType = BinaryThresholdImageFilter; using DilationFilterType = ReconstructionByDilationImageFilter; - typename ThresholdFilterType::Pointer narrowThreshold = ThresholdFilterType::New(); + auto narrowThreshold = ThresholdFilterType::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); narrowThreshold->SetLowerThreshold(m_Threshold2); @@ -86,14 +86,14 @@ DoubleThresholdImageFilter::GenerateData() narrowThreshold->SetOutsideValue(m_OutsideValue); narrowThreshold->SetInput(this->GetInput()); - typename ThresholdFilterType::Pointer wideThreshold = ThresholdFilterType::New(); + auto wideThreshold = ThresholdFilterType::New(); wideThreshold->SetLowerThreshold(m_Threshold1); wideThreshold->SetUpperThreshold(m_Threshold4); wideThreshold->SetInsideValue(m_InsideValue); wideThreshold->SetOutsideValue(m_OutsideValue); wideThreshold->SetInput(this->GetInput()); - typename DilationFilterType::Pointer dilate = DilationFilterType::New(); + auto dilate = DilationFilterType::New(); dilate->SetMarkerImage(narrowThreshold->GetOutput()); dilate->SetMaskImage(wideThreshold->GetOutput()); dilate->SetFullyConnected(m_FullyConnected); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx index 2485c5164a0..deb2ce3711d 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkFlatStructuringElement.hxx @@ -923,7 +923,7 @@ FlatStructuringElement::Ball(RadiusType radius, bool radiusIsParamet // Create an image to hold the ellipsoid // - typename ImageType::Pointer sourceImage = ImageType::New(); + auto sourceImage = ImageType::New(); typename ImageType::RegionType region; RadiusType size = radius; for (i = 0; i < (int)VDimension; ++i) @@ -952,7 +952,7 @@ FlatStructuringElement::Ball(RadiusType radius, bool radiusIsParamet using EllipsoidType = EllipsoidInteriorExteriorSpatialFunction; // Create an ellipsoid spatial function for the source image - typename EllipsoidType::Pointer spatialFunction = EllipsoidType::New(); + auto spatialFunction = EllipsoidType::New(); // Define and set the axes lengths for the ellipsoid typename EllipsoidType::InputType axes; @@ -1029,7 +1029,7 @@ FlatStructuringElement::Annulus(RadiusType radius, // Create an image to hold the ellipsoid // - typename ImageType::Pointer kernelImage = ImageType::New(); + auto kernelImage = ImageType::New(); typename ImageType::RegionType region; RadiusType size = radius; for (unsigned int i = 0; i < NDimension; ++i) @@ -1057,8 +1057,8 @@ FlatStructuringElement::Annulus(RadiusType radius, using EllipsoidType = EllipsoidInteriorExteriorSpatialFunction; // Create an ellipsoid spatial function for the source image - typename EllipsoidType::Pointer ellipsoidOuter = EllipsoidType::New(); - typename EllipsoidType::Pointer ellipsoidInner = EllipsoidType::New(); + auto ellipsoidOuter = EllipsoidType::New(); + auto ellipsoidInner = EllipsoidType::New(); // Define and set the axes lengths for the ellipsoid typename EllipsoidType::InputType axesOuter; @@ -1189,7 +1189,7 @@ FlatStructuringElement::ComputeBufferFromLines() // Create an image to hold the ellipsoid // - typename ImageType::Pointer sourceImage = ImageType::New(); + auto sourceImage = ImageType::New(); typename ImageType::RegionType region; RadiusType size = this->GetRadius(); for (int i = 0; i < (int)VDimension; ++i) @@ -1229,7 +1229,7 @@ FlatStructuringElement::ComputeBufferFromLines() // dilate the pixel using DilateType = VanHerkGilWermanDilateImageFilter; - typename DilateType::Pointer dilate = DilateType::New(); + auto dilate = DilateType::New(); // suspect that multithreading does odd things when images are // really tiny dilate->SetNumberOfWorkUnits(1); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx index 49e96d5b5be..7db8150f190 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedClosingImageFilter.hxx @@ -114,7 +114,7 @@ GrayscaleConnectedClosingImageFilter::GenerateData() ReconstructionByErosionImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx index 8a10d8cbc32..caba12febf4 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleConnectedOpeningImageFilter.hxx @@ -113,7 +113,7 @@ GrayscaleConnectedOpeningImageFilter::GenerateData() ReconstructionByDilationImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(dilate, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleDilateImageFilter.hxx index b6d4d541e12..e4819a95395 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleDilateImageFilter.hxx @@ -142,7 +142,7 @@ void GrayscaleDilateImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -176,7 +176,7 @@ GrayscaleDilateImageFilter::GenerateData() m_AnchorFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_AnchorFilter, 0.9f); - typename CastFilterType::Pointer cast = CastFilterType::New(); + auto cast = CastFilterType::New(); cast->SetInput(m_AnchorFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); @@ -190,7 +190,7 @@ GrayscaleDilateImageFilter::GenerateData() m_VHGWFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_VHGWFilter, 0.9f); - typename CastFilterType::Pointer cast = CastFilterType::New(); + auto cast = CastFilterType::New(); cast->SetInput(m_VHGWFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleErodeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleErodeImageFilter.hxx index 9998fe1226f..d9d1cd16c1a 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleErodeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleErodeImageFilter.hxx @@ -142,7 +142,7 @@ void GrayscaleErodeImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -176,7 +176,7 @@ GrayscaleErodeImageFilter::GenerateData() m_AnchorFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_AnchorFilter, 0.9f); - typename CastFilterType::Pointer cast = CastFilterType::New(); + auto cast = CastFilterType::New(); cast->SetInput(m_AnchorFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); @@ -190,7 +190,7 @@ GrayscaleErodeImageFilter::GenerateData() m_VHGWFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_VHGWFilter, 0.9f); - typename CastFilterType::Pointer cast = CastFilterType::New(); + auto cast = CastFilterType::New(); cast->SetInput(m_VHGWFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx index efc99fd2c8d..1312e158196 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleFillholeImageFilter.hxx @@ -115,7 +115,7 @@ GrayscaleFillholeImageFilter::GenerateData() ReconstructionByErosionImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx index 24fab78c35a..096083fb145 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicDilateImageFilter.hxx @@ -193,7 +193,7 @@ GrayscaleGeodesicDilateImageFilter::GenerateData() singleIteration->GetOutput()->SetRequestedRegion(this->GetOutput()->GetRequestedRegion()); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(singleIteration, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx index 7c1fdae5292..9159607a614 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGeodesicErodeImageFilter.hxx @@ -193,7 +193,7 @@ GrayscaleGeodesicErodeImageFilter::GenerateData() singleIteration->GetOutput()->SetRequestedRegion(this->GetOutput()->GetRequestedRegion()); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(singleIteration, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx index 64fe04709cd..4c6e2c256fb 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleGrindPeakImageFilter.hxx @@ -125,7 +125,7 @@ GrayscaleGrindPeakImageFilter::GenerateData() ReconstructionByDilationImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(dilate, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalClosingImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalClosingImageFilter.hxx index 183ab014395..63b0c84e8d1 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalClosingImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalClosingImageFilter.hxx @@ -128,7 +128,7 @@ void GrayscaleMorphologicalClosingImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -142,7 +142,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::NonpositiveMin()); @@ -156,7 +156,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge progress->RegisterInternalFilter(m_BasicErodeFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_BasicErodeFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -185,7 +185,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::NonpositiveMin()); @@ -199,7 +199,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge progress->RegisterInternalFilter(m_HistogramErodeFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_HistogramErodeFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -228,7 +228,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::NonpositiveMin()); @@ -242,7 +242,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge progress->RegisterInternalFilter(m_VanHerkGilWermanErodeFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_VanHerkGilWermanErodeFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -271,7 +271,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::NonpositiveMin()); @@ -282,7 +282,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge progress->RegisterInternalFilter(m_AnchorFilter, 0.8f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_AnchorFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -298,7 +298,7 @@ GrayscaleMorphologicalClosingImageFilter::Ge progress->RegisterInternalFilter(m_AnchorFilter, 0.9f); using CastType = CastImageFilter; - typename CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(m_AnchorFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalOpeningImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalOpeningImageFilter.hxx index 8c9f5d728b0..6c2fd570b7c 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalOpeningImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkGrayscaleMorphologicalOpeningImageFilter.hxx @@ -125,7 +125,7 @@ void GrayscaleMorphologicalOpeningImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -139,7 +139,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::max()); @@ -153,7 +153,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge progress->RegisterInternalFilter(m_BasicDilateFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_BasicDilateFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -182,7 +182,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::max()); @@ -196,7 +196,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge progress->RegisterInternalFilter(m_HistogramDilateFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_HistogramDilateFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -225,7 +225,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::max()); @@ -239,7 +239,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge progress->RegisterInternalFilter(m_VanHerkGilWermanDilateFilter, 0.4f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_VanHerkGilWermanDilateFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -259,7 +259,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge m_VanHerkGilWermanDilateFilter->GraftOutput(this->GetOutput()); using CastType = CastImageFilter; - typename CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(m_VanHerkGilWermanDilateFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); @@ -274,7 +274,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge if (m_SafeBorder) { using PadType = ConstantPadImageFilter; - typename PadType::Pointer pad = PadType::New(); + auto pad = PadType::New(); pad->SetPadLowerBound(this->GetKernel().GetRadius()); pad->SetPadUpperBound(this->GetKernel().GetRadius()); pad->SetConstant(NumericTraits::max()); @@ -285,7 +285,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge progress->RegisterInternalFilter(m_AnchorFilter, 0.8f); using CropType = CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(m_AnchorFilter->GetOutput()); crop->SetUpperBoundaryCropSize(this->GetKernel().GetRadius()); crop->SetLowerBoundaryCropSize(this->GetKernel().GetRadius()); @@ -301,7 +301,7 @@ GrayscaleMorphologicalOpeningImageFilter::Ge progress->RegisterInternalFilter(m_AnchorFilter, 0.9f); using CastType = CastImageFilter; - typename CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(m_AnchorFilter->GetOutput()); progress->RegisterInternalFilter(cast, 0.1f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkHConcaveImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkHConcaveImageFilter.hxx index 3d80cad5a44..bdf655ec15b 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkHConcaveImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkHConcaveImageFilter.hxx @@ -61,7 +61,7 @@ HConcaveImageFilter::GenerateData() this->AllocateOutputs(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Delegate to a H-Minima filter. diff --git a/Modules/Filtering/MathematicalMorphology/include/itkHConvexImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkHConvexImageFilter.hxx index 9d5e2c50a9f..76ea275b471 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkHConvexImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkHConvexImageFilter.hxx @@ -58,7 +58,7 @@ void HConvexImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkHMaximaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkHMaximaImageFilter.hxx index 630f3eddc58..7f5d0ec5078 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkHMaximaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkHMaximaImageFilter.hxx @@ -66,7 +66,7 @@ HMaximaImageFilter::GenerateData() // dilation. the marker image is the input image minus the height // parameter. using ShiftFilterType = ShiftScaleImageFilter; - typename ShiftFilterType::Pointer shift = ShiftFilterType::New(); + auto shift = ShiftFilterType::New(); shift->SetInput(this->GetInput()); shift->SetShift(-1.0 * static_cast(m_Height)); @@ -77,7 +77,7 @@ HMaximaImageFilter::GenerateData() ReconstructionByDilationImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(dilate, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkHMinimaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkHMinimaImageFilter.hxx index bbe6c261eb9..bef27a8a07a 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkHMinimaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkHMinimaImageFilter.hxx @@ -66,7 +66,7 @@ HMinimaImageFilter::GenerateData() // erosion. the marker image is the input image minus the height // parameter. using ShiftFilterType = ShiftScaleImageFilter; - typename ShiftFilterType::Pointer shift = ShiftFilterType::New(); + auto shift = ShiftFilterType::New(); shift->SetInput(this->GetInput()); shift->SetShift(static_cast(m_Height)); @@ -77,7 +77,7 @@ HMinimaImageFilter::GenerateData() ReconstructionByErosionImageFilter::New(); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); progress->RegisterInternalFilter(erode, 1.0f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkMorphologicalGradientImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkMorphologicalGradientImageFilter.hxx index 3facd2746a2..f780ac9f56b 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkMorphologicalGradientImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkMorphologicalGradientImageFilter.hxx @@ -124,7 +124,7 @@ void MorphologicalGradientImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -141,7 +141,7 @@ MorphologicalGradientImageFilter::GenerateDa m_BasicErodeFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_BasicErodeFilter, 0.4f); - typename SubtractFilterType::Pointer sub = SubtractFilterType::New(); + auto sub = SubtractFilterType::New(); sub->SetInput1(m_BasicDilateFilter->GetOutput()); sub->SetInput2(m_BasicErodeFilter->GetOutput()); progress->RegisterInternalFilter(sub, 0.1f); @@ -169,7 +169,7 @@ MorphologicalGradientImageFilter::GenerateDa m_AnchorErodeFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_AnchorErodeFilter, 0.4f); - typename SubtractFilterType::Pointer sub = SubtractFilterType::New(); + auto sub = SubtractFilterType::New(); sub->SetInput1(m_AnchorDilateFilter->GetOutput()); sub->SetInput2(m_AnchorErodeFilter->GetOutput()); progress->RegisterInternalFilter(sub, 0.1f); @@ -187,7 +187,7 @@ MorphologicalGradientImageFilter::GenerateDa m_VanHerkGilWermanErodeFilter->SetInput(this->GetInput()); progress->RegisterInternalFilter(m_VanHerkGilWermanErodeFilter, 0.4f); - typename SubtractFilterType::Pointer sub = SubtractFilterType::New(); + auto sub = SubtractFilterType::New(); sub->SetInput1(m_VanHerkGilWermanDilateFilter->GetOutput()); sub->SetInput2(m_VanHerkGilWermanErodeFilter->GetOutput()); progress->RegisterInternalFilter(sub, 0.1f); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkOpeningByReconstructionImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkOpeningByReconstructionImageFilter.hxx index 5d044a805b3..a95402ecd0e 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkOpeningByReconstructionImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkOpeningByReconstructionImageFilter.hxx @@ -62,7 +62,7 @@ void OpeningByReconstructionImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -90,7 +90,7 @@ OpeningByReconstructionImageFilter::Generate if (m_PreserveIntensities) { dilate->Update(); - typename TInputImage::Pointer tempImage = TInputImage::New(); + auto tempImage = TInputImage::New(); tempImage->SetRegions(erode->GetOutput()->GetBufferedRegion()); tempImage->CopyInformation(this->GetInput()); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.hxx index c471099acb1..f9ca424294b 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkReconstructionImageFilter.hxx @@ -100,8 +100,8 @@ ReconstructionImageFilter::GenerateData() if (m_UseInternalCopy) { - typename PadType::Pointer MaskPad = PadType::New(); - typename PadType::Pointer MarkerPad = PadType::New(); + auto MaskPad = PadType::New(); + auto MarkerPad = PadType::New(); padSize.Fill(1); MaskPad->SetConstant(m_MarkerValue); @@ -324,7 +324,7 @@ ReconstructionImageFilter::GenerateData() if (m_UseInternalCopy) { using CropType = typename itk::CropImageFilter; - typename CropType::Pointer crop = CropType::New(); + auto crop = CropType::New(); crop->SetInput(markerImageP); crop->SetUpperBoundaryCropSize(padSize); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkRegionalMaximaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkRegionalMaximaImageFilter.hxx index 6795793e4e0..7feba56089e 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkRegionalMaximaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkRegionalMaximaImageFilter.hxx @@ -66,7 +66,7 @@ void RegionalMaximaImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -110,7 +110,7 @@ RegionalMaximaImageFilter::GenerateData() else { using ThresholdType = BinaryThresholdImageFilter; - typename ThresholdType::Pointer thresholder = ThresholdType::New(); + auto thresholder = ThresholdType::New(); thresholder->SetInput(regionalMax->GetOutput()); thresholder->SetUpperThreshold(regionalMax->GetMarkerValue()); thresholder->SetLowerThreshold(regionalMax->GetMarkerValue()); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkRegionalMinimaImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkRegionalMinimaImageFilter.hxx index 104699999d5..d1a633987fe 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkRegionalMinimaImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkRegionalMinimaImageFilter.hxx @@ -67,7 +67,7 @@ void RegionalMinimaImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -113,7 +113,7 @@ RegionalMinimaImageFilter::GenerateData() else { using ThresholdType = BinaryThresholdImageFilter; - typename ThresholdType::Pointer threshold = ThresholdType::New(); + auto threshold = ThresholdType::New(); threshold->SetInput(regionalMin->GetOutput()); threshold->SetUpperThreshold(regionalMin->GetMarkerValue()); diff --git a/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanErodeDilateImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanErodeDilateImageFilter.hxx index 27d6459e09f..dd8dd6e7675 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanErodeDilateImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanErodeDilateImageFilter.hxx @@ -65,7 +65,7 @@ VanHerkGilWermanErodeDilateImageFilter::DynamicThre IReg.Crop(this->GetInput()->GetRequestedRegion()); // allocate an internal buffer - typename InputImageType::Pointer internalbuffer = InputImageType::New(); + auto internalbuffer = InputImageType::New(); internalbuffer->SetRegions(IReg); internalbuffer->Allocate(); InputImagePointer output = internalbuffer; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanUtilities.hxx b/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanUtilities.hxx index 3d30481f91f..da25109e53b 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanUtilities.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkVanHerkGilWermanUtilities.hxx @@ -140,7 +140,7 @@ DoFace(typename TImage::ConstPointer input, // using ItType = ImageRegionConstIteratorWithIndex; // ItType it(input, face); - typename TImage::Pointer dumbImg = TImage::New(); + auto dumbImg = TImage::New(); dumbImg->SetRegions(face); TLine NormLine = line; diff --git a/Modules/Filtering/MathematicalMorphology/include/itkWhiteTopHatImageFilter.hxx b/Modules/Filtering/MathematicalMorphology/include/itkWhiteTopHatImageFilter.hxx index 6a2c800c4bd..6b8710070ef 100644 --- a/Modules/Filtering/MathematicalMorphology/include/itkWhiteTopHatImageFilter.hxx +++ b/Modules/Filtering/MathematicalMorphology/include/itkWhiteTopHatImageFilter.hxx @@ -39,7 +39,7 @@ void WhiteTopHatImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx index 87b62159c82..1e6ae84b582 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkAnchorErodeDilateImageFilterTest.cxx @@ -33,7 +33,7 @@ itkAnchorErodeDilateImageFilterTest(int, char ** const) using FunctionType = std::less; using FilterType = itk::AnchorErodeDilateImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AnchorErodeDilateImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx index dda51fefb08..14c260f8e03 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkAnchorOpenCloseImageFilterTest.cxx @@ -34,7 +34,7 @@ itkAnchorOpenCloseImageFilterTest(int, char ** const) using CompateType2 = std::greater; using FilterType = itk::AnchorOpenCloseImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AnchorOpenCloseImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx index c7f9e5c70f0..33d0517e5b2 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkClosingByReconstructionImageFilterTest.cxx @@ -48,7 +48,7 @@ itkClosingByReconstructionImageFilterTest(int argc, char * argv[]) itk::ClosingByReconstructionImageFilter; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); @@ -56,7 +56,7 @@ itkClosingByReconstructionImageFilterTest(int argc, char * argv[]) // Create the filter - MorphologicalFilterType::Pointer filter = MorphologicalFilterType::New(); + auto filter = MorphologicalFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ClosingByReconstructionImageFilter, ImageToImageFilter); @@ -78,7 +78,7 @@ itkClosingByReconstructionImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx index e7828a03fdf..5986a1dffa7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkDoubleThresholdImageFilterTest.cxx @@ -63,13 +63,13 @@ itkDoubleThresholdImageFilterTest(int argc, char * argv[]) // Creation of Reader and Writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - RescaleType::Pointer rescaler = RescaleType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto rescaler = RescaleType::New(); // Create the filter - DoubleThresholdFilterType::Pointer threshold = DoubleThresholdFilterType::New(); - itk::SimpleFilterWatcher watcher(threshold, "threshold"); + auto threshold = DoubleThresholdFilterType::New(); + itk::SimpleFilterWatcher watcher(threshold, "threshold"); // Setup the input and output files reader->SetFileName(argv[1]); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx index aed347eedca..0ca4f5a7a85 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest2.cxx @@ -38,7 +38,7 @@ GetImage(const itk::FlatStructuringElement & flatElement) using ConstIterator = typename FlatStructuringElement<2U>::ConstIterator; using PixelType = unsigned char; - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::RegionType region; RadiusType size = flatElement.GetRadius(); Index centerIdx; @@ -86,7 +86,7 @@ itkFlatStructuringElementTest2(int argc, char * argv[]) // Read test image as unsigned char using ImageUCType = itk::Image; using ReaderUCType = itk::ImageFileReader; - ReaderUCType::Pointer reader = ReaderUCType::New(); + auto reader = ReaderUCType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->UpdateLargestPossibleRegion()); @@ -101,13 +101,13 @@ itkFlatStructuringElementTest2(int argc, char * argv[]) using ImageBoolType = itk::Image; using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetInput(testImg); rescale->SetOutputMinimum(itk::NumericTraits::ZeroValue()); rescale->SetOutputMaximum(itk::NumericTraits::OneValue()); using castFilterType = itk::CastImageFilter; - castFilterType::Pointer cast = castFilterType::New(); + auto cast = castFilterType::New(); cast->SetInput(rescale->GetOutput()); cast->Update(); ImageBoolType::Pointer testImgBool = cast->GetOutput(); @@ -118,7 +118,7 @@ itkFlatStructuringElementTest2(int argc, char * argv[]) // Write result from GetImage for comparisson with input image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(imgFromStructure); @@ -129,7 +129,7 @@ itkFlatStructuringElementTest2(int argc, char * argv[]) // Pad test image to even size using ConstPadFilterType = itk::ConstantPadImageFilter; - ConstPadFilterType::Pointer padFilter = ConstPadFilterType::New(); + auto padFilter = ConstPadFilterType::New(); padFilter->SetInput(testImgBool); ImageBoolType::SizeType lowerExtendRegion; lowerExtendRegion[0] = 1; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx index 65d0df58dfc..6660c4a8047 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkFlatStructuringElementTest3.cxx @@ -29,7 +29,7 @@ SEToFile(const TSEType & e, const std::string & fname) using ImageType = itk::Image; - typename ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); typename ImageType::IndexType start; start.Fill(0); @@ -55,7 +55,7 @@ SEToFile(const TSEType & e, const std::string & fname) } using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(fname); writer->SetInput(img); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx index 55fffa6d68b..a0f4615ba7b 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedClosingImageFilterTest.cxx @@ -56,7 +56,7 @@ itkGrayscaleConnectedClosingImageFilterTest(int argc, char * argv[]) using ConnectedClosingFilterType = itk::GrayscaleConnectedClosingImageFilter; // Create the filter - ConnectedClosingFilterType::Pointer connectedClosing = ConnectedClosingFilterType::New(); + auto connectedClosing = ConnectedClosingFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(connectedClosing, GrayscaleConnectedClosingImageFilter, ImageToImageFilter); @@ -64,7 +64,7 @@ itkGrayscaleConnectedClosingImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(connectedClosing, "connectedClosing"); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); @@ -87,7 +87,7 @@ itkGrayscaleConnectedClosingImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(connectedClosing->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx index 6d336d0ca79..d387b809285 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleConnectedOpeningImageFilterTest.cxx @@ -56,7 +56,7 @@ itkGrayscaleConnectedOpeningImageFilterTest(int argc, char * argv[]) using ConnectedOpeningFilterType = itk::GrayscaleConnectedOpeningImageFilter; // Create the filter - ConnectedOpeningFilterType::Pointer connectedOpening = ConnectedOpeningFilterType::New(); + auto connectedOpening = ConnectedOpeningFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(connectedOpening, GrayscaleConnectedOpeningImageFilter, ImageToImageFilter); @@ -65,7 +65,7 @@ itkGrayscaleConnectedOpeningImageFilterTest(int argc, char * argv[]) watcher.QuietOn(); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); @@ -88,7 +88,7 @@ itkGrayscaleConnectedOpeningImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(connectedOpening->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx index de39103ecf9..7a0a1cf0afb 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleDilateImageFilterTest.cxx @@ -40,13 +40,13 @@ itkGrayscaleDilateImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleDilateImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -73,7 +73,7 @@ itkGrayscaleDilateImageFilterTest(int ac, char * av[]) filter->SetRadius(4); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -100,7 +100,7 @@ itkGrayscaleDilateImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx index 3faea8050a0..f1a5aed9ee2 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleErodeImageFilterTest.cxx @@ -40,13 +40,13 @@ itkGrayscaleErodeImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleErodeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -73,7 +73,7 @@ itkGrayscaleErodeImageFilterTest(int ac, char * av[]) filter->SetRadius(4); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -100,7 +100,7 @@ itkGrayscaleErodeImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx index 86ccd08f233..95992fbab86 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFillholeImageFilterTest.cxx @@ -64,12 +64,12 @@ itkGrayscaleFillholeImageFilterTest(int argc, char * argv[]) // Creation of Reader and Writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - RescaleType::Pointer rescaler = RescaleType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto rescaler = RescaleType::New(); // Create the filter - FillholeFilterType::Pointer fillhole = FillholeFilterType::New(); + auto fillhole = FillholeFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fillhole, GrayscaleFillholeImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx index 797ec362064..9bee1a3c5f5 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionDilateImageFilterTest.cxx @@ -46,7 +46,7 @@ itkGrayscaleFunctionDilateImageFilterTest(int argc, char * argv[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -119,7 +119,7 @@ itkGrayscaleFunctionDilateImageFilterTest(int argc, char * argv[]) using myFilterType = itk::GrayscaleFunctionDilateImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher filterWatcher(filter); // Create the structuring element @@ -172,7 +172,7 @@ itkGrayscaleFunctionDilateImageFilterTest(int argc, char * argv[]) if (argc == 2) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(filter->GetOutput()); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx index 6b681550c37..783d34c05e6 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleFunctionErodeImageFilterTest.cxx @@ -46,7 +46,7 @@ itkGrayscaleFunctionErodeImageFilterTest(int argc, char * argv[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -119,7 +119,7 @@ itkGrayscaleFunctionErodeImageFilterTest(int argc, char * argv[]) using myFilterType = itk::GrayscaleFunctionErodeImageFilter; // Create the filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watcher(filter, "filter"); // Create the structuring element @@ -170,7 +170,7 @@ itkGrayscaleFunctionErodeImageFilterTest(int argc, char * argv[]) if (argc == 2) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(filter->GetOutput()); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx index 7d181ef7c60..8dff92c08d2 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGeodesicErodeDilateImageFilterTest.cxx @@ -48,12 +48,12 @@ itkGrayscaleGeodesicErodeDilateImageFilterTest(int argc, char * argv[]) using DilateFilterType = itk::GrayscaleGeodesicDilateImageFilter; using ErodeFilterType = itk::GrayscaleGeodesicErodeImageFilter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - ShiftFilterType::Pointer shiftErode = ShiftFilterType::New(); - ShiftFilterType::Pointer shiftDilate = ShiftFilterType::New(); - ErodeFilterType::Pointer erode = ErodeFilterType::New(); - DilateFilterType::Pointer dilate = DilateFilterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto shiftErode = ShiftFilterType::New(); + auto shiftDilate = ShiftFilterType::New(); + auto erode = ErodeFilterType::New(); + auto dilate = DilateFilterType::New(); // Create the reader and writer reader->SetFileName(argv[1]); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx index 974f36f018f..203f40f0374 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleGrindPeakImageFilterTest.cxx @@ -52,13 +52,13 @@ itkGrayscaleGrindPeakImageFilterTest(int argc, char * argv[]) using WriteImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Create the filter using GrindPeakFilterType = itk::GrayscaleGrindPeakImageFilter; - GrindPeakFilterType::Pointer grindpeak = GrindPeakFilterType::New(); + auto grindpeak = GrindPeakFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(grindpeak, GrayscaleGrindPeakImageFilter, ImageToImageFilter); @@ -71,7 +71,7 @@ itkGrayscaleGrindPeakImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(grindpeak->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx index 3703aaf91d8..23e1bb5f953 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest.cxx @@ -55,14 +55,14 @@ itkGrayscaleMorphologicalClosingImageFilterTest(int argc, char * argv[]) using FilterType = itk::GrayscaleMorphologicalClosingImageFilter; // Create the reader and writer - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, GrayscaleMorphologicalClosingImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx index 9f21fbabbe6..17846fa4745 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalClosingImageFilterTest2.cxx @@ -40,13 +40,13 @@ itkGrayscaleMorphologicalClosingImageFilterTest2(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleMorphologicalClosingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -80,7 +80,7 @@ itkGrayscaleMorphologicalClosingImageFilterTest2(int ac, char * av[]) filter->SetSafeBorder(std::stoi(av[6])); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -107,7 +107,7 @@ itkGrayscaleMorphologicalClosingImageFilterTest2(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx index 438e6eea1e3..daff94796a3 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest.cxx @@ -55,14 +55,14 @@ itkGrayscaleMorphologicalOpeningImageFilterTest(int argc, char * argv[]) using FilterType = itk::GrayscaleMorphologicalOpeningImageFilter; // Create the reader and writer - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); // Create the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, GrayscaleMorphologicalOpeningImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx index 9296bbd1855..8a4e8d5eea6 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkGrayscaleMorphologicalOpeningImageFilterTest2.cxx @@ -40,13 +40,13 @@ itkGrayscaleMorphologicalOpeningImageFilterTest2(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleMorphologicalOpeningImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -80,7 +80,7 @@ itkGrayscaleMorphologicalOpeningImageFilterTest2(int ac, char * av[]) filter->SetSafeBorder(std::stoi(av[6])); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -107,7 +107,7 @@ itkGrayscaleMorphologicalOpeningImageFilterTest2(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx index 007731e7542..d588d0b4e2f 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConcaveImageFilterTest.cxx @@ -50,7 +50,7 @@ itkHConcaveImageFilterTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -60,7 +60,7 @@ itkHConcaveImageFilterTest(int argc, char * argv[]) using HConcaveFilterType = itk::HConcaveImageFilter; // Create the filter - HConcaveFilterType::Pointer hConcaveFilter = HConcaveFilterType::New(); + auto hConcaveFilter = HConcaveFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(hConcaveFilter, HConcaveImageFilter, ImageToImageFilter); @@ -84,7 +84,7 @@ itkHConcaveImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(hConcaveFilter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx index b86dce56ae3..2c30b704095 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConvexConcaveImageFilterTest.cxx @@ -64,13 +64,13 @@ itkHConvexConcaveImageFilterTest(int argc, char * argv[]) // Creation of reader and writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - RescaleType::Pointer rescaler = RescaleType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto rescaler = RescaleType::New(); // Create the filters - HConvexFilterType::Pointer hConvexFilter = HConvexFilterType::New(); - HConcaveFilterType::Pointer hConcaveFilter = HConcaveFilterType::New(); + auto hConvexFilter = HConvexFilterType::New(); + auto hConcaveFilter = HConcaveFilterType::New(); itk::SimpleFilterWatcher watchConvex(hConvexFilter, "HConvexImageFilter"); itk::SimpleFilterWatcher watchConcave(hConcaveFilter, "HConcaveImageFilter"); @@ -89,7 +89,7 @@ itkHConvexConcaveImageFilterTest(int argc, char * argv[]) // Create a filter to add the two images using AddFilterType = itk::AddImageFilter; - AddFilterType::Pointer add = AddFilterType::New(); + auto add = AddFilterType::New(); add->SetInput1(hConvexFilter->GetOutput()); add->SetInput2(hConcaveFilter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx index 238b668ba9e..d2bb6bc1fbb 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHConvexImageFilterTest.cxx @@ -50,7 +50,7 @@ itkHConvexImageFilterTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -60,7 +60,7 @@ itkHConvexImageFilterTest(int argc, char * argv[]) using HConvexFilterType = itk::HConvexImageFilter; // Create the filter - HConvexFilterType::Pointer hConvexFilter = HConvexFilterType::New(); + auto hConvexFilter = HConvexFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(hConvexFilter, HConvexImageFilter, ImageToImageFilter); @@ -84,7 +84,7 @@ itkHConvexImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(hConvexFilter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx index 4ce4a083b2a..762a40c5662 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaImageFilterTest.cxx @@ -50,7 +50,7 @@ itkHMaximaImageFilterTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -60,7 +60,7 @@ itkHMaximaImageFilterTest(int argc, char * argv[]) using HMaximaFilterType = itk::HMaximaImageFilter; // Create the filter - HMaximaFilterType::Pointer hMaximaFilter = HMaximaFilterType::New(); + auto hMaximaFilter = HMaximaFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(hMaximaFilter, HMaximaImageFilter, ImageToImageFilter); @@ -84,7 +84,7 @@ itkHMaximaImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(hMaximaFilter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx index ea8ff647327..653d812a598 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMaximaMinimaImageFilterTest.cxx @@ -60,12 +60,12 @@ itkHMaximaMinimaImageFilterTest(int argc, char * argv[]) // Creation of reader and writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); // Create the filters - HMaximaFilterType::Pointer hMaximaFilter = HMaximaFilterType::New(); - HMinimaFilterType::Pointer hMinimaFilter = HMinimaFilterType::New(); + auto hMaximaFilter = HMaximaFilterType::New(); + auto hMinimaFilter = HMinimaFilterType::New(); itk::SimpleFilterWatcher watchHmaxima(hMaximaFilter, "HMaximaImageFilter"); itk::SimpleFilterWatcher watchHminima(hMinimaFilter, "HMinimaImageFilter"); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx index f0d4c8526cb..cd5fd1fcd89 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkHMinimaImageFilterTest.cxx @@ -50,7 +50,7 @@ itkHMinimaImageFilterTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -60,7 +60,7 @@ itkHMinimaImageFilterTest(int argc, char * argv[]) using HMinimaFilterType = itk::HMinimaImageFilter; // Create the filter - HMinimaFilterType::Pointer hMinimaFilter = HMinimaFilterType::New(); + auto hMinimaFilter = HMinimaFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(hMinimaFilter, HMinimaImageFilter, ImageToImageFilter); @@ -84,7 +84,7 @@ itkHMinimaImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(hMinimaFilter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx index f42e945959b..539306b76c7 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleDilateImageFilterTest.cxx @@ -40,13 +40,13 @@ itkMapGrayscaleDilateImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleDilateImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -73,7 +73,7 @@ itkMapGrayscaleDilateImageFilterTest(int ac, char * av[]) filter->SetRadius(4); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -100,7 +100,7 @@ itkMapGrayscaleDilateImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx index 630714e2c3e..2c9a088fd3c 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleErodeImageFilterTest.cxx @@ -40,13 +40,13 @@ itkMapGrayscaleErodeImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleErodeImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -73,7 +73,7 @@ itkMapGrayscaleErodeImageFilterTest(int ac, char * av[]) filter->SetRadius(4); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -100,7 +100,7 @@ itkMapGrayscaleErodeImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx index 1a943d5aea5..9c63fe93a08 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalClosingImageFilterTest.cxx @@ -40,13 +40,13 @@ itkMapGrayscaleMorphologicalClosingImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleMorphologicalClosingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -80,7 +80,7 @@ itkMapGrayscaleMorphologicalClosingImageFilterTest(int ac, char * av[]) filter->SetSafeBorder(std::stoi(av[6])); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -107,7 +107,7 @@ itkMapGrayscaleMorphologicalClosingImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx index b544a0dc0bd..8fdc14c2d29 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapGrayscaleMorphologicalOpeningImageFilterTest.cxx @@ -40,13 +40,13 @@ itkMapGrayscaleMorphologicalOpeningImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); // Create a filter using SRType = itk::FlatStructuringElement; using FilterType = itk::GrayscaleMorphologicalOpeningImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -80,7 +80,7 @@ itkMapGrayscaleMorphologicalOpeningImageFilterTest(int ac, char * av[]) filter->SetSafeBorder(std::stoi(av[6])); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); filter->SetAlgorithm(FilterType::AlgorithmEnum::BASIC); @@ -107,7 +107,7 @@ itkMapGrayscaleMorphologicalOpeningImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx index 71e9efb03a2..af7fecb297d 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapMaskedRankImageFilterTest.cxx @@ -38,16 +38,16 @@ itkMapMaskedRankImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); - ReaderType::Pointer input2 = ReaderType::New(); + auto input2 = ReaderType::New(); input2->SetFileName(av[2]); // Create a filter using SEType = itk::FlatStructuringElement<2>; using FilterType = itk::MaskedRankImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -148,7 +148,7 @@ itkMapMaskedRankImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[3]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx index 9b7f426f4ef..c0749dd615b 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMapRankImageFilterTest.cxx @@ -38,14 +38,14 @@ itkMapRankImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using SEType = itk::FlatStructuringElement<2>; using FilterType = itk::RankImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -105,7 +105,7 @@ itkMapRankImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx index 3fdf14dc29e..719e90a6ffb 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMaskedRankImageFilterTest.cxx @@ -38,15 +38,15 @@ itkMaskedRankImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); - ReaderType::Pointer input2 = ReaderType::New(); + auto input2 = ReaderType::New(); input2->SetFileName(av[2]); // Create a filter using FilterType = itk::MaskedRankImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -147,7 +147,7 @@ itkMaskedRankImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[3]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx index 0e90258913e..4055726d65a 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest.cxx @@ -39,7 +39,7 @@ itkMorphologicalGradientImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using StructuringElementType = itk::BinaryBallStructuringElement; @@ -48,14 +48,14 @@ itkMorphologicalGradientImageFilterTest(int argc, char * argv[]) structuringElement.CreateStructuringElement(); using GradientType = itk::MorphologicalGradientImageFilter; - GradientType::Pointer gradient = GradientType::New(); + auto gradient = GradientType::New(); gradient->SetInput(reader->GetOutput()); gradient->SetKernel(structuringElement); itk::SimpleFilterWatcher watcher(gradient); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(gradient->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx index 8d8428be9cf..ef847d44ce2 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMorphologicalGradientImageFilterTest2.cxx @@ -40,7 +40,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using StructuringElementType = itk::BinaryBallStructuringElement; @@ -49,7 +49,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) structuringElement.CreateStructuringElement(); using GradientType = itk::MorphologicalGradientImageFilter; - GradientType::Pointer gradient = GradientType::New(); + auto gradient = GradientType::New(); gradient->SetInput(reader->GetOutput()); gradient->SetKernel(structuringElement); itk::SimpleFilterWatcher watcher(gradient); @@ -58,7 +58,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) std::cout << "algorithmType : " << algorithmType << std::endl; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(gradient->GetOutput()); writer->SetFileName(argv[2]); @@ -81,7 +81,7 @@ itkMorphologicalGradientImageFilterTest2(int argc, char * argv[]) SRType structuringElement2 = SRType::Box(elementRadius); using Gradient1Type = itk::MorphologicalGradientImageFilter; - Gradient1Type::Pointer gradient1 = Gradient1Type::New(); + auto gradient1 = Gradient1Type::New(); gradient1->SetInput(reader->GetOutput()); gradient1->SetKernel(structuringElement2); gradient1->SetAlgorithm(GradientType::AlgorithmEnum::VHGW); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx index d729d9db419..f7002ff2468 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkMovingHistogramMorphologyImageFilterTest.cxx @@ -33,7 +33,7 @@ itkMovingHistogramMorphologyImageFilterTest(int, char ** const) using HistogramType = itk::Function::MorphologyHistogram>; using FilterType = itk::MovingHistogramMorphologyImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MovingHistogramMorphologyImageFilter, MovingHistogramImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx index 3523ffbe7d3..98bd34960ed 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkObjectMorphologyImageFilterTest.cxx @@ -52,7 +52,7 @@ itkObjectMorphologyImageFilterTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create an image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index mySizeType size; @@ -122,10 +122,10 @@ itkObjectMorphologyImageFilterTest(int, char *[]) using binErodeFilterType = itk::BinaryErodeImageFilter; // Create the filter - myDilateFilterType::Pointer dilateFilter = myDilateFilterType::New(); - myErodeFilterType::Pointer erodeFilter = myErodeFilterType::New(); - binDilateFilterType::Pointer binDilateFilter = binDilateFilterType::New(); - binErodeFilterType::Pointer binErodeFilter = binErodeFilterType::New(); + auto dilateFilter = myDilateFilterType::New(); + auto erodeFilter = myErodeFilterType::New(); + auto binDilateFilter = binDilateFilterType::New(); + auto binErodeFilter = binErodeFilterType::New(); // Create the structuring element myKernelType ball; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx index 9980aedbc43..e7f34f18716 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest.cxx @@ -47,7 +47,7 @@ itkOpeningByReconstructionImageFilterTest(int argc, char * argv[]) itk::OpeningByReconstructionImageFilter; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); @@ -55,7 +55,7 @@ itkOpeningByReconstructionImageFilterTest(int argc, char * argv[]) // Create the filter - MorphologicalFilterType::Pointer filter = MorphologicalFilterType::New(); + auto filter = MorphologicalFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, OpeningByReconstructionImageFilter, ImageToImageFilter); @@ -81,7 +81,7 @@ itkOpeningByReconstructionImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx index 9550435f80d..d9bf56dab03 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkOpeningByReconstructionImageFilterTest2.cxx @@ -52,7 +52,7 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[]) itk::OpeningByReconstructionImageFilter; // Create image - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); // Define regions of input image RegionType region; @@ -81,7 +81,7 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[]) inputImage->FillBuffer(static_cast(0)); // Create the filter - MorphologicalFilterType::Pointer filter = MorphologicalFilterType::New(); + auto filter = MorphologicalFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, OpeningByReconstructionImageFilter, ImageToImageFilter); @@ -107,7 +107,7 @@ itkOpeningByReconstructionImageFilterTest2(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx index 5b3c83ceff2..28bf086abb0 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRankImageFilterTest.cxx @@ -38,12 +38,12 @@ itkRankImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using FilterType = itk::RankImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -103,7 +103,7 @@ itkRankImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRegionalMaximaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRegionalMaximaImageFilterTest.cxx index e65a7859038..e5cc65aff59 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRegionalMaximaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRegionalMaximaImageFilterTest.cxx @@ -37,11 +37,11 @@ RegionalMaximaImageFilterTestHelper(std::string inputImageFile, using OutputImageType = TInputImage; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImageFile); using FilterType = itk::RegionalMaximaImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); @@ -63,7 +63,7 @@ RegionalMaximaImageFilterTestHelper(std::string inputImageFile, // Write the output images using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(outputImageFile); writer->Update(); @@ -71,7 +71,7 @@ RegionalMaximaImageFilterTestHelper(std::string inputImageFile, // Produce the same output with other filters using ConvexFilterType = itk::HConvexImageFilter; - typename ConvexFilterType::Pointer convexFilter = ConvexFilterType::New(); + auto convexFilter = ConvexFilterType::New(); convexFilter->SetInput(reader->GetOutput()); convexFilter->SetFullyConnected(fullyConnected); convexFilter->SetHeight(1); @@ -79,12 +79,12 @@ RegionalMaximaImageFilterTestHelper(std::string inputImageFile, // Convex gives maxima with value = 1 and others with value = 0 // Rescale the image so we have maxima = 255 other = 0 using RescaleFilterType = itk::RescaleIntensityImageFilter; - typename RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(convexFilter->GetOutput()); rescaler->SetOutputMaximum(255); rescaler->SetOutputMinimum(0); - typename WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(rescaler->GetOutput()); writer2->SetFileName(outputImageFile2); writer2->Update(); @@ -127,7 +127,7 @@ itkRegionalMaximaImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using FilterType = itk::RegionalMaximaImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RegionalMaximaImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRegionalMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRegionalMinimaImageFilterTest.cxx index 9770c841b02..034db9084c9 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRegionalMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRegionalMinimaImageFilterTest.cxx @@ -37,11 +37,11 @@ RegionalMinimaImageFilterTestHelper(std::string inputImageFile, using OutputImageType = TInputImage; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImageFile); using FilterType = itk::RegionalMinimaImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); @@ -63,7 +63,7 @@ RegionalMinimaImageFilterTestHelper(std::string inputImageFile, // Write the output images using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(outputImageFile); writer->Update(); @@ -71,7 +71,7 @@ RegionalMinimaImageFilterTestHelper(std::string inputImageFile, // Produce the same output with other filters using ConcaveFilterType = itk::HConcaveImageFilter; - typename ConcaveFilterType::Pointer concaveFilter = ConcaveFilterType::New(); + auto concaveFilter = ConcaveFilterType::New(); concaveFilter->SetInput(reader->GetOutput()); concaveFilter->SetFullyConnected(fullyConnected); concaveFilter->SetHeight(1); @@ -79,12 +79,12 @@ RegionalMinimaImageFilterTestHelper(std::string inputImageFile, // Concave gives maxima with value = 1 and others with value = 0 // Rescale the image so we have maxima = 255 other = 0 using RescaleFilterType = itk::RescaleIntensityImageFilter; - typename RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(concaveFilter->GetOutput()); rescaler->SetOutputMaximum(255); rescaler->SetOutputMinimum(0); - typename WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(rescaler->GetOutput()); writer2->SetFileName(outputImageFile2); writer2->Update(); @@ -127,7 +127,7 @@ itkRegionalMinimaImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using FilterType = itk::RegionalMinimaImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RegionalMinimaImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx index 9f2b9a413e5..9d918bddf99 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest.cxx @@ -68,16 +68,16 @@ itkRemoveBoundaryObjectsTest(int argc, char * argv[]) // Creation of Reader and Writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - RescaleType::Pointer rescaler = RescaleType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto rescaler = RescaleType::New(); // Create the filter - FillholeFilterType::Pointer fillhole = FillholeFilterType::New(); + auto fillhole = FillholeFilterType::New(); // Create the xor and not filter - XorFilterType::Pointer xorfilter = XorFilterType::New(); - NotFilterType::Pointer notfilter = NotFilterType::New(); + auto xorfilter = XorFilterType::New(); + auto notfilter = NotFilterType::New(); // Setup the input and output files reader->SetFileName(argv[1]); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx index dc6b29f5644..1ee5dfea11c 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkRemoveBoundaryObjectsTest2.cxx @@ -63,14 +63,14 @@ itkRemoveBoundaryObjectsTest2(int argc, char * argv[]) using XorFilterType = itk::XorImageFilter; // Creation of Reader and Writer filters - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); // Create the filter - GrindPeakFilterType::Pointer grindpeak = GrindPeakFilterType::New(); + auto grindpeak = GrindPeakFilterType::New(); // Create the xor and not filter - XorFilterType::Pointer xorfilter = XorFilterType::New(); + auto xorfilter = XorFilterType::New(); // Setup the input and output files reader->SetFileName(argv[1]); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx index 509350dc9a2..ff0d45da3ec 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkShapedIteratorFromStructuringElementTest.cxx @@ -41,7 +41,7 @@ itkShapedIteratorFromStructuringElementTest(int, char *[]) using ImageType = itk::Image; using PixelType = ImageType::PixelType; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); CreateImagex(image); using StructuringElementType = itk::BinaryBallStructuringElement; diff --git a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx index 98e9f0b64c8..0a772bac0ac 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkTopHatImageFilterTest.cxx @@ -38,7 +38,7 @@ itkTopHatImageFilterTestHelper(TKernelImageFilter * { // Declare the reader and writer using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName); itk::SimpleFilterWatcher watcher(filter, "filter"); @@ -61,7 +61,7 @@ itkTopHatImageFilterTestHelper(TKernelImageFilter * // Write output using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(filter->GetOutput()); @@ -125,7 +125,7 @@ itkTopHatImageFilterTest(int argc, char * argv[]) { // Create the filter using BlackFilterType = itk::BlackTopHatImageFilter; - BlackFilterType::Pointer filter = BlackFilterType::New(); + auto filter = BlackFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BlackTopHatImageFilter, KernelImageFilter); @@ -140,7 +140,7 @@ itkTopHatImageFilterTest(int argc, char * argv[]) { // Create the filter using WhiteFilterType = itk::WhiteTopHatImageFilter; - WhiteFilterType::Pointer filter = WhiteFilterType::New(); + auto filter = WhiteFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, WhiteTopHatImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx index 2680cf483a8..c52e710ac37 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMaximaImageFilterTest.cxx @@ -47,11 +47,11 @@ itkValuedRegionalMaximaImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::ValuedRegionalMaximaImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ValuedRegionalMaximaImageFilter, ValuedRegionalExtremaImageFilter); @@ -66,7 +66,7 @@ itkValuedRegionalMaximaImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); @@ -75,7 +75,7 @@ itkValuedRegionalMaximaImageFilterTest(int argc, char * argv[]) // Produce the same output with other filters using ConvexFilterType = itk::HConvexImageFilter; - ConvexFilterType::Pointer convexFilter = ConvexFilterType::New(); + auto convexFilter = ConvexFilterType::New(); convexFilter->SetInput(reader->GetOutput()); convexFilter->SetFullyConnected(fullyConnected); convexFilter->SetHeight(1); @@ -83,18 +83,18 @@ itkValuedRegionalMaximaImageFilterTest(int argc, char * argv[]) // Convex gives maxima with value=1 and others with value = 0 // Rescale the image so we have maxima = 255 other = 0 using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(convexFilter->GetOutput()); rescaler->SetOutputMaximum(255); rescaler->SetOutputMinimum(0); // in the input image, select the values of the pixel at the minima using AndFilterType = itk::AndImageFilter; - AndFilterType::Pointer andFilter = AndFilterType::New(); + auto andFilter = AndFilterType::New(); andFilter->SetInput(0, rescaler->GetOutput()); andFilter->SetInput(1, reader->GetOutput()); - WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(andFilter->GetOutput()); writer2->SetFileName(argv[3]); writer2->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx index 48f1209a1c4..9071a34d5d0 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkValuedRegionalMinimaImageFilterTest.cxx @@ -49,11 +49,11 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::ValuedRegionalMinimaImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ValuedRegionalMinimaImageFilter, ValuedRegionalExtremaImageFilter); @@ -68,7 +68,7 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(filter->Update()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); @@ -77,7 +77,7 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) // Produce the same output with other filters using ConcaveFilterType = itk::HConcaveImageFilter; - ConcaveFilterType::Pointer concaveFilter = ConcaveFilterType::New(); + auto concaveFilter = ConcaveFilterType::New(); concaveFilter->SetInput(reader->GetOutput()); concaveFilter->SetFullyConnected(fullyConnected); concaveFilter->SetHeight(1); @@ -85,14 +85,14 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) // Concave gives minima with value=1 and others with value = 0 // Rescale the image so we have minima = 255 other = 0 using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(concaveFilter->GetOutput()); rescaler->SetOutputMaximum(255); rescaler->SetOutputMinimum(0); // In the input image, select the values of the pixel at the minima using AndFilterType = itk::AndImageFilter; - AndFilterType::Pointer andFilter = AndFilterType::New(); + auto andFilter = AndFilterType::New(); andFilter->SetInput(0, rescaler->GetOutput()); andFilter->SetInput(1, reader->GetOutput()); @@ -100,18 +100,18 @@ itkValuedRegionalMinimaImageFilterTest(int argc, char * argv[]) // Get the non minima pixel by inverting the rescaled image // We will have minima value = 0 and non minima value = 255 using InvertFilterType = itk::InvertIntensityImageFilter; - InvertFilterType::Pointer invertFilter = InvertFilterType::New(); + auto invertFilter = InvertFilterType::New(); invertFilter->SetInput(rescaler->GetOutput()); // Get the highest value from the and and invert filters. The minima have // value >= 0 in "a" image and the non minima have a value=0. In invert, // the non minima have a value=255 and the minima a value=0 using MaxType = itk::MaximumImageFilter; - MaxType::Pointer max = MaxType::New(); + auto max = MaxType::New(); max->SetInput(0, invertFilter->GetOutput()); max->SetInput(1, andFilter->GetOutput()); - WriterType::Pointer writer2 = WriterType::New(); + auto writer2 = WriterType::New(); writer2->SetInput(andFilter->GetOutput()); writer2->SetFileName(argv[3]); writer2->Update(); diff --git a/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx b/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx index 157a9975e5e..51fbe079c10 100644 --- a/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx +++ b/Modules/Filtering/MathematicalMorphology/test/itkVanHerkGilWermanErodeDilateImageFilterTest.cxx @@ -32,7 +32,7 @@ itkVanHerkGilWermanErodeDilateImageFilterTest(int, char ** const) using FunctionType = std::less; using FilterType = itk::VanHerkGilWermanErodeDilateImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, VanHerkGilWermanErodeDilateImageFilter, KernelImageFilter); diff --git a/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx b/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx index 2b46aa3fac4..0080818f920 100644 --- a/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx +++ b/Modules/Filtering/Path/include/itkExtractOrthogonalSwath2DImageFilter.hxx @@ -177,7 +177,7 @@ ExtractOrthogonalSwath2DImageFilter::GenerateData() ContinuousIndex continousIndex; PathVectorType pathDerivative; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(inputImagePtr); // Iterate through the output image diff --git a/Modules/Filtering/Path/test/itkChainCodePath2DTest.cxx b/Modules/Filtering/Path/test/itkChainCodePath2DTest.cxx index d4420244ecc..dc69be887ba 100644 --- a/Modules/Filtering/Path/test/itkChainCodePath2DTest.cxx +++ b/Modules/Filtering/Path/test/itkChainCodePath2DTest.cxx @@ -32,7 +32,7 @@ itkChainCodePath2DTest(int, char *[]) IndexType index; OffsetType offset; - PathType::Pointer path = PathType::New(); + auto path = PathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, ChainCodePath2D, ChainCodePath); diff --git a/Modules/Filtering/Path/test/itkChainCodePathTest.cxx b/Modules/Filtering/Path/test/itkChainCodePathTest.cxx index 4e09c37f1b1..d8df8c19b99 100644 --- a/Modules/Filtering/Path/test/itkChainCodePathTest.cxx +++ b/Modules/Filtering/Path/test/itkChainCodePathTest.cxx @@ -34,7 +34,7 @@ itkChainCodePathTest(int, char *[]) IndexType index; OffsetType offset; - PathType::Pointer path = PathType::New(); + auto path = PathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, ChainCodePath, Path); diff --git a/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx b/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx index 0334c3c8a2f..a78356003a8 100644 --- a/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkChainCodeToFourierSeriesPathFilterTest.cxx @@ -44,7 +44,7 @@ itkChainCodeToFourierSeriesPathFilterTest(int, char *[]) std::cout << "Making a triangle Path with v0 at (30,30) -> (30,33) -> (33,33)" << std::endl; VertexType v; - PolyLinePathType::Pointer inputPath = PolyLinePathType::New(); + auto inputPath = PolyLinePathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(inputPath, PolyLineParametricPath, ParametricPath); @@ -59,13 +59,13 @@ itkChainCodeToFourierSeriesPathFilterTest(int, char *[]) inputPath->AddVertex(v); // Set up the first filter - PathToChainCodePathFilterType::Pointer pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); + auto pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); pathToChainCodePathFilter->SetInput(inputPath); ChainPathType::Pointer chainPath = pathToChainCodePathFilter->GetOutput(); // Set up the second filter - ChainCodeToFSPathFilterType::Pointer chainCodeToFSPathFilter = ChainCodeToFSPathFilterType::New(); + auto chainCodeToFSPathFilter = ChainCodeToFSPathFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(chainCodeToFSPathFilter, ChainCodeToFourierSeriesPathFilter, PathToPathFilter); diff --git a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx index 028a13da6d0..eae1abfa9e9 100644 --- a/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkExtractOrthogonalSwath2DImageFilterTest.cxx @@ -54,8 +54,8 @@ itkExtractOrthogonalSwath2DImageFilterTest(int argc, char * argv[]) // Set up the image std::cout << "Making a 64x64 white square centered in a 128x128 black image" << std::endl; - ImageType::Pointer inputImage = ImageType::New(); - IndexType start; + auto inputImage = ImageType::New(); + IndexType start; start[0] = 0; start[1] = 0; ImageType::SizeType size; @@ -93,8 +93,8 @@ itkExtractOrthogonalSwath2DImageFilterTest(int argc, char * argv[]) // Set up the path std::cout << "Making a square Path with v0 at (24,24) -> (24,104) -> (104,104) -> (104,24)" << std::endl; - PolyLineParametricPathType::Pointer inputPath = PolyLineParametricPathType::New(); - VertexType v; + auto inputPath = PolyLineParametricPathType::New(); + VertexType v; v.Fill(24); inputPath->AddVertex(v); v[0] = 24; @@ -109,7 +109,7 @@ itkExtractOrthogonalSwath2DImageFilterTest(int argc, char * argv[]) inputPath->AddVertex(v); // Set up the first filter - PathToChainCodePathFilterType::Pointer pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); + auto pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); pathToChainCodePathFilter->SetInput(inputPath); ChainCodePathType::Pointer chainPath = pathToChainCodePathFilter->GetOutput(); diff --git a/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx b/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx index 9dbb2811793..6244c3a3207 100644 --- a/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx +++ b/Modules/Filtering/Path/test/itkFourierSeriesPathTest.cxx @@ -35,7 +35,7 @@ itkFourierSeriesPathTest(int, char *[]) OffsetType offset; VectorType cosV, sinV; - PathType::Pointer path = PathType::New(); + auto path = PathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, FourierSeriesPath, ParametricPath); diff --git a/Modules/Filtering/Path/test/itkHilbertPathTest.cxx b/Modules/Filtering/Path/test/itkHilbertPathTest.cxx index cda15a48793..02073bc6698 100644 --- a/Modules/Filtering/Path/test/itkHilbertPathTest.cxx +++ b/Modules/Filtering/Path/test/itkHilbertPathTest.cxx @@ -29,7 +29,7 @@ HilbertPathTestHelper(unsigned int maxHilbertPathOder) using IndexType = typename PathType::IndexType; - typename PathType::Pointer path = PathType::New(); + auto path = PathType::New(); for (unsigned int order = 1; order < maxHilbertPathOder; ++order) { @@ -90,7 +90,7 @@ itkHilbertPathTest(int, char *[]) // Test dimension = 2 using HilbertPathType2D = itk::HilbertPath; - HilbertPathType2D::Pointer path2D = HilbertPathType2D::New(); + auto path2D = HilbertPathType2D::New(); // Exercise basic object methods // Done outside the helper function in the test because GCC is limited @@ -101,7 +101,7 @@ itkHilbertPathTest(int, char *[]) // Test dimension = 3 using HilbertPathType3D = itk::HilbertPath; - HilbertPathType3D::Pointer path3D = HilbertPathType3D::New(); + auto path3D = HilbertPathType3D::New(); // Exercise basic object methods // Done outside the helper function in the test because GCC is limited @@ -112,7 +112,7 @@ itkHilbertPathTest(int, char *[]) // Test dimension = 4 using HilbertPathType4D = itk::HilbertPath; - HilbertPathType4D::Pointer path4D = HilbertPathType4D::New(); + auto path4D = HilbertPathType4D::New(); // Exercise basic object methods // Done outside the helper function in the test because GCC is limited diff --git a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx index f4571bf296e..6ab34b9a56a 100644 --- a/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkOrthogonalSwath2DPathFilterTest.cxx @@ -71,7 +71,7 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) // Set up the path std::cout << "Making a square Path with v0 at (24,24) -> (24,104) -> (104,104) -> (104,24)" << std::endl; - PolyLineParametricPathType::Pointer inputPath = PolyLineParametricPathType::New(); + auto inputPath = PolyLineParametricPathType::New(); VertexType v; v.Fill(24); @@ -88,7 +88,7 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) inputPath->AddVertex(v); // Set up the first path filter - PathToChainCodePathFilterType::Pointer pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); + auto pathToChainCodePathFilter = PathToChainCodePathFilterType::New(); pathToChainCodePathFilter->SetInput(inputPath); // Set up the second path filter @@ -99,8 +99,8 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) // Set up the image std::cout << "Making a 64x64 black square centered in a 128x128 white image" << std::endl; - UCharImageType::Pointer inputImage = UCharImageType::New(); - IndexType start; + auto inputImage = UCharImageType::New(); + IndexType start; start[0] = 0; start[1] = 0; UCharImageType::SizeType size; @@ -137,13 +137,13 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) } // Cast the input image into a double image - CastFilterType::Pointer castFilter = CastFilterType::New(); + auto castFilter = CastFilterType::New(); castFilter->SetInput(inputImage); castFilter->SetOutputMinimum(0); castFilter->SetOutputMaximum(1.0); // Smooth the (double pixel type) input image - SmoothFilterType::Pointer smoothFilter = SmoothFilterType::New(); + auto smoothFilter = SmoothFilterType::New(); smoothFilter->SetInput(castFilter->GetOutput()); double gaussianVariance = 1.0; // We want a fast 3x3 kernel. A Gausian operator will not truncate its kernel @@ -157,7 +157,7 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) smoothFilter->SetMaximumError(maxError); // Extract the swath image - SwathFilterType::Pointer swathFilter = SwathFilterType::New(); + auto swathFilter = SwathFilterType::New(); swathFilter->SetImageInput(smoothFilter->GetOutput()); swathFilter->SetPathInput(chainCodeToFourierSeriesPathFilter->GetOutput()); size[0] = 512; @@ -165,13 +165,13 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) swathFilter->SetSize(size); // Find the vertical gradient of the swath image - MeritFilterType::Pointer meritFilter = MeritFilterType::New(); + auto meritFilter = MeritFilterType::New(); meritFilter->SetInput(swathFilter->GetOutput()); meritFilter->SetOrder(1); // first partial derivative meritFilter->SetDirection(1); // d/dy // Set up the test OrthogonalSwath2DPathFilter - OrthogonalSwath2DPathFilterType::Pointer orthogonalSwath2DPathFilter = OrthogonalSwath2DPathFilterType::New(); + auto orthogonalSwath2DPathFilter = OrthogonalSwath2DPathFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(orthogonalSwath2DPathFilter, OrthogonalSwath2DPathFilter, PathAndImageToPathFilter); @@ -198,7 +198,7 @@ itkOrthogonalSwath2DPathFilterTest(int, char *[]) UCharImageType::Pointer outputImage = orthogonallyCorrected2DParametricPathToImageFilter->GetOutput(); // Setup the swath merit output image - RescaleIntensityImageFilterType::Pointer rescaleIntensityImageFilter = RescaleIntensityImageFilterType::New(); + auto rescaleIntensityImageFilter = RescaleIntensityImageFilterType::New(); rescaleIntensityImageFilter->SetInput(meritFilter->GetOutput()); rescaleIntensityImageFilter->SetOutputMinimum(0); rescaleIntensityImageFilter->SetOutputMaximum(255); diff --git a/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx b/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx index 812229735ac..ff063306c9b 100644 --- a/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx +++ b/Modules/Filtering/Path/test/itkOrthogonallyCorrected2DParametricPathTest.cxx @@ -41,7 +41,7 @@ itkOrthogonallyCorrected2DParametricPathTest(int, char *[]) VertexType v; // Original Path - OriginalPathType::Pointer originalPath = OriginalPathType::New(); + auto originalPath = OriginalPathType::New(); v.Fill(2); originalPath->AddVertex(v); v[0] = 4; @@ -64,7 +64,7 @@ itkOrthogonallyCorrected2DParametricPathTest(int, char *[]) } // Create the corrected path - PathType::Pointer path = PathType::New(); + auto path = PathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, OrthogonallyCorrected2DParametricPath, ParametricPath); diff --git a/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx b/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx index 255cda76966..be3608e2cd7 100644 --- a/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx +++ b/Modules/Filtering/Path/test/itkPathFunctionsTest.cxx @@ -44,7 +44,7 @@ itkPathFunctionsTest(int, char *[]) // Set up the image std::cout << "Making a 64x64 white square centered in a 128x128 black image" << std::endl; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); IndexType start; start[0] = 0; @@ -93,10 +93,10 @@ itkPathFunctionsTest(int, char *[]) // Set up the path std::cout << "Making a square Path with v0 at (30,30) and v2 at (33,33)" << std::endl; - VertexType v; - PolyLineParametricPathType::Pointer inPath = PolyLineParametricPathType::New(); - ChainPathType::Pointer chainPath = ChainPathType::New(); - FourierSeriesPathType::Pointer path = FourierSeriesPathType::New(); + VertexType v; + auto inPath = PolyLineParametricPathType::New(); + auto chainPath = ChainPathType::New(); + auto path = FourierSeriesPathType::New(); v.Fill(30); inPath->AddVertex(v); v[0] = 33; diff --git a/Modules/Filtering/Path/test/itkPathIteratorTest.cxx b/Modules/Filtering/Path/test/itkPathIteratorTest.cxx index 7f19a444755..6182bfbcc64 100644 --- a/Modules/Filtering/Path/test/itkPathIteratorTest.cxx +++ b/Modules/Filtering/Path/test/itkPathIteratorTest.cxx @@ -40,7 +40,7 @@ itkPathIteratorTest(int, char *[]) // Setup the image std::cout << "Making a 64x64 white square centered in a 128x128 black image" << std::endl; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); IndexType start; start[0] = 0; @@ -88,8 +88,8 @@ itkPathIteratorTest(int, char *[]) // Set up the path std::cout << "Making a square Path with v0 at (30,30) and v2 at (33,33)" << std::endl; - VertexType v; - PathType::Pointer path = PathType::New(); + VertexType v; + auto path = PathType::New(); v.Fill(30); path->AddVertex(v); v[0] = 33; diff --git a/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx b/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx index e94f0b431ce..9889fac613a 100644 --- a/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkPathToChainCodePathFilterTest.cxx @@ -38,7 +38,7 @@ itkPathToChainCodePathFilterTest(int, char *[]) // Setup the path std::cout << "Making a triangle Path with v0 at (30,30) -> (30,33) -> (33,33)" << std::endl; VertexType v; - InPathType::Pointer inPath = InPathType::New(); + auto inPath = InPathType::New(); ChainPathType::Pointer chainPath; v.Fill(30); @@ -50,7 +50,7 @@ itkPathToChainCodePathFilterTest(int, char *[]) inPath->AddVertex(v); // Set up the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PathToChainCodePathFilter, PathToPathFilter); bool maximallyConnected = false; diff --git a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx index 6fed741858c..d05891ce5e4 100644 --- a/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx +++ b/Modules/Filtering/Path/test/itkPathToImageFilterTest.cxx @@ -35,7 +35,7 @@ itkPathToImageFilterTest(int, char *[]) // Set up the path - PolyLineParametricPathType::Pointer path = PolyLineParametricPathType::New(); + auto path = PolyLineParametricPathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, PolyLineParametricPath, ParametricPath); @@ -55,7 +55,7 @@ itkPathToImageFilterTest(int, char *[]) path->AddVertex(v); - PathToImageFilterType::Pointer pathToImageFilter = PathToImageFilterType::New(); + auto pathToImageFilter = PathToImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(pathToImageFilter, PathToImageFilter, ImageSource); diff --git a/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx b/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx index 93f29be2324..12bce9dcd2b 100644 --- a/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx +++ b/Modules/Filtering/Path/test/itkPolyLineParametricPathTest.cxx @@ -36,7 +36,7 @@ itkPolyLineParametricPathTest(int, char *[]) OffsetType offset; VertexType v; - PathType::Pointer path = PathType::New(); + auto path = PathType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(path, PolyLineParametricPath, ParametricPath); @@ -84,7 +84,7 @@ itkPolyLineParametricPathTest(int, char *[]) // Test a degenerate path std::cout << "Generating degenerate path" << std::endl; - PathType::Pointer path2 = PathType::New(); + auto path2 = PathType::New(); // Add a bunch of points closely spaced together for (double k = 0; k < 10; k += 0.1) diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx index 052de6f14c7..76c242d6529 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBinaryMask3DQuadEdgeMeshSourceTest.cxx @@ -62,7 +62,7 @@ itkBinaryMask3DQuadEdgeMeshSourceTest(int, char *[]) region.SetSize(size); region.SetIndex(start); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); @@ -97,7 +97,7 @@ itkBinaryMask3DQuadEdgeMeshSourceTest(int, char *[]) ++it; } - MeshSourceType::Pointer meshSource = MeshSourceType::New(); + auto meshSource = MeshSourceType::New(); meshSource->SetInput(image); meshSource->SetObjectValue(internalValue); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest.cxx index 68a44292ba7..a19c379f311 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest.cxx @@ -50,7 +50,7 @@ itkBorderQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** READ THE FILE IN ** - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -67,7 +67,7 @@ itkBorderQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); // ** CHOSE< COMPUTE AND SET BORDER TRANSFORM ** - BorderTransformType::Pointer border_transform = BorderTransformType::New(); + auto border_transform = BorderTransformType::New(); border_transform->SetInput(mesh); // two following line for coverage border_transform->SetRadius(border_transform->GetRadius()); @@ -110,7 +110,7 @@ itkBorderQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer output = border_transform->GetOutput(); // ** WRITE OUTPUT ** - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(border_transform->GetOutput()); writer->SetFileName(argv[4]); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest2.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest2.cxx index d5905077dc6..10d6cf7e7bc 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest2.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkBorderQuadEdgeMeshFilterTest2.cxx @@ -46,10 +46,10 @@ itkBorderQuadEdgeMeshFilterTest2(int argc, char * argv[]) using SourceType = itk::RegularSphereMeshSource; using BorderTransformType = itk::BorderQuadEdgeMeshFilter; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); // ** CHOSE< COMPUTE AND SET BORDER TRANSFORM ** - BorderTransformType::Pointer border_transform = BorderTransformType::New(); + auto border_transform = BorderTransformType::New(); border_transform->SetInput(source->GetOutput()); border_transform->SetTransformType(BorderTransformType::BorderTransformEnum::SQUARE_BORDER_TRANSFORM); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx index 959647f0e7a..dafb6602e8e 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkCleanQuadEdgeMeshFilterTest.cxx @@ -44,7 +44,7 @@ itkCleanQuadEdgeMeshFilterTest(int argc, char * argv[]) using WriterType = itk::MeshFileWriter; // ** READ THE FILE IN ** - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -65,13 +65,13 @@ itkCleanQuadEdgeMeshFilterTest(int argc, char * argv[]) ssout >> tol; using CleanFilterType = itk::CleanQuadEdgeMeshFilter; - CleanFilterType::Pointer filter = CleanFilterType::New(); + auto filter = CleanFilterType::New(); filter->SetInput(mesh); filter->SetRelativeTolerance(tol); filter->Update(); // ** WRITE OUTPUT ** - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx index ae8f8bdf7c4..8fe0173c36d 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest.cxx @@ -43,7 +43,7 @@ itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try { @@ -58,14 +58,14 @@ itkDiscreteGaussianCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); - CurvatureFilterType::Pointer gaussian_curvature = CurvatureFilterType::New(); + auto gaussian_curvature = CurvatureFilterType::New(); gaussian_curvature->SetInput(mesh); gaussian_curvature->Update(); MeshType::Pointer output = gaussian_curvature->GetOutput(); using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("gaussian_curvature.vtk"); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx index 9dc8fff0462..8f376ea8117 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest.cxx @@ -42,7 +42,7 @@ itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try { @@ -57,14 +57,14 @@ itkDiscreteMaximumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); - CurvatureFilterType::Pointer max_curvature = CurvatureFilterType::New(); + auto max_curvature = CurvatureFilterType::New(); max_curvature->SetInput(mesh); max_curvature->Update(); MeshType::Pointer output = max_curvature->GetOutput(); using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("max_curvature.vtk"); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx index cd67c2db47b..ca6e9e2ca74 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest.cxx @@ -42,7 +42,7 @@ itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try { @@ -57,14 +57,14 @@ itkDiscreteMeanCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); - CurvatureFilterType::Pointer mean_curvature = CurvatureFilterType::New(); + auto mean_curvature = CurvatureFilterType::New(); mean_curvature->SetInput(mesh); mean_curvature->Update(); MeshType::Pointer output = mean_curvature->GetOutput(); using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("mean_curvature.vtk"); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx index 725d15a6b02..80fbc658e01 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest.cxx @@ -42,7 +42,7 @@ itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try { @@ -57,14 +57,14 @@ itkDiscreteMinimumCurvatureQuadEdgeMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); - CurvatureFilterType::Pointer min_curvature = CurvatureFilterType::New(); + auto min_curvature = CurvatureFilterType::New(); min_curvature->SetInput(mesh); min_curvature->Update(); MeshType::Pointer output = min_curvature->GetOutput(); using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(output); writer->SetFileName("min_curvature.vtk"); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx index 90fe9a543e9..5451fe59da8 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest.cxx @@ -41,14 +41,14 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest(int argc, char using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using SolverType = VNLSparseLUSolverTraits; using FilterType = itk::LaplacianDeformationQuadEdgeMeshFilterWithHardConstraints; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetOrder(2); @@ -107,7 +107,7 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithHardConstraintsTest(int argc, char } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx index 03ad0a1fc9e..df920de9fb0 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest.cxx @@ -41,14 +41,14 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest(int argc, char using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using SolverType = VNLSparseLUSolverTraits; using FilterType = itk::LaplacianDeformationQuadEdgeMeshFilterWithSoftConstraints; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetOrder(1); filter->SetLambda(1.); @@ -110,7 +110,7 @@ itkLaplacianDeformationQuadEdgeMeshFilterWithSoftConstraintsTest(int argc, char } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx index 55f9840b231..c19b51a85b7 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkNormalQuadEdgeMeshFilterTest.cxx @@ -78,7 +78,7 @@ itkNormalQuadEdgeMeshFilterTest(int argc, char * argv[]) } } - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -94,7 +94,7 @@ itkNormalQuadEdgeMeshFilterTest(int argc, char * argv[]) InputMeshType::Pointer mesh = reader->GetOutput(); - NormalFilterType::Pointer normals = NormalFilterType::New(); + auto normals = NormalFilterType::New(); normals->SetInput(mesh); normals->SetWeight(weight_type); normals->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkParameterizationQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkParameterizationQuadEdgeMeshFilterTest.cxx index 4034c82c332..8e34b8e2969 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkParameterizationQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkParameterizationQuadEdgeMeshFilterTest.cxx @@ -58,7 +58,7 @@ ParameterizationQuadEdgeMeshFilterTest(int argc, char * argv[]) // ** READ THE FILE IN ** - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -75,7 +75,7 @@ ParameterizationQuadEdgeMeshFilterTest(int argc, char * argv[]) typename MeshType::Pointer mesh = reader->GetOutput(); // ** CHOSE< COMPUTE AND SET BORDER TRANSFORM ** - typename BorderTransformType::Pointer border_transform = BorderTransformType::New(); + auto border_transform = BorderTransformType::New(); border_transform->SetInput(mesh); // two following line for coverage border_transform->SetRadius(border_transform->GetRadius()); @@ -109,7 +109,7 @@ ParameterizationQuadEdgeMeshFilterTest(int argc, char * argv[]) itk::HarmonicMatrixCoefficients coeff4; using ParametrizationType = itk::ParameterizationQuadEdgeMeshFilter; - typename ParametrizationType::Pointer param = ParametrizationType::New(); + auto param = ParametrizationType::New(); param->SetInput(mesh); param->SetBorderTransform(border_transform); @@ -146,7 +146,7 @@ ParameterizationQuadEdgeMeshFilterTest(int argc, char * argv[]) typename MeshType::Pointer output = param->GetOutput(); // ** WRITE OUTPUT ** - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(param->GetOutput()); writer->SetFileName(argv[5]); writer->Update(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx index 965a95d2931..f849f388742 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkRegularSphereQuadEdgeMeshSourceTest.cxx @@ -36,7 +36,7 @@ itkRegularSphereQuadEdgeMeshSourceTest(int argc, char * argv[]) using SphereMeshSourceType = itk::RegularSphereMeshSource; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); + auto mySphereMeshSource = SphereMeshSourceType::New(); using PointType = SphereMeshSourceType::PointType; using VectorType = SphereMeshSourceType::VectorType; @@ -81,7 +81,7 @@ itkRegularSphereQuadEdgeMeshSourceTest(int argc, char * argv[]) using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(myMesh); writer->SetFileName(argv[1]); writer->Write(); diff --git a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx index 65f2ea9fd10..bb248403fa6 100644 --- a/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx +++ b/Modules/Filtering/QuadEdgeMeshFiltering/test/itkSmoothingQuadEdgeMeshFilterTest.cxx @@ -46,7 +46,7 @@ itkSmoothingQuadEdgeMeshFilterTest(int argc, char * argv[]) using WriterType = itk::MeshFileWriter; // ** READ THE FILE IN ** - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); diff --git a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx index 041282d24c9..c3764b2b79f 100644 --- a/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBinomialBlurImageFilter.hxx @@ -110,7 +110,7 @@ BinomialBlurImageFilter::GenerateData() // Processing with doubles eliminates possible rounding artifacts which may // accumulate over repeated integer division using TTempImage = Image; - typename TTempImage::Pointer tempPtr = TTempImage::New(); + auto tempPtr = TTempImage::New(); typename TTempImage::RegionType tempRegion; tempRegion = inputPtr->GetRequestedRegion(); diff --git a/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx index a72fd096333..8336c748ecf 100644 --- a/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBoxMeanImageFilter.hxx @@ -61,7 +61,7 @@ BoxMeanImageFilter::DynamicThreadedGenerateData( accumRegion.PadByRadius(internalRadius); accumRegion.Crop(inputImage->GetRequestedRegion()); - typename AccumImageType::Pointer accImage = AccumImageType::New(); + auto accImage = AccumImageType::New(); accImage->SetRegions(accumRegion); accImage->Allocate(); diff --git a/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx index 14b3fa44d24..94280e17503 100644 --- a/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkBoxSigmaImageFilter.hxx @@ -63,7 +63,7 @@ BoxSigmaImageFilter::DynamicThreadedGenerateData( accumRegion.PadByRadius(internalRadius); accumRegion.Crop(inputImage->GetRequestedRegion()); - typename AccumImageType::Pointer accImage = AccumImageType::New(); + auto accImage = AccumImageType::New(); accImage->SetRegions(accumRegion); accImage->Allocate(); diff --git a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx index b6240dfd5ee..821f483702f 100644 --- a/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkDiscreteGaussianImageFilter.hxx @@ -121,7 +121,7 @@ DiscreteGaussianImageFilter::GenerateData() // Create an internal image to protect the input image's metdata // (e.g. RequestedRegion). The StreamingImageFilter changes the // requested region as part of its normal processing. - typename TInputImage::Pointer localInput = TInputImage::New(); + auto localInput = TInputImage::New(); localInput->Graft(this->GetInput()); // Determine the dimensionality to filter @@ -167,7 +167,7 @@ DiscreteGaussianImageFilter::GenerateData() oper.resize(filterDimensionality); // Create a process accumulator for tracking the progress of minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Set up the operators diff --git a/Modules/Filtering/Smoothing/include/itkSmoothingRecursiveGaussianImageFilter.hxx b/Modules/Filtering/Smoothing/include/itkSmoothingRecursiveGaussianImageFilter.hxx index 55bf3ffe872..b3397f758cf 100644 --- a/Modules/Filtering/Smoothing/include/itkSmoothingRecursiveGaussianImageFilter.hxx +++ b/Modules/Filtering/Smoothing/include/itkSmoothingRecursiveGaussianImageFilter.hxx @@ -242,7 +242,7 @@ SmoothingRecursiveGaussianImageFilter::GenerateData() } // Create a process accumulator for tracking the progress of this minipipeline. - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Register the filter with the with progress accumulator using diff --git a/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx index 599c5e7272a..6c5013da193 100644 --- a/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkBoxMeanImageFilterTest.cxx @@ -38,12 +38,12 @@ itkBoxMeanImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using FilterType = itk::BoxMeanImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -90,7 +90,7 @@ itkBoxMeanImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx index 236ab3e3957..5c67df44a0f 100644 --- a/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkBoxSigmaImageFilterTest.cxx @@ -38,12 +38,12 @@ itkBoxSigmaImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using FilterType = itk::BoxSigmaImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -90,7 +90,7 @@ itkBoxSigmaImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx index e8de4327f22..09f731c4d65 100644 --- a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest.cxx @@ -43,7 +43,7 @@ itkDiscreteGaussianImageFilterTest(int argc, char * argv[]) using FilterType = itk::DiscreteGaussianImageFilter; using ArrayType = FilterType::ArrayType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DiscreteGaussianImageFilter, ImageToImageFilter); diff --git a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest2.cxx b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest2.cxx index fb172367135..6b980d1b752 100644 --- a/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest2.cxx +++ b/Modules/Filtering/Smoothing/test/itkDiscreteGaussianImageFilterTest2.cxx @@ -38,19 +38,19 @@ itkDiscreteGaussianImageFilterTestA(int argc, char * argv[]) const char * output_file_name = argv[5]; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(input_file_name); using FilterType = itk::DiscreteGaussianImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetVariance(sigma); filter->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(output_file_name); writer->SetInput(filter->GetOutput()); writer->UseCompressionOn(); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnTensorsTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnTensorsTest.cxx index 7c9804e2693..9e4bcdd0a08 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnTensorsTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnTensorsTest.cxx @@ -55,7 +55,7 @@ itkRecursiveGaussianImageFiltersOnTensorsTest(int, char *[]) ImageType::RegionType region; region.SetSize(size); region.SetIndex(index); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->SetRequestedRegion(region); @@ -79,8 +79,8 @@ itkRecursiveGaussianImageFiltersOnTensorsTest(int, char *[]) // is filtered independently. // using FilterType = itk::RecursiveGaussianImageFilter; - FilterType::Pointer filterX = FilterType::New(); - FilterType::Pointer filterY = FilterType::New(); + auto filterX = FilterType::New(); + auto filterY = FilterType::New(); filterX->SetDirection(0); // 0 --> X direction filterY->SetDirection(1); // 1 --> Y direction filterX->SetOrder(itk::GaussianOrderEnum::ZeroOrder); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnVectorImageTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnVectorImageTest.cxx index a354262cbbf..2c61e7a49fa 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnVectorImageTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersOnVectorImageTest.cxx @@ -53,7 +53,7 @@ itkRecursiveGaussianImageFiltersOnVectorImageTest(int, char *[]) ImageType::RegionType region; region.SetSize(size); region.SetIndex(index); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->SetRequestedRegion(region); @@ -78,8 +78,8 @@ itkRecursiveGaussianImageFiltersOnVectorImageTest(int, char *[]) // is filtered independently. // using FilterType = itk::RecursiveGaussianImageFilter; - FilterType::Pointer filterX = FilterType::New(); - FilterType::Pointer filterY = FilterType::New(); + auto filterX = FilterType::New(); + auto filterY = FilterType::New(); filterX->SetDirection(0); // 0 --> X direction filterY->SetDirection(1); // 1 --> Y direction filterX->SetOrder(itk::GaussianOrderEnum::ZeroOrder); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersTest.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersTest.cxx index eec0d57af65..72a06f6107f 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianImageFiltersTest.cxx @@ -49,7 +49,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -110,7 +110,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) using myGaussianFilterType = itk::RecursiveGaussianImageFilter; // Create a Filter - myGaussianFilterType::Pointer filter = myGaussianFilterType::New(); + auto filter = myGaussianFilterType::New(); // Connect the input images @@ -126,7 +126,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) // Create a Filter - myGaussianFilterType::Pointer filter1 = myGaussianFilterType::New(); + auto filter1 = myGaussianFilterType::New(); // Connect the input images @@ -141,7 +141,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) std::cout << " Done !" << std::endl; // Create a Filter - myGaussianFilterType::Pointer filter2 = myGaussianFilterType::New(); + auto filter2 = myGaussianFilterType::New(); // Connect the input images filter2->SetInput(inputImage); @@ -180,7 +180,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) SpacingType spacing; spacing[0] = 1.0; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(region); inputImage->Allocate(); inputImage->SetSpacing(spacing); @@ -193,7 +193,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) using FilterType = itk::RecursiveGaussianImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputImage); @@ -458,7 +458,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) SpacingType spacing; spacing[0] = 1.0; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(region); inputImage->Allocate(); inputImage->SetSpacing(spacing); @@ -470,7 +470,7 @@ itkRecursiveGaussianImageFiltersTest(int, char *[]) inputImage->SetPixel(index, static_cast(1.0)); using FilterType = itk::RecursiveGaussianImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputImage); filter->SetSigma(1); diff --git a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx index 81b090ebac8..5dc2f2e9bd0 100644 --- a/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx +++ b/Modules/Filtering/Smoothing/test/itkRecursiveGaussianScaleSpaceTest1.cxx @@ -43,7 +43,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac double expected_max = std::pow(double(order), order * 0.5) * std::exp(-0.5 * order); using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(imageSize); @@ -72,7 +72,7 @@ NormalizeSineWave(double frequencyPerImage, unsigned int order, double pixelSpac using GaussianFilterType = itk::RecursiveGaussianImageFilter; - GaussianFilterType::Pointer filter = GaussianFilterType::New(); + auto filter = GaussianFilterType::New(); filter->SetInput(image); filter->SetDirection(0); filter->SetSigma(sigma_max); diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx index e6224ff9cff..88fd09e0cd2 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest.cxx @@ -47,7 +47,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest(int, char *[]) constexpr unsigned int numberOfComponents = 3; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -109,7 +109,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest(int, char *[]) // Create Image adaptor on the RGB Image using myAdaptorType = itk::RGBToLuminanceImageAdaptor; - myAdaptorType::Pointer adaptor = myAdaptorType::New(); + auto adaptor = myAdaptorType::New(); adaptor->SetImage(inputImage); @@ -120,7 +120,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageAdaptorTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watchit(filter); // Connect the input images diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx index af15cd8361f..49fd8572231 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest.cxx @@ -44,7 +44,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest(int, char *[]) constexpr unsigned int numberOfComponents = 3; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -111,7 +111,7 @@ itkSmoothingRecursiveGaussianImageFilterOnImageOfVectorTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watchit(filter); // Connect the input images diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx index 196cae83245..68afaf57d93 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest.cxx @@ -42,7 +42,7 @@ itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest(int, char *[]) constexpr unsigned int numberOfComponents = 3; // Create the image - myImageType::Pointer inputImage = myImageType::New(); + auto inputImage = myImageType::New(); // Define their size, and start index @@ -109,7 +109,7 @@ itkSmoothingRecursiveGaussianImageFilterOnVectorImageTest(int, char *[]) // Create a Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); itk::SimpleFilterWatcher watchit(filter); // Connect the input images diff --git a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx index f1243e07aa7..766084d8e26 100644 --- a/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx +++ b/Modules/Filtering/Smoothing/test/itkSmoothingRecursiveGaussianImageFilterTest.cxx @@ -32,11 +32,11 @@ InPlaceTest(char * inputFilename, bool normalizeAcrossScale, typename TFilter::S { // Read the input image using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFilename); // Create the filter - typename TFilter::Pointer filter = TFilter::New(); + auto filter = TFilter::New(); filter->SetNormalizeAcrossScale(normalizeAcrossScale); filter->SetSigma(sigmaValue); @@ -120,14 +120,14 @@ itkSmoothingRecursiveGaussianImageFilterTest(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Declare the type for the itk::SmoothingRecursiveGaussianImageFilter using SmoothingRecursiveGaussianImageFilterType = itk::SmoothingRecursiveGaussianImageFilter; // Create the filter - SmoothingRecursiveGaussianImageFilterType::Pointer filter = SmoothingRecursiveGaussianImageFilterType::New(); + auto filter = SmoothingRecursiveGaussianImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SmoothingRecursiveGaussianImageFilter, InPlaceImageFilter); @@ -159,7 +159,7 @@ itkSmoothingRecursiveGaussianImageFilterTest(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(filter->GetOutput()); diff --git a/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx b/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx index de385de14e7..5a4ce746ce0 100644 --- a/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx +++ b/Modules/Filtering/SpatialFunction/test/itkSpatialFunctionImageEvaluatorFilterTest.cxx @@ -35,7 +35,7 @@ itkSpatialFunctionImageEvaluatorFilterTest(int, char *[]) ImageType::PointValueType sourceImageOrigin[] = { 0, 0, 0 }; // Create the sourceImage - ImageType::Pointer sourceImage = ImageType::New(); + auto sourceImage = ImageType::New(); sourceImage->SetOrigin(sourceImageOrigin); sourceImage->SetSpacing(sourceImageSpacing); @@ -58,11 +58,11 @@ itkSpatialFunctionImageEvaluatorFilterTest(int, char *[]) // Create and initialize a new Gaussian function using FunctionType = itk::GaussianSpatialFunction; - FunctionType::Pointer func = FunctionType::New(); + auto func = FunctionType::New(); // Run the image evaluator filter using TFilter = itk::SpatialFunctionImageEvaluatorFilter; - TFilter::Pointer filter = TFilter::New(); + auto filter = TFilter::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, SpatialFunctionImageEvaluatorFilter, ImageToImageFilter); diff --git a/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.hxx b/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.hxx index 5464fe86f51..b9dad535947 100644 --- a/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.hxx +++ b/Modules/Filtering/Thresholding/include/itkBinaryThresholdImageFilter.hxx @@ -42,11 +42,11 @@ BinaryThresholdImageFilter::BinaryThresholdImageFilte // We are going to create the object with a few default inputs to // hold the threshold values. - typename InputPixelObjectType::Pointer lower = InputPixelObjectType::New(); + auto lower = InputPixelObjectType::New(); lower->Set(NumericTraits::NonpositiveMin()); this->ProcessObject::SetNthInput(1, lower); - typename InputPixelObjectType::Pointer upper = InputPixelObjectType::New(); + auto upper = InputPixelObjectType::New(); upper->Set(NumericTraits::max()); this->ProcessObject::SetNthInput(2, upper); } diff --git a/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.hxx b/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.hxx index a5e12c3e119..4fe5ec76dfc 100644 --- a/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.hxx +++ b/Modules/Filtering/Thresholding/include/itkHistogramThresholdImageFilter.hxx @@ -71,13 +71,13 @@ template void HistogramThresholdImageFilter::GenerateData() { - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); HistogramGeneratorPointer histogramGenerator = HistogramGeneratorType::New(); using MaskedHistogramGeneratorType = Statistics::MaskedImageToHistogramFilter; - typename MaskedHistogramGeneratorType::Pointer maskedHistogramGenerator = MaskedHistogramGeneratorType::New(); + auto maskedHistogramGenerator = MaskedHistogramGeneratorType::New(); if (this->GetMaskImage()) { @@ -103,7 +103,7 @@ HistogramThresholdImageFilter::GenerateDa progress->RegisterInternalFilter(m_Calculator, .2f); using ThresholderType = BinaryThresholdImageFilter; - typename ThresholderType::Pointer thresholder = ThresholderType::New(); + auto thresholder = ThresholderType::New(); thresholder->SetInput(this->GetInput()); thresholder->SetLowerThreshold(NumericTraits::NonpositiveMin()); thresholder->SetUpperThresholdInput(m_Calculator->GetOutput()); @@ -113,7 +113,7 @@ HistogramThresholdImageFilter::GenerateDa progress->RegisterInternalFilter(thresholder, .4f); using MaskType = MaskImageFilter; - typename MaskType::Pointer masker = MaskType::New(); + auto masker = MaskType::New(); if ((this->GetMaskOutput()) && (this->GetMaskImage())) { diff --git a/Modules/Filtering/Thresholding/include/itkKappaSigmaThresholdImageFilter.hxx b/Modules/Filtering/Thresholding/include/itkKappaSigmaThresholdImageFilter.hxx index 8e2c9d58e5e..ea75a3e6176 100644 --- a/Modules/Filtering/Thresholding/include/itkKappaSigmaThresholdImageFilter.hxx +++ b/Modules/Filtering/Thresholding/include/itkKappaSigmaThresholdImageFilter.hxx @@ -36,11 +36,11 @@ template void KappaSigmaThresholdImageFilter::GenerateData() { - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Compute the Threshold for the input image - typename CalculatorType::Pointer thresholdImageCalculator = CalculatorType::New(); + auto thresholdImageCalculator = CalculatorType::New(); thresholdImageCalculator->SetImage(this->GetInput()); thresholdImageCalculator->SetMask(this->GetMaskImage()); thresholdImageCalculator->SetMaskValue(m_MaskValue); diff --git a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.hxx b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.hxx index ecf8d253dc6..364e7b14a31 100644 --- a/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.hxx +++ b/Modules/Filtering/Thresholding/include/itkOtsuMultipleThresholdsImageFilter.hxx @@ -36,17 +36,17 @@ template void OtsuMultipleThresholdsImageFilter::GenerateData() { - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Create a histogram of the image intensities - typename HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(this->GetInput()); histogramGenerator->SetNumberOfBins(m_NumberOfHistogramBins); histogramGenerator->Compute(); // Compute the multiple Otsu Thresholds for the input image - typename OtsuCalculatorType::Pointer otsuHistogramThresholdCalculator = OtsuCalculatorType::New(); + auto otsuHistogramThresholdCalculator = OtsuCalculatorType::New(); otsuHistogramThresholdCalculator->SetInputHistogram(histogramGenerator->GetOutput()); otsuHistogramThresholdCalculator->SetNumberOfThresholds(m_NumberOfThresholds); otsuHistogramThresholdCalculator->SetValleyEmphasis(m_ValleyEmphasis); diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx index a980cbf05b1..b14c09179c0 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest.cxx @@ -43,7 +43,7 @@ itkBinaryThresholdImageFilterTest(int, char *[]) // Use a random image source as input using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); InputImageType::SizeValueType sizeArray[Dimension] = { 3, 3, 3 }; @@ -54,7 +54,7 @@ itkBinaryThresholdImageFilterTest(int, char *[]) // Declare the type for the binary threshold filter using FilterType = itk::BinaryThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, BinaryThresholdImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx index a3a7117278b..196b776dfa2 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdImageFilterTest2.cxx @@ -50,12 +50,12 @@ itkBinaryThresholdImageFilterTest2(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(reader2->Update()); @@ -66,8 +66,8 @@ itkBinaryThresholdImageFilterTest2(int argc, char * argv[]) using ThresholdType = itk::BinaryThresholdImageFilter; // Create the filters - StatisticsType::Pointer statistics = StatisticsType::New(); - ThresholdType::Pointer threshold = ThresholdType::New(); + auto statistics = StatisticsType::New(); + auto threshold = ThresholdType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(threshold, BinaryThresholdImageFilter, UnaryFunctorImageFilter); @@ -85,7 +85,7 @@ itkBinaryThresholdImageFilterTest2(int argc, char * argv[]) // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(threshold->GetOutput()); diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx index 7778eb9a3c4..103ce306229 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdProjectionImageFilterTest.cxx @@ -44,14 +44,14 @@ itkBinaryThresholdProjectionImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::BinaryThresholdProjectionImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -78,7 +78,7 @@ itkBinaryThresholdProjectionImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx b/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx index 8ac9b8df2fe..44c81a873ff 100644 --- a/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkBinaryThresholdSpatialFunctionTest.cxx @@ -48,7 +48,7 @@ itkBinaryThresholdSpatialFunctionTest(int, char *[]) using PointType = SphereFunctionType::PointType; using ParametersType = SphereFunctionType::ParametersType; - SphereFunctionType::Pointer sphere = SphereFunctionType::New(); + auto sphere = SphereFunctionType::New(); // We must initialize the sphere before use sphere->Initialize(); @@ -62,7 +62,7 @@ itkBinaryThresholdSpatialFunctionTest(int, char *[]) std::cout << "SphereParameters: " << sphere->GetParameters() << std::endl; // Create a binary threshold function - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, BinaryThresholdSpatialFunction, SpatialFunction); @@ -109,7 +109,7 @@ itkBinaryThresholdSpatialFunctionTest(int, char *[]) // Set up a dummy image using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(10); image->SetRegions(size); diff --git a/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx index 523e7e5670f..5e1897463e2 100644 --- a/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkHuangMaskedThresholdImageFilterTest.cxx @@ -48,20 +48,20 @@ itkHuangMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::HuangThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -106,7 +106,7 @@ itkHuangMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx index a41fb430971..7d6adb15162 100644 --- a/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkHuangThresholdImageFilterTest.cxx @@ -48,14 +48,14 @@ itkHuangThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::HuangThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkHuangThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx index a5eb1b0139f..3e33d04251c 100644 --- a/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIntermodesMaskedThresholdImageFilterTest.cxx @@ -49,21 +49,21 @@ itkIntermodesMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::IntermodesThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, IntermodesThresholdImageFilter, HistogramThresholdImageFilter); @@ -115,7 +115,7 @@ itkIntermodesMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx index 070f203bb21..7bba34c6fdf 100644 --- a/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIntermodesThresholdImageFilterTest.cxx @@ -50,14 +50,14 @@ itkIntermodesThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::IntermodesThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -125,7 +125,7 @@ itkIntermodesThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx index b101d791db6..a39d36b23f3 100644 --- a/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIsoDataMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkIsoDataMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::IsoDataThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -106,7 +106,7 @@ itkIsoDataMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx index f062fe2a874..0989c243388 100644 --- a/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkIsoDataThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkIsoDataThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::IsoDataThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -109,7 +109,7 @@ itkIsoDataThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx index 7546b1a0a34..be9d18eb051 100644 --- a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageCalculatorTest.cxx @@ -44,13 +44,13 @@ itkKappaSigmaThresholdImageCalculatorTest(int argc, char * argv[]) using MaskType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); // Create and initialize the calculator using CalculatorType = itk::KappaSigmaThresholdImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, KappaSigmaThresholdImageCalculator, Object); diff --git a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx index d4696ae6efe..0261c848b43 100644 --- a/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKappaSigmaThresholdImageFilterTest.cxx @@ -50,14 +50,14 @@ itkKappaSigmaThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::KappaSigmaThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -105,7 +105,7 @@ itkKappaSigmaThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx index 0087cccba6d..383e9a0930f 100644 --- a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkKittlerIllingworthMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::KittlerIllingworthThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -106,7 +106,7 @@ itkKittlerIllingworthMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx index 8eb0e0c2d89..0d287a20408 100644 --- a/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkKittlerIllingworthThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkKittlerIllingworthThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::KittlerIllingworthThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -109,7 +109,7 @@ itkKittlerIllingworthThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx index 153947a19a4..de138181ed6 100644 --- a/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkLiMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkLiMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::LiThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -106,7 +106,7 @@ itkLiMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx index 29fb8528f7f..eaa41dcef3b 100644 --- a/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkLiThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkLiThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::LiThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -109,7 +109,7 @@ itkLiThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx index a4d88a70466..391ef7fcbba 100644 --- a/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMaximumEntropyMaskedThresholdImageFilterTest.cxx @@ -49,21 +49,21 @@ itkMaximumEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::MaximumEntropyThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -108,7 +108,7 @@ itkMaximumEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx index a1ff4aea472..f08dbc81a53 100644 --- a/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMaximumEntropyThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkMaximumEntropyThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::MaximumEntropyThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkMaximumEntropyThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx index c344f5acf59..3c0b41e051d 100644 --- a/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMomentsMaskedThresholdImageFilterTest.cxx @@ -49,21 +49,21 @@ itkMomentsMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::MomentsThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -108,7 +108,7 @@ itkMomentsMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx index cb32bc4b684..5c8f1d7c12a 100644 --- a/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkMomentsThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkMomentsThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::MomentsThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkMomentsThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx index 5c54419185b..f30aeb0791c 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkOtsuMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::OtsuThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -107,7 +107,7 @@ itkOtsuMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx index dd99d822fda..4deabe2b48b 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest.cxx @@ -34,7 +34,7 @@ itkOtsuMultipleThresholdsCalculatorTest(int argc, char * argv[]) using MeasurementType = float; using HistogramType = itk::Statistics::Histogram; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); // Initialize histogram HistogramType::SizeType size; @@ -79,7 +79,7 @@ itkOtsuMultipleThresholdsCalculatorTest(int argc, char * argv[]) using OtsuMultipleThresholdCalculatorType = itk::OtsuMultipleThresholdsCalculator; - OtsuMultipleThresholdCalculatorType::Pointer otsuThresholdCalculator = OtsuMultipleThresholdCalculatorType::New(); + auto otsuThresholdCalculator = OtsuMultipleThresholdCalculatorType::New(); #if defined(ITKV4_COMPATIBILITY) ITK_TEST_EXPECT_TRUE(otsuThresholdCalculator->GetReturnBinMidpoint()); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx index 838cfc79afc..2f47d61ff28 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsCalculatorTest2.cxx @@ -23,7 +23,7 @@ itkOtsuMultipleThresholdsCalculatorTest2(int, char *[]) { using MeasurementType = float; using HistogramType = itk::Statistics::Histogram; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); bool passed = true; constexpr unsigned pixelCount = 4; @@ -55,7 +55,7 @@ itkOtsuMultipleThresholdsCalculatorTest2(int, char *[]) } using OtsuMultipleThresholdCalculatorType = itk::OtsuMultipleThresholdsCalculator; - OtsuMultipleThresholdCalculatorType::Pointer otsuThresholdCalculator = OtsuMultipleThresholdCalculatorType::New(); + auto otsuThresholdCalculator = OtsuMultipleThresholdCalculatorType::New(); otsuThresholdCalculator->SetInputHistogram(histogram); otsuThresholdCalculator->SetNumberOfThresholds(thresholdCount); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx index 16e5eb9cdb9..d7b4f63023a 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuMultipleThresholdsImageFilterTest.cxx @@ -58,14 +58,14 @@ itkOtsuMultipleThresholdsImageFilterTest(int argc, char * argv[]) // Set up the reader using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::OtsuMultipleThresholdsImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -124,14 +124,14 @@ itkOtsuMultipleThresholdsImageFilterTest(int argc, char * argv[]) // image looks nearly uniform unless there are a large number of labels. // using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetOutput()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); // Write out the test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx index c0b2399a8f9..3a6e547e87f 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorTest.cxx @@ -37,7 +37,7 @@ itkOtsuThresholdCalculatorTest(int, char *[]) using CalculatorType = itk::OtsuThresholdCalculator; // Allocate a simple test image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; // Define the image size and physical coordinates @@ -81,7 +81,7 @@ itkOtsuThresholdCalculatorTest(int, char *[]) ++iter; } - HistogramGeneratorType::Pointer histGenerator = HistogramGeneratorType::New(); + auto histGenerator = HistogramGeneratorType::New(); histGenerator->SetInput(image); HistogramGeneratorType::HistogramSizeType hsize(1); hsize[0] = 64; @@ -89,7 +89,7 @@ itkOtsuThresholdCalculatorTest(int, char *[]) histGenerator->SetAutoMinimumMaximum(true); // Create and initialize the calculator - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, OtsuThresholdCalculator, HistogramThresholdCalculator); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx index f70b7780391..cf19a33bb35 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest.cxx @@ -48,23 +48,23 @@ itkOtsuThresholdCalculatorVersusOtsuMultipleThresholdsCalculatorTest(int argc, c int numberOfThresholds = 1; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; using HistogramType = HistogramGeneratorType::HistogramType; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); // Compute the OtsuThreshold for the input image. using OtsuCalculatorType = itk::OtsuThresholdCalculator; - OtsuCalculatorType::Pointer otsuCalculator = OtsuCalculatorType::New(); + auto otsuCalculator = OtsuCalculatorType::New(); otsuCalculator->SetInput(histogramGenerator->GetOutput()); // Compute the OtsuMultipleThresholds for the input image using OtsuMultipleCalculatorType = itk::OtsuMultipleThresholdsCalculator; - OtsuMultipleCalculatorType::Pointer otsuMultipleCalculator = OtsuMultipleCalculatorType::New(); + auto otsuMultipleCalculator = OtsuMultipleCalculatorType::New(); otsuMultipleCalculator->SetInputHistogram(histogramGenerator->GetOutput()); otsuMultipleCalculator->SetNumberOfThresholds(numberOfThresholds); diff --git a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx index 19a42d3cc2a..2c23b6ce5d2 100644 --- a/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkOtsuThresholdImageFilterTest.cxx @@ -50,14 +50,14 @@ itkOtsuThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::OtsuThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -125,7 +125,7 @@ itkOtsuThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx index 082d32df219..dc33016c630 100644 --- a/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkRenyiEntropyMaskedThresholdImageFilterTest.cxx @@ -49,21 +49,21 @@ itkRenyiEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::RenyiEntropyThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkRenyiEntropyMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx index 368ee881de3..59d4e454edf 100644 --- a/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkRenyiEntropyThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkRenyiEntropyThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::RenyiEntropyThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkRenyiEntropyThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx index 73445e2a8e7..e84692f2235 100644 --- a/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkShanbhagMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkShanbhagMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::ShanbhagThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -107,7 +107,7 @@ itkShanbhagMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx index 6a168a610e0..2bff5ca538b 100644 --- a/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkShanbhagThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkShanbhagThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::ShanbhagThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -110,7 +110,7 @@ itkShanbhagThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx index 98dce5d80d9..8b9e91e86d4 100644 --- a/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkThresholdImageFilterTest.cxx @@ -146,7 +146,7 @@ itkThresholdImageFilterTest(int, char *[]) using PixelType = int; using IntImage1DType = itk::Image; - IntImage1DType::Pointer input = IntImage1DType::New(); + auto input = IntImage1DType::New(); IntImage1DType::SpacingValueType inputSpacing[1] = { 0.7 }; input->SetSpacing(inputSpacing); IntImage1DType::PointValueType inputOrigin[1] = { 15 }; diff --git a/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx index 07cf6748242..09e09e243a8 100644 --- a/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkThresholdLabelerImageFilterTest.cxx @@ -44,7 +44,7 @@ ThresholdLabelerImageFilterTestHelper(bool useRealTypeThresholds) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->Allocate(); @@ -95,7 +95,7 @@ ThresholdLabelerImageFilterTestHelper(bool useRealTypeThresholds) // Apply labeler filter using LabelerFilterType = itk::ThresholdLabelerImageFilter; - LabelerFilterType::Pointer labelerFilter = LabelerFilterType::New(); + auto labelerFilter = LabelerFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(labelerFilter, ThresholdLabelerImageFilter, UnaryFunctorImageFilter); diff --git a/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx index ca9d63032a4..49ff50e7aba 100644 --- a/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkTriangleMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkTriangleMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::TriangleThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -107,7 +107,7 @@ itkTriangleMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkTriangleThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkTriangleThresholdImageFilterTest.cxx index cda450b6cf9..a067eac586c 100644 --- a/Modules/Filtering/Thresholding/test/itkTriangleThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkTriangleThresholdImageFilterTest.cxx @@ -45,14 +45,14 @@ itkTriangleThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::TriangleThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -108,7 +108,7 @@ itkTriangleThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx index 30fce462c35..a3a9b7d0b77 100644 --- a/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkYenMaskedThresholdImageFilterTest.cxx @@ -48,21 +48,21 @@ itkYenMaskedThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using MaskReaderType = itk::ImageFileReader; - MaskReaderType::Pointer maskReader = MaskReaderType::New(); + auto maskReader = MaskReaderType::New(); maskReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(maskReader->Update()); using FilterType = itk::YenThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -107,7 +107,7 @@ itkYenMaskedThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx b/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx index 9300e61db69..5df8e6f2213 100644 --- a/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx +++ b/Modules/Filtering/Thresholding/test/itkYenThresholdImageFilterTest.cxx @@ -47,14 +47,14 @@ itkYenThresholdImageFilterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); using FilterType = itk::YenThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -109,7 +109,7 @@ itkYenThresholdImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/IO/BMP/include/itkBMPImageIOFactory.h b/Modules/IO/BMP/include/itkBMPImageIOFactory.h index 877e9ce383f..c16b9fb9dda 100644 --- a/Modules/IO/BMP/include/itkBMPImageIOFactory.h +++ b/Modules/IO/BMP/include/itkBMPImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIOBMP_EXPORT BMPImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - BMPImageIOFactory::Pointer BMPFactory = BMPImageIOFactory::New(); + auto BMPFactory = BMPImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(BMPFactory); } diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx index fc3cd7d14ed..f29c72c61e1 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest2.cxx @@ -41,7 +41,7 @@ itkBMPImageIOTest2(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->UpdateOutputInformation(); diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx index 12a52737891..dd230ba0d17 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest3.cxx @@ -46,7 +46,7 @@ itkBMPImageIOTest3(int argc, char * argv[]) using IteratorType = itk::ImageRegionConstIterator; - ReaderType::Pointer lowerLeftImageReader = ReaderType::New(); + auto lowerLeftImageReader = ReaderType::New(); itk::BMPImageIO::Pointer lowerLeftImageIO = itk::BMPImageIO::New(); @@ -55,7 +55,7 @@ itkBMPImageIOTest3(int argc, char * argv[]) lowerLeftImageReader->SetImageIO(lowerLeftImageIO); lowerLeftImageReader->SetFileName(argv[1]); - ReaderType::Pointer upperLeftImageReader = ReaderType::New(); + auto upperLeftImageReader = ReaderType::New(); itk::BMPImageIO::Pointer upperLeftImageIO = itk::BMPImageIO::New(); diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx index a4cd516bcc2..664386f53a3 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest4.cxx @@ -48,7 +48,7 @@ itkBMPImageIOTest4(int argc, char * argv[]) using IteratorType = itk::ImageRegionConstIterator; - ReaderType::Pointer lowerLeftImageReader = ReaderType::New(); + auto lowerLeftImageReader = ReaderType::New(); itk::BMPImageIO::Pointer lowerLeftImageIO = itk::BMPImageIO::New(); @@ -57,7 +57,7 @@ itkBMPImageIOTest4(int argc, char * argv[]) lowerLeftImageReader->SetImageIO(lowerLeftImageIO); lowerLeftImageReader->SetFileName(argv[1]); - ReaderType::Pointer upperLeftImageReader = ReaderType::New(); + auto upperLeftImageReader = ReaderType::New(); itk::BMPImageIO::Pointer upperLeftImageIO = itk::BMPImageIO::New(); diff --git a/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx b/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx index a0a4aef2789..6c5f8f520a7 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTest5.cxx @@ -49,7 +49,7 @@ itkBMPImageIOTest5(int argc, char * argv[]) using IteratorType = itk::ImageRegionConstIterator; - ReaderType::Pointer compressedImageReader = ReaderType::New(); + auto compressedImageReader = ReaderType::New(); itk::BMPImageIO::Pointer compressedImageIO = itk::BMPImageIO::New(); @@ -59,7 +59,7 @@ itkBMPImageIOTest5(int argc, char * argv[]) compressedImageReader->SetFileName(argv[1]); compressedImageIO->SetFileName(argv[1]); - ReaderType::Pointer uncompressedImageReader = ReaderType::New(); + auto uncompressedImageReader = ReaderType::New(); itk::BMPImageIO::Pointer uncompressedImageIO = itk::BMPImageIO::New(); diff --git a/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx b/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx index ec315ef6292..4cbce52b68b 100644 --- a/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx +++ b/Modules/IO/BMP/test/itkBMPImageIOTestPalette.cxx @@ -48,10 +48,10 @@ itkBMPImageIOTestPalette(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; using IOType = itk::BMPImageIO; - IOType::Pointer io = IOType::New(); + auto io = IOType::New(); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(io, BMPImageIO, ImageIOBase); diff --git a/Modules/IO/BioRad/include/itkBioRadImageIOFactory.h b/Modules/IO/BioRad/include/itkBioRadImageIOFactory.h index 0f38758aebb..c42b01c6adc 100644 --- a/Modules/IO/BioRad/include/itkBioRadImageIOFactory.h +++ b/Modules/IO/BioRad/include/itkBioRadImageIOFactory.h @@ -67,7 +67,7 @@ class ITKIOBioRad_EXPORT BioRadImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - BioRadImageIOFactory::Pointer bioradFactory = BioRadImageIOFactory::New(); + auto bioradFactory = BioRadImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(bioradFactory); } diff --git a/Modules/IO/BioRad/test/itkBioRadImageIOTest.cxx b/Modules/IO/BioRad/test/itkBioRadImageIOTest.cxx index 0ba82072e92..00c77044395 100644 --- a/Modules/IO/BioRad/test/itkBioRadImageIOTest.cxx +++ b/Modules/IO/BioRad/test/itkBioRadImageIOTest.cxx @@ -42,10 +42,10 @@ itkBioRadImageIOTest(int argc, char * argv[]) const char * filename = argv[1]; const char * outfilename = argv[2]; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); - ImageIOType::Pointer bioradImageIO = ImageIOType::New(); + auto bioradImageIO = ImageIOType::New(); reader->SetImageIO(bioradImageIO); try @@ -61,7 +61,7 @@ itkBioRadImageIOTest(int argc, char * argv[]) } using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outfilename); writer->SetInput(reader->GetOutput()); writer->SetImageIO(bioradImageIO); diff --git a/Modules/IO/Bruker/include/itkBruker2dseqImageIOFactory.h b/Modules/IO/Bruker/include/itkBruker2dseqImageIOFactory.h index 938ed1bbdb9..a2b72729466 100644 --- a/Modules/IO/Bruker/include/itkBruker2dseqImageIOFactory.h +++ b/Modules/IO/Bruker/include/itkBruker2dseqImageIOFactory.h @@ -64,7 +64,7 @@ class ITKIOBruker_EXPORT Bruker2dseqImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - Bruker2dseqImageIOFactory::Pointer factory = Bruker2dseqImageIOFactory::New(); + auto factory = Bruker2dseqImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(factory); } diff --git a/Modules/IO/Bruker/test/itkBrukerImageTest.cxx b/Modules/IO/Bruker/test/itkBrukerImageTest.cxx index dd8738df939..021eface521 100644 --- a/Modules/IO/Bruker/test/itkBrukerImageTest.cxx +++ b/Modules/IO/Bruker/test/itkBrukerImageTest.cxx @@ -52,8 +52,8 @@ itkBrukerImageTest(int argc, char * argv[]) { using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); // Bruker has a lot of extraneous meta-data, get rid of it diff --git a/Modules/IO/CSV/include/itkCSVArray2DFileReader.h b/Modules/IO/CSV/include/itkCSVArray2DFileReader.h index 192b8977260..df5e79d8da7 100644 --- a/Modules/IO/CSV/include/itkCSVArray2DFileReader.h +++ b/Modules/IO/CSV/include/itkCSVArray2DFileReader.h @@ -61,7 +61,7 @@ namespace itk * from an input file: * * using ReaderType = itk::CSVArray2DFileReader; - * ReaderType::Pointer reader = ReaderType::New(); + * auto reader = ReaderType::New(); * * std::string filename = "NameOfFile.csv"; * reader->SetFileName( filename ); diff --git a/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx b/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx index 779dd454a8c..76caa3664c8 100644 --- a/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx +++ b/Modules/IO/CSV/test/itkCSVArray2DFileReaderTest.cxx @@ -121,7 +121,7 @@ itkCSVArray2DFileReaderTest(int argc, char * argv[]) // Read and Parse the data using ReaderType = itk::CSVArray2DFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); std::string filename = "nonexistentfilename.csv"; reader->SetFileName(filename); diff --git a/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx b/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx index b4791d256b3..6ca1416de66 100644 --- a/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx +++ b/Modules/IO/CSV/test/itkCSVArray2DFileReaderWriterTest.cxx @@ -93,7 +93,7 @@ itkCSVFileReaderWriterTest_Func(int argc, char * argv[], bool headers) // write out the array2D object using WriterType = itk::CSVNumericObjectFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); if (argc < 2) { @@ -134,7 +134,7 @@ itkCSVFileReaderWriterTest_Func(int argc, char * argv[], bool headers) } using ReaderType = itk::CSVArray2DFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); reader->SetFieldDelimiterCharacter(','); reader->SetStringDelimiterCharacter('"'); diff --git a/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx b/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx index 43724f0d34d..fec352201e2 100644 --- a/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx +++ b/Modules/IO/CSV/test/itkCSVNumericObjectFileWriterTest.cxx @@ -55,7 +55,7 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) array[2][5] = 3e+10; using Array2DWriterType = itk::CSVNumericObjectFileWriter; - Array2DWriterType::Pointer array_writer = Array2DWriterType::New(); + auto array_writer = Array2DWriterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(array_writer, CSVNumericObjectFileWriter, LightProcessObject); @@ -138,7 +138,7 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) vnlmatrix[2][3] = 5.6; using vnlMatrixWriterType = itk::CSVNumericObjectFileWriter; - vnlMatrixWriterType::Pointer vnl_matrix_writer = vnlMatrixWriterType::New(); + auto vnl_matrix_writer = vnlMatrixWriterType::New(); vnl_matrix_writer->SetFileName(filename); vnl_matrix_writer->SetInput(&vnlmatrix); @@ -188,7 +188,7 @@ itkCSVNumericObjectFileWriterTest(int argc, char * argv[]) RowHeaders.emplace_back("Row3"); using fixedMatrixWriterType = itk::CSVNumericObjectFileWriter; - fixedMatrixWriterType::Pointer fixed_matrix_writer = fixedMatrixWriterType::New(); + auto fixed_matrix_writer = fixedMatrixWriterType::New(); fixed_matrix_writer->SetFileName(filename); fixed_matrix_writer->SetInput(&fixedmatrix); diff --git a/Modules/IO/DCMTK/include/itkDCMTKImageIOFactory.h b/Modules/IO/DCMTK/include/itkDCMTKImageIOFactory.h index 0eea838db1a..e11e032d344 100644 --- a/Modules/IO/DCMTK/include/itkDCMTKImageIOFactory.h +++ b/Modules/IO/DCMTK/include/itkDCMTKImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIODCMTK_EXPORT DCMTKImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - DCMTKImageIOFactory::Pointer DCMTKFactory = DCMTKImageIOFactory::New(); + auto DCMTKFactory = DCMTKImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(DCMTKFactory); } diff --git a/Modules/IO/DCMTK/test/itkDCMTKImageIOMultiFrameImageTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKImageIOMultiFrameImageTest.cxx index 8f17360bf6e..9ac0c28f483 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKImageIOMultiFrameImageTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKImageIOMultiFrameImageTest.cxx @@ -93,9 +93,9 @@ itkDCMTKImageIOMultiFrameImageTest(int ac, char * av[]) return EXIT_FAILURE; } - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); + auto dcmImageIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/DCMTK/test/itkDCMTKImageIONoPreambleTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKImageIONoPreambleTest.cxx index 6bf99ea84c8..4304b0482a3 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKImageIONoPreambleTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKImageIONoPreambleTest.cxx @@ -41,15 +41,15 @@ itkDCMTKImageIONoPreambleTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::DCMTKImageIO; - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); - bool canRead = dcmImageIO->CanReadFile(av[1]); + auto dcmImageIO = ImageIOType::New(); + bool canRead = dcmImageIO->CanReadFile(av[1]); if (!canRead) { std::cerr << "Cannot read file " << std::endl; return EXIT_FAILURE; } - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/DCMTK/test/itkDCMTKImageIOOrthoDirTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKImageIOOrthoDirTest.cxx index 6252a0878fe..477fd032e02 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKImageIOOrthoDirTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKImageIOOrthoDirTest.cxx @@ -42,9 +42,9 @@ itkDCMTKImageIOOrthoDirTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::DCMTKImageIO; - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); + auto dcmImageIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/DCMTK/test/itkDCMTKImageIOSlopeInterceptTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKImageIOSlopeInterceptTest.cxx index 9faef67c143..6018c899329 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKImageIOSlopeInterceptTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKImageIOSlopeInterceptTest.cxx @@ -43,12 +43,12 @@ itkDCMTKImageIOSlopeInterceptTest(int ac, char * av[]) const PixelType rescaleSlope(2); const PixelType rescaleIntercept(-99); - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); + auto dcmImageIO = ImageIOType::New(); ImageType::Pointer images[2]; for (unsigned i = 0; i < 2; ++i) { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[i + 1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/DCMTK/test/itkDCMTKImageIOTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKImageIOTest.cxx index 71bfaac40ca..b7f29be1eaf 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKImageIOTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKImageIOTest.cxx @@ -43,9 +43,9 @@ itkDCMTKImageIOTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::DCMTKImageIO; - ImageIOType::Pointer dcmtkImageIO = ImageIOType::New(); + auto dcmtkImageIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmtkImageIO); // reader->DebugOn(); @@ -59,13 +59,13 @@ itkDCMTKImageIOTest(int ac, char * av[]) using WriteImageType = itk::Image; using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); rescaler->SetInput(reader->GetOutput()); using Writer2Type = itk::ImageFileWriter; - Writer2Type::Pointer writer2 = Writer2Type::New(); + auto writer2 = Writer2Type::New(); // writer2->DebugOn(); writer2->SetFileName(av[3]); writer2->SetInput(rescaler->GetOutput()); diff --git a/Modules/IO/DCMTK/test/itkDCMTKMultiFrame4DTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKMultiFrame4DTest.cxx index 2f9ae448bfb..cc5f756cc40 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKMultiFrame4DTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKMultiFrame4DTest.cxx @@ -37,7 +37,7 @@ itkDCMTKMultiFrame4DTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::DCMTKImageIO::New()); reader->SetFileName(argv[1]); @@ -47,7 +47,7 @@ itkDCMTKMultiFrame4DTest(int argc, char * argv[]) ImageType::Pointer im = reader->GetOutput(); std::cout << im; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(im); writer->SetFileName(argv[2]); @@ -60,12 +60,12 @@ itkDCMTKMultiFrame4DTest(int argc, char * argv[]) using SubtractFilterType = itk::SubtractImageFilter; - SubtractFilterType::Pointer subtractFilter = SubtractFilterType::New(); + auto subtractFilter = SubtractFilterType::New(); subtractFilter->SetInput1(im); subtractFilter->SetInput2(reader->GetOutput()); using StatisticsFilterType = itk::StatisticsImageFilter; - StatisticsFilterType::Pointer statisticsFilter = StatisticsFilterType::New(); + auto statisticsFilter = StatisticsFilterType::New(); statisticsFilter->SetInput(subtractFilter->GetOutput()); diff --git a/Modules/IO/DCMTK/test/itkDCMTKRGBImageIOTest.cxx b/Modules/IO/DCMTK/test/itkDCMTKRGBImageIOTest.cxx index 586e62e1351..3dd36458846 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKRGBImageIOTest.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKRGBImageIOTest.cxx @@ -43,9 +43,9 @@ itkDCMTKRGBImageIOTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::DCMTKImageIO; - ImageIOType::Pointer dcmtkImageIO = ImageIOType::New(); + auto dcmtkImageIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmtkImageIO); @@ -54,7 +54,7 @@ itkDCMTKRGBImageIOTest(int ac, char * av[]) using WriteImageType = itk::Image; using Writer2Type = itk::ImageFileWriter; - Writer2Type::Pointer writer2 = Writer2Type::New(); + auto writer2 = Writer2Type::New(); writer2->SetFileName(av[2]); writer2->SetInput(reader->GetOutput()); diff --git a/Modules/IO/DCMTK/test/itkDCMTKSeriesReadImageWrite.cxx b/Modules/IO/DCMTK/test/itkDCMTKSeriesReadImageWrite.cxx index 535b3dd1e61..871b8889570 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKSeriesReadImageWrite.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKSeriesReadImageWrite.cxx @@ -50,8 +50,8 @@ itkDCMTKSeriesReadImageWrite(int argc, char * argv[]) using ImageIOType = itk::DCMTKImageIO; using SeriesFileNames = itk::DCMTKSeriesFileNames; - ImageIOType::Pointer dcmtkIO = ImageIOType::New(); - SeriesFileNames::Pointer it = SeriesFileNames::New(); + auto dcmtkIO = ImageIOType::New(); + auto it = SeriesFileNames::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(it, DCMTKSeriesFileNames, ProcessObject); @@ -79,7 +79,7 @@ itkDCMTKSeriesReadImageWrite(int argc, char * argv[]) auto loadPrivateTags = static_cast(std::stoi(argv[5])); ITK_TEST_SET_GET_BOOLEAN(it, LoadPrivateTags, loadPrivateTags); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); const ReaderType::FileNamesContainer & fileNames = it->GetInputFileNames(); const unsigned int numberOfFileNames = fileNames.size(); @@ -97,7 +97,7 @@ itkDCMTKSeriesReadImageWrite(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/DCMTK/test/itkDCMTKSeriesStreamReadImageWrite.cxx b/Modules/IO/DCMTK/test/itkDCMTKSeriesStreamReadImageWrite.cxx index 0e27d823aca..420967d93f3 100644 --- a/Modules/IO/DCMTK/test/itkDCMTKSeriesStreamReadImageWrite.cxx +++ b/Modules/IO/DCMTK/test/itkDCMTKSeriesStreamReadImageWrite.cxx @@ -84,11 +84,11 @@ itkDCMTKSeriesStreamReadImageWrite(int argc, char * argv[]) bool expectedToStream = !forceNoStreaming; - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - SeriesFileNames::Pointer filenameGenerator = SeriesFileNames::New(); + auto gdcmIO = ImageIOType::New(); + auto filenameGenerator = SeriesFileNames::New(); filenameGenerator->SetInputDirectory(argv[1]); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); const ReaderType::FileNamesContainer & filenames = filenameGenerator->GetInputFileNames(); @@ -97,11 +97,11 @@ itkDCMTKSeriesStreamReadImageWrite(int argc, char * argv[]) using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer streamer = StreamingFilter::New(); + auto streamer = StreamingFilter::New(); streamer->SetInput(monitor->GetOutput()); streamer->SetNumberOfStreamDivisions(numberOfDataPieces); @@ -176,7 +176,7 @@ itkDCMTKSeriesStreamReadImageWrite(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/GDCM/include/itkGDCMImageIOFactory.h b/Modules/IO/GDCM/include/itkGDCMImageIOFactory.h index e6abace041d..79ec952e57d 100644 --- a/Modules/IO/GDCM/include/itkGDCMImageIOFactory.h +++ b/Modules/IO/GDCM/include/itkGDCMImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIOGDCM_EXPORT GDCMImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GDCMImageIOFactory::Pointer gdcmFactory = GDCMImageIOFactory::New(); + auto gdcmFactory = GDCMImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(gdcmFactory); } diff --git a/Modules/IO/GDCM/test/itkGDCMImageIONoCrashTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageIONoCrashTest.cxx index c22ee2b505e..f72392a1e53 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIONoCrashTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIONoCrashTest.cxx @@ -40,11 +40,11 @@ itkGDCMImageIONoCrashTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::GDCMImageIO; - ImageIOType::Pointer gdcmImageIO = ImageIOType::New(); + auto gdcmImageIO = ImageIOType::New(); const std::string inputFile{ av[1] }; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFile); reader->SetImageIO(gdcmImageIO); if (!gdcmImageIO->CanReadFile(inputFile.c_str())) diff --git a/Modules/IO/GDCM/test/itkGDCMImageIONoPreambleTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageIONoPreambleTest.cxx index df94b34e7f5..f46b0993f60 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIONoPreambleTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIONoPreambleTest.cxx @@ -41,15 +41,15 @@ itkGDCMImageIONoPreambleTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::GDCMImageIO; - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); - bool canRead = dcmImageIO->CanReadFile(argv[1]); + auto dcmImageIO = ImageIOType::New(); + bool canRead = dcmImageIO->CanReadFile(argv[1]); if (!canRead) { std::cerr << "Cannot read file " << std::endl; return EXIT_FAILURE; } - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/GDCM/test/itkGDCMImageIOOrthoDirTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageIOOrthoDirTest.cxx index a2b75de8fb9..d424d266f4d 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIOOrthoDirTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIOOrthoDirTest.cxx @@ -40,9 +40,9 @@ itkGDCMImageIOOrthoDirTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::GDCMImageIO; - ImageIOType::Pointer dcmImageIO = ImageIOType::New(); + auto dcmImageIO = ImageIOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->SetImageIO(dcmImageIO); diff --git a/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx index 4fe2bfd00f2..3a2a0c7c931 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIOTest.cxx @@ -46,10 +46,10 @@ itkGDCMImageIOTest(int argc, char * argv[]) using InputImageType = itk::Image; using ImageIOType = itk::GDCMImageIO; - ImageIOType::Pointer gdcmImageIO = ImageIOType::New(); + auto gdcmImageIO = ImageIOType::New(); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(dicomImageFileName); reader->SetImageIO(gdcmImageIO); try @@ -93,7 +93,7 @@ itkGDCMImageIOTest(int argc, char * argv[]) // Rewrite the image in DICOM format using DicomWriterType = itk::ImageFileWriter; - DicomWriterType::Pointer dicomWriter = DicomWriterType::New(); + auto dicomWriter = DicomWriterType::New(); dicomWriter->SetFileName(outputDicomFileName); dicomWriter->SetInput(reader->GetOutput()); dicomWriter->UseInputMetaDataDictionaryOff(); @@ -111,11 +111,11 @@ itkGDCMImageIOTest(int argc, char * argv[]) } using GeneratedDicomReaderType = itk::ImageFileReader; - GeneratedDicomReaderType::Pointer generatedDicomReader = GeneratedDicomReaderType::New(); + auto generatedDicomReader = GeneratedDicomReaderType::New(); generatedDicomReader->SetFileName(outputDicomFileName); using MetaWriterType = itk::ImageFileWriter; - MetaWriterType::Pointer metaWriter = MetaWriterType::New(); + auto metaWriter = MetaWriterType::New(); metaWriter->SetFileName(outputImageFileName); metaWriter->SetInput(generatedDicomReader->GetOutput()); try @@ -136,7 +136,7 @@ itkGDCMImageIOTest(int argc, char * argv[]) using RescaledImageType = itk::Image; using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); rescaler->SetInput(reader->GetOutput()); @@ -144,7 +144,7 @@ itkGDCMImageIOTest(int argc, char * argv[]) // Rewrite the image in DICOM format but using less bits per pixel // using RescaledDicomWriterType = itk::ImageFileWriter; - RescaledDicomWriterType::Pointer rescaledDicomWriter = RescaledDicomWriterType::New(); + auto rescaledDicomWriter = RescaledDicomWriterType::New(); rescaledDicomWriter->SetFileName(rescaledDicomFileName); rescaledDicomWriter->SetInput(rescaler->GetOutput()); rescaledDicomWriter->UseInputMetaDataDictionaryOff(); @@ -172,11 +172,11 @@ itkGDCMImageIOTest(int argc, char * argv[]) } using GeneratedRescaledDicomReaderType = itk::ImageFileReader; - GeneratedRescaledDicomReaderType::Pointer rescaledDicomReader = GeneratedRescaledDicomReaderType::New(); + auto rescaledDicomReader = GeneratedRescaledDicomReaderType::New(); rescaledDicomReader->SetFileName(rescaledDicomFileName); using RescaledMetaWriterType = itk::ImageFileWriter; - RescaledMetaWriterType::Pointer rescaledMetaWriter = RescaledMetaWriterType::New(); + auto rescaledMetaWriter = RescaledMetaWriterType::New(); rescaledMetaWriter->SetFileName(rescaledOutputImageFileName); rescaledMetaWriter->SetInput(rescaledDicomReader->GetOutput()); diff --git a/Modules/IO/GDCM/test/itkGDCMImageIOTest2.cxx b/Modules/IO/GDCM/test/itkGDCMImageIOTest2.cxx index b5c17b9e996..ad9196a4b18 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageIOTest2.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageIOTest2.cxx @@ -42,7 +42,7 @@ itkGDCMImageIOTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(input); try { @@ -113,7 +113,7 @@ itkGDCMImageIOTest2(int argc, char * argv[]) std::string output_raw = output; output_raw += "-raw.dcm"; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetImageIO(dicomIO); writer->SetInput(reader->GetOutput()); writer->UseInputMetaDataDictionaryOff(); diff --git a/Modules/IO/GDCM/test/itkGDCMImageOrientationPatientTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageOrientationPatientTest.cxx index c5f06320add..7e44dfbc26a 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageOrientationPatientTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageOrientationPatientTest.cxx @@ -55,14 +55,14 @@ itkGDCMImageOrientationPatientTest(int argc, char * argv[]) Image2DType::SizeType size2D; size2D.Fill(16); - RandomImageSource2DType::Pointer src2D = RandomImageSource2DType::New(); + auto src2D = RandomImageSource2DType::New(); src2D->SetMin(0); src2D->SetMax(255); src2D->SetSpacing(spacing2D); src2D->SetSize(size2D); - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - DictionaryType dictionary; + auto gdcmIO = ImageIOType::New(); + DictionaryType dictionary; // Set all required DICOM fields std::ostringstream value; @@ -96,8 +96,8 @@ itkGDCMImageOrientationPatientTest(int argc, char * argv[]) src2D->GetOutput()->SetMetaDataDictionary(dictionary); - Writer2DType::Pointer writer2D = Writer2DType::New(); - std::ostringstream filename; + auto writer2D = Writer2DType::New(); + std::ostringstream filename; filename.str(""); filename << argv[1] << "/itkGDCMImageOrientationPatientTest.dcm"; writer2D->SetInput(src2D->GetOutput()); @@ -116,7 +116,7 @@ itkGDCMImageOrientationPatientTest(int argc, char * argv[]) } // Now read the dicom back and check its origin - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename.str().c_str()); reader->Update(); diff --git a/Modules/IO/GDCM/test/itkGDCMImagePositionPatientTest.cxx b/Modules/IO/GDCM/test/itkGDCMImagePositionPatientTest.cxx index f6adcdf3ae8..78239966982 100644 --- a/Modules/IO/GDCM/test/itkGDCMImagePositionPatientTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImagePositionPatientTest.cxx @@ -60,14 +60,14 @@ itkGDCMImagePositionPatientTest(int argc, char * argv[]) Image2DType::SizeType size2D; size2D.Fill(16); - RandomImageSource2DType::Pointer src2D = RandomImageSource2DType::New(); + auto src2D = RandomImageSource2DType::New(); src2D->SetMin(0); src2D->SetMax(255); src2D->SetSpacing(spacing2D); src2D->SetSize(size2D); - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - DictionaryType dictionary; + auto gdcmIO = ImageIOType::New(); + DictionaryType dictionary; // Set all required DICOM fields std::ostringstream value; @@ -86,8 +86,8 @@ itkGDCMImagePositionPatientTest(int argc, char * argv[]) src2D->GetOutput()->SetMetaDataDictionary(dictionary); - Writer2DType::Pointer writer2D = Writer2DType::New(); - std::ostringstream filename; + auto writer2D = Writer2DType::New(); + std::ostringstream filename; filename.str(""); filename << argv[1] << "/itkGDCMImagePositionPatientTest.dcm"; writer2D->SetInput(src2D->GetOutput()); @@ -106,7 +106,7 @@ itkGDCMImagePositionPatientTest(int argc, char * argv[]) } // Now read the dicom back and check its origin - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename.str().c_str()); reader->Update(); diff --git a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx index 2aa1bbe5847..671c62b5ea0 100644 --- a/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMImageReadSeriesWriteTest.cxx @@ -45,7 +45,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputImage); @@ -54,7 +54,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) using ImageIOType = itk::GDCMImageIO; using NamesGeneratorType = itk::NumericSeriesFileNames; - ImageIOType::Pointer gdcmIO = ImageIOType::New(); + auto gdcmIO = ImageIOType::New(); itksys::SystemTools::MakeDirectory(outputDirectory); @@ -64,7 +64,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) using Image2DType = itk::Image; using SeriesWriterType = itk::ImageSeriesWriter; - NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); + auto namesGenerator = NamesGeneratorType::New(); itk::MetaDataDictionary & dict = gdcmIO->GetMetaDataDictionary(); std::string tagkey, value; @@ -79,7 +79,7 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) itk::EncapsulateMetaData(dict, tagkey, value); - SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); + auto seriesWriter = SeriesWriterType::New(); seriesWriter->SetInput(reader->GetOutput()); seriesWriter->SetImageIO(gdcmIO); @@ -103,11 +103,11 @@ itkGDCMImageReadSeriesWriteTest(int argc, char * argv[]) // Now read back in and write out as 3D image for comparison with the input. using SeriesReaderType = itk::ImageSeriesReader; - SeriesReaderType::Pointer seriesReader = SeriesReaderType::New(); + auto seriesReader = SeriesReaderType::New(); seriesReader->SetFileNames(namesGenerator->GetFileNames()); using SingleWriterType = itk::ImageFileWriter; - SingleWriterType::Pointer singleWriter = SingleWriterType::New(); + auto singleWriter = SingleWriterType::New(); singleWriter->SetInput(seriesReader->GetOutput()); singleWriter->SetFileName(singleOutputImage); diff --git a/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx b/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx index 5f3e6eae3b2..b5c1d79c8c6 100644 --- a/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMLegacyMultiFrameTest.cxx @@ -43,13 +43,13 @@ itkGDCMLegacyMultiFrameTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); itk::GDCMImageIO::Pointer imageIO = itk::GDCMImageIO::New(); reader->SetImageIO(imageIO); reader->SetFileName(inputFileName); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(outputFileName); try diff --git a/Modules/IO/GDCM/test/itkGDCMLoadImageSpacingTest.cxx b/Modules/IO/GDCM/test/itkGDCMLoadImageSpacingTest.cxx index dedd0169464..bfae8157b26 100644 --- a/Modules/IO/GDCM/test/itkGDCMLoadImageSpacingTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMLoadImageSpacingTest.cxx @@ -52,7 +52,7 @@ itkGDCMLoadImageSpacingTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; itk::GDCMImageIO::Pointer imageIO = itk::GDCMImageIO::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(imageIO); reader->SetFileName(imageFilename); try diff --git a/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx b/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx index 89793c08424..bcac3d6f8c0 100644 --- a/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx +++ b/Modules/IO/GDCM/test/itkGDCMSeriesStreamReadImageWriteTest.cxx @@ -80,8 +80,8 @@ itkGDCMSeriesStreamReadImageWriteTest(int argc, char * argv[]) using ImageIOType = itk::GDCMImageIO; using SeriesFileNames = itk::GDCMSeriesFileNames; - ImageIOType::Pointer gdcmIO = ImageIOType::New(); - SeriesFileNames::Pointer filenameGenerator = SeriesFileNames::New(); + auto gdcmIO = ImageIOType::New(); + auto filenameGenerator = SeriesFileNames::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filenameGenerator, GDCMSeriesFileNames, ProcessObject); @@ -101,7 +101,7 @@ itkGDCMSeriesStreamReadImageWriteTest(int argc, char * argv[]) filenameGenerator->SetInputDirectory(inputDirectory); using ReaderType = itk::ImageSeriesReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); const ReaderType::FileNamesContainer & filenames = filenameGenerator->GetInputFileNames(); @@ -110,11 +110,11 @@ itkGDCMSeriesStreamReadImageWriteTest(int argc, char * argv[]) using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer streamer = StreamingFilter::New(); + auto streamer = StreamingFilter::New(); streamer->SetInput(monitor->GetOutput()); streamer->SetNumberOfStreamDivisions(numberOfDataPieces); @@ -189,7 +189,7 @@ itkGDCMSeriesStreamReadImageWriteTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/GE/include/itkGE4ImageIOFactory.h b/Modules/IO/GE/include/itkGE4ImageIOFactory.h index e42ffb5aaa7..d58d8d2a6da 100644 --- a/Modules/IO/GE/include/itkGE4ImageIOFactory.h +++ b/Modules/IO/GE/include/itkGE4ImageIOFactory.h @@ -58,7 +58,7 @@ class ITKIOGE_EXPORT GE4ImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GE4ImageIOFactory::Pointer metaFactory = GE4ImageIOFactory::New(); + auto metaFactory = GE4ImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/GE/include/itkGE5ImageIOFactory.h b/Modules/IO/GE/include/itkGE5ImageIOFactory.h index 89a2c326d71..d1776fb454b 100644 --- a/Modules/IO/GE/include/itkGE5ImageIOFactory.h +++ b/Modules/IO/GE/include/itkGE5ImageIOFactory.h @@ -58,7 +58,7 @@ class ITKIOGE_EXPORT GE5ImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GE5ImageIOFactory::Pointer metaFactory = GE5ImageIOFactory::New(); + auto metaFactory = GE5ImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/GE/include/itkGEAdwImageIOFactory.h b/Modules/IO/GE/include/itkGEAdwImageIOFactory.h index 1b4647a5abd..f858ddf8dc6 100644 --- a/Modules/IO/GE/include/itkGEAdwImageIOFactory.h +++ b/Modules/IO/GE/include/itkGEAdwImageIOFactory.h @@ -58,7 +58,7 @@ class ITKIOGE_EXPORT GEAdwImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GEAdwImageIOFactory::Pointer metaFactory = GEAdwImageIOFactory::New(); + auto metaFactory = GEAdwImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/GE/test/itkGEImageIOTest.cxx b/Modules/IO/GE/test/itkGEImageIOTest.cxx index c8306252050..947dfe54ddc 100644 --- a/Modules/IO/GE/test/itkGEImageIOTest.cxx +++ b/Modules/IO/GE/test/itkGEImageIOTest.cxx @@ -53,8 +53,8 @@ itkGEImageIOFactoryTest(int ac, char * av[]) } char * filename = *++av; - ImagePointer input; - ImageReaderType::Pointer imageReader = ImageReaderType::New(); + ImagePointer input; + auto imageReader = ImageReaderType::New(); try { @@ -113,8 +113,8 @@ itkGEImageIOTest(int ac, char * av[]) return EXIT_FAILURE; } - ImagePointer input; - ImageReaderType::Pointer imageReader = ImageReaderType::New(); + ImagePointer input; + auto imageReader = ImageReaderType::New(); try { @@ -140,7 +140,7 @@ itkGEImageIOTest(int ac, char * av[]) if (failmode == std::string("true")) { - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetInput(input); writer->SetFileName(av[4]); writer->Update(); diff --git a/Modules/IO/GIPL/include/itkGiplImageIOFactory.h b/Modules/IO/GIPL/include/itkGiplImageIOFactory.h index 3b2024baf8c..7a190462d23 100644 --- a/Modules/IO/GIPL/include/itkGiplImageIOFactory.h +++ b/Modules/IO/GIPL/include/itkGiplImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIOGIPL_EXPORT GiplImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GiplImageIOFactory::Pointer GiplFactory = GiplImageIOFactory::New(); + auto GiplFactory = GiplImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(GiplFactory); } diff --git a/Modules/IO/HDF5/include/itkHDF5ImageIOFactory.h b/Modules/IO/HDF5/include/itkHDF5ImageIOFactory.h index 7d8fb95c0ac..78e4003ee8d 100644 --- a/Modules/IO/HDF5/include/itkHDF5ImageIOFactory.h +++ b/Modules/IO/HDF5/include/itkHDF5ImageIOFactory.h @@ -60,7 +60,7 @@ class ITKIOHDF5_EXPORT HDF5ImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - HDF5ImageIOFactory::Pointer metaFactory = HDF5ImageIOFactory::New(); + auto metaFactory = HDF5ImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx b/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx index c19beb3099a..5abdc7ea925 100644 --- a/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx +++ b/Modules/IO/HDF5/test/itkHDF5ImageIOStreamingReadWriteTest.cxx @@ -102,9 +102,9 @@ HDF5ReadWriteTest2(const char * fileName) // Write image with streaming. using WriterType = typename itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using MonitorFilterType = typename itk::PipelineMonitorImageFilter; - typename MonitorFilterType::Pointer writerMonitor = MonitorFilterType::New(); + auto writerMonitor = MonitorFilterType::New(); writerMonitor->SetInput(imageSource->GetOutput()); writer->SetFileName(fileName); writer->SetInput(writerMonitor->GetOutput()); @@ -146,13 +146,13 @@ HDF5ReadWriteTest2(const char * fileName) // Read image with streaming. using ReaderType = typename itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(fileName); reader->SetUseStreaming(true); - typename MonitorFilterType::Pointer readerMonitor = MonitorFilterType::New(); + auto readerMonitor = MonitorFilterType::New(); readerMonitor->SetInput(reader->GetOutput()); using StreamingFilter = typename itk::StreamingImageFilter; - typename StreamingFilter::Pointer streamer = StreamingFilter::New(); + auto streamer = StreamingFilter::New(); streamer->SetInput(readerMonitor->GetOutput()); streamer->SetNumberOfStreamDivisions(5); typename ImageType::Pointer image; diff --git a/Modules/IO/ImageBase/include/itkIOTestHelper.h b/Modules/IO/ImageBase/include/itkIOTestHelper.h index d4bbdd49507..5072f47768d 100644 --- a/Modules/IO/ImageBase/include/itkIOTestHelper.h +++ b/Modules/IO/ImageBase/include/itkIOTestHelper.h @@ -37,7 +37,7 @@ class IOTestHelper { using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); { if (imageio) { @@ -81,7 +81,7 @@ class IOTestHelper { using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); if (imageio.IsNull()) { @@ -169,7 +169,7 @@ class IOTestHelper AllocateImageFromRegionAndSpacing(const typename ImageType::RegionType & region, const typename ImageType::SpacingType & spacing) { - typename ImageType::Pointer rval = ImageType::New(); + auto rval = ImageType::New(); SetIdentityDirection(rval); rval->SetSpacing(spacing); rval->SetRegions(region); @@ -182,7 +182,7 @@ class IOTestHelper const typename ImageType::SpacingType & spacing, int vecLength) { - typename ImageType::Pointer rval = ImageType::New(); + auto rval = ImageType::New(); rval->SetSpacing(spacing); rval->SetRegions(region); rval->SetVectorLength(vecLength); diff --git a/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx b/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx index 418f0d4f229..71e79a889dd 100644 --- a/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx +++ b/Modules/IO/ImageBase/include/itkImageSeriesReader.hxx @@ -123,8 +123,8 @@ ImageSeriesReader::GenerateOutputInformation() const int firstFileName = (m_ReverseOrder ? numberOfFiles - 1 : 0); const int lastFileName = (m_ReverseOrder ? 0 : numberOfFiles - 1); - typename ReaderType::Pointer firstReader = ReaderType::New(); - typename ReaderType::Pointer lastReader = ReaderType::New(); + auto firstReader = ReaderType::New(); + auto lastReader = ReaderType::New(); firstReader->SetFileName(m_FileNames[firstFileName].c_str()); lastReader->SetFileName(m_FileNames[lastFileName].c_str()); if (m_ImageIO) @@ -321,7 +321,7 @@ ImageSeriesReader::GenerateData() } // configure reader - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(m_FileNames[iFileName].c_str()); TOutputImage * readerOutput = reader->GetOutput(); diff --git a/Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx b/Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx index 1ee8475f386..c2eb5dae990 100644 --- a/Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx +++ b/Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx @@ -187,7 +187,7 @@ ImageSeriesWriter::WriteFiles() } // Allocate an image for output and create an iterator for it - typename OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(outRegion); outputImage->SetNumberOfComponentsPerPixel(inputImage->GetNumberOfComponentsPerPixel()); outputImage->Allocate(); @@ -265,7 +265,7 @@ ImageSeriesWriter::WriteFiles() // Copy the selected "slice" into the output image. ImageAlgorithm::Copy(inputImage, outputImage.GetPointer(), inRegion, outRegion); - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->UseInputMetaDataDictionaryOff(); // use the dictionary from the // ImageIO class diff --git a/Modules/IO/ImageBase/test/itk64bitTest.cxx b/Modules/IO/ImageBase/test/itk64bitTest.cxx index 7a5b95b3539..3415eb35433 100644 --- a/Modules/IO/ImageBase/test/itk64bitTest.cxx +++ b/Modules/IO/ImageBase/test/itk64bitTest.cxx @@ -63,7 +63,7 @@ itk64bitTest(int argc, char * argv[]) int returnValue = EXIT_SUCCESS; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // Input/Test64bit.nrrd try @@ -75,7 +75,7 @@ itk64bitTest(int argc, char * argv[]) std::cout << "Writing " << argv[2] << std::endl; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(argv[2]); writer->Update(); diff --git a/Modules/IO/ImageBase/test/itkFileFreeImageIOFactory.h b/Modules/IO/ImageBase/test/itkFileFreeImageIOFactory.h index 79c36556879..eb9f5c2558f 100644 --- a/Modules/IO/ImageBase/test/itkFileFreeImageIOFactory.h +++ b/Modules/IO/ImageBase/test/itkFileFreeImageIOFactory.h @@ -57,7 +57,7 @@ class FileFreeImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - FileFreeImageIOFactory::Pointer fileFreeFactory = FileFreeImageIOFactory::New(); + auto fileFreeFactory = FileFreeImageIOFactory::New(); ObjectFactoryBase::RegisterFactory(fileFreeFactory); } diff --git a/Modules/IO/ImageBase/test/itkIOPluginTest.cxx b/Modules/IO/ImageBase/test/itkIOPluginTest.cxx index d0e69216c59..eb87d2ddaff 100644 --- a/Modules/IO/ImageBase/test/itkIOPluginTest.cxx +++ b/Modules/IO/ImageBase/test/itkIOPluginTest.cxx @@ -77,8 +77,8 @@ itkIOPluginTest(int argc, char * argv[]) using ImageNDType = itk::Image; using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); int status = EXIT_SUCCESS; try diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderDimensionsTest.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderDimensionsTest.cxx index e7e70713a8f..de9ba322093 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderDimensionsTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderDimensionsTest.cxx @@ -62,10 +62,10 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing reading to 4D image" << std::endl; try { - Reader4DType::Pointer reader = Reader4DType::New(); + auto reader = Reader4DType::New(); reader->SetFileName(argv[1]); - Writer4DType::Pointer writer = Writer4DType::New(); + auto writer = Writer4DType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(tempFile1); writer->Update(); @@ -80,12 +80,12 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing reading from 4D image into 3D" << std::endl; try { - Reader3DType::Pointer reader = Reader3DType::New(); + auto reader = Reader3DType::New(); // we expect the filename to be 4 dimensions reader->SetFileName(tempFile1); - Writer3DType::Pointer writer = Writer3DType::New(); + auto writer = Writer3DType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(tempFile2); writer->Update(); @@ -101,10 +101,10 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing requested stream reading from 3D image into 4D" << std::endl; try { - Reader4DType::Pointer reader = Reader4DType::New(); + auto reader = Reader4DType::New(); reader->SetFileName(tempFile2); - Writer4DType::Pointer writer = Writer4DType::New(); + auto writer = Writer4DType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(tempFile3); writer->SetNumberOfStreamDivisions(4); @@ -121,11 +121,11 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing requested stream reading from 4D image into 3D" << std::endl; try { - Reader3DType::Pointer reader = Reader3DType::New(); + auto reader = Reader3DType::New(); reader->SetFileName(tempFile3); reader->Update(); - Writer3DType::Pointer writer = Writer3DType::New(); + auto writer = Writer3DType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(tempFile4); writer->SetNumberOfStreamDivisions(4); @@ -142,7 +142,7 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing reading from 4D image into 2D" << std::endl; try { - Reader2DType::Pointer reader = Reader2DType::New(); + auto reader = Reader2DType::New(); // we expect the filename to be 4 dimensions reader->SetFileName(tempFile1); reader->UpdateLargestPossibleRegion(); @@ -159,7 +159,7 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing requested invalid paste IORegion" << std::endl; try { - Reader4DType::Pointer reader = Reader4DType::New(); + auto reader = Reader4DType::New(); reader->SetFileName(tempFile4); Image4DType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); @@ -174,7 +174,7 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) } - Writer4DType::Pointer writer = Writer4DType::New(); + auto writer = Writer4DType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(tempFile5); // this file name should not // matter since it should never be written @@ -200,7 +200,7 @@ itkImageFileReaderDimensionsTest(int argc, char * argv[]) std::cout << "testing reading to char 2D image" << std::endl; try { - CharReader2DType::Pointer reader = CharReader2DType::New(); + auto reader = CharReader2DType::New(); reader->SetFileName(argv[1]); reader->Update(); } diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderPositiveSpacingTest.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderPositiveSpacingTest.cxx index a4211311a87..d15506e8ed6 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderPositiveSpacingTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderPositiveSpacingTest.cxx @@ -36,7 +36,7 @@ itkImageFileReaderPositiveSpacingTest(int ac, char * av[]) using ImageNDType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); reader->Update(); ImageNDType::Pointer image = reader->GetOutput(); diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx index 0fd0f2df10a..08def6b4d5e 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest.cxx @@ -57,17 +57,17 @@ itkImageFileReaderStreamingTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer streamer = StreamingFilter::New(); + auto streamer = StreamingFilter::New(); streamer->SetInput(monitor->GetOutput()); streamer->SetNumberOfStreamDivisions(numberOfDataPieces); diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx index e228ae6aca1..02fc4f4cd93 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderStreamingTest2.cxx @@ -43,14 +43,14 @@ SameRegionImage(ImageConstPointer test, ImageConstPointer baseline) unsigned int numberOfPixelTolerance = 0; using ExtractImageFilter = itk::ExtractImageFilter; - ExtractImageFilter::Pointer extractor = ExtractImageFilter::New(); + auto extractor = ExtractImageFilter::New(); extractor->SetDirectionCollapseToSubmatrix(); extractor->SetExtractionRegion(test->GetLargestPossibleRegion()); extractor->SetInput(baseline); using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(extractor->GetOutput()); diff->SetTestInput(test); diff->SetDifferenceThreshold(intensityTolerance); @@ -80,24 +80,24 @@ itkImageFileReaderStreamingTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer baselineReader = ReaderType::New(); + auto baselineReader = ReaderType::New(); baselineReader->SetFileName(argv[1]); baselineReader->UpdateLargestPossibleRegion(); ImageType::ConstPointer baselineImage = baselineReader->GetOutput(); - ReaderType::Pointer streamingReader = ReaderType::New(); + auto streamingReader = ReaderType::New(); streamingReader->SetFileName(argv[1]); streamingReader->UseStreamingOn(); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(streamingReader->GetOutput()); using ExtractImageFilter = itk::ExtractImageFilter; - ExtractImageFilter::Pointer extractor = ExtractImageFilter::New(); + auto extractor = ExtractImageFilter::New(); extractor->SetDirectionCollapseToSubmatrix(); extractor->SetInput(monitor->GetOutput()); diff --git a/Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx index 5076e081170..7a8ceabfe34 100644 --- a/Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileReaderTest1.cxx @@ -36,7 +36,7 @@ itkImageFileReaderTest1(int ac, char * av[]) int status = 1; try { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->Update(); } catch (const itk::ExceptionObject & ex) @@ -56,7 +56,7 @@ itkImageFileReaderTest1(int ac, char * av[]) status = 1; try { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName("this_file_should_not_exist"); reader->Update(); } @@ -76,7 +76,7 @@ itkImageFileReaderTest1(int ac, char * av[]) status = 1; try { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); // this is the executable and no reader should be able to read it reader->SetFileName(av[0]); reader->Update(); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx index 38eea0ac279..c724c15948a 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest1.cxx @@ -41,7 +41,7 @@ itkImageFileWriterPastingTest1(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); @@ -65,7 +65,7 @@ itkImageFileWriterPastingTest1(int argc, char * argv[]) unsigned int zsize = fullsize[2] / m_NumberOfPieces; // Setup the writer - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); for (unsigned int i = 0; i < m_NumberOfPieces; ++i) diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx index 6df9f889c25..964b7498012 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest2.cxx @@ -36,7 +36,7 @@ SameImage(ImagePointer testImage, ImagePointer baselineImage) unsigned long numberOfPixelTolerance = 0; using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineImage); diff->SetTestInput(testImage); diff->SetDifferenceThreshold(intensityTolerance); @@ -79,7 +79,7 @@ itkImageFileWriterPastingTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); @@ -101,11 +101,11 @@ itkImageFileWriterPastingTest2(int argc, char * argv[]) ImageType::RegionType pasteRegion(pasteIndex, pasteSize); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); // Setup the writer - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(monitor->GetOutput()); @@ -150,14 +150,14 @@ itkImageFileWriterPastingTest2(int argc, char * argv[]) } using ExtractImageFilterType = itk::ExtractImageFilter; - ExtractImageFilterType::Pointer extractBaselineImage = ExtractImageFilterType::New(); + auto extractBaselineImage = ExtractImageFilterType::New(); extractBaselineImage->SetDirectionCollapseToSubmatrix(); extractBaselineImage->SetInput(reader->GetOutput()); extractBaselineImage->SetExtractionRegion(pasteRegion); - ReaderType::Pointer readerTestImage = ReaderType::New(); + auto readerTestImage = ReaderType::New(); readerTestImage->SetFileName(argv[2]); - ExtractImageFilterType::Pointer extractTestImage = ExtractImageFilterType::New(); + auto extractTestImage = ExtractImageFilterType::New(); extractTestImage->SetDirectionCollapseToSubmatrix(); extractTestImage->SetInput(readerTestImage->GetOutput()); extractTestImage->SetExtractionRegion(pasteRegion); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx index 45481d40621..b13ea17e258 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterPastingTest3.cxx @@ -38,7 +38,7 @@ SameImage(ImagePointer testImage, ImagePointer baselineImage) unsigned long numberOfPixelTolerance = 0; using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineImage); diff->SetTestInput(testImage); diff->SetDifferenceThreshold(intensityTolerance); @@ -89,7 +89,7 @@ itkImageFileWriterPastingTest3(int argc, char * argv[]) // Then let the reader go out of scope to orphan the image to have // no source. { - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); reader->UpdateOutputInformation(); @@ -116,7 +116,7 @@ itkImageFileWriterPastingTest3(int argc, char * argv[]) // Setup the writer with an image which doesn't have a source // // We expect that the writer should respect the LargestPossibleRegion - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(image); @@ -129,11 +129,11 @@ itkImageFileWriterPastingTest3(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->UpdateOutputInformation(); - ReaderType::Pointer readerTestImage = ReaderType::New(); + auto readerTestImage = ReaderType::New(); readerTestImage->SetFileName(argv[2]); readerTestImage->UpdateOutputInformation(); @@ -148,14 +148,14 @@ itkImageFileWriterPastingTest3(int argc, char * argv[]) // compare the two subregions using ExtractImageFilterType = itk::ExtractImageFilter; - ExtractImageFilterType::Pointer extractTestImage = ExtractImageFilterType::New(); + auto extractTestImage = ExtractImageFilterType::New(); extractTestImage->SetInput(readerTestImage->GetOutput()); extractTestImage->SetDirectionCollapseToSubmatrix(); extractTestImage->SetExtractionRegion(image->GetBufferedRegion()); extractTestImage->InPlaceOn(); using ExtractImageFilterType = itk::ExtractImageFilter; - ExtractImageFilterType::Pointer extractBaselineImage = ExtractImageFilterType::New(); + auto extractBaselineImage = ExtractImageFilterType::New(); extractBaselineImage->SetInput(reader->GetOutput()); extractBaselineImage->SetDirectionCollapseToSubmatrix(); extractBaselineImage->SetExtractionRegion(image->GetBufferedRegion()); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx index 3c4416fe753..38ef6d502f8 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingPastingCompressingTest1.cxx @@ -45,7 +45,7 @@ SameImage(ImagePointer testImage, ImagePointer baselineImage) // NOTE ALEX: it look slike this filter does not take the spacing // into account, to check later. using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineImage); diff->SetTestInput(testImage); diff->SetDifferenceThreshold(intensityTolerance); @@ -78,7 +78,7 @@ bool SameImage(std::string testImageFileName, ImagePointer baselineImage) { using ReaderType = itk::ImageFileReader; - ReaderType::Pointer readerTestImage = ReaderType::New(); + auto readerTestImage = ReaderType::New(); readerTestImage->SetFileName(testImageFileName); // NOTE ALEX: here we suppose the reading went well @@ -119,7 +119,7 @@ ActualTest(std::string inputFileName, using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputFileName.c_str()); reader->SetUseStreaming(true); @@ -143,11 +143,11 @@ ActualTest(std::string inputFileName, // ?? using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); // Setup the writer - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(monitor->GetOutput()); @@ -203,14 +203,14 @@ ActualTest(std::string inputFileName, if (pasteWriting) { using ExtractImageFilterType = itk::ExtractImageFilter; - ExtractImageFilterType::Pointer extractBaselineImage = ExtractImageFilterType::New(); + auto extractBaselineImage = ExtractImageFilterType::New(); extractBaselineImage->SetDirectionCollapseToSubmatrix(); extractBaselineImage->SetInput(reader->GetOutput()); extractBaselineImage->SetExtractionRegion(pasteRegion); - ReaderType::Pointer readerTestImage = ReaderType::New(); + auto readerTestImage = ReaderType::New(); readerTestImage->SetFileName(outputFileName); - ExtractImageFilterType::Pointer extractTestImage = ExtractImageFilterType::New(); + auto extractTestImage = ExtractImageFilterType::New(); extractTestImage->SetDirectionCollapseToSubmatrix(); extractTestImage->SetInput(readerTestImage->GetOutput()); extractTestImage->SetExtractionRegion(pasteRegion); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx index d870357c4ef..3aed3cbc88b 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest1.cxx @@ -62,12 +62,12 @@ itkImageFileWriterStreamingTest1(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); if (forceNoStreamingInput) @@ -77,7 +77,7 @@ itkImageFileWriterStreamingTest1(int argc, char * argv[]) } // Setup the writer - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(monitor->GetOutput()); writer->SetNumberOfStreamDivisions(numberOfDataPieces); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx index 8f696ffe956..eae02e951bf 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterStreamingTest2.cxx @@ -38,13 +38,13 @@ SameImage(std::string output, std::string baseline) unsigned int radiusTolerance = 0; unsigned int numberOfPixelTolerance = 0; - ReaderType::Pointer testReader = ReaderType::New(); - ReaderType::Pointer baselineReader = ReaderType::New(); + auto testReader = ReaderType::New(); + auto baselineReader = ReaderType::New(); testReader->SetFileName(output); baselineReader->SetFileName(baseline); using DiffType = itk::Testing::ComparisonImageFilter; - DiffType::Pointer diff = DiffType::New(); + auto diff = DiffType::New(); diff->SetValidInput(baselineReader->GetOutput()); diff->SetTestInput(testReader->GetOutput()); diff->SetDifferenceThreshold(intensityTolerance); @@ -79,15 +79,15 @@ itkImageFileWriterStreamingTest2(int argc, char * argv[]) unsigned int numberOfDataPieces = 4; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(monitor->GetOutput()); writer->SetNumberOfStreamDivisions(numberOfDataPieces); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterTest.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterTest.cxx index ffe0dff0b63..ed26a1f985d 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterTest.cxx @@ -31,7 +31,7 @@ itkImageFileWriterTest(int ac, char * av[]) using ImageNDType = itk::Image; using WriterType = itk::ImageFileWriter; - ImageNDType::Pointer image = ImageNDType::New(); + auto image = ImageNDType::New(); ImageNDType::RegionType region; ImageNDType::IndexType index; ImageNDType::SizeType size; @@ -49,7 +49,7 @@ itkImageFileWriterTest(int ac, char * av[]) int status = 1; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->Update(); } catch (const itk::ExceptionObject & ex) @@ -68,7 +68,7 @@ itkImageFileWriterTest(int ac, char * av[]) status = 1; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->Update(); } @@ -88,7 +88,7 @@ itkImageFileWriterTest(int ac, char * av[]) status = 1; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName("this_is_a_bad_filename"); writer->Update(); @@ -109,7 +109,7 @@ itkImageFileWriterTest(int ac, char * av[]) status = 1; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(av[1]); writer->Update(); @@ -130,7 +130,7 @@ itkImageFileWriterTest(int ac, char * av[]) status = 1; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(av[1]); writer->UpdateLargestPossibleRegion(); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterTest2.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterTest2.cxx index 582ed2fd7eb..6285fa3cad8 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterTest2.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterTest2.cxx @@ -33,7 +33,7 @@ itkImageFileWriterTest2(int ac, char * av[]) using WriterType = itk::ImageFileWriter; using ReaderType = itk::ImageFileReader; - ImageNDType::Pointer image = ImageNDType::New(); + auto image = ImageNDType::New(); ImageNDType::RegionType region; ImageNDType::IndexType index; ImageNDType::SizeType size; @@ -56,8 +56,8 @@ itkImageFileWriterTest2(int ac, char * av[]) std::cout << "Original Starting Point (physical cooridents) : " << originalPoint << std::endl; std::cout << "Original Origin: " << image->GetOrigin() << std::endl; - WriterType::Pointer writer = WriterType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto writer = WriterType::New(); + auto reader = ReaderType::New(); try { writer->SetInput(image); diff --git a/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx b/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx index 16c928a93d2..a87d7fa50db 100644 --- a/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageFileWriterUpdateLargestPossibleRegionTest.cxx @@ -36,12 +36,12 @@ itkImageFileWriterUpdateLargestPossibleRegionTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(reader->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx b/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx index 39915313444..f55be196c4d 100644 --- a/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIODirection2DTest.cxx @@ -38,7 +38,7 @@ itkImageIODirection2DTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); @@ -81,7 +81,7 @@ itkImageIODirection2DTest(int ac, char * av[]) if (ac > 6) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(av[6]); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx b/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx index 6661047530e..712b0950cac 100644 --- a/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageIODirection3DTest.cxx @@ -38,7 +38,7 @@ itkImageIODirection3DTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); @@ -82,7 +82,7 @@ itkImageIODirection3DTest(int ac, char * av[]) if (ac > 11) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(av[11]); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/ImageBase/test/itkImageSeriesReaderDimensionsTest.cxx b/Modules/IO/ImageBase/test/itkImageSeriesReaderDimensionsTest.cxx index 7501224fe65..cf6511a6afd 100644 --- a/Modules/IO/ImageBase/test/itkImageSeriesReaderDimensionsTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageSeriesReaderDimensionsTest.cxx @@ -51,7 +51,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a single 2D image to 2D" << std::endl; try { - Reader2DType::Pointer reader = Reader2DType::New(); + auto reader = Reader2DType::New(); reader->SetFileNames(fname); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -65,7 +65,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a single 2D image to 3D" << std::endl; try { - Reader3DType::Pointer reader = Reader3DType::New(); + auto reader = Reader3DType::New(); reader->SetFileNames(fname); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -79,7 +79,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a single 2D image to 4D" << std::endl; try { - Reader4DType::Pointer reader = Reader4DType::New(); + auto reader = Reader4DType::New(); reader->SetFileNames(fname); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -95,7 +95,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a series of 2D images to 2D" << std::endl; try { - Reader2DType::Pointer reader = Reader2DType::New(); + auto reader = Reader2DType::New(); reader->SetFileNames(fnames); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -109,7 +109,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a series of 2D images to 3D" << std::endl; try { - Reader3DType::Pointer reader = Reader3DType::New(); + auto reader = Reader3DType::New(); reader->SetFileNames(fnames); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -123,7 +123,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a series of 2D images to 4D" << std::endl; try { - Reader4DType::Pointer reader = Reader4DType::New(); + auto reader = Reader4DType::New(); reader->SetFileNames(fnames); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; @@ -137,7 +137,7 @@ itkImageSeriesReaderDimensionsTest(int ac, char * av[]) std::cout << "testing reading a series of 2D images to 5D" << std::endl; try { - Reader5DType::Pointer reader = Reader5DType::New(); + auto reader = Reader5DType::New(); reader->SetFileNames(fnames); reader->Update(); std::cout << "output image size:: " << reader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; diff --git a/Modules/IO/ImageBase/test/itkImageSeriesReaderSamplingTest.cxx b/Modules/IO/ImageBase/test/itkImageSeriesReaderSamplingTest.cxx index 9ab258585ed..7304abaf8ac 100644 --- a/Modules/IO/ImageBase/test/itkImageSeriesReaderSamplingTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageSeriesReaderSamplingTest.cxx @@ -42,7 +42,7 @@ itkImageSeriesReaderSamplingTest(int ac, char * av[]) std::cout << "testing reading a series of 2D images to 3D with extra slices" << std::endl; try { - Reader3DType::Pointer reader = Reader3DType::New(); + auto reader = Reader3DType::New(); reader->SetFileNames(fnames); reader->Update(); double maxSamplingDeviation = 0.0; diff --git a/Modules/IO/ImageBase/test/itkImageSeriesReaderVectorTest.cxx b/Modules/IO/ImageBase/test/itkImageSeriesReaderVectorTest.cxx index 27ae36daf20..90168a08ddf 100644 --- a/Modules/IO/ImageBase/test/itkImageSeriesReaderVectorTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageSeriesReaderVectorTest.cxx @@ -40,7 +40,7 @@ itkImageSeriesReaderVectorTest(int ac, char * av[]) std::cout << "testing reading a image series into VecorImage" << std::endl; try { - VectorImageSeriesReader::Pointer reader = VectorImageSeriesReader::New(); + auto reader = VectorImageSeriesReader::New(); reader->SetFileNames(fnames); reader->Update(); } @@ -53,7 +53,7 @@ itkImageSeriesReaderVectorTest(int ac, char * av[]) std::cout << "testing reading image series into ImageOfVectors " << std::endl; try { - VectorImageSeriesReader::Pointer reader = VectorImageSeriesReader::New(); + auto reader = VectorImageSeriesReader::New(); reader->SetFileNames(fnames); reader->Update(); } diff --git a/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx b/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx index d3d91eb25fc..d250efdcf97 100644 --- a/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx +++ b/Modules/IO/ImageBase/test/itkImageSeriesWriterTest.cxx @@ -50,7 +50,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); std::string seriesIdentifier = seriesUID.begin()->c_str(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileNames(nameGenerator->GetFileNames(seriesIdentifier)); reader->SetImageIO(io); @@ -67,7 +67,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) using OutputImageType = itk::Image; using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetInput(reader->GetOutput()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); @@ -78,7 +78,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) // for generating the list of filenames. This API will be removed after ITK 1.8 using WriterType = itk::ImageSeriesWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); itk::SimpleFilterWatcher watcher2(writer); @@ -105,7 +105,7 @@ itkImageSeriesWriterTest(int argc, char * argv[]) using WriterType = itk::ImageSeriesWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); char format[4096]; diff --git a/Modules/IO/ImageBase/test/itkLargeImageWriteConvertReadTest.cxx b/Modules/IO/ImageBase/test/itkLargeImageWriteConvertReadTest.cxx index 5601e6be5b3..0e76213e3df 100644 --- a/Modules/IO/ImageBase/test/itkLargeImageWriteConvertReadTest.cxx +++ b/Modules/IO/ImageBase/test/itkLargeImageWriteConvertReadTest.cxx @@ -40,7 +40,7 @@ itkLargeImageWriteConvertReadTest(int ac, char * av[]) itk::TimeProbesCollectorBase chronometer; { // begin write block - OutputImageType::Pointer image = OutputImageType::New(); + auto image = OutputImageType::New(); OutputImageType::RegionType region; OutputImageType::IndexType index; OutputImageType::SizeType size; @@ -79,7 +79,7 @@ itkLargeImageWriteConvertReadTest(int ac, char * av[]) std::cout << "Trying to write the image to disk" << std::endl; try { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(av[1]); chronometer.Start("Write"); @@ -95,7 +95,7 @@ itkLargeImageWriteConvertReadTest(int ac, char * av[]) } // end writing block so data is freed std::cout << "Trying to read the image back from disk" << std::endl; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(av[1]); try diff --git a/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx b/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx index 0fc1c35c204..c7a4719837e 100644 --- a/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx +++ b/Modules/IO/ImageBase/test/itkLargeImageWriteReadTest.cxx @@ -46,7 +46,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) itk::TimeProbesCollectorBase chronometer; { // begin write block - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); index.Fill(0); region.SetSize(size); region.SetIndex(index); @@ -86,7 +86,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) std::cout << "Trying to write the image to disk" << std::endl; try { - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(filename); chronometer.Start("Write"); @@ -101,7 +101,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) } // end write block to free the memory std::cout << "Trying to read the image back from disk" << std::endl; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); try diff --git a/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx b/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx index 47f3b41f255..5e55713fee4 100644 --- a/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx +++ b/Modules/IO/ImageBase/test/itkMatrixImageWriteReadTest.cxx @@ -33,7 +33,7 @@ itkMatrixImageWriteReadTest(int ac, char * av[]) using MatrixPixelType = itk::Matrix; using MatrixImageType = itk::Image; - MatrixImageType::Pointer matrixImage1 = MatrixImageType::New(); + auto matrixImage1 = MatrixImageType::New(); MatrixImageType::SizeType size; size.Fill(10); @@ -81,7 +81,7 @@ itkMatrixImageWriteReadTest(int ac, char * av[]) using MatrixWriterType = itk::ImageFileWriter; - MatrixWriterType::Pointer matrixWriter = MatrixWriterType::New(); + auto matrixWriter = MatrixWriterType::New(); matrixWriter->SetInput(matrixImage1); matrixWriter->SetFileName(av[1]); @@ -99,7 +99,7 @@ itkMatrixImageWriteReadTest(int ac, char * av[]) using MatrixReaderType = itk::ImageFileReader; - MatrixReaderType::Pointer matrixReader = MatrixReaderType::New(); + auto matrixReader = MatrixReaderType::New(); matrixReader->SetFileName(av[1]); diff --git a/Modules/IO/ImageBase/test/itkNoiseImageFilterTest.cxx b/Modules/IO/ImageBase/test/itkNoiseImageFilterTest.cxx index 8a04565abe9..189fba12328 100644 --- a/Modules/IO/ImageBase/test/itkNoiseImageFilterTest.cxx +++ b/Modules/IO/ImageBase/test/itkNoiseImageFilterTest.cxx @@ -46,12 +46,12 @@ itkNoiseImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::NoiseImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescale = RescaleFilterType::New(); + auto rescale = RescaleFilterType::New(); rescale->SetOutputMinimum(0); rescale->SetOutputMaximum(255); rescale->SetInput(filter->GetOutput()); diff --git a/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx b/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx index a479e42b79b..3bfa88b55ec 100644 --- a/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx +++ b/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx @@ -36,7 +36,7 @@ itkReadWriteImageWithDictionaryTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; // Create the 16x16 input image - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); ImageType::SizeType size; size.Fill(16); @@ -64,14 +64,14 @@ itkReadWriteImageWithDictionaryTest(int argc, char * argv[]) itk::EncapsulateMetaData(inputDictionary, itk::ITK_PatientID, patientstr); // Write the image down - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(inputImage); writer->SetFileName(argv[1]); writer->Update(); // Read the image back - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); diff --git a/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx b/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx index 1ae57c7c563..ae167c9af27 100644 --- a/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx +++ b/Modules/IO/ImageBase/test/itkVectorImageReadWriteTest.cxx @@ -41,9 +41,9 @@ itkVectorImageReadWriteTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ImageType::Pointer inputImage = ImageType::New(); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto inputImage = ImageType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); // In this test, we will create a 9x9 image of vectors with pixels (4,4) // and (1,6) set to 'vector1'. We will filter it using diff --git a/Modules/IO/JPEG/include/itkJPEGImageIOFactory.h b/Modules/IO/JPEG/include/itkJPEGImageIOFactory.h index 4c16c73e0c8..062741a77dd 100644 --- a/Modules/IO/JPEG/include/itkJPEGImageIOFactory.h +++ b/Modules/IO/JPEG/include/itkJPEGImageIOFactory.h @@ -62,7 +62,7 @@ class ITKIOJPEG_EXPORT JPEGImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - JPEGImageIOFactory::Pointer JPEGFactory = JPEGImageIOFactory::New(); + auto JPEGFactory = JPEGImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(JPEGFactory); } diff --git a/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx b/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx index 3c51d46b8cd..260c6d71b07 100644 --- a/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx +++ b/Modules/IO/JPEG/test/itkJPEGImageIOTest2.cxx @@ -36,7 +36,7 @@ itkJPEGImageIOTest2(int argc, char * argv[]) using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::IndexType start; @@ -63,7 +63,7 @@ itkJPEGImageIOTest2(int argc, char * argv[]) image->SetSpacing(spacing); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(image); @@ -72,7 +72,7 @@ itkJPEGImageIOTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); diff --git a/Modules/IO/JPEG2000/include/itkJPEG2000ImageIOFactory.h b/Modules/IO/JPEG2000/include/itkJPEG2000ImageIOFactory.h index ba160e4731a..828c643fd9b 100644 --- a/Modules/IO/JPEG2000/include/itkJPEG2000ImageIOFactory.h +++ b/Modules/IO/JPEG2000/include/itkJPEG2000ImageIOFactory.h @@ -74,7 +74,7 @@ class ITKIOJPEG2000_EXPORT JPEG2000ImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - JPEG2000ImageIOFactory::Pointer factory = JPEG2000ImageIOFactory::New(); + auto factory = JPEG2000ImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(factory); } diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx index 52e18369b78..c3ffbe02487 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIORegionOfInterest.cxx @@ -53,7 +53,7 @@ itkJPEG2000ImageIORegionOfInterest(int argc, char * argv[]) // the input and output image types. A filter object is created with the // New() method and assigned to a \doxygen{SmartPointer}. using FilterType = itk::RegionOfInterestImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // The RegionOfInterestImageFilter requires a region to be // defined by the user. The region is specified by an \doxygen{Index} @@ -77,8 +77,8 @@ itkJPEG2000ImageIORegionOfInterest(int argc, char * argv[]) filter->SetRegionOfInterest(desiredRegion); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx index abd7f01e0a9..0c5978b66c3 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest01.cxx @@ -49,8 +49,8 @@ itkJPEG2000ImageIOTest01(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx index c944ba4028c..57a16399b91 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest02.cxx @@ -49,8 +49,8 @@ itkJPEG2000ImageIOTest02(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx index 94a8f60dfbf..b36c76b8ea4 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest03.cxx @@ -47,8 +47,8 @@ itkJPEG2000ImageIOTest03(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx index 2525fc0b05c..9fd9ba2ad04 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest04.cxx @@ -49,11 +49,11 @@ itkJPEG2000ImageIOTest04(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; using IOBaseType = itk::JPEG2000ImageIO; - IOBaseType::Pointer base = IOBaseType::New(); + auto base = IOBaseType::New(); base->SetTileSize(std::stoi(argv[3]), std::stoi(argv[4])); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest05.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest05.cxx index 370e0662cc2..6dc2bc81529 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest05.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest05.cxx @@ -40,7 +40,7 @@ itkJPEG2000ImageIOTest05(int argc, char * argv[]) using OutputImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); // reader->SetUseStreaming( true ); @@ -56,7 +56,7 @@ itkJPEG2000ImageIOTest05(int argc, char * argv[]) using WriterType = itk::ImageSeriesWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); char format[4096]; diff --git a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx index a9a34562562..c49d5adf2db 100644 --- a/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx +++ b/Modules/IO/JPEG2000/test/itkJPEG2000ImageIOTest06.cxx @@ -48,8 +48,8 @@ itkJPEG2000ImageIOTest06(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); const std::string inputFilename = argv[1]; const std::string outputFilename = argv[2]; diff --git a/Modules/IO/LSM/include/itkLSMImageIOFactory.h b/Modules/IO/LSM/include/itkLSMImageIOFactory.h index 742ae23dc6b..d32178c3c75 100644 --- a/Modules/IO/LSM/include/itkLSMImageIOFactory.h +++ b/Modules/IO/LSM/include/itkLSMImageIOFactory.h @@ -67,7 +67,7 @@ class ITKIOLSM_EXPORT LSMImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - LSMImageIOFactory::Pointer lsmFactory = LSMImageIOFactory::New(); + auto lsmFactory = LSMImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(lsmFactory); } diff --git a/Modules/IO/LSM/test/itkLSMImageIOTest.cxx b/Modules/IO/LSM/test/itkLSMImageIOTest.cxx index 2b14d2ebcc4..d335627168c 100644 --- a/Modules/IO/LSM/test/itkLSMImageIOTest.cxx +++ b/Modules/IO/LSM/test/itkLSMImageIOTest.cxx @@ -41,11 +41,11 @@ itkLSMImageIOTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using ImageIOType = itk::LSMImageIO; - ReaderType::Pointer reader = ReaderType::New(); - const char * inputFileName = argv[1]; + auto reader = ReaderType::New(); + const char * inputFileName = argv[1]; reader->SetFileName(inputFileName); - ImageIOType::Pointer lsmImageIO = ImageIOType::New(); + auto lsmImageIO = ImageIOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(lsmImageIO, LSMImageIO, TIFFImageIO); @@ -64,7 +64,7 @@ itkLSMImageIOTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(lsmImageIO->Write(buffer)); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(reader->GetOutput()); diff --git a/Modules/IO/MINC/include/itkMINCImageIOFactory.h b/Modules/IO/MINC/include/itkMINCImageIOFactory.h index 6bf34c6cb8e..eb0d6a46a52 100644 --- a/Modules/IO/MINC/include/itkMINCImageIOFactory.h +++ b/Modules/IO/MINC/include/itkMINCImageIOFactory.h @@ -66,7 +66,7 @@ class ITKIOMINC_EXPORT MINCImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - MINCImageIOFactory::Pointer MINCFactory = MINCImageIOFactory::New(); + auto MINCFactory = MINCImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(MINCFactory); } diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest.cxx index d1c0c8d1478..7e99201fae9 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest.cxx @@ -317,7 +317,7 @@ MINCReadWriteTest(const char * fileName, const char * minc_storage_type, double origin[i] = static_cast(i) * 5.0; } - typename ImageType::Pointer im = ImageType::New(); + auto im = ImageType::New(); typename ImageType::RegionType region; region.SetSize(size); @@ -572,7 +572,7 @@ MINCReadWriteTestVector(const char * fileName, spacing[i] = 1.0 + static_cast(i); origin[i] = static_cast(i) * 5.0; } - typename ImageType::Pointer im = ImageType::New(); + auto im = ImageType::New(); // itk::IOTestHelper::AllocateImageFromRegionAndSpacing(imageRegion,spacing); typename ImageType::RegionType region; diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx index 13d3e309c4a..eea62072d77 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest2.cxx @@ -48,8 +48,8 @@ itkMINCImageIOTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetImageIO(mincIO1); writer->SetImageIO(mincIO2); diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx index 48873230b9a..af5a5c3b10e 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest4.cxx @@ -46,9 +46,9 @@ test_image_moments(const char * input_image, using MomentsCalculatorType = itk::ImageMomentsCalculator; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); - typename MomentsCalculatorType::Pointer calculator = MomentsCalculatorType::New(); + auto calculator = MomentsCalculatorType::New(); // reader->SetImageIO( mincIO1 ); @@ -88,7 +88,7 @@ test_image_moments(const char * input_image, if (output_image) { - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(output_image); writer->SetInput(reader->GetOutput()); writer->Update(); diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx index 01b1a78c67d..06e1edac1b7 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest_2D.cxx @@ -44,9 +44,9 @@ test_image_moments(const char * input_image, using MomentsCalculatorType = itk::ImageMomentsCalculator; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); - typename MomentsCalculatorType::Pointer calculator = MomentsCalculatorType::New(); + auto calculator = MomentsCalculatorType::New(); reader->SetFileName(input_image); @@ -79,7 +79,7 @@ test_image_moments(const char * input_image, if (output_image) { - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(output_image); writer->SetInput(reader->GetOutput()); writer->Update(); diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest_4D.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest_4D.cxx index 2adb2cc5b0d..dee59c2590e 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest_4D.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest_4D.cxx @@ -43,8 +43,8 @@ itkMINCImageIOTest_4D(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/IO/MINC/test/itkMINCImageIOTest_Labels.cxx b/Modules/IO/MINC/test/itkMINCImageIOTest_Labels.cxx index 874098d0f1d..ea1a4303514 100644 --- a/Modules/IO/MINC/test/itkMINCImageIOTest_Labels.cxx +++ b/Modules/IO/MINC/test/itkMINCImageIOTest_Labels.cxx @@ -43,8 +43,8 @@ itkMINCImageIOTest_Labels(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/IO/MRC/include/itkMRCImageIOFactory.h b/Modules/IO/MRC/include/itkMRCImageIOFactory.h index 7c605958d96..e891a439b03 100644 --- a/Modules/IO/MRC/include/itkMRCImageIOFactory.h +++ b/Modules/IO/MRC/include/itkMRCImageIOFactory.h @@ -73,7 +73,7 @@ class ITKIOMRC_EXPORT MRCImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - MRCImageIOFactory::Pointer vtkFactory = MRCImageIOFactory::New(); + auto vtkFactory = MRCImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(vtkFactory); } diff --git a/Modules/IO/MRC/test/itkMRCImageIOTest.cxx b/Modules/IO/MRC/test/itkMRCImageIOTest.cxx index a6c2c42d64f..6ed5fd1b5a3 100644 --- a/Modules/IO/MRC/test/itkMRCImageIOTest.cxx +++ b/Modules/IO/MRC/test/itkMRCImageIOTest.cxx @@ -51,7 +51,7 @@ MRCImageIOTester::Write(const std::string & filePrefix, std::string using PixelType = typename ImageType::PixelType; // allocate an 10x10x10 image - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType m_ImageSize; m_ImageSize.Fill(10); image->SetRegions(m_ImageSize); @@ -82,12 +82,12 @@ MRCImageIOTester::Write(const std::string & filePrefix, std::string } using ImageFileWriterType = itk::ImageFileWriter; - typename ImageFileWriterType::Pointer writer = ImageFileWriterType::New(); + auto writer = ImageFileWriterType::New(); writer->SetInput(image); // force use of MRCImageIO using IOType = itk::MRCImageIO; - IOType::Pointer mrcIO = IOType::New(); + auto mrcIO = IOType::New(); writer->SetImageIO(mrcIO); std::ostringstream m_NameWithIndex; @@ -149,11 +149,11 @@ MRCImageIOTester::Read(const std::string & filePrefix, std::string & using PixelType = typename ImageType::PixelType; using ImageFileReaderType = itk::ImageFileReader; - typename ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); // force use of MRCImageIO using IOType = itk::MRCImageIO; - IOType::Pointer mrcIO = IOType::New(); + auto mrcIO = IOType::New(); reader->SetImageIO(mrcIO); // construct the image filename @@ -465,7 +465,7 @@ itkMRCImageIOTest(int argc, char * argv[]) // Exercise other methods to improve coverage using IOType = itk::MRCImageIO; - IOType::Pointer mrcIO = IOType::New(); + auto mrcIO = IOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(mrcIO, MRCImageIO, StreamingImageIOBase); diff --git a/Modules/IO/MRC/test/itkMRCImageIOTest2.cxx b/Modules/IO/MRC/test/itkMRCImageIOTest2.cxx index 155cc0a5f4e..f126ed8cf07 100644 --- a/Modules/IO/MRC/test/itkMRCImageIOTest2.cxx +++ b/Modules/IO/MRC/test/itkMRCImageIOTest2.cxx @@ -34,7 +34,7 @@ Test(const std::string & inFileName, const std::string & outFileName, const std: using ImageType = TImageType; using ImageFileReaderType = itk::ImageFileReader; - typename ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); reader->SetFileName(inFileName); reader->UpdateLargestPossibleRegion(); @@ -86,14 +86,14 @@ Test(const std::string & inFileName, const std::string & outFileName, const std: } using HashFilter = itk::Testing::HashImageFilter; - typename HashFilter::Pointer hasher = HashFilter::New(); + auto hasher = HashFilter::New(); hasher->SetInput(image); hasher->Update(); ITK_TEST_EXPECT_EQUAL(md5, hasher->GetHash()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(outFileName); writer->Update(); diff --git a/Modules/IO/MeshBYU/include/itkBYUMeshIOFactory.h b/Modules/IO/MeshBYU/include/itkBYUMeshIOFactory.h index 15612bc4951..cfa0fcf4800 100644 --- a/Modules/IO/MeshBYU/include/itkBYUMeshIOFactory.h +++ b/Modules/IO/MeshBYU/include/itkBYUMeshIOFactory.h @@ -57,7 +57,7 @@ class ITKIOMeshBYU_EXPORT BYUMeshIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - BYUMeshIOFactory::Pointer byuFactory = BYUMeshIOFactory::New(); + auto byuFactory = BYUMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(byuFactory); } diff --git a/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h b/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h index 47db0a78b03..673a7c4e8d3 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h +++ b/Modules/IO/MeshBase/include/itkMeshFileTestHelper.h @@ -308,7 +308,7 @@ test(char * INfilename, char * OUTfilename, bool IsBinary) return EXIT_SUCCESS; } - typename MeshFileReaderType::Pointer reader1 = MeshFileReaderType::New(); + auto reader1 = MeshFileReaderType::New(); reader1->SetFileName(OUTfilename); try { diff --git a/Modules/IO/MeshBase/test/itkMeshFileReaderTest.cxx b/Modules/IO/MeshBase/test/itkMeshFileReaderTest.cxx index 203c202322d..67d42b4ab2a 100644 --- a/Modules/IO/MeshBase/test/itkMeshFileReaderTest.cxx +++ b/Modules/IO/MeshBase/test/itkMeshFileReaderTest.cxx @@ -37,7 +37,7 @@ itkMeshFileReaderTest(int argc, char * argv[]) using MeshType = itk::QuadEdgeMesh; using ReaderType = itk::MeshFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(reader, MeshFileReader, MeshSource); diff --git a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIOFactory.h b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIOFactory.h index 6435f7f1e45..571bc05ae29 100644 --- a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIOFactory.h +++ b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferAsciiMeshIOFactory.h @@ -56,7 +56,7 @@ class ITKIOMeshFreeSurfer_EXPORT FreeSurferAsciiMeshIOFactory : public ObjectFac static void RegisterOneFactory() { - FreeSurferAsciiMeshIOFactory::Pointer freesurferFactory = FreeSurferAsciiMeshIOFactory::New(); + auto freesurferFactory = FreeSurferAsciiMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(freesurferFactory); } diff --git a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIOFactory.h b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIOFactory.h index 4415ff110f5..e7e46a39166 100644 --- a/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIOFactory.h +++ b/Modules/IO/MeshFreeSurfer/include/itkFreeSurferBinaryMeshIOFactory.h @@ -56,7 +56,7 @@ class ITKIOMeshFreeSurfer_EXPORT FreeSurferBinaryMeshIOFactory : public ObjectFa static void RegisterOneFactory() { - FreeSurferBinaryMeshIOFactory::Pointer freesurferFactory = FreeSurferBinaryMeshIOFactory::New(); + auto freesurferFactory = FreeSurferBinaryMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(freesurferFactory); } diff --git a/Modules/IO/MeshGifti/include/itkGiftiMeshIOFactory.h b/Modules/IO/MeshGifti/include/itkGiftiMeshIOFactory.h index 0db8c2eec8a..7a2b964124e 100644 --- a/Modules/IO/MeshGifti/include/itkGiftiMeshIOFactory.h +++ b/Modules/IO/MeshGifti/include/itkGiftiMeshIOFactory.h @@ -56,7 +56,7 @@ class ITKIOMeshGifti_EXPORT GiftiMeshIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - GiftiMeshIOFactory::Pointer giftiFactory = GiftiMeshIOFactory::New(); + auto giftiFactory = GiftiMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(giftiFactory); } diff --git a/Modules/IO/MeshOBJ/include/itkOBJMeshIOFactory.h b/Modules/IO/MeshOBJ/include/itkOBJMeshIOFactory.h index 237dd822e80..0fdb551ac1e 100644 --- a/Modules/IO/MeshOBJ/include/itkOBJMeshIOFactory.h +++ b/Modules/IO/MeshOBJ/include/itkOBJMeshIOFactory.h @@ -57,7 +57,7 @@ class ITKIOMeshOBJ_EXPORT OBJMeshIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - OBJMeshIOFactory::Pointer objFactory = OBJMeshIOFactory::New(); + auto objFactory = OBJMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(objFactory); } diff --git a/Modules/IO/MeshOFF/include/itkOFFMeshIOFactory.h b/Modules/IO/MeshOFF/include/itkOFFMeshIOFactory.h index 54edf424847..77f8c98d707 100644 --- a/Modules/IO/MeshOFF/include/itkOFFMeshIOFactory.h +++ b/Modules/IO/MeshOFF/include/itkOFFMeshIOFactory.h @@ -57,7 +57,7 @@ class ITKIOMeshOFF_EXPORT OFFMeshIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - OFFMeshIOFactory::Pointer offFactory = OFFMeshIOFactory::New(); + auto offFactory = OFFMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(offFactory); } diff --git a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIOFactory.h b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIOFactory.h index b2dd736ee58..932d7c9ed23 100644 --- a/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIOFactory.h +++ b/Modules/IO/MeshVTK/include/itkVTKPolyDataMeshIOFactory.h @@ -57,7 +57,7 @@ class ITKIOMeshVTK_EXPORT VTKPolyDataMeshIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - VTKPolyDataMeshIOFactory::Pointer vtkFactory = VTKPolyDataMeshIOFactory::New(); + auto vtkFactory = VTKPolyDataMeshIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(vtkFactory); } diff --git a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx index 62b74d4a00a..3cbd12dded5 100644 --- a/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx +++ b/Modules/IO/MeshVTK/test/itkMeshFileWriteReadTensorTest.cxx @@ -53,11 +53,11 @@ itkMeshFileWriteReadTensorTest(int argc, char * argv[]) Mesh2dType::PixelType pixel2d; pixel2d.Fill(0); - Mesh2dType::Pointer mesh2d = Mesh2dType::New(); + auto mesh2d = Mesh2dType::New(); mesh2d->SetPoint(0, point2d); mesh2d->SetPointData(0, pixel2d); - MeshWriter2dType::Pointer mesh2dWriter = MeshWriter2dType::New(); + auto mesh2dWriter = MeshWriter2dType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(mesh2dWriter, MeshFileWriter, ProcessObject); @@ -85,11 +85,11 @@ itkMeshFileWriteReadTensorTest(int argc, char * argv[]) Mesh3dType::PixelType pixel3d; pixel3d.Fill(0); - Mesh3dType::Pointer mesh3d = Mesh3dType::New(); + auto mesh3d = Mesh3dType::New(); mesh3d->SetPoint(0, point3d); mesh3d->SetPointData(0, pixel3d); - MeshWriter3dType::Pointer mesh3dWriter = MeshWriter3dType::New(); + auto mesh3dWriter = MeshWriter3dType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(mesh3dWriter, MeshFileWriter, ProcessObject); diff --git a/Modules/IO/Meta/include/itkMetaImageIOFactory.h b/Modules/IO/Meta/include/itkMetaImageIOFactory.h index 2582c03dc14..2caf44edc68 100644 --- a/Modules/IO/Meta/include/itkMetaImageIOFactory.h +++ b/Modules/IO/Meta/include/itkMetaImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIOMeta_EXPORT MetaImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - MetaImageIOFactory::Pointer metaFactory = MetaImageIOFactory::New(); + auto metaFactory = MetaImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx b/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx index af21b0924c5..170965c537d 100644 --- a/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx +++ b/Modules/IO/Meta/test/itkLargeMetaImageWriteReadTest.cxx @@ -49,7 +49,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) itk::TimeProbesCollectorBase chronometer; { // begin write block - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); index.Fill(0); region.SetSize(size); region.SetIndex(index); @@ -89,7 +89,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) std::cout << "Trying to write the image to disk" << std::endl; try { - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(filename); chronometer.Start("Write"); @@ -104,7 +104,7 @@ ActualTest(std::string filename, typename TImageType::SizeType size) } // end write block to free the memory std::cout << "Trying to read the image back from disk" << std::endl; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); itk::MetaImageIO::Pointer io = itk::MetaImageIO::New(); diff --git a/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx b/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx index 7679f205978..91a0249fa94 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOMetaDataTest.cxx @@ -32,7 +32,7 @@ ReadImage(const std::string & fileName) { typename TImage::Pointer image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(fileName.c_str()); itk::MetaImageIO::Pointer io = itk::MetaImageIO::New(); @@ -63,7 +63,7 @@ void WriteImage(typename ImageType::Pointer & image, const std::string & fileName) { using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(fileName.c_str()); @@ -161,7 +161,7 @@ itkMetaImageIOMetaDataTest(int argc, char * argv[]) using ImageType = itk::Image; using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ImageType::SizeValueType size[Dim] = { 32, 32 }; source->SetSize(size); source->SetMin(itk::NumericTraits::min()); diff --git a/Modules/IO/Meta/test/itkMetaImageIOTest.cxx b/Modules/IO/Meta/test/itkMetaImageIOTest.cxx index ecdf60aa9b9..bf5c784217f 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOTest.cxx @@ -45,7 +45,7 @@ itkMetaImageIOTest(int argc, char * argv[]) // Force use of MetaIO using IOType = itk::MetaImageIO; - IOType::Pointer metaIn = IOType::New(); + auto metaIn = IOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(metaIn, MetaImageIO, ImageIOBase); @@ -96,7 +96,7 @@ itkMetaImageIOTest(int argc, char * argv[]) // Generate test image itk::ImageFileWriter::Pointer writer; writer = itk::ImageFileWriter::New(); - IOType::Pointer metaOut = IOType::New(); + auto metaOut = IOType::New(); writer->SetImageIO(metaOut); writer->SetInput(reader->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx b/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx index 9e837ea58c2..d25015bb967 100644 --- a/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx +++ b/Modules/IO/Meta/test/itkMetaImageIOTest2.cxx @@ -43,7 +43,7 @@ TestUnknowMetaDataBug(const std::string & fname) ImageType::SizeType size = { { 32, 32 } }; region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); image->FillBuffer(0); @@ -55,7 +55,7 @@ TestUnknowMetaDataBug(const std::string & fname) dict, "AnUnsuportedComplexInitalized", std::complex(1.234560F)); using Hasher = itk::Testing::HashImageFilter; - Hasher::Pointer hasher = Hasher::New(); + auto hasher = Hasher::New(); hasher->SetInput(image); hasher->InPlaceOff(); hasher->Update(); diff --git a/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx b/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx index 91735532f2d..bc1b7eb3afc 100644 --- a/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageStreamingIOTest.cxx @@ -42,15 +42,15 @@ itkMetaImageStreamingIOTest(int ac, char * av[]) using StreamingFilterType = itk::StreamingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - StreamingFilterType::Pointer streamer = StreamingFilterType::New(); + auto streamer = StreamingFilterType::New(); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); - IOType::Pointer metaIn = IOType::New(); - IOType::Pointer metaOut = IOType::New(); + auto metaIn = IOType::New(); + auto metaOut = IOType::New(); reader->SetImageIO(metaIn); writer->SetImageIO(metaOut); diff --git a/Modules/IO/Meta/test/itkMetaImageStreamingWriterIOTest.cxx b/Modules/IO/Meta/test/itkMetaImageStreamingWriterIOTest.cxx index 787f8ebdc96..43657936480 100644 --- a/Modules/IO/Meta/test/itkMetaImageStreamingWriterIOTest.cxx +++ b/Modules/IO/Meta/test/itkMetaImageStreamingWriterIOTest.cxx @@ -42,7 +42,7 @@ itkMetaImageStreamingWriterIOTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(metaImageIO); reader->SetFileName(argv[1]); reader->SetUseStreaming(true); @@ -72,7 +72,7 @@ itkMetaImageStreamingWriterIOTest(int argc, char * argv[]) unsigned int zsize = fullsize[2] / numberOfPieces; // Setup the writer - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); for (unsigned int i = 0; i < numberOfPieces; ++i) diff --git a/Modules/IO/NIFTI/include/itkNiftiImageIOFactory.h b/Modules/IO/NIFTI/include/itkNiftiImageIOFactory.h index b05a9a4ce49..93e1b37c865 100644 --- a/Modules/IO/NIFTI/include/itkNiftiImageIOFactory.h +++ b/Modules/IO/NIFTI/include/itkNiftiImageIOFactory.h @@ -58,7 +58,7 @@ class ITKIONIFTI_EXPORT NiftiImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - NiftiImageIOFactory::Pointer metaFactory = NiftiImageIOFactory::New(); + auto metaFactory = NiftiImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/NIFTI/test/itkExtractSlice.cxx b/Modules/IO/NIFTI/test/itkExtractSlice.cxx index 47b949a30e4..8abad7d0f55 100644 --- a/Modules/IO/NIFTI/test/itkExtractSlice.cxx +++ b/Modules/IO/NIFTI/test/itkExtractSlice.cxx @@ -40,7 +40,7 @@ itkExtractSlice(int argc, char * argv[]) using ExtractType = itk::ExtractImageFilter; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->UpdateOutputInformation(); @@ -54,13 +54,13 @@ itkExtractSlice(int argc, char * argv[]) outRegion.SetSize(outSize); outRegion.SetIndex(outIndex); - ExtractType::Pointer extractFilter = ExtractType::New(); + auto extractFilter = ExtractType::New(); extractFilter->SetDirectionCollapseToSubmatrix(); extractFilter->InPlaceOn(); extractFilter->SetInput(reader->GetOutput()); extractFilter->SetExtractionRegion(outRegion); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(extractFilter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx index 68b68de16c7..47cd56be5ca 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest12.cxx @@ -54,7 +54,7 @@ itkNiftiImageIOTest12(int ac, char * av[]) #endif region.SetIndex(startIndex); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->SetNumberOfComponentsPerPixel(3); image->SetOrigin(itk::MakePoint(-7.0, -13.0, -19.0)); @@ -80,7 +80,7 @@ itkNiftiImageIOTest12(int ac, char * av[]) using Hasher = itk::Testing::HashImageFilter; auto myHasher = [&](ImageType::Pointer imptr) -> std::string { - Hasher::Pointer originalHasher = Hasher::New(); + auto originalHasher = Hasher::New(); originalHasher->InPlaceOff(); originalHasher->SetInput(imptr); originalHasher->Update(); diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest2.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest2.cxx index a0a2f2a34b9..dfeab37d732 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest2.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest2.cxx @@ -49,7 +49,7 @@ itkNiftiImageIOTest2(int ac, char * av[]) { using ImageReaderType = itk::ImageFileReader; itk::NiftiImageIO::Pointer io = itk::NiftiImageIO::New(); - ImageReaderType::Pointer imageReader = ImageReaderType::New(); + auto imageReader = ImageReaderType::New(); imageReader->SetImageIO(io); imageReader->SetFileName(arg2); imageReader->Update(); diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx index 01fd8b9ae20..ebd85812cd1 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest4.cxx @@ -79,8 +79,8 @@ itkNiftiImageIOTest4(int ac, char * av[]) using TransformType = itk::AffineTransform; using AxisType = itk::Vector; - TransformType::Pointer transform = TransformType::New(); - AxisType axis; + auto transform = TransformType::New(); + AxisType axis; axis[0] = 1.0; axis[1] = 0.0; axis[2] = 0.0; diff --git a/Modules/IO/NIFTI/test/itkNiftiImageIOTest5.cxx b/Modules/IO/NIFTI/test/itkNiftiImageIOTest5.cxx index 3425d4a0fbc..d8b1a3d3fff 100644 --- a/Modules/IO/NIFTI/test/itkNiftiImageIOTest5.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiImageIOTest5.cxx @@ -146,7 +146,7 @@ SlopeInterceptWriteTest() size[2] = 4; region.SetSize(size); region.SetIndex(start); - typename OutputImageType::Pointer outputimage = OutputImageType::New(); + auto outputimage = OutputImageType::New(); outputimage->SetRegions(region); outputimage->Allocate(); using OutputIteratorType = itk::ImageRegionIterator; @@ -161,8 +161,8 @@ SlopeInterceptWriteTest() itout.Set(static_cast(i)); } using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); - itk::NiftiImageIO::Pointer niftiImageIO(itk::NiftiImageIO::New()); + auto writer = WriterType::New(); + itk::NiftiImageIO::Pointer niftiImageIO(itk::NiftiImageIO::New()); niftiImageIO->SetRescaleSlope(1.0 / 256.0); niftiImageIO->SetRescaleIntercept(-10.0); writer->SetImageIO(niftiImageIO); diff --git a/Modules/IO/NIFTI/test/itkNiftiReadAnalyzeTest.cxx b/Modules/IO/NIFTI/test/itkNiftiReadAnalyzeTest.cxx index 6952b403872..27375ba2d53 100644 --- a/Modules/IO/NIFTI/test/itkNiftiReadAnalyzeTest.cxx +++ b/Modules/IO/NIFTI/test/itkNiftiReadAnalyzeTest.cxx @@ -199,7 +199,7 @@ ReadImage(const std::string & fileName, { using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); typename itk::NiftiImageIO::Pointer imageIO = itk::NiftiImageIO::New(); { imageIO->SetLegacyAnalyze75Mode(analyze_mode); diff --git a/Modules/IO/NRRD/include/itkNrrdImageIOFactory.h b/Modules/IO/NRRD/include/itkNrrdImageIOFactory.h index ccd8c976691..b5107417fd8 100644 --- a/Modules/IO/NRRD/include/itkNrrdImageIOFactory.h +++ b/Modules/IO/NRRD/include/itkNrrdImageIOFactory.h @@ -57,7 +57,7 @@ class ITKIONRRD_EXPORT NrrdImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - NrrdImageIOFactory::Pointer nrrdFactory = NrrdImageIOFactory::New(); + auto nrrdFactory = NrrdImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(nrrdFactory); } diff --git a/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx index ae3b675c397..294e8462050 100644 --- a/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdComplexImageReadTest.cxx @@ -36,7 +36,7 @@ itkNrrdComplexImageReadTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdComplexImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdComplexImageReadWriteTest.cxx index 8625d9272d6..b422c6be610 100644 --- a/Modules/IO/NRRD/test/itkNrrdComplexImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdComplexImageReadWriteTest.cxx @@ -37,7 +37,7 @@ itkNrrdComplexImageReadWriteTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadTest.cxx index 97c380b1e98..1cf43f268ab 100644 --- a/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadTest.cxx @@ -36,7 +36,7 @@ itkNrrdCovariantVectorImageReadTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadWriteTest.cxx index 88a09e151f3..ec06416c7c3 100644 --- a/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdCovariantVectorImageReadWriteTest.cxx @@ -37,7 +37,7 @@ itkNrrdCovariantVectorImageReadWriteTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTensorDoubleWriteTensorDoubleTest.cxx b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTensorDoubleWriteTensorDoubleTest.cxx index 85738ac1553..2f79de5f85f 100644 --- a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTensorDoubleWriteTensorDoubleTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTensorDoubleWriteTensorDoubleTest.cxx @@ -37,7 +37,7 @@ itkNrrdDiffusionTensor3DImageReadTensorDoubleWriteTensorDoubleTest(int ac, char using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx index 127e2f6994a..25c44e54237 100644 --- a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadTest.cxx @@ -36,7 +36,7 @@ itkNrrdDiffusionTensor3DImageReadTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadWriteTest.cxx index 7c20e252925..b4eb75d917b 100644 --- a/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdDiffusionTensor3DImageReadWriteTest.cxx @@ -37,7 +37,7 @@ itkNrrdDiffusionTensor3DImageReadWriteTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx index a44d11f17c2..da4b2fcee7c 100644 --- a/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdImageReadWriteTest.cxx @@ -42,7 +42,7 @@ itkNrrdImageReadWriteTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx b/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx index ea02e4d4622..5f577b36310 100644 --- a/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdMetaDataTest.cxx @@ -42,7 +42,7 @@ itkNrrdMetaDataTest(int ac, char * av[]) // Image type using ImageType = itk::Image; // create dummy image - ImageType::Pointer image1 = ImageType::New(); + auto image1 = ImageType::New(); ImageType::SizeType size = { { 2, 2, 2 } }; image1->SetRegions(size); image1->Allocate(); @@ -61,12 +61,12 @@ itkNrrdMetaDataTest(int ac, char * av[]) std::string fname = av[1]; fname += "/metadatatest.nrrd"; // set up writer - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetImageIO(itk::NrrdImageIO::New()); writer->SetFileName(fname.c_str()); writer->SetInput(image1); // set up reader - ImageReaderType::Pointer reader = ImageReaderType::New(); + auto reader = ImageReaderType::New(); reader->SetFileName(fname.c_str()); reader->SetImageIO(itk::NrrdImageIO::New()); ImageType::Pointer image2; diff --git a/Modules/IO/NRRD/test/itkNrrdVectorImageReadTest.cxx b/Modules/IO/NRRD/test/itkNrrdVectorImageReadTest.cxx index f2c13e56b66..1091d828490 100644 --- a/Modules/IO/NRRD/test/itkNrrdVectorImageReadTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdVectorImageReadTest.cxx @@ -36,7 +36,7 @@ itkNrrdVectorImageReadTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/NRRD/test/itkNrrdVectorImageReadWriteTest.cxx b/Modules/IO/NRRD/test/itkNrrdVectorImageReadWriteTest.cxx index 002a0afdda4..472097e3c78 100644 --- a/Modules/IO/NRRD/test/itkNrrdVectorImageReadWriteTest.cxx +++ b/Modules/IO/NRRD/test/itkNrrdVectorImageReadWriteTest.cxx @@ -37,7 +37,7 @@ itkNrrdVectorImageReadWriteTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetImageIO(itk::NrrdImageIO::New()); diff --git a/Modules/IO/PNG/include/itkPNGImageIOFactory.h b/Modules/IO/PNG/include/itkPNGImageIOFactory.h index 79b9a555c36..c383de017c7 100644 --- a/Modules/IO/PNG/include/itkPNGImageIOFactory.h +++ b/Modules/IO/PNG/include/itkPNGImageIOFactory.h @@ -62,7 +62,7 @@ class ITKIOPNG_EXPORT PNGImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - PNGImageIOFactory::Pointer pngFactory = PNGImageIOFactory::New(); + auto pngFactory = PNGImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(pngFactory); } diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest.cxx index 3d97ac180c7..4b22ad710de 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest.cxx @@ -168,7 +168,7 @@ itkPNGImageIOTest(int argc, char * argv[]) // 3D non-degenerate volume // - ImageType3D::Pointer volume = ImageType3D::New(); + auto volume = ImageType3D::New(); ImageType3D::SizeType size3D; size3D.Fill(10); @@ -183,7 +183,7 @@ itkPNGImageIOTest(int argc, char * argv[]) volume->FillBuffer(0); using WriterType3D = itk::ImageFileWriter; - WriterType3D::Pointer writer3D = WriterType3D::New(); + auto writer3D = WriterType3D::New(); writer3D->SetFileName(argv[2]); writer3D->SetImageIO(io); @@ -196,7 +196,7 @@ itkPNGImageIOTest(int argc, char * argv[]) // 3D degenerate volume // - ImageType3D::Pointer degenerateVolume = ImageType3D::New(); + auto degenerateVolume = ImageType3D::New(); // Collapse the first dimension. size3D[0] = 1; region3D.SetSize(size3D); @@ -214,7 +214,7 @@ itkPNGImageIOTest(int argc, char * argv[]) // // 2D non-degenerate volume // - ImageType2D::Pointer image = ImageType2D::New(); + auto image = ImageType2D::New(); ImageType2D::SizeType size2D; size2D.Fill(10); @@ -229,7 +229,7 @@ itkPNGImageIOTest(int argc, char * argv[]) image->FillBuffer(0); using WriterType2D = itk::ImageFileWriter; - WriterType2D::Pointer writer2D = WriterType2D::New(); + auto writer2D = WriterType2D::New(); writer2D->SetFileName(argv[2]); writer2D->SetImageIO(io); @@ -241,7 +241,7 @@ itkPNGImageIOTest(int argc, char * argv[]) // // 2D degenerate volume // - ImageType2D::Pointer degenerateImage = ImageType2D::New(); + auto degenerateImage = ImageType2D::New(); // Collapse the first dimension size2D[0] = 1; @@ -259,7 +259,7 @@ itkPNGImageIOTest(int argc, char * argv[]) // // 1D image // - ImageType1D::Pointer line = ImageType1D::New(); + auto line = ImageType1D::New(); ImageType1D::SizeType size1D; size1D.Fill(10); @@ -274,7 +274,7 @@ itkPNGImageIOTest(int argc, char * argv[]) line->FillBuffer(0); using WriterType1D = itk::ImageFileWriter; - WriterType1D::Pointer writer1D = WriterType1D::New(); + auto writer1D = WriterType1D::New(); writer1D->SetFileName(argv[2]); writer1D->SetImageIO(io); writer1D->SetInput(line); diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx index c749c3ca7c7..87dc587037a 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest2.cxx @@ -147,7 +147,7 @@ itkPNGImageIOTest2(int argc, char * argv[]) } // Actually reading an RGBA image - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetImageIO(io); @@ -186,7 +186,7 @@ itkPNGImageIOTest2(int argc, char * argv[]) ImageType::Pointer inputImage = reader->GetOutput(); // Write the grayscale output image - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(inputImage); writer->SetImageIO(io); writer->SetFileName(argv[2]); diff --git a/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx b/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx index 6c3f0dc6950..6f96b924932 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTest3.cxx @@ -41,7 +41,7 @@ itkPNGImageIOTest3(int argc, char * argv[]) // Read the input image itk::PNGImageIO::Pointer io = itk::PNGImageIO::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->SetImageIO(io); diff --git a/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx b/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx index cdd74e204b6..e56c72c3912 100644 --- a/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx +++ b/Modules/IO/PNG/test/itkPNGImageIOTestPalette.cxx @@ -54,12 +54,12 @@ itkPNGImageIOTestPalette(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; using IOType = itk::PNGImageIO; - IOType::Pointer io = IOType::New(); + auto io = IOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(io, PNGImageIO, ImageIOBase); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); ITK_TEST_SET_GET_BOOLEAN(io, ExpandRGBPalette, expandRGBPalette); diff --git a/Modules/IO/PhilipsREC/include/itkPhilipsRECImageIOFactory.h b/Modules/IO/PhilipsREC/include/itkPhilipsRECImageIOFactory.h index 6aec57639b0..1a24405f2d0 100644 --- a/Modules/IO/PhilipsREC/include/itkPhilipsRECImageIOFactory.h +++ b/Modules/IO/PhilipsREC/include/itkPhilipsRECImageIOFactory.h @@ -68,7 +68,7 @@ class ITKIOPhilipsREC_EXPORT PhilipsRECImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - PhilipsRECImageIOFactory::Pointer factory = PhilipsRECImageIOFactory::New(); + auto factory = PhilipsRECImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(factory); } diff --git a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx index 4d92b123244..26634856938 100644 --- a/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx +++ b/Modules/IO/PhilipsREC/src/itkPhilipsRECImageIO.cxx @@ -523,7 +523,7 @@ PhilipsRECImageIO::CanReadFile(const char * FileNameToRead) // Zero out par_parameter. memset(&par, 0, sizeof(struct par_parameter)); - PhilipsPAR::Pointer philipsPAR = PhilipsPAR::New(); + auto philipsPAR = PhilipsPAR::New(); try { philipsPAR->ReadPAR(HeaderFileName, &par); @@ -552,7 +552,7 @@ PhilipsRECImageIO::ReadImageInformation() memset(&par, 0, sizeof(struct par_parameter)); // Read PAR file. - PhilipsPAR::Pointer philipsPAR = PhilipsPAR::New(); + auto philipsPAR = PhilipsPAR::New(); try { philipsPAR->ReadPAR(HeaderFileName, &par); @@ -568,8 +568,8 @@ PhilipsRECImageIO::ReadImageInformation() } // Get all the diffusion info, rescale, etc. - GradientBvalueContainerType::Pointer diffusionBvalueVector = GradientBvalueContainerType::New(); - GradientDirectionContainerType::Pointer diffusionGradientOrientationVector = GradientDirectionContainerType::New(); + auto diffusionBvalueVector = GradientBvalueContainerType::New(); + auto diffusionGradientOrientationVector = GradientDirectionContainerType::New(); if (!philipsPAR->GetDiffusionGradientOrientationAndBValues( HeaderFileName, diffusionGradientOrientationVector, diffusionBvalueVector)) { @@ -579,7 +579,7 @@ PhilipsRECImageIO::ReadImageInformation() } // Get ASL label types. - LabelTypesASLContainerType::Pointer labelTypesASLVector = LabelTypesASLContainerType::New(); + auto labelTypesASLVector = LabelTypesASLContainerType::New(); if (!philipsPAR->GetLabelTypesASL(HeaderFileName, labelTypesASLVector)) { ExceptionObject exception(__FILE__, __LINE__, "Problem reading ASL label types from PAR file", ITK_LOCATION); @@ -886,7 +886,7 @@ PhilipsRECImageIO::ReadImageInformation() EncapsulateMetaData(thisDic, PAR_ReconstructionNr, par.recno); EncapsulateMetaData(thisDic, PAR_ScanDuration, par.scan_duration); EncapsulateMetaData(thisDic, PAR_MaxNumberOfCardiacPhases, par.cardiac_phases); - TriggerTimesContainerType::Pointer triggerTimes = TriggerTimesContainerType::New(); + auto triggerTimes = TriggerTimesContainerType::New(); triggerTimes->resize(par.cardiac_phases); for (unsigned int ttime_index = 0; ttime_index < (unsigned int)par.cardiac_phases; ++ttime_index) @@ -896,7 +896,7 @@ PhilipsRECImageIO::ReadImageInformation() EncapsulateMetaData(thisDic, PAR_TriggerTimes, triggerTimes); EncapsulateMetaData(thisDic, PAR_MaxNumberOfEchoes, par.echoes); - EchoTimesContainerType::Pointer echoTimes = EchoTimesContainerType::New(); + auto echoTimes = EchoTimesContainerType::New(); echoTimes->resize(par.echoes); for (unsigned int echo_index = 0; echo_index < (unsigned int)par.echoes; ++echo_index) @@ -913,7 +913,7 @@ PhilipsRECImageIO::ReadImageInformation() EncapsulateMetaData(thisDic, PAR_ScanMode, std::string(par.scan_mode)); EncapsulateMetaData(thisDic, PAR_NumberOfAverages, par.num_averages); EncapsulateMetaData(thisDic, PAR_ScanResolution, ScanResolutionType(par.scan_resolution)); - RepetitionTimesContainerType::Pointer repTimes = RepetitionTimesContainerType::New(); + auto repTimes = RepetitionTimesContainerType::New(); repTimes->resize(par.mixes); // This has only been verified using a // Look-Locker sequence and may not be valid. diff --git a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOOrientationTest.cxx b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOOrientationTest.cxx index 84ec2eb35e9..e362a93dd06 100644 --- a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOOrientationTest.cxx +++ b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOOrientationTest.cxx @@ -50,29 +50,29 @@ itkPhilipsRECImageIOOrientationTest(int argc, char * argv[]) using SubtractImageFilterType = itk::SubtractImageFilter; using NearestInterpType = itk::NearestNeighborInterpolateImageFunction; - ReaderType::Pointer referenceReader = ReaderType::New(); + auto referenceReader = ReaderType::New(); referenceReader->SetImageIO(PhilipsRECImageIOType::New()); referenceReader->SetFileName(argv[1]); - ReaderType::Pointer targetReader = ReaderType::New(); + auto targetReader = ReaderType::New(); targetReader->SetImageIO(PhilipsRECImageIOType::New()); targetReader->SetFileName(argv[2]); - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); - ResampleImageFilterType::Pointer resample = ResampleImageFilterType::New(); + auto resample = ResampleImageFilterType::New(); resample->SetInput(referenceReader->GetOutput()); resample->SetTransform(transform); resample->SetInterpolator(NearestInterpType::New()); resample->UseReferenceImageOn(); resample->SetReferenceImage(targetReader->GetOutput()); - SubtractImageFilterType::Pointer subtract = SubtractImageFilterType::New(); + auto subtract = SubtractImageFilterType::New(); subtract->SetInput1(targetReader->GetOutput()); subtract->SetInput2(resample->GetOutput()); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(subtract->GetOutput()); writer->UseCompressionOn(); diff --git a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOPrintTest.cxx b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOPrintTest.cxx index 6d20ce848a1..a71ddacc93b 100644 --- a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOPrintTest.cxx +++ b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOPrintTest.cxx @@ -34,7 +34,7 @@ itkPhilipsRECImageIOPrintTest(int argc, char * argv[]) using PhilipsRECImageIOType = itk::PhilipsRECImageIO; - PhilipsRECImageIOType::Pointer imageIO = PhilipsRECImageIOType::New(); + auto imageIO = PhilipsRECImageIOType::New(); if (!imageIO->CanReadFile(argv[1])) { diff --git a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOTest.cxx b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOTest.cxx index 1bc1c8ed40a..a6d2ad6b75e 100644 --- a/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOTest.cxx +++ b/Modules/IO/PhilipsREC/test/itkPhilipsRECImageIOTest.cxx @@ -39,8 +39,8 @@ itkPhilipsRECImageIOTest(int argc, char * argv[]) itk::PhilipsRECImageIOFactory::RegisterOneFactory(); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/IO/RAW/test/itkRawImageIOTest3.cxx b/Modules/IO/RAW/test/itkRawImageIOTest3.cxx index bb5b159371d..c2fbc533b03 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest3.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest3.cxx @@ -59,7 +59,7 @@ itkRawImageIOTest3(int argc, char * argv[]) region.SetIndex(index); region.SetSize(size); - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->Allocate(); @@ -74,7 +74,7 @@ itkRawImageIOTest3(int argc, char * argv[]) ++ii; } - RawImageIOType::Pointer io = RawImageIOType::New(); + auto io = RawImageIOType::New(); io->SetByteOrderToBigEndian(); // Write out the image diff --git a/Modules/IO/RAW/test/itkRawImageIOTest4.cxx b/Modules/IO/RAW/test/itkRawImageIOTest4.cxx index 7c5d6070fc8..102e84cb546 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest4.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest4.cxx @@ -42,7 +42,7 @@ class RawImageIOReadFileTester using ReaderType = itk::ImageFileReader; using IOType = itk::RawImageIO; - typename IOType::Pointer io = IOType::New(); + auto io = IOType::New(); io->SetFileTypeToBinary(); @@ -60,7 +60,7 @@ class RawImageIOReadFileTester io->SetDimensions(j, dims[j]); } - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); reader->SetImageIO(io); diff --git a/Modules/IO/RAW/test/itkRawImageIOTest5.cxx b/Modules/IO/RAW/test/itkRawImageIOTest5.cxx index 787ebc41726..260c735a058 100644 --- a/Modules/IO/RAW/test/itkRawImageIOTest5.cxx +++ b/Modules/IO/RAW/test/itkRawImageIOTest5.cxx @@ -76,12 +76,12 @@ class RawImageReaderAndWriter Write() { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(m_FileName.c_str()); writer->SetInput(m_Image); - RawImageIOType::Pointer rawImageIO = RawImageIOType::New(); + auto rawImageIO = RawImageIOType::New(); writer->SetImageIO(rawImageIO); writer->Update(); @@ -91,10 +91,10 @@ class RawImageReaderAndWriter Read() { using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(m_FileName.c_str()); - RawImageIOType::Pointer rawImageIO = RawImageIOType::New(); + auto rawImageIO = RawImageIOType::New(); reader->SetImageIO(rawImageIO); unsigned int dim[2] = { 16, 16 }; diff --git a/Modules/IO/Siemens/include/itkSiemensVisionImageIOFactory.h b/Modules/IO/Siemens/include/itkSiemensVisionImageIOFactory.h index 97961d70090..a1f802f69e2 100644 --- a/Modules/IO/Siemens/include/itkSiemensVisionImageIOFactory.h +++ b/Modules/IO/Siemens/include/itkSiemensVisionImageIOFactory.h @@ -58,7 +58,7 @@ class ITKIOSiemens_EXPORT SiemensVisionImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - SiemensVisionImageIOFactory::Pointer metaFactory = SiemensVisionImageIOFactory::New(); + auto metaFactory = SiemensVisionImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx b/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx index 75036f32c27..ba47fa21dab 100644 --- a/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx +++ b/Modules/IO/SpatialObjects/test/itkReadVesselTubeSpatialObjectTest.cxx @@ -33,7 +33,7 @@ itkReadVesselTubeSpatialObjectTest(int argc, char * argv[]) using ReaderType = itk::SpatialObjectReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inputVessel); try diff --git a/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx b/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx index 1185935a136..89f36a1239c 100644 --- a/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx +++ b/Modules/IO/SpatialObjects/test/itkReadWriteSpatialObjectTest.cxx @@ -200,14 +200,14 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) tube1->SetPoints(list); tube1->Update(); - VesselTubeType::Pointer tube2 = VesselTubeType::New(); + auto tube2 = VesselTubeType::New(); tube2->SetTypeName("VesselTubeSpatialObject"); tube2->GetProperty().SetName("Tube 2"); tube2->SetId(2); tube2->SetPoints(list2); tube2->Update(); - DTITubeType::Pointer tube3 = DTITubeType::New(); + auto tube3 = DTITubeType::New(); tube3->GetProperty().SetName("Tube 3"); tube3->SetId(3); tube3->SetPoints(list3); @@ -288,7 +288,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) sit.Set(i); } - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->GetProperty().SetName("Image 1"); image->SetImage(itkImage); image->Update(); @@ -314,7 +314,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) itM.Set(i); } - ImageMaskType::Pointer maskImage = ImageMaskType::New(); + auto maskImage = ImageMaskType::New(); maskImage->GetProperty().SetName("Mask Image 1"); maskImage->SetImage(itkImageMask); maskImage->Update(); @@ -323,7 +323,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) tubeN2->Update(); // Define a contour - ContourType::Pointer contour = ContourType::New(); + auto contour = ContourType::New(); contour->GetProperty().SetName("My First Contour"); contour->SetInterpolationMethod(ContourType::InterpolationMethodEnum::EXPLICIT_INTERPOLATION); contour->SetIsClosed(true); @@ -385,7 +385,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) std::cout << "Testing Writing SceneSpatialObject: " << std::endl; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); try { writer->SetInput(tubeN1); @@ -416,7 +416,7 @@ itkReadWriteSpatialObjectTest(int argc, char * argv[]) std::cout << "Testing Reading SceneSpatialObject: "; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); if ((argc > 2) && (strcmp(argv[2], "binary"))) { reader->SetFileName(argv[2]); diff --git a/Modules/IO/Stimulate/include/itkStimulateImageIOFactory.h b/Modules/IO/Stimulate/include/itkStimulateImageIOFactory.h index 73ce3dd0f34..2e9cf9b26d6 100644 --- a/Modules/IO/Stimulate/include/itkStimulateImageIOFactory.h +++ b/Modules/IO/Stimulate/include/itkStimulateImageIOFactory.h @@ -66,7 +66,7 @@ class ITKIOStimulate_EXPORT StimulateImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - StimulateImageIOFactory::Pointer stimulateFactory = StimulateImageIOFactory::New(); + auto stimulateFactory = StimulateImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(stimulateFactory); } diff --git a/Modules/IO/TIFF/include/itkTIFFImageIOFactory.h b/Modules/IO/TIFF/include/itkTIFFImageIOFactory.h index 5e7e5148749..2c932ed6b1b 100644 --- a/Modules/IO/TIFF/include/itkTIFFImageIOFactory.h +++ b/Modules/IO/TIFF/include/itkTIFFImageIOFactory.h @@ -62,7 +62,7 @@ class ITKIOTIFF_EXPORT TIFFImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - TIFFImageIOFactory::Pointer TIFFFactory = TIFFImageIOFactory::New(); + auto TIFFFactory = TIFFImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(TIFFFactory); } diff --git a/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx b/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx index 03dd06d1f1c..09fc68a6e2c 100644 --- a/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx +++ b/Modules/IO/TIFF/test/itkLargeTIFFImageWriteReadTest.cxx @@ -51,7 +51,7 @@ itkLargeTIFFImageWriteReadTestHelper(std::string filename, typename TImage::Size { // Write block - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); index.Fill(0); region.SetSize(size); region.SetIndex(index); @@ -95,7 +95,7 @@ itkLargeTIFFImageWriteReadTestHelper(std::string filename, typename TImage::Size std::cout << "Trying to write the image to disk" << std::endl; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(image); writer->SetFileName(filename); @@ -109,7 +109,7 @@ itkLargeTIFFImageWriteReadTestHelper(std::string filename, typename TImage::Size } // end write block to free the memory std::cout << "Trying to read the image back from disk" << std::endl; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); itk::TIFFImageIO::Pointer io = itk::TIFFImageIO::New(); diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx index 698f4a17a95..e310793b0ed 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOCompressionTest.cxx @@ -37,8 +37,8 @@ itkTIFFImageIOCompressionTestHelper(int, char * argv[], int JPEGQuality) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); itk::TIFFImageIO::Pointer imageIO = itk::TIFFImageIO::New(); diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOTest.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOTest.cxx index 8f4fad535a2..95cbb9a2b8b 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOTest.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOTest.cxx @@ -31,7 +31,7 @@ TestMultipleReads(const std::string & fname, TImage *) using ImageType = TImage; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); itk::TIFFImageIO::Pointer io = itk::TIFFImageIO::New(); reader->SetFileName(fname.c_str()); @@ -66,8 +66,8 @@ itkTIFFImageIOTestHelper(int, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - typename ReaderType::Pointer reader = ReaderType::New(); - typename WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); itk::TIFFImageIO::Pointer io = itk::TIFFImageIO::New(); reader->SetFileName(argv[1]); diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx index 46b79d49e13..efd78f6e1d0 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOTest2.cxx @@ -36,7 +36,7 @@ itkTIFFImageIOTest2(int argc, char * argv[]) using PixelType = unsigned char; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::IndexType start; @@ -62,7 +62,7 @@ itkTIFFImageIOTest2(int argc, char * argv[]) image->SetSpacing(spacing); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[1]); writer->SetInput(image); @@ -70,7 +70,7 @@ itkTIFFImageIOTest2(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); diff --git a/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx b/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx index 88b6f6a511e..2beb0fa9c37 100644 --- a/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx +++ b/Modules/IO/TIFF/test/itkTIFFImageIOTestPalette.cxx @@ -62,12 +62,12 @@ itkTIFFImageIOTestPalette(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; using IOType = itk::TIFFImageIO; - IOType::Pointer io = IOType::New(); + auto io = IOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(io, TIFFImageIO, ImageIOBase); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); ITK_TEST_SET_GET_BOOLEAN(io, ExpandRGBPalette, expandRGBPalette); diff --git a/Modules/IO/TransformBase/test/itkTransformFileReaderTemplateTest.cxx b/Modules/IO/TransformBase/test/itkTransformFileReaderTemplateTest.cxx index b26eaa96351..effa2208078 100644 --- a/Modules/IO/TransformBase/test/itkTransformFileReaderTemplateTest.cxx +++ b/Modules/IO/TransformBase/test/itkTransformFileReaderTemplateTest.cxx @@ -31,7 +31,7 @@ itkTransformFileReaderTemplateTest(int argc, char * argv[]) using TransformReaderType = itk::TransformFileReaderTemplate; - TransformReaderType::Pointer transformReader = TransformReaderType::New(); + auto transformReader = TransformReaderType::New(); std::cout << "Reader class = " << transformReader->GetNameOfClass() << "Reader base = " << dynamic_cast(transformReader.GetPointer())->GetNameOfClass() diff --git a/Modules/IO/TransformBase/test/itkTransformFileReaderTest.cxx b/Modules/IO/TransformBase/test/itkTransformFileReaderTest.cxx index cc7db756006..0ab493babfe 100644 --- a/Modules/IO/TransformBase/test/itkTransformFileReaderTest.cxx +++ b/Modules/IO/TransformBase/test/itkTransformFileReaderTest.cxx @@ -25,7 +25,7 @@ itkTransformFileReaderTest(int, char *[]) { using TransformReaderType = itk::TransformFileReader; - TransformReaderType::Pointer transformReader = TransformReaderType::New(); + auto transformReader = TransformReaderType::New(); std::cout << "Reader class = " << transformReader->GetNameOfClass() << "Reader base = " << dynamic_cast(transformReader.GetPointer())->GetNameOfClass() diff --git a/Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx b/Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx index e243e2f5f88..88c63297581 100644 --- a/Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx +++ b/Modules/IO/TransformBase/test/itkTransformFileWriterTemplateTest.cxx @@ -32,7 +32,7 @@ itkTransformFileWriterTemplateTest(int argc, char * argv[]) using TransformWriterType = itk::TransformFileWriterTemplate; - TransformWriterType::Pointer transformWriter = TransformWriterType::New(); + auto transformWriter = TransformWriterType::New(); std::cout << "Writer class = " << transformWriter->GetNameOfClass() << "Writer base = " << dynamic_cast(transformWriter.GetPointer())->GetNameOfClass() diff --git a/Modules/IO/TransformBase/test/itkTransformFileWriterTest.cxx b/Modules/IO/TransformBase/test/itkTransformFileWriterTest.cxx index 725aa3e950e..98220740129 100644 --- a/Modules/IO/TransformBase/test/itkTransformFileWriterTest.cxx +++ b/Modules/IO/TransformBase/test/itkTransformFileWriterTest.cxx @@ -26,7 +26,7 @@ itkTransformFileWriterTest(int, char *[]) using TransformWriterType = itk::TransformFileWriter; - TransformWriterType::Pointer transformWriter = TransformWriterType::New(); + auto transformWriter = TransformWriterType::New(); std::cout << "Writer class = " << transformWriter->GetNameOfClass() << "Writer base = " << dynamic_cast(transformWriter.GetPointer())->GetNameOfClass() diff --git a/Modules/IO/TransformFactory/include/itkTransformFactory.h b/Modules/IO/TransformFactory/include/itkTransformFactory.h index 8cc17c8477e..9d36fbe7958 100644 --- a/Modules/IO/TransformFactory/include/itkTransformFactory.h +++ b/Modules/IO/TransformFactory/include/itkTransformFactory.h @@ -48,7 +48,7 @@ class TransformFactory : public TransformFactoryBase static void RegisterTransform() { - typename T::Pointer t = T::New(); + auto t = T::New(); TransformFactoryBase::Pointer f = TransformFactoryBase::GetFactory(); diff --git a/Modules/IO/TransformHDF5/include/itkHDF5TransformIOFactory.h b/Modules/IO/TransformHDF5/include/itkHDF5TransformIOFactory.h index b9b00d0af36..59b955aea81 100644 --- a/Modules/IO/TransformHDF5/include/itkHDF5TransformIOFactory.h +++ b/Modules/IO/TransformHDF5/include/itkHDF5TransformIOFactory.h @@ -57,7 +57,7 @@ class ITKIOTransformHDF5_EXPORT HDF5TransformIOFactory : public ObjectFactoryBas static void RegisterOneFactory() { - HDF5TransformIOFactory::Pointer metaFactory = HDF5TransformIOFactory::New(); + auto metaFactory = HDF5TransformIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx index 3df9a24502c..1317633db6a 100644 --- a/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx +++ b/Modules/IO/TransformHDF5/test/itkIOTransformHDF5Test.cxx @@ -44,9 +44,9 @@ ReadWriteTest(const std::string fileName, const bool isRealDisplacementField, co const double aNumberThatCanNotBeRepresentedInFloatingPoint = 1e-5 + 1e-7 + 1e-9 + 1e-13; const double requiredSpacing = 1.2 + aNumberThatCanNotBeRepresentedInFloatingPoint; const double requiredOrigin = 23.0 + aNumberThatCanNotBeRepresentedInFloatingPoint; - typename DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using FieldType = typename DisplacementTransformType::DisplacementFieldType; - typename FieldType::Pointer knownField = FieldType::New(); // This is based on itk::Image + auto knownField = FieldType::New(); // This is based on itk::Image { constexpr int dimLength = 20; typename FieldType::SizeType size; @@ -76,11 +76,11 @@ ReadWriteTest(const std::string fileName, const bool isRealDisplacementField, co // Now test reading/writing many different transform types. using TransformReaderType = itk::TransformFileReaderTemplate; - typename TransformReaderType::Pointer reader = TransformReaderType::New(); + auto reader = TransformReaderType::New(); reader->SetFileName(fileName); using TransformIOType = itk::HDF5TransformIOTemplate; - typename TransformIOType::Pointer transformIO = TransformIOType::New(); + auto transformIO = TransformIOType::New(); reader->SetTransformIO(transformIO); if (reader->GetTransformIO() != transformIO.GetPointer()) { @@ -89,7 +89,7 @@ ReadWriteTest(const std::string fileName, const bool isRealDisplacementField, co } using TransformWriterType = itk::TransformFileWriterTemplate; - typename TransformWriterType::Pointer writer = TransformWriterType::New(); + auto writer = TransformWriterType::New(); writer->SetFileName(fileName); writer->SetTransformIO(transformIO); writer->SetUseCompression(UseCompression); @@ -181,7 +181,7 @@ oneTest(const std::string goodname, const std::string badname, const bool UseCom { using AffineTransformType = typename itk::AffineTransform; using AffineTransformTypeNotRegistered = typename itk::AffineTransform; - typename AffineTransformType::Pointer affine = AffineTransformType::New(); + auto affine = AffineTransformType::New(); // Set it's parameters { @@ -250,7 +250,7 @@ oneTest(const std::string goodname, const std::string badname, const bool UseCom std::cout << "Creating bad writer" << std::endl; - typename AffineTransformTypeNotRegistered::Pointer Bogus = AffineTransformTypeNotRegistered::New(); + auto Bogus = AffineTransformTypeNotRegistered::New(); // Set it's parameters { @@ -403,7 +403,7 @@ itkIOTransformHDF5Test(int argc, char * argv[]) { // This test only verifies that the test can read the transform. using TFM_READER_TYPE = typename itk::TransformFileReaderTemplate; - TFM_READER_TYPE::Pointer reader = TFM_READER_TYPE::New(); + auto reader = TFM_READER_TYPE::New(); reader->SetFileName(testType); reader->Update(); TFM_READER_TYPE::TransformListType const * const myTransformList = reader->GetTransformList(); diff --git a/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx b/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx index 693d581bea8..b4687bb5b9a 100644 --- a/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx +++ b/Modules/IO/TransformHDF5/test/itkThinPlateTransformWriteReadTest.cxx @@ -43,7 +43,7 @@ ReadWriteTest(const char * const fileName) using ParametersValueType = typename TransformType::ScalarType; // Create transform - typename TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); using PointType = typename TransformType::InputPointType; using PointsIteratorType = typename TransformType::PointsIterator; using PointSetType = typename TransformType::PointSetType; @@ -53,8 +53,8 @@ ReadWriteTest(const char * const fileName) PointType mappedPoint; // Reserve memory for the number of points - typename PointSetType::Pointer sourceLandmarks = PointSetType::New(); - typename PointSetType::Pointer targetLandmarks = PointSetType::New(); + auto sourceLandmarks = PointSetType::New(); + auto targetLandmarks = PointSetType::New(); sourceLandmarks->GetPoints()->Reserve(4); targetLandmarks->GetPoints()->Reserve(4); @@ -105,14 +105,14 @@ ReadWriteTest(const char * const fileName) // Write transform to file using TransformWriterType = typename itk::TransformFileWriterTemplate; - typename TransformWriterType::Pointer transformWriter = TransformWriterType::New(); + auto transformWriter = TransformWriterType::New(); transformWriter->SetFileName(fileName); transformWriter->AddTransform(transform); ITK_TRY_EXPECT_NO_EXCEPTION(transformWriter->Update()); // Read transform file using TransformReaderType = typename itk::TransformFileReaderTemplate; - typename TransformReaderType::Pointer transformReader = TransformReaderType::New(); + auto transformReader = TransformReaderType::New(); transformReader->SetFileName(fileName); ITK_TRY_EXPECT_NO_EXCEPTION(transformReader->Update()); diff --git a/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIOFactory.h b/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIOFactory.h index 7201200f100..14ac4a59029 100644 --- a/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIOFactory.h +++ b/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIOFactory.h @@ -56,7 +56,7 @@ class ITKIOTransformInsightLegacy_EXPORT TxtTransformIOFactory : public ObjectFa static void RegisterOneFactory() { - TxtTransformIOFactory::Pointer metaFactory = TxtTransformIOFactory::New(); + auto metaFactory = TxtTransformIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/TransformInsightLegacy/test/itkIOEuler3DTransformTxtTest.cxx b/Modules/IO/TransformInsightLegacy/test/itkIOEuler3DTransformTxtTest.cxx index 9992f609932..c6ad42bfcdf 100644 --- a/Modules/IO/TransformInsightLegacy/test/itkIOEuler3DTransformTxtTest.cxx +++ b/Modules/IO/TransformInsightLegacy/test/itkIOEuler3DTransformTxtTest.cxx @@ -39,10 +39,10 @@ itkIOEuler3DTransformTxtTest(int argc, char * argv[]) TransformType::Pointer oldStyleInput, newStyleInput; using ReaderType = itk::TransformFileReaderTemplate; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); using WriterType = itk::TransformFileWriterTemplate; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); // read old style format in reader->SetFileName(argv[1]); diff --git a/Modules/IO/TransformInsightLegacy/test/itkIOTransformTxtTest.cxx b/Modules/IO/TransformInsightLegacy/test/itkIOTransformTxtTest.cxx index 891959fe860..94df78a076d 100644 --- a/Modules/IO/TransformInsightLegacy/test/itkIOTransformTxtTest.cxx +++ b/Modules/IO/TransformInsightLegacy/test/itkIOTransformTxtTest.cxx @@ -35,7 +35,7 @@ oneTest(const std::string & outputDirectory, const char * goodname, const char * unsigned int i; using AffineTransformType = itk::AffineTransform; using AffineTransformTypeNotRegistered = itk::AffineTransform; - typename AffineTransformType::Pointer affine = AffineTransformType::New(); + auto affine = AffineTransformType::New(); itk::ObjectFactoryBase::RegisterFactory(itk::TxtTransformIOFactory::New()); @@ -116,7 +116,7 @@ oneTest(const std::string & outputDirectory, const char * goodname, const char * std::cout << "Creating bad writer" << std::endl; - typename AffineTransformTypeNotRegistered::Pointer Bogus = AffineTransformTypeNotRegistered::New(); + auto Bogus = AffineTransformTypeNotRegistered::New(); // Set it's parameters { @@ -236,7 +236,7 @@ templatelessTest(const std::string & outputDirectory) const std::string outputFile = outputDirectory + "itkIOTransformTxtTestRigid2DTransform.tfm"; using TransformType = itk::Rigid2DTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); itk::TransformFileWriter::Pointer writer = itk::TransformFileWriter::New(); writer->SetInput(transform); diff --git a/Modules/IO/TransformMINC/include/itkMINCTransformIOFactory.h b/Modules/IO/TransformMINC/include/itkMINCTransformIOFactory.h index 33c2b53fa14..737eac70627 100644 --- a/Modules/IO/TransformMINC/include/itkMINCTransformIOFactory.h +++ b/Modules/IO/TransformMINC/include/itkMINCTransformIOFactory.h @@ -58,7 +58,7 @@ class ITKIOTransformMINC_EXPORT MINCTransformIOFactory : public ObjectFactoryBas static void RegisterOneFactory() { - MINCTransformIOFactory::Pointer metaFactory = MINCTransformIOFactory::New(); + auto metaFactory = MINCTransformIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx index e7fb63c2f2a..7054b2cfb0f 100644 --- a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx +++ b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx @@ -104,7 +104,7 @@ MINCTransformIOTemplate::ReadOneTransform(VIO_General_tran if (xfm->inverse_flag) { using AffineTransformType = AffineTransform; - typename AffineTransformType::Pointer tmp = AffineTransformType::New(); + auto tmp = AffineTransformType::New(); tmp->SetParametersByValue(parameterArray); tmp->GetInverse(static_cast(transform.GetPointer())); } @@ -138,8 +138,8 @@ MINCTransformIOTemplate::ReadOneTransform(VIO_General_tran using GridImageType = typename DisplacementFieldTransformType::DisplacementFieldType; using MincReaderType = ImageFileReader; - MINCImageIO::Pointer mincIO = MINCImageIO::New(); - typename MincReaderType::Pointer reader = MincReaderType::New(); + auto mincIO = MINCImageIO::New(); + auto reader = MincReaderType::New(); reader->SetImageIO(mincIO); reader->SetFileName(xfm->displacement_volume_file); reader->Update(); @@ -251,8 +251,8 @@ MINCTransformIOTemplate::WriteOneTransform(const int sprintf(tmp, "%s_grid_%d.mnc", xfm_file_base, serial); ++serial; - MINCImageIO::Pointer mincIO = MINCImageIO::New(); - typename MincWriterType::Pointer writer = MincWriterType::New(); + auto mincIO = MINCImageIO::New(); + auto writer = MincWriterType::New(); writer->SetImageIO(mincIO); writer->SetFileName(tmp); diff --git a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx index ae4a53e8288..aa4ba03c970 100644 --- a/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx +++ b/Modules/IO/TransformMINC/test/itkIOTransformMINCTest.cxx @@ -61,7 +61,7 @@ check_linear(const char * linear_transform) using AffineTransformType = itk::AffineTransform; const double tolerance = 1e-5; - AffineTransformType::Pointer affine = AffineTransformType::New(); + auto affine = AffineTransformType::New(); itk::ObjectFactoryBase::RegisterFactory(itk::MINCTransformIOFactory::New()); @@ -167,8 +167,8 @@ check_nonlinear_double(const char * nonlinear_transform) using DisplacementFieldTransform = itk::DisplacementFieldTransform; using DisplacementFieldType = DisplacementFieldTransform::DisplacementFieldType; - DisplacementFieldTransform::Pointer disp = DisplacementFieldTransform::New(); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto disp = DisplacementFieldTransform::New(); + auto field = DisplacementFieldType::New(); // create zero displacement field DisplacementFieldType::SizeType imageSize3D = { { 10, 10, 10 } }; @@ -308,8 +308,8 @@ check_nonlinear_float(const char * nonlinear_transform) using DisplacementFieldTransform = itk::DisplacementFieldTransform; using DisplacementFieldType = DisplacementFieldTransform::DisplacementFieldType; - DisplacementFieldTransform::Pointer disp = DisplacementFieldTransform::New(); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto disp = DisplacementFieldTransform::New(); + auto field = DisplacementFieldType::New(); // create zero displacement field DisplacementFieldType::SizeType imageSize3D = { { 10, 10, 10 } }; @@ -476,9 +476,9 @@ check_composite(const char * transform_file) const double tolerance = 1e-5; - AffineTransformType::Pointer affine1 = AffineTransformType::New(); - AffineTransformType::Pointer affine2 = AffineTransformType::New(); - CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto affine1 = AffineTransformType::New(); + auto affine2 = AffineTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); itk::ObjectFactoryBase::RegisterFactory(itk::MINCTransformIOFactory::New()); @@ -609,7 +609,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file) using DisplacementFieldTransform = itk::DisplacementFieldTransform; using DisplacementFieldType = DisplacementFieldTransform::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // create zero displacement field DisplacementFieldType::SizeType imageSize3D = { { 10, 10, 10 } }; @@ -637,7 +637,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file) using MincWriterType = itk::ImageFileWriter; - typename MincWriterType::Pointer writer = MincWriterType::New(); + auto writer = MincWriterType::New(); // expecting .mnc here writer->SetFileName(transform_grid_file); @@ -676,7 +676,7 @@ check_composite2(const char * transform_file, const char * transform_grid_file) using CompositeTransformType = itk::CompositeTransform; using TransformType = itk::Transform; - CompositeTransformType::Pointer _xfm = CompositeTransformType::New(); + auto _xfm = CompositeTransformType::New(); for (const auto & it : *list) { it->Print(std::cout); diff --git a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx index 0b789a18737..29cbc90613c 100644 --- a/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx +++ b/Modules/IO/TransformMINC/test/itkMINCTransformAdapterTest.cxx @@ -61,7 +61,7 @@ compare_linear(const char * linear_transform) itk::ObjectFactoryBase::RegisterFactory(itk::MINCTransformIOFactory::New()); using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affine = AffineTransformType::New(); + auto affine = AffineTransformType::New(); AffineTransformType::OutputVectorType rot_axis; rot_axis[0] = 1.0; @@ -135,8 +135,8 @@ compare_nonlinear_double(const char * nonlinear_transform) using DisplacementFieldTransform = itk::DisplacementFieldTransform; using DisplacementFieldType = DisplacementFieldTransform::DisplacementFieldType; - DisplacementFieldTransform::Pointer disp = DisplacementFieldTransform::New(); - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto disp = DisplacementFieldTransform::New(); + auto field = DisplacementFieldType::New(); // create zero displacement field DisplacementFieldType::SizeType imageSize3D = { { 10, 10, 10 } }; diff --git a/Modules/IO/TransformMatlab/include/itkMatlabTransformIOFactory.h b/Modules/IO/TransformMatlab/include/itkMatlabTransformIOFactory.h index 3573745af6d..a67f53be97a 100644 --- a/Modules/IO/TransformMatlab/include/itkMatlabTransformIOFactory.h +++ b/Modules/IO/TransformMatlab/include/itkMatlabTransformIOFactory.h @@ -57,7 +57,7 @@ class ITKIOTransformMatlab_EXPORT MatlabTransformIOFactory : public ObjectFactor static void RegisterOneFactory() { - MatlabTransformIOFactory::Pointer metaFactory = MatlabTransformIOFactory::New(); + auto metaFactory = MatlabTransformIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(metaFactory); } diff --git a/Modules/IO/TransformMatlab/test/itkIOTransformMatlabTest.cxx b/Modules/IO/TransformMatlab/test/itkIOTransformMatlabTest.cxx index 86ebe468a73..a470b002ed0 100644 --- a/Modules/IO/TransformMatlab/test/itkIOTransformMatlabTest.cxx +++ b/Modules/IO/TransformMatlab/test/itkIOTransformMatlabTest.cxx @@ -34,7 +34,7 @@ oneTest(const char * goodname, const char * badname) unsigned int i; using AffineTransformType = itk::AffineTransform; using AffineTransformTypeNotRegistered = itk::AffineTransform; - typename AffineTransformType::Pointer affine = AffineTransformType::New(); + auto affine = AffineTransformType::New(); using TransformWriterType = itk::TransformFileWriterTemplate; using TransformReaderType = itk::TransformFileReaderTemplate; @@ -58,8 +58,8 @@ oneTest(const char * goodname, const char * badname) } affine->SetFixedParameters(p); } - typename TransformWriterType::Pointer writer = TransformWriterType::New(); - typename TransformReaderType::Pointer reader = TransformReaderType::New(); + auto writer = TransformWriterType::New(); + auto reader = TransformReaderType::New(); // writer->AddTransform(affine); writer->SetInput(affine); @@ -107,7 +107,7 @@ oneTest(const char * goodname, const char * badname) std::cout << "\n\nCreating bad writer" << std::endl; - typename AffineTransformTypeNotRegistered::Pointer Bogus = AffineTransformTypeNotRegistered::New(); + auto Bogus = AffineTransformTypeNotRegistered::New(); // Set it's parameters { @@ -127,8 +127,8 @@ oneTest(const char * goodname, const char * badname) Bogus->SetFixedParameters(p); } - typename TransformWriterType::Pointer badwriter = TransformWriterType::New(); - typename TransformReaderType::Pointer badreader = TransformReaderType::New(); + auto badwriter = TransformWriterType::New(); + auto badreader = TransformReaderType::New(); badwriter->AddTransform(Bogus); badwriter->SetFileName(badname); @@ -197,7 +197,7 @@ secondTest() fb.close(); using TransformReaderType = itk::TransformFileReaderTemplate; - typename TransformReaderType::Pointer reader = TransformReaderType::New(); + auto reader = TransformReaderType::New(); reader->SetFileName("IllegalTransform.txt"); try { @@ -234,7 +234,7 @@ thirdTest() fb.close(); using TransformReaderType = itk::TransformFileReaderTemplate; - typename TransformReaderType::Pointer reader = TransformReaderType::New(); + auto reader = TransformReaderType::New(); reader->SetFileName("IllegalMat.Mat"); try { diff --git a/Modules/IO/VTK/include/itkVTKImageIOFactory.h b/Modules/IO/VTK/include/itkVTKImageIOFactory.h index c9bb0a44287..cf7c6efdc3a 100644 --- a/Modules/IO/VTK/include/itkVTKImageIOFactory.h +++ b/Modules/IO/VTK/include/itkVTKImageIOFactory.h @@ -67,7 +67,7 @@ class ITKIOVTK_EXPORT VTKImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - VTKImageIOFactory::Pointer vtkFactory = VTKImageIOFactory::New(); + auto vtkFactory = VTKImageIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(vtkFactory); } diff --git a/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx b/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx index b9e1b2d8d68..081833c1de3 100644 --- a/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIO2Test.cxx @@ -84,7 +84,7 @@ class VTKImageIOTester // force use of VTKImageIO using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); if (ascii) { vtkIO->SetFileTypeToASCII(); @@ -95,11 +95,11 @@ class VTKImageIOTester } using ImageFileWriterType = itk::ImageFileWriter; - typename ImageFileWriterType::Pointer writer = ImageFileWriterType::New(); + auto writer = ImageFileWriterType::New(); writer->SetImageIO(vtkIO); // allocate an 10x10x10 image - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); typename ImageType::SizeType imageSize; imageSize.Fill(10); image->SetRegions(imageSize); @@ -161,11 +161,11 @@ class VTKImageIOTester using ImageType = itk::Image; using ImageFileReaderType = itk::ImageFileReader; - typename ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); // force use of VTKImageIO using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); reader->SetImageIO(vtkIO); // set ascii or binary @@ -282,7 +282,7 @@ class VTKImageIOTester CanReadFileTest(const std::string & filePrefix, const std::string & fileExtension, std::string & outputPath) { using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); std::string fileName = VTKImageIOTester::SetupFileName(filePrefix, fileExtension, outputPath); @@ -293,7 +293,7 @@ class VTKImageIOTester CanWriteFileTest(const std::string & filePrefix, const std::string & fileExtension, std::string & outputPath) { using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); std::string fileName = VTKImageIOTester::SetupFileName(filePrefix, fileExtension, outputPath); @@ -431,7 +431,7 @@ itkVTKImageIO2Test(int argc, char * argv[]) // use print methods // using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(vtkIO, VTKImageIO, StreamingImageIOBase); diff --git a/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx b/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx index 3a4b6829e72..922713a522e 100644 --- a/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIO2Test2.cxx @@ -51,7 +51,7 @@ itkVTKImageIO2Test2(int argc, char * argv[]) { // allocate an 10x10x10 image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType imageSize; imageSize.Fill(10); image->SetRegions(imageSize); @@ -80,9 +80,9 @@ itkVTKImageIO2Test2(int argc, char * argv[]) } using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetImageIO(vtkIO); writer->SetInput(image); writer->SetFileName(outputFileName.c_str()); @@ -92,20 +92,20 @@ itkVTKImageIO2Test2(int argc, char * argv[]) // check that a request to stream is not { using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(outputFileName.c_str()); reader->SetImageIO(vtkIO); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); constexpr unsigned int numberOfDataPieces = 10; using StreamingFilter = itk::StreamingImageFilter; - StreamingFilter::Pointer streamer = StreamingFilter::New(); + auto streamer = StreamingFilter::New(); streamer->SetInput(monitor->GetOutput()); streamer->SetNumberOfStreamDivisions(numberOfDataPieces); @@ -130,20 +130,20 @@ itkVTKImageIO2Test2(int argc, char * argv[]) { using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(outputFileName.c_str()); reader->SetImageIO(vtkIO); reader->UpdateLargestPossibleRegion(); using MonitorFilter = itk::PipelineMonitorImageFilter; - MonitorFilter::Pointer monitor = MonitorFilter::New(); + auto monitor = MonitorFilter::New(); monitor->SetInput(reader->GetOutput()); constexpr unsigned int numberOfDataPieces = 10; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetImageIO(vtkIO); writer->SetInput(monitor->GetOutput()); writer->SetNumberOfStreamDivisions(numberOfDataPieces); diff --git a/Modules/IO/VTK/test/itkVTKImageIOFileReadTest.cxx b/Modules/IO/VTK/test/itkVTKImageIOFileReadTest.cxx index b1188f6fab5..d42b88d1ca8 100644 --- a/Modules/IO/VTK/test/itkVTKImageIOFileReadTest.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIOFileReadTest.cxx @@ -27,7 +27,7 @@ ReadImage(const std::string fileName, typename TImage::Pointer image) { using IOType = itk::VTKImageIO; - IOType::Pointer vtkIO = IOType::New(); + auto vtkIO = IOType::New(); if (!vtkIO->CanReadFile(fileName.c_str())) { @@ -37,7 +37,7 @@ ReadImage(const std::string fileName, typename TImage::Pointer image) using ImageType = TImage; using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer reader = ImageReaderType::New(); + auto reader = ImageReaderType::New(); reader->SetImageIO(vtkIO); reader->SetFileName(fileName); @@ -70,7 +70,7 @@ itkVTKImageIOFileReadTest(int argc, char * argv[]) // Read matrix.vtk file using matrixImageType = itk::Image; - matrixImageType::Pointer matriximage = matrixImageType::New(); + auto matriximage = matrixImageType::New(); if (ReadImage(argv[1], matriximage) == EXIT_FAILURE) { @@ -81,7 +81,7 @@ itkVTKImageIOFileReadTest(int argc, char * argv[]) // Read ironProt.vtk file using ironProtImageType = itk::Image; - ironProtImageType::Pointer ironProtimage = ironProtImageType::New(); + auto ironProtimage = ironProtImageType::New(); if (ReadImage(argv[2], ironProtimage) == EXIT_FAILURE) { diff --git a/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx b/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx index feb968ce59f..3830c485b82 100644 --- a/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx +++ b/Modules/IO/VTK/test/itkVTKImageIOTest2.cxx @@ -46,8 +46,8 @@ itkVTKImageIOTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/IO/XML/include/itkDOMReader.hxx b/Modules/IO/XML/include/itkDOMReader.hxx index 9ffebe6a18e..a8a63a91a31 100644 --- a/Modules/IO/XML/include/itkDOMReader.hxx +++ b/Modules/IO/XML/include/itkDOMReader.hxx @@ -33,7 +33,7 @@ DOMReader::DOMReader() // Create the logger. this->m_Logger = LoggerType::New(); // by default logged messages go to the console - typename StdStreamLogOutput::Pointer defout = StdStreamLogOutput::New(); + auto defout = StdStreamLogOutput::New(); defout->SetStream(std::cout); this->m_Logger->AddLogOutput(defout); // settings that may be important @@ -133,7 +133,7 @@ DOMReader::Update() this->m_IntermediateDOM->RemoveAllAttributesAndChildren(); // read the input XML file and update the DOM object - typename DOMNodeXMLReader::Pointer reader = DOMNodeXMLReader::New(); + auto reader = DOMNodeXMLReader::New(); reader->SetDOMNodeXML(this->m_IntermediateDOM); reader->SetFileName(fn.ToString()); reader->Update(); diff --git a/Modules/IO/XML/include/itkDOMWriter.hxx b/Modules/IO/XML/include/itkDOMWriter.hxx index 05234955b75..9277f125c5d 100644 --- a/Modules/IO/XML/include/itkDOMWriter.hxx +++ b/Modules/IO/XML/include/itkDOMWriter.hxx @@ -34,7 +34,7 @@ DOMWriter::DOMWriter() // Create the logger. this->m_Logger = LoggerType::New(); // by default logged messages go to the console - typename StdStreamLogOutput::Pointer defout = StdStreamLogOutput::New(); + auto defout = StdStreamLogOutput::New(); defout->SetStream(std::cout); this->m_Logger->AddLogOutput(defout); // settings that may be important @@ -115,7 +115,7 @@ DOMWriter::Update() { if (this->m_IntermediateDOM.IsNull()) { - typename DOMNodeType::Pointer temp = DOMNodeType::New(); + auto temp = DOMNodeType::New(); this->SetIntermediateDOM(temp); } @@ -136,7 +136,7 @@ DOMWriter::Update() itksys::SystemTools::ChangeDirectory(sOldWorkingDir); // write the newly updated DOM object to the output XML file - typename DOMNodeXMLWriter::Pointer writer = DOMNodeXMLWriter::New(); + auto writer = DOMNodeXMLWriter::New(); writer->SetFileName(fn.ToString()); writer->SetInput(this->m_IntermediateDOM); writer->Update(); diff --git a/Modules/IO/XML/src/itkDOMNode.cxx b/Modules/IO/XML/src/itkDOMNode.cxx index 8343fac046d..61510131c90 100644 --- a/Modules/IO/XML/src/itkDOMNode.cxx +++ b/Modules/IO/XML/src/itkDOMNode.cxx @@ -664,7 +664,7 @@ DOMNode::GetTextChild(IdentifierType i) const void DOMNode::AddTextChild(const std::string & text, IdentifierType i) { - DOMTextNode::Pointer tnode = DOMTextNode::New(); + auto tnode = DOMTextNode::New(); tnode->SetText(text); this->AddChild((DOMTextNode *)tnode, i); } @@ -673,7 +673,7 @@ DOMNode::AddTextChild(const std::string & text, IdentifierType i) void DOMNode::AddTextChildAtBegin(const std::string & text) { - DOMTextNode::Pointer tnode = DOMTextNode::New(); + auto tnode = DOMTextNode::New(); tnode->SetText(text); this->AddChildAtBegin((DOMTextNode *)tnode); } @@ -682,7 +682,7 @@ DOMNode::AddTextChildAtBegin(const std::string & text) void DOMNode::AddTextChildAtEnd(const std::string & text) { - DOMTextNode::Pointer tnode = DOMTextNode::New(); + auto tnode = DOMTextNode::New(); tnode->SetText(text); this->AddChildAtEnd((DOMTextNode *)tnode); } @@ -691,7 +691,7 @@ DOMNode::AddTextChildAtEnd(const std::string & text) void DOMNode::SetTextChild(const std::string & text, IdentifierType i) { - DOMTextNode::Pointer tnode = DOMTextNode::New(); + auto tnode = DOMTextNode::New(); tnode->SetText(text); this->SetChild((DOMTextNode *)tnode, i); } diff --git a/Modules/IO/XML/src/itkDOMNodeXMLReader.cxx b/Modules/IO/XML/src/itkDOMNodeXMLReader.cxx index e73f29699b5..5a98749aa39 100644 --- a/Modules/IO/XML/src/itkDOMNodeXMLReader.cxx +++ b/Modules/IO/XML/src/itkDOMNodeXMLReader.cxx @@ -66,7 +66,7 @@ DOMNodeXMLReader::Update(std::istream & is) { if (m_DOMNodeXML.IsNull()) { - OutputType::Pointer temp = OutputType::New(); + auto temp = OutputType::New(); this->SetDOMNodeXML(temp); } m_DOMNodeXML->RemoveAllAttributesAndChildren(); diff --git a/Modules/IO/XML/test/itkDOMTestObjectDOMReader.h b/Modules/IO/XML/test/itkDOMTestObjectDOMReader.h index 8dea619bb1a..e0036b122ef 100644 --- a/Modules/IO/XML/test/itkDOMTestObjectDOMReader.h +++ b/Modules/IO/XML/test/itkDOMTestObjectDOMReader.h @@ -59,7 +59,7 @@ DOMTestObjectDOMReader::GenerateData(const DOMNodeType * inputdom, const void *) OutputType * output = this->GetOutput(); if (output == nullptr) { - OutputType::Pointer object = OutputType::New(); + auto object = OutputType::New(); output = (OutputType *)object; this->SetOutput(output); } diff --git a/Modules/Nonunit/IntegratedTest/test/itkBioRadImageIOTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkBioRadImageIOTest.cxx index f1e5fd47f41..77422a6403a 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkBioRadImageIOTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkBioRadImageIOTest.cxx @@ -39,10 +39,10 @@ itkBioRadImageIOTest(int argc, char * argv[]) const char * filename = argv[1]; const char * outfilename = argv[2]; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(filename); - ImageIOType::Pointer bioradImageIO = ImageIOType::New(); + auto bioradImageIO = ImageIOType::New(); reader->SetImageIO(bioradImageIO); bioradImageIO->DebugOn(); @@ -59,7 +59,7 @@ itkBioRadImageIOTest(int argc, char * argv[]) // using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetImageIO(bioradImageIO); writer->SetFileName(outfilename); writer->SetInput(reader->GetOutput()); diff --git a/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx index 29551ba6f0d..cfc6ea2670c 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkFilterImageAddTest.cxx @@ -40,8 +40,8 @@ itkFilterImageAddTest(int, char *[]) using myRegionType = itk::ImageRegion; // Create two images - myImageType1::Pointer inputImageA = myImageType1::New(); - myImageType2::Pointer inputImageB = myImageType2::New(); + auto inputImageA = myImageType1::New(); + auto inputImageB = myImageType2::New(); // Define their size, and start index mySizeType size; @@ -105,7 +105,7 @@ itkFilterImageAddTest(int, char *[]) // Create an ADD Filter - myFilterType::Pointer filter = myFilterType::New(); + auto filter = myFilterType::New(); // Connect the input images diff --git a/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx b/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx index fec04928539..1397f6af3f2 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkImageToHistogramFilterTest4.cxx @@ -51,19 +51,19 @@ itkImageToHistogramFilterTest4Templated(int argc, char * argv[]) using VectorImageType = TVectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using ComposeType = itk::ComposeImageFilter; - typename ComposeType::Pointer compose = ComposeType::New(); + auto compose = ComposeType::New(); compose->SetInput1(reader->GetOutput()); compose->SetInput2(reader2->GetOutput()); using HistogramFilterType = itk::Statistics::ImageToHistogramFilter; - typename HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(compose->GetOutput()); itk::SimpleFilterWatcher watcher(histogramFilter, "histogramFilter"); @@ -74,16 +74,16 @@ itkImageToHistogramFilterTest4Templated(int argc, char * argv[]) // is of greater dimension than the histogram using FloatImageType = itk::Image; using ImageFilterType = itk::HistogramToLogProbabilityImageFilter; - typename ImageFilterType::Pointer imageFilter = ImageFilterType::New(); + auto imageFilter = ImageFilterType::New(); imageFilter->SetInput(histogramFilter->GetOutput()); itk::SimpleFilterWatcher watcher2(imageFilter, "imageFilter"); using RescaleType = itk::RescaleIntensityImageFilter; - typename RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetInput(imageFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescale->GetOutput()); writer->SetFileName(argv[3]); diff --git a/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx b/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx index 118356686aa..2fd24ae36c7 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkMaskedImageToHistogramFilterTest1.cxx @@ -47,22 +47,22 @@ itkMaskedImageToHistogramFilterTest1(int argc, char * argv[]) using VectorImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); - ReaderType::Pointer reader3 = ReaderType::New(); + auto reader3 = ReaderType::New(); reader3->SetFileName(argv[3]); using ComposeType = itk::ComposeImageFilter; - ComposeType::Pointer compose = ComposeType::New(); + auto compose = ComposeType::New(); compose->SetInput1(reader->GetOutput()); compose->SetInput2(reader2->GetOutput()); using HistogramFilterType = itk::Statistics::MaskedImageToHistogramFilter; - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); + auto histogramFilter = HistogramFilterType::New(); histogramFilter->SetInput(compose->GetOutput()); histogramFilter->SetMaskImage(reader3->GetOutput()); histogramFilter->SetMaskValue(std::stoi(argv[4])); @@ -102,15 +102,15 @@ itkMaskedImageToHistogramFilterTest1(int argc, char * argv[]) // is of greater dimension than the histogram using FloatImageType = itk::Image; using ImageFilterType = itk::HistogramToLogProbabilityImageFilter; - ImageFilterType::Pointer imageFilter = ImageFilterType::New(); + auto imageFilter = ImageFilterType::New(); imageFilter->SetInput(histogramFilter->GetOutput()); using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetInput(imageFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescale->GetOutput()); writer->SetFileName(argv[5]); diff --git a/Modules/Nonunit/IntegratedTest/test/itkMaximumDecisionRuleTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkMaximumDecisionRuleTest.cxx index bc93b2a2ef4..280fdaa99ee 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkMaximumDecisionRuleTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkMaximumDecisionRuleTest.cxx @@ -26,7 +26,7 @@ itkMaximumDecisionRuleTest(int, char *[]) using MembershipVectorType = MaximumDecisionRuleType::MembershipVectorType; - MaximumDecisionRuleType::Pointer decisionRule = MaximumDecisionRuleType::New(); + auto decisionRule = MaximumDecisionRuleType::New(); std::cout << decisionRule->GetNameOfClass() << std::endl; std::cout << decisionRule->MaximumDecisionRuleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Nonunit/IntegratedTest/test/itkMaximumRatioDecisionRuleTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkMaximumRatioDecisionRuleTest.cxx index 5c95d08d7ea..720c25bab17 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkMaximumRatioDecisionRuleTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkMaximumRatioDecisionRuleTest.cxx @@ -26,7 +26,7 @@ itkMaximumRatioDecisionRuleTest(int, char *[]) using MembershipVectorType = MaximumRatioDecisionRuleType::MembershipVectorType; - MaximumRatioDecisionRuleType::Pointer decisionRule = MaximumRatioDecisionRuleType::New(); + auto decisionRule = MaximumRatioDecisionRuleType::New(); std::cout << decisionRule->GetNameOfClass() << std::endl; std::cout << decisionRule->MaximumRatioDecisionRuleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Nonunit/IntegratedTest/test/itkMinimumDecisionRuleTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkMinimumDecisionRuleTest.cxx index 60899260626..ae57a2787f2 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkMinimumDecisionRuleTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkMinimumDecisionRuleTest.cxx @@ -26,7 +26,7 @@ itkMinimumDecisionRuleTest(int, char *[]) using MembershipVectorType = MinimumDecisionRuleType::MembershipVectorType; - MinimumDecisionRuleType::Pointer decisionRule = MinimumDecisionRuleType::New(); + auto decisionRule = MinimumDecisionRuleType::New(); std::cout << decisionRule->GetNameOfClass() << std::endl; std::cout << decisionRule->MinimumDecisionRuleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Nonunit/IntegratedTest/test/itkPolygonCellTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkPolygonCellTest.cxx index be0f9235263..eb980efed38 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkPolygonCellTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkPolygonCellTest.cxx @@ -59,7 +59,7 @@ itkPolygonCellTest(int, char *[]) /** * Create the mesh through its object factory. */ - MeshType::Pointer mesh = MeshType::New(); + auto mesh = MeshType::New(); mesh->DebugOn(); /** diff --git a/Modules/Nonunit/IntegratedTest/test/itkReleaseDataFilterTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkReleaseDataFilterTest.cxx index 7f373bda570..d936e4e4688 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkReleaseDataFilterTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkReleaseDataFilterTest.cxx @@ -42,7 +42,7 @@ itkReleaseDataFilterTest(int, char *[]) ImageType::GlobalReleaseDataFlagOn(); using RandomImageSourceType = itk::RandomImageSource; - RandomImageSourceType::Pointer random = RandomImageSourceType::New(); + auto random = RandomImageSourceType::New(); random->SetMin(0.0); random->SetMax(1000.0); @@ -59,7 +59,7 @@ itkReleaseDataFilterTest(int, char *[]) ImageType::PointValueType origin[2] = { 15, 400 }; random->SetOrigin(origin); - MonitorFilter::Pointer monitor1 = MonitorFilter::New(); + auto monitor1 = MonitorFilter::New(); monitor1->SetInput(random->GetOutput()); @@ -67,7 +67,7 @@ itkReleaseDataFilterTest(int, char *[]) // Create a mean image using MeanImageFilterType = itk::MeanImageFilter; - MeanImageFilterType::Pointer mean1 = MeanImageFilterType::New(); + auto mean1 = MeanImageFilterType::New(); mean1->SetInput(monitor1->GetOutput()); // define the neighborhood size used for the mean filter @@ -75,27 +75,27 @@ itkReleaseDataFilterTest(int, char *[]) neighRadius.Fill(2); mean1->SetRadius(neighRadius); - MonitorFilter::Pointer monitor2a = MonitorFilter::New(); + auto monitor2a = MonitorFilter::New(); monitor2a->SetInput(mean1->GetOutput()); // pipeline b using ShiftScaleImageFilterType = itk::ShiftScaleImageFilter; - ShiftScaleImageFilterType::Pointer shiftscale = ShiftScaleImageFilterType::New(); + auto shiftscale = ShiftScaleImageFilterType::New(); shiftscale->SetInput(monitor1->GetOutput()); shiftscale->SetScale(2.0); shiftscale->SetShift(-100.0); using ShrinkImageFilterType = itk::ShrinkImageFilter; - ShrinkImageFilterType::Pointer shrinker = ShrinkImageFilterType::New(); + auto shrinker = ShrinkImageFilterType::New(); shrinker->SetInput(shiftscale->GetOutput()); shrinker->SetShrinkFactors(2); - MonitorFilter::Pointer monitor2b = MonitorFilter::New(); + auto monitor2b = MonitorFilter::New(); monitor2b->SetInput(shrinker->GetOutput()); using StreamingImageFilterType = itk::StreamingImageFilter; - StreamingImageFilterType::Pointer streamer = StreamingImageFilterType::New(); + auto streamer = StreamingImageFilterType::New(); streamer->SetInput(monitor2b->GetOutput()); streamer->SetNumberOfStreamDivisions(4); diff --git a/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx b/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx index 16496fce54b..676b770e6cf 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkShrinkImagePreserveObjectPhysicalLocations.cxx @@ -48,7 +48,7 @@ MakeTwoLevelPyramid(TImageType::Pointer refImage) { PyramidFilterType::ScheduleType pyramidSchedule; - PyramidFilterType::Pointer MyPyramid = PyramidFilterType::New(); + auto MyPyramid = PyramidFilterType::New(); MyPyramid->SetInput(refImage); MyPyramid->SetNumberOfLevels(2); MyPyramid->SetMaximumError(1.e-5); @@ -94,7 +94,7 @@ GetCenterOfMass(TImageType::Pointer volume) TImageType::PointType CenterOfMass; { using momentsCalculatorType = itk::ImageMomentsCalculator; - momentsCalculatorType::Pointer moments = momentsCalculatorType::New(); + auto moments = momentsCalculatorType::New(); moments->SetImage(volume); moments->Compute(); TImageType::PointType::VectorType tempCenterOfMass = moments->GetCenterOfGravity(); @@ -157,7 +157,7 @@ itkShrinkImagePreserveObjectPhysicalLocations(int, char *[]) newDirection[1][1] = 0; newOrigin = newDirection * newOrigin; - TImageType::Pointer image = TImageType::New(); + auto image = TImageType::New(); image->SetOrigin(newOrigin); image->SetSpacing(newSpacing); image->SetRegions(newSize); @@ -214,7 +214,7 @@ itkShrinkImagePreserveObjectPhysicalLocations(int, char *[]) //#define __WRITE_DEBUG_IMAGING__ #ifdef __WRITE_DEBUG_IMAGING__ using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); itk::CastImageFilter::Pointer castFilter = itk::CastImageFilter::New(); diff --git a/Modules/Nonunit/IntegratedTest/test/itkStatisticsPrintTest.cxx b/Modules/Nonunit/IntegratedTest/test/itkStatisticsPrintTest.cxx index a064a5675ad..71ea147f43f 100644 --- a/Modules/Nonunit/IntegratedTest/test/itkStatisticsPrintTest.cxx +++ b/Modules/Nonunit/IntegratedTest/test/itkStatisticsPrintTest.cxx @@ -112,28 +112,28 @@ itkStatisticsPrintTest(int, char *[]) using KdTreeBasedKMeansEstimatorType = itk::Statistics::KdTreeBasedKmeansEstimator; - SampleType::Pointer sampleObj = SampleType::New(); + auto sampleObj = SampleType::New(); std::cout << "----------ListSample " << sampleObj; - SubSampleType::Pointer subsampleObj = SubSampleType::New(); + auto subsampleObj = SubSampleType::New(); std::cout << "----------Subsample " << subsampleObj; - HistogramType::Pointer HistogramObj = HistogramType::New(); + auto HistogramObj = HistogramType::New(); std::cout << "----------Histogram " << HistogramObj; - SampleToHistogramFilterType::Pointer SampleToHistogramFilterObj = SampleToHistogramFilterType::New(); + auto SampleToHistogramFilterObj = SampleToHistogramFilterType::New(); std::cout << "----------SampleToHistogramFilter "; std::cout << SampleToHistogramFilterObj; - SampleClassifierFilterType::Pointer xSampleClassifierFilterObj = SampleClassifierFilterType::New(); + auto xSampleClassifierFilterObj = SampleClassifierFilterType::New(); std::cout << "----------SampleClassifierFilter "; std::cout << xSampleClassifierFilterObj; - ImageToListSampleFilterType::Pointer ImageToListSampleFilterObj = ImageToListSampleFilterType::New(); + auto ImageToListSampleFilterObj = ImageToListSampleFilterType::New(); std::cout << "----------ImageToListSampleFilter "; std::cout << ImageToListSampleFilterObj; - ImageToListSampleAdaptorType::Pointer ImageToListSampleAdaptorObj = ImageToListSampleAdaptorType::New(); + auto ImageToListSampleAdaptorObj = ImageToListSampleAdaptorType::New(); std::cout << "----------ImageToListSampleAdaptor "; std::cout << ImageToListSampleAdaptorObj; @@ -142,7 +142,7 @@ itkStatisticsPrintTest(int, char *[]) std::cout << "----------JointDomainImageToListSampleAdaptor "; std::cout << JointDomainImageToListSampleAdaptorObj; - PointSetToListSampleAdaptorType::Pointer PointSetToListSampleAdaptorObj = PointSetToListSampleAdaptorType::New(); + auto PointSetToListSampleAdaptorObj = PointSetToListSampleAdaptorType::New(); std::cout << "----------PointSetToListSampleAdaptor "; std::cout << PointSetToListSampleAdaptorObj; @@ -165,60 +165,60 @@ itkStatisticsPrintTest(int, char *[]) HistogramToTextureFeaturesFilterType::New(); std::cout << "----------HistogramToTextureFeaturesFilter " << HistogramToTextureFeaturesFilterObj; - MembershipSampleType::Pointer MembershipSampleObj = MembershipSampleType::New(); + auto MembershipSampleObj = MembershipSampleType::New(); std::cout << "----------MembershipSample " << MembershipSampleObj; DistanceToCentroidMembershipFunctionType::Pointer DistanceToCentroidMembershipFunctionObj = DistanceToCentroidMembershipFunctionType::New(); std::cout << "----------DistanceToCentroidMembershipFunction " << DistanceToCentroidMembershipFunctionObj; - MeanSampleFilterType::Pointer meanFilterObj = MeanSampleFilterType::New(); + auto meanFilterObj = MeanSampleFilterType::New(); std::cout << "----------Mean filter " << meanFilterObj; - WeightedMeanSampleFilterType::Pointer weighedMeanSampleFilterObj = WeightedMeanSampleFilterType::New(); + auto weighedMeanSampleFilterObj = WeightedMeanSampleFilterType::New(); std::cout << "----------WeightedMean filter " << weighedMeanSampleFilterObj; - CovarianceSampleFilterType::Pointer covarianceFilterObj = CovarianceSampleFilterType::New(); + auto covarianceFilterObj = CovarianceSampleFilterType::New(); std::cout << "----------Covariance filter " << covarianceFilterObj; WeightedCovarianceSampleFilterType::Pointer weighedCovarianceSampleFilterObj = WeightedCovarianceSampleFilterType::New(); std::cout << "----------WeightedCovariance filter " << weighedCovarianceSampleFilterObj; - NeighborhoodSamplerType::Pointer neighborhoodSamplerObj = NeighborhoodSamplerType::New(); + auto neighborhoodSamplerObj = NeighborhoodSamplerType::New(); std::cout << "----------NeighborhoodSamplerType filter " << neighborhoodSamplerObj; - DenseFrequencyContainer2Type::Pointer DenseFrequencyContainer2Obj = DenseFrequencyContainer2Type::New(); + auto DenseFrequencyContainer2Obj = DenseFrequencyContainer2Type::New(); std::cout << "----------DenseFrequencyContainer " << DenseFrequencyContainer2Obj; - SparseFrequencyContainer2Type::Pointer SparseFrequencyContainer2Obj = SparseFrequencyContainer2Type::New(); + auto SparseFrequencyContainer2Obj = SparseFrequencyContainer2Type::New(); std::cout << "----------SparseFrequencyContainer2 " << SparseFrequencyContainer2Obj; - EuclideanDistanceMetricType::Pointer euclideanDistance = EuclideanDistanceMetricType::New(); + auto euclideanDistance = EuclideanDistanceMetricType::New(); std::cout << "----------EuclideanDistanceMetricType " << euclideanDistance; - EuclideanSquareDistanceMetricType::Pointer euclideanSquareDistance = EuclideanSquareDistanceMetricType::New(); + auto euclideanSquareDistance = EuclideanSquareDistanceMetricType::New(); std::cout << "----------EuclideanSquareDistanceMetricType " << euclideanSquareDistance; - MahalanobisDistanceMetricType::Pointer mahalanobisDistance = MahalanobisDistanceMetricType::New(); + auto mahalanobisDistance = MahalanobisDistanceMetricType::New(); std::cout << "----------MahalanobisDistanceMetricType " << mahalanobisDistance; - ManhattanDistanceMetricType::Pointer manhattanDistance = ManhattanDistanceMetricType::New(); + auto manhattanDistance = ManhattanDistanceMetricType::New(); std::cout << "----------ManhattanDistanceMetricType " << manhattanDistance; - MaximumDecisionRuleType::Pointer maximumDecsion = MaximumDecisionRuleType::New(); + auto maximumDecsion = MaximumDecisionRuleType::New(); std::cout << "----------MaximumDecisionRuleType " << maximumDecsion; - MinimumDecisionRuleType::Pointer minimumDecsion = MinimumDecisionRuleType::New(); + auto minimumDecsion = MinimumDecisionRuleType::New(); std::cout << "----------MinimumDecisionRuleType " << minimumDecsion; - ImageClassifierFilterType::Pointer classifierFilter = ImageClassifierFilterType::New(); + auto classifierFilter = ImageClassifierFilterType::New(); std::cout << "----------ImageClassifierFilterType " << classifierFilter; - EMEstimatorType::Pointer emEstimator = EMEstimatorType::New(); + auto emEstimator = EMEstimatorType::New(); std::cout << "----------EMEstimatorType " << emEstimator; - KdTreeBasedKMeansEstimatorType::Pointer kdTreeBasedEstimator = KdTreeBasedKMeansEstimatorType::New(); + auto kdTreeBasedEstimator = KdTreeBasedKMeansEstimatorType::New(); std::cout << "----------KdTreeBasedKMeansEstimatorType " << kdTreeBasedEstimator; return EXIT_SUCCESS; diff --git a/Modules/Nonunit/Review/include/itkAttributeMorphologyBaseImageFilter.hxx b/Modules/Nonunit/Review/include/itkAttributeMorphologyBaseImageFilter.hxx index 5c89cddffa2..c06e626a1b3 100644 --- a/Modules/Nonunit/Review/include/itkAttributeMorphologyBaseImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkAttributeMorphologyBaseImageFilter.hxx @@ -67,7 +67,7 @@ AttributeMorphologyBaseImageFilter; - typename CastType::Pointer cast = CastType::New(); + auto cast = CastType::New(); cast->SetInput(this->GetInput()); cast->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); cast->SetInPlace(false); diff --git a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx index 43e690623c9..8ed1fb22cc5 100644 --- a/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkDirectFourierReconstructionImageToImageFilter.hxx @@ -195,7 +195,7 @@ DirectFourierReconstructionImageToImageFilter::Genera inputIt.GoToBegin(); // Setup projection line - ProjectionLineType::Pointer projectionLine = ProjectionLineType::New(); + auto projectionLine = ProjectionLineType::New(); ProjectionLineType::RegionType pRegion; ProjectionLineType::SizeType pSize; ProjectionLineType::IndexType pStart; @@ -211,7 +211,7 @@ DirectFourierReconstructionImageToImageFilter::Genera const unsigned int pLineHalfShift = pSize[0] - inputROISize[m_RDirection] / 2; // Setup 1D FFT Filter - FFTLineFilterType::Pointer FFT = FFTLineFilterType::New(); + auto FFT = FFTLineFilterType::New(); FFT->SetInput(projectionLine); // Setup FFT Line interpolator stack @@ -232,7 +232,7 @@ DirectFourierReconstructionImageToImageFilter::Genera FFTSliceRegion.SetSize(FFTSliceSize); FFTSliceRegion.SetIndex(FFTSliceStart); - FFTSliceType::Pointer FFTSlice = FFTSliceType::New(); + auto FFTSlice = FFTSliceType::New(); FFTSlice->SetRegions(FFTSliceRegion); FFTSlice->Allocate(true); // initialize // buffer to zero @@ -382,7 +382,7 @@ DirectFourierReconstructionImageToImageFilter::Genera } // for FFTSliceIt // Setup inverse 2D FFT Filter - IFFTSliceFilterType::Pointer IFFT = IFFTSliceFilterType::New(); + auto IFFT = IFFTSliceFilterType::New(); IFFT->SetInput(FFTSlice); // Calculate the inverse 2D FFT of the slice diff --git a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx index a4f4b032b3a..b89842817b0 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGaussianDerivativeImageFunction.hxx @@ -100,7 +100,7 @@ DiscreteGaussianDerivativeImageFunction::RecomputeGaussian // only one. using KernelImageType = itk::Image; - typename KernelImageType::Pointer kernelImage = KernelImageType::New(); + auto kernelImage = KernelImageType::New(); using RegionType = typename KernelImageType::RegionType; RegionType region; @@ -129,7 +129,7 @@ DiscreteGaussianDerivativeImageFunction::RecomputeGaussian // Now create an image filter to perform successive convolutions using NeighborhoodFilterType = itk::NeighborhoodOperatorImageFilter; - typename NeighborhoodFilterType::Pointer convolutionFilter = NeighborhoodFilterType::New(); + auto convolutionFilter = NeighborhoodFilterType::New(); for (unsigned int direction = 0; direction < Self::ImageDimension2; ++direction) { diff --git a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx index bd989a69795..8528fb16ca7 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteGradientMagnitudeGaussianImageFunction.hxx @@ -113,7 +113,7 @@ DiscreteGradientMagnitudeGaussianImageFunction::RecomputeG // N convolutions for each point we calculate but only one. using KernelImageType = itk::Image; - typename KernelImageType::Pointer kernelImage = KernelImageType::New(); + auto kernelImage = KernelImageType::New(); using RegionType = typename KernelImageType::RegionType; RegionType region; @@ -140,7 +140,7 @@ DiscreteGradientMagnitudeGaussianImageFunction::RecomputeG // Now create an image filter to perform successive convolutions using NeighborhoodFilterType = itk::NeighborhoodOperatorImageFilter; - typename NeighborhoodFilterType::Pointer convolutionFilter = NeighborhoodFilterType::New(); + auto convolutionFilter = NeighborhoodFilterType::New(); unsigned int opidx; // current operator index in m_OperatorArray diff --git a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx index a129ef261fc..afa380a3c91 100644 --- a/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx +++ b/Modules/Nonunit/Review/include/itkDiscreteHessianGaussianImageFunction.hxx @@ -106,7 +106,7 @@ DiscreteHessianGaussianImageFunction::RecomputeGaussianKer // only one. using KernelImageType = itk::Image; - typename KernelImageType::Pointer kernelImage = KernelImageType::New(); + auto kernelImage = KernelImageType::New(); using RegionType = typename KernelImageType::RegionType; RegionType region; @@ -133,7 +133,7 @@ DiscreteHessianGaussianImageFunction::RecomputeGaussianKer // Now create an image filter to perform successive convolutions using NeighborhoodFilterType = itk::NeighborhoodOperatorImageFilter; - typename NeighborhoodFilterType::Pointer convolutionFilter = NeighborhoodFilterType::New(); + auto convolutionFilter = NeighborhoodFilterType::New(); // Array that stores the current order for each direction using OrderArrayType = FixedArray; diff --git a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx index 971c514b7f6..14330a7464e 100644 --- a/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkLabelGeometryImageFilter.hxx @@ -102,7 +102,7 @@ CalculateOrientedImage(const vnl_symmetric_eigensystem & // centroid of the object, the rotation matrix is specified by the // eigenvectors, and there is no translation. using TransformType = itk::AffineTransform; - typename TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); typename TransformType::MatrixType rotationMatrix(vnl_RotationMatrix); typename TransformType::CenterType center; typename TInputImage::PointType origin; @@ -118,7 +118,7 @@ CalculateOrientedImage(const vnl_symmetric_eigensystem & transform->SetMatrix(rotationMatrix); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); // The m_OrientedBoundingBoxSize is specified to float precision. // Here we need an integer size large enough to contain all of the points, so @@ -143,7 +143,7 @@ CalculateOrientedImage(const vnl_symmetric_eigensystem & // Set up the interpolator. // Use a nearest neighbor interpolator since these are labeled images. using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); } else @@ -151,7 +151,7 @@ CalculateOrientedImage(const vnl_symmetric_eigensystem & // Set up the interpolator. // Use a linear interpolator since these are intensity images. using InterpolatorType = itk::LinearInterpolateImageFunction; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); resampler->SetInterpolator(interpolator); } resampler->Update(); diff --git a/Modules/Nonunit/Review/include/itkMiniPipelineSeparableImageFilter.hxx b/Modules/Nonunit/Review/include/itkMiniPipelineSeparableImageFilter.hxx index a7c5748e5e8..8f2273c530d 100644 --- a/Modules/Nonunit/Review/include/itkMiniPipelineSeparableImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkMiniPipelineSeparableImageFilter.hxx @@ -102,7 +102,7 @@ MiniPipelineSeparableImageFilter::GenerateDa m_Filters[0]->SetInput(this->GetInput()); // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); for (unsigned i = 0; i < ImageDimension; ++i) { diff --git a/Modules/Nonunit/Review/include/itkRobustAutomaticThresholdImageFilter.hxx b/Modules/Nonunit/Review/include/itkRobustAutomaticThresholdImageFilter.hxx index 9b0d59d8112..f3d20687e7a 100644 --- a/Modules/Nonunit/Review/include/itkRobustAutomaticThresholdImageFilter.hxx +++ b/Modules/Nonunit/Review/include/itkRobustAutomaticThresholdImageFilter.hxx @@ -38,11 +38,11 @@ template void RobustAutomaticThresholdImageFilter::GenerateData() { - typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); // Compute the Threshold for the input image - typename CalculatorType::Pointer thresholdCalculator = CalculatorType::New(); + auto thresholdCalculator = CalculatorType::New(); thresholdCalculator->SetInput(this->GetInput()); thresholdCalculator->SetGradient(this->GetGradientImage()); thresholdCalculator->SetPow(m_Pow); diff --git a/Modules/Nonunit/Review/include/itkVoxBoCUBImageIOFactory.h b/Modules/Nonunit/Review/include/itkVoxBoCUBImageIOFactory.h index 59ea5129221..e20f8c70e14 100644 --- a/Modules/Nonunit/Review/include/itkVoxBoCUBImageIOFactory.h +++ b/Modules/Nonunit/Review/include/itkVoxBoCUBImageIOFactory.h @@ -62,7 +62,7 @@ class VoxBoCUBImageIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - VoxBoCUBImageIOFactory::Pointer VoxBoCUBFactory = VoxBoCUBImageIOFactory::New(); + auto VoxBoCUBFactory = VoxBoCUBImageIOFactory::New(); ObjectFactoryBase::RegisterFactory(VoxBoCUBFactory); } diff --git a/Modules/Nonunit/Review/test/itkAreaClosingImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkAreaClosingImageFilterTest.cxx index 934c449abaa..7bb51167e09 100644 --- a/Modules/Nonunit/Review/test/itkAreaClosingImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkAreaClosingImageFilterTest.cxx @@ -43,11 +43,11 @@ itkAreaClosingImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::AreaClosingImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AreaClosingImageFilter, AttributeMorphologyBaseImageFilter); @@ -85,7 +85,7 @@ itkAreaClosingImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx index f08daecebc8..96be4be25d8 100644 --- a/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkAreaOpeningImageFilterTest.cxx @@ -43,11 +43,11 @@ itkAreaOpeningImageFilterTest(int argc, char * argv[]) using IType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::AreaOpeningImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AreaOpeningImageFilter, AttributeMorphologyBaseImageFilter); @@ -85,7 +85,7 @@ itkAreaOpeningImageFilterTest(int argc, char * argv[]) itk::SimpleFilterWatcher watcher(filter, "filter"); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkConformalFlatteningMeshFilterTest.cxx b/Modules/Nonunit/Review/test/itkConformalFlatteningMeshFilterTest.cxx index 88f0c421e1b..ff757366a79 100644 --- a/Modules/Nonunit/Review/test/itkConformalFlatteningMeshFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkConformalFlatteningMeshFilterTest.cxx @@ -42,7 +42,7 @@ itkConformalFlatteningMeshFilterTest(int argc, char * argv[]) using CellIdentifier = MeshType::CellIdentifier; // Read mesh file - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -50,7 +50,7 @@ itkConformalFlatteningMeshFilterTest(int argc, char * argv[]) MeshType::Pointer mesh = reader->GetOutput(); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ConformalFlatteningMeshFilter, MeshToMeshFilter); @@ -88,7 +88,7 @@ itkConformalFlatteningMeshFilterTest(int argc, char * argv[]) MeshType::Pointer newMesh = filter->GetOutput(); // Write to file - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(newMesh); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkConformalFlatteningQuadEdgeMeshFilterTest.cxx b/Modules/Nonunit/Review/test/itkConformalFlatteningQuadEdgeMeshFilterTest.cxx index 8fe01ea6689..c3ea6a1950f 100644 --- a/Modules/Nonunit/Review/test/itkConformalFlatteningQuadEdgeMeshFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkConformalFlatteningQuadEdgeMeshFilterTest.cxx @@ -49,7 +49,7 @@ itkConformalFlatteningQuadEdgeMeshFilterTest(int argc, char * argv[]) std::cout << "Read " << argv[1] << std::endl; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try @@ -68,7 +68,7 @@ itkConformalFlatteningQuadEdgeMeshFilterTest(int argc, char * argv[]) // Test itkConformalFlatteningMeshFilter // - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the input filter->SetInput(mesh); @@ -114,7 +114,7 @@ itkConformalFlatteningQuadEdgeMeshFilterTest(int argc, char * argv[]) std::cout << "Write " << argv[2] << std::endl; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(newMesh); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkDirectFourierReconstructionImageToImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkDirectFourierReconstructionImageToImageFilterTest.cxx index ae37bf18d4f..61ed57f5fc5 100644 --- a/Modules/Nonunit/Review/test/itkDirectFourierReconstructionImageToImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkDirectFourierReconstructionImageToImageFilterTest.cxx @@ -89,17 +89,17 @@ itkDirectFourierReconstructionImageToImageFilterTest(int argc, char * argv[]) return EXIT_FAILURE; } - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - SmootherType::Pointer smoother = SmootherType::New(); + auto smoother = SmootherType::New(); smoother->SetInput(reader->GetOutput()); smoother->SetSigma(std::stod(argv[17])); smoother->SetDirection(std::stoi(argv[3])); - ReconstructionFilterType::Pointer reconstruct = ReconstructionFilterType::New(); + auto reconstruct = ReconstructionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(reconstruct, DirectFourierReconstructionImageToImageFilter, ImageToImageFilter); @@ -121,16 +121,16 @@ itkDirectFourierReconstructionImageToImageFilterTest(int argc, char * argv[]) reconstruct->SetRadialSplineOrder(std::stoi(argv[9])); reconstruct->SetAlphaRange(std::stoi(argv[10])); - CommandProgressUpdate::Pointer observer = CommandProgressUpdate::New(); + auto observer = CommandProgressUpdate::New(); reconstruct->AddObserver(itk::ProgressEvent(), observer); - RescalerType::Pointer rescaler = RescalerType::New(); + auto rescaler = RescalerType::New(); rescaler->SetInput(reconstruct->GetOutput()); rescaler->SetOutputMinimum(itk::NumericTraits::min()); rescaler->SetOutputMaximum(itk::NumericTraits::max()); - ROIFilterType::Pointer ROIFilter = ROIFilterType::New(); + auto ROIFilter = ROIFilterType::New(); ROIFilter->SetInput(rescaler->GetOutput()); ROIFilterType::IndexType start; @@ -151,7 +151,7 @@ itkDirectFourierReconstructionImageToImageFilterTest(int argc, char * argv[]) ROIFilter->SetRegionOfInterest(requestedRegion); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->UseCompressionOn(); writer->SetInput(ROIFilter->GetOutput()); diff --git a/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx index d5ada56efea..bba28886ce9 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteGaussianDerivativeImageFunctionTest.cxx @@ -34,7 +34,7 @@ itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) // Read the input image using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -44,7 +44,7 @@ itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) // Create the itk::DiscreteGaussianDerivativeImageFunction using GaussianDerivativeImageFunctionType = itk::DiscreteGaussianDerivativeImageFunction; - typename GaussianDerivativeImageFunctionType::Pointer function = GaussianDerivativeImageFunctionType::New(); + auto function = GaussianDerivativeImageFunctionType::New(); function->SetInputImage(inputImage); @@ -107,7 +107,7 @@ itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) // Create image for storing result - typename ImageType::Pointer output = ImageType::New(); + auto output = ImageType::New(); output->SetSpacing(inputImage->GetSpacing()); output->SetOrigin(inputImage->GetOrigin()); output->SetDirection(inputImage->GetDirection()); @@ -161,14 +161,14 @@ itkDiscreteGaussianDerivativeImageFunctionTestND(int argc, char * argv[]) using OutputImageType = itk::Image; using RescaleType = itk::RescaleIntensityImageFilter; - typename RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(output); rescaler->SetOutputMinimum(itk::NumericTraits::min()); rescaler->SetOutputMaximum(itk::NumericTraits::max()); // Write the output image using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); @@ -206,7 +206,7 @@ itkDiscreteGaussianDerivativeImageFunctionTest(int argc, char * argv[]) using ImageType = itk::Image; using GaussianDerivativeImageFunctionType = itk::DiscreteGaussianDerivativeImageFunction; - GaussianDerivativeImageFunctionType::Pointer function = GaussianDerivativeImageFunctionType::New(); + auto function = GaussianDerivativeImageFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, DiscreteGaussianDerivativeImageFunction, ImageFunction); diff --git a/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx index cc7e1f0a0e0..9f6d8da7666 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteGradientMagnitudeGaussianImageFunctionTest.cxx @@ -34,7 +34,7 @@ itkDiscreteGradientMagnitudeGaussianImageFunctionTestND(int argc, char * argv[]) // Read input image using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -118,7 +118,7 @@ itkDiscreteGradientMagnitudeGaussianImageFunctionTestND(int argc, char * argv[]) // Create image for storing result - typename ImageType::Pointer output = ImageType::New(); + auto output = ImageType::New(); output->SetSpacing(inputImage->GetSpacing()); output->SetOrigin(inputImage->GetOrigin()); output->SetDirection(inputImage->GetDirection()); @@ -171,14 +171,14 @@ itkDiscreteGradientMagnitudeGaussianImageFunctionTestND(int argc, char * argv[]) using OutputPixelType = unsigned char; using OutputImageType = itk::Image; using RescaleType = itk::RescaleIntensityImageFilter; - typename RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(output); rescaler->SetOutputMinimum(itk::NumericTraits::min()); rescaler->SetOutputMaximum(itk::NumericTraits::max()); // Write the output image using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(rescaler->GetOutput()); diff --git a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx index 67a8e0e74e3..85818606d41 100644 --- a/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkDiscreteHessianGaussianImageFunctionTest.cxx @@ -35,7 +35,7 @@ itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) // Read input using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -46,7 +46,7 @@ itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) typename HessianGaussianImageFunctionType::TensorType hessian; typename HessianGaussianImageFunctionType::TensorType::EigenValuesArrayType eigenValues; - typename HessianGaussianImageFunctionType::Pointer function = HessianGaussianImageFunctionType::New(); + auto function = HessianGaussianImageFunctionType::New(); function->SetInputImage(reader->GetOutput()); @@ -172,7 +172,7 @@ itkDiscreteHessianGaussianImageFunctionTestND(int argc, char * argv[]) // Write the output image using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(output); @@ -279,7 +279,7 @@ itkDiscreteHessianGaussianImageFunctionTest(int argc, char * argv[]) using HessianGaussianImageFunctionType = itk::DiscreteHessianGaussianImageFunction; - HessianGaussianImageFunctionType::Pointer function = HessianGaussianImageFunctionType::New(); + auto function = HessianGaussianImageFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(function, DiscreteHessianGaussianImageFunction, ImageFunction); diff --git a/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx index 8b4675c0b18..40abccde93d 100644 --- a/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkFastApproximateRankImageFilterTest.cxx @@ -38,12 +38,12 @@ itkFastApproximateRankImageFilterTest(int ac, char * av[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using FilterType = itk::FastApproximateRankImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); using RadiusType = FilterType::RadiusType; @@ -103,7 +103,7 @@ itkFastApproximateRankImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); writer->Update(); diff --git a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx index dfecb4651c5..1e900290589 100644 --- a/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkGridForwardWarpImageFilterTest.cxx @@ -58,7 +58,7 @@ itkGridForwardWarpImageFilterTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create an input image - DisplacementFieldType::Pointer inputDisplacementField = DisplacementFieldType::New(); + auto inputDisplacementField = DisplacementFieldType::New(); // Define its size, and start index SizeType size; @@ -100,7 +100,7 @@ itkGridForwardWarpImageFilterTest(int argc, char * argv[]) // Create the filter instance - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, GridForwardWarpImageFilter, ImageToImageFilter); @@ -122,7 +122,7 @@ itkGridForwardWarpImageFilterTest(int argc, char * argv[]) // Write the result image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[1]); diff --git a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx index db3f3814361..b4a1f4b567f 100644 --- a/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkImageFunctionTest.cxx @@ -122,7 +122,7 @@ itkImageFunctionTest(int, char *[]) using FunctionType = itk::TestImageFunction; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); IndexType start; start.Fill(1); @@ -147,7 +147,7 @@ itkImageFunctionTest(int, char *[]) image->Print(std::cout); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); /* Test SetInputImage & Accessors */ function->SetInputImage(image); diff --git a/Modules/Nonunit/Review/test/itkLabelGeometryImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkLabelGeometryImageFilterTest.cxx index 9d200d3ec02..ab31525c6c9 100644 --- a/Modules/Nonunit/Review/test/itkLabelGeometryImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkLabelGeometryImageFilterTest.cxx @@ -102,17 +102,17 @@ LabelGeometryImageFilterTest(std::string labelImageName, // Read the label image. using LabelReaderType = itk::ImageFileReader; - typename LabelReaderType::Pointer labelReader = LabelReaderType::New(); + auto labelReader = LabelReaderType::New(); labelReader->SetFileName(labelImageName); // Read the intensity image. using IntensityReaderType = itk::ImageFileReader; - typename IntensityReaderType::Pointer intensityReader = IntensityReaderType::New(); + auto intensityReader = IntensityReaderType::New(); intensityReader->SetFileName(intensityImageName); // First test the filter without any intensity image. using LabelGeometryType = itk::LabelGeometryImageFilter; - typename LabelGeometryType::Pointer labelGeometryFilter = LabelGeometryType::New(); + auto labelGeometryFilter = LabelGeometryType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(labelGeometryFilter, LabelGeometryImageFilter, ImageToImageFilter); @@ -132,7 +132,7 @@ LabelGeometryImageFilterTest(std::string labelImageName, // Write out the oriented image of the first object. typename LabelGeometryType::LabelPixelType labelValue = 1; using IntensityWriterType = itk::ImageFileWriter; - typename IntensityWriterType::Pointer intensityWriter = IntensityWriterType::New(); + auto intensityWriter = IntensityWriterType::New(); intensityWriter->SetFileName(outputImageName); intensityWriter->SetInput(labelGeometryFilter->GetOrientedIntensityImage(labelValue)); @@ -208,7 +208,7 @@ LabelGeometryImageFilterTest(std::string labelImageName, columnName.push_back("Orientation"); // write out the array2D object - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFileName); writer->SetInput(&matrix); writer->SetColumnHeaders(columnName); @@ -228,14 +228,14 @@ LabelGeometryImageFilterTest(std::string labelImageName, // Read the values we just wrote. // This is better than comparing against the values in memory because some truncation occurs when writing to file. using ReaderType = itk::CSVArray2DFileReader; - ReaderType::Pointer newReader = ReaderType::New(); + auto newReader = ReaderType::New(); newReader->SetFileName(outputFileName); newReader->SetFieldDelimiterCharacter(','); newReader->HasColumnHeadersOn(); newReader->HasRowHeadersOff(); // Read the values to compare against. - ReaderType::Pointer compareReader = ReaderType::New(); + auto compareReader = ReaderType::New(); compareReader->SetFileName(compareFileName); compareReader->SetFieldDelimiterCharacter(','); compareReader->HasColumnHeadersOn(); @@ -246,11 +246,11 @@ LabelGeometryImageFilterTest(std::string labelImageName, using DataFrameObjectType = itk::CSVArray2DDataObject; - DataFrameObjectType::Pointer newDFO = DataFrameObjectType::New(); + auto newDFO = DataFrameObjectType::New(); newDFO = newReader->GetOutput(); MatrixType newMatrix = newDFO->GetMatrix(); - DataFrameObjectType::Pointer compareDFO = DataFrameObjectType::New(); + auto compareDFO = DataFrameObjectType::New(); compareDFO = compareReader->GetOutput(); MatrixType compareMatrix = compareDFO->GetMatrix(); diff --git a/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx index 5aa062cdd3b..4b908b0f5fc 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseDenseFiniteDifferenceImageFilterTest.cxx @@ -89,7 +89,7 @@ itkMultiphaseDenseFiniteDifferenceImageFilterTest(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -103,7 +103,7 @@ itkMultiphaseDenseFiniteDifferenceImageFilterTest(int, char *[]) RegionBasedLevelSetFunctionType, IdCellType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << "GetNameOfClass() = " << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx index 5ce111a1fbc..fb14afca6e9 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseFiniteDifferenceImageFilterTest.cxx @@ -86,7 +86,7 @@ itkMultiphaseFiniteDifferenceImageFilterTest(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -100,7 +100,7 @@ itkMultiphaseFiniteDifferenceImageFilterTest(int, char *[]) RegionBasedLevelSetFunctionType, IdCellType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << "GetNameOfClass() = " << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx index bf15ab53efe..82dc81d3cc9 100644 --- a/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkMultiphaseSparseFiniteDifferenceImageFilterTest.cxx @@ -92,7 +92,7 @@ itkMultiphaseSparseFiniteDifferenceImageFilterTest(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -106,7 +106,7 @@ itkMultiphaseSparseFiniteDifferenceImageFilterTest(int, char *[]) RegionBasedLevelSetFunctionType, IdCellType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Instantiate the filter of interest to exercise its basic object methods typename FilterType::Superclass::Pointer multiphaseSparseFiniteDiffFilter = FilterType::Superclass::New(); diff --git a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.cxx b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.cxx index 233a1b7dec8..6c11e131b9f 100644 --- a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.cxx +++ b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.cxx @@ -39,8 +39,8 @@ itkOptImageToImageMetricsTest(int, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.h b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.h index 2a3b7f63773..c2bb3b41774 100644 --- a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.h +++ b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest.h @@ -212,14 +212,14 @@ BasicTest(FixedImageReaderType * fixedImageReader, // Mean squares using MetricType = itk::MeanSquaresImageToImageMetric; - typename MetricType::Pointer msMetric = MetricType::New(); + auto msMetric = MetricType::New(); MeanSquaresMetricInitializer msMetricInitializer(msMetric); TestAMetric(fixedImageReader, movingImageReader, interpolator, transform, msMetric.GetPointer(), msMetricInitializer); // Mattes MI using MattesMetricType = itk::MattesMutualInformationImageToImageMetric; - typename MattesMetricType::Pointer mattesMetric = MattesMetricType::New(); + auto mattesMetric = MattesMetricType::New(); MattesMIMetricInitializer mattesMetricInitializer(mattesMetric); TestAMetric( @@ -265,8 +265,8 @@ AffineLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType using InterpolatorType = itk::LinearInterpolateImageFunction; using TransformType = itk::AffineTransform; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - TransformType::Pointer transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); BasicTest(fixedImageReader, movingImageReader, interpolator.GetPointer(), transform.GetPointer()); } @@ -280,8 +280,8 @@ RigidLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType * using InterpolatorType = itk::LinearInterpolateImageFunction; using TransformType = itk::Rigid2DTransform; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - TransformType::Pointer transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); BasicTest(fixedImageReader, movingImageReader, interpolator.GetPointer(), transform.GetPointer()); } @@ -295,8 +295,8 @@ TranslationLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReader using InterpolatorType = itk::LinearInterpolateImageFunction; using TransformType = itk::TranslationTransform; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - TransformType::Pointer transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); BasicTest(fixedImageReader, movingImageReader, interpolator.GetPointer(), transform.GetPointer()); } @@ -311,8 +311,8 @@ DoDebugTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType * mov using InterpolatorType = itk::LinearInterpolateImageFunction; using TransformType = itk::Rigid2DTransform; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - TransformType::Pointer transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); using FixedImageType = typename FixedImageReaderType::OutputImageType; using MovingImageType = typename MovingImageReaderType::OutputImageType; @@ -325,7 +325,7 @@ DoDebugTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType * mov // Mean squares using MetricType = itk::MeanSquaresImageToImageMetric; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); MeanSquaresMetricInitializer metricInitializer(metric); metric->SetFixedImageRegion(fixedImageReader->GetOutput()->GetBufferedRegion()); diff --git a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.cxx b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.cxx index ffe5aab6702..4753ebf9f60 100644 --- a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.cxx +++ b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.cxx @@ -36,8 +36,8 @@ itkOptImageToImageMetricsTest2(int, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h index 538f89f9709..ae7a1751ba2 100644 --- a/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h +++ b/Modules/Nonunit/Review/test/itkOptImageToImageMetricsTest2.h @@ -138,7 +138,7 @@ BasicTest(FixedImageReaderType * fixedImageReader, // Mean squares using MetricType = itk::MeanSquaresImageToImageMetric; - typename MetricType::Pointer msMetric = MetricType::New(); + auto msMetric = MetricType::New(); MeanSquaresMetricInitializer msMetricInitializer(msMetric); TestAMetric(fixedImageReader, movingImageReader, interpolator, transform, msMetric.GetPointer(), msMetricInitializer); @@ -202,7 +202,7 @@ BSplineLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType using TransformType = itk::BSplineTransform; - typename TransformType::Pointer bsplineTransform = TransformType::New(); + auto bsplineTransform = TransformType::New(); typename TransformType::MeshSizeType meshSize; typename TransformType::PhysicalDimensionsType physicalDimensions; @@ -222,7 +222,7 @@ BSplineLinearTest(FixedImageReaderType * fixedImageReader, MovingImageReaderType ParametersType parameters(numberOfParameters); - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); BasicTest(fixedImageReader, movingImageReader, interpolator.GetPointer(), bsplineTransform.GetPointer()); } diff --git a/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx b/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx index a5c33c2c62e..a1ac5297bd8 100644 --- a/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx +++ b/Modules/Nonunit/Review/test/itkOptMattesMutualInformationImageToImageMetricThreadsTest1.cxx @@ -52,8 +52,8 @@ itkOptMattesMutualInformationImageToImageMetricThreadsTest1(int argc, char * arg using ImageReaderType = itk::ImageFileReader; - ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); - ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -71,16 +71,16 @@ itkOptMattesMutualInformationImageToImageMetricThreadsTest1(int argc, char * arg using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); using MetricType = itk::MattesMutualInformationImageToImageMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, MattesMutualInformationImageToImageMetric, ImageToImageMetric); using TranformType = itk::TranslationTransform; - TranformType::Pointer transform = TranformType::New(); + auto transform = TranformType::New(); unsigned int numberOfSamples = 100; diff --git a/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx b/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx index 4df857333f3..64bc8b36c2f 100644 --- a/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkRegionBasedLevelSetFunctionTest.cxx @@ -125,7 +125,7 @@ itkRegionBasedLevelSetFunctionTest(int, char *[]) using RegionBasedLevelSetFunctionType = itk::RegionBasedLevelSetFunctionTestHelper; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Nonunit/Review/test/itkReviewPrintTest.cxx b/Modules/Nonunit/Review/test/itkReviewPrintTest.cxx index f84289ebfe8..c00b0898d99 100644 --- a/Modules/Nonunit/Review/test/itkReviewPrintTest.cxx +++ b/Modules/Nonunit/Review/test/itkReviewPrintTest.cxx @@ -60,8 +60,8 @@ itkReviewPrintTest(int, char *[]) using OutputImageType = itk::Image; // Dummy variable just to force the full instantiation of the class - CharType::Pointer dummyImage = CharType::New(); - VectorImageType::Pointer dummy2 = VectorImageType::New(); + auto dummyImage = CharType::New(); + auto dummy2 = VectorImageType::New(); itk::ContourExtractor2DImageFilter::Pointer ContourExtractor2DImageFilterObj = itk::ContourExtractor2DImageFilter::New(); @@ -75,7 +75,7 @@ itkReviewPrintTest(int, char *[]) itk::LabelOverlayImageFilter::New(); std::cout << "-------------LabelOverlayImageFilter " << LabelOverlayImageFilterObj; - QuadEdgeMeshType::Pointer QuadEdgeMeshObj = QuadEdgeMeshType::New(); + auto QuadEdgeMeshObj = QuadEdgeMeshType::New(); std::cout << "-------------QuadEdgeMesh " << QuadEdgeMeshObj; itk::ValuedRegionalMaximaImageFilter::Pointer ValuedRegionalMaximaImageFilterObj = diff --git a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx index c7abd843364..1ff498f048c 100644 --- a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx +++ b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdCalculatorTest.cxx @@ -44,17 +44,17 @@ itkRobustAutomaticThresholdCalculatorTest(int argc, char * argv[]) using RealImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using GradientType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientType::Pointer gradient = GradientType::New(); + auto gradient = GradientType::New(); gradient->SetInput(reader->GetOutput()); gradient->SetSigma(10); gradient->Update(); using CalculatorType = itk::RobustAutomaticThresholdCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, RobustAutomaticThresholdCalculator, Object); diff --git a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx index 56be29be66d..02b263096b2 100644 --- a/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkRobustAutomaticThresholdImageFilterTest.cxx @@ -46,11 +46,11 @@ itkRobustAutomaticThresholdImageFilterTest(int argc, char * argv[]) using RealImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using GradientType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientType::Pointer gradient = GradientType::New(); + auto gradient = GradientType::New(); gradient->SetInput(reader->GetOutput()); gradient->SetSigma(10); @@ -58,7 +58,7 @@ itkRobustAutomaticThresholdImageFilterTest(int argc, char * argv[]) using FilterType = itk::RobustAutomaticThresholdImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, RobustAutomaticThresholdImageFilter, ImageToImageFilter); @@ -101,7 +101,7 @@ itkRobustAutomaticThresholdImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx index e0e4aad09c5..e174c3f9b09 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest1.cxx @@ -36,7 +36,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest1(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -48,7 +48,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest1(int, char *[]) RegionBasedLevelSetFunctionType, SharedDataHelperType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << "GetNameOfClass() = " << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx index 273f9baf71a..5feacf803b2 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest2.cxx @@ -62,23 +62,23 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest2(int argc, char * argv[]) using DomainFunctionType = itk::AtanRegularizedHeavisideStepFunction; - DomainFunctionType::Pointer domainFunction = DomainFunctionType::New(); + auto domainFunction = DomainFunctionType::New(); domainFunction->SetEpsilon(epsilon); - LevelSetReaderType::Pointer levelSetReader1 = LevelSetReaderType::New(); + auto levelSetReader1 = LevelSetReaderType::New(); levelSetReader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(levelSetReader1->Update()); - FeatureReaderType::Pointer featureReader = FeatureReaderType::New(); + auto featureReader = FeatureReaderType::New(); featureReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(featureReader->Update()); - MultiLevelSetType::Pointer levelSetFilter = MultiLevelSetType::New(); + auto levelSetFilter = MultiLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( levelSetFilter, ScalarChanAndVeseDenseLevelSetImageFilter, MultiphaseDenseFiniteDifferenceImageFilter); @@ -105,7 +105,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest2(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(levelSetFilter->Update()); - WriterType::Pointer writer1 = WriterType::New(); + auto writer1 = WriterType::New(); writer1->SetInput(levelSetFilter->GetOutput()); writer1->UseCompressionOn(); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx index b330b80b305..b449dc35d1c 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest3.cxx @@ -37,7 +37,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest3(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -49,7 +49,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest3(int, char *[]) RegionBasedLevelSetFunctionType, SharedDataHelperType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << "GetNameOfClass() = " << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx index fa7d2c9abb2..8571fd86f03 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseDenseLevelSetImageFilterTest4.cxx @@ -74,23 +74,23 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest4(int argc, char * argv[]) using DomainFunctionType = itk::AtanRegularizedHeavisideStepFunction; - DomainFunctionType::Pointer domainFunction = DomainFunctionType::New(); + auto domainFunction = DomainFunctionType::New(); domainFunction->SetEpsilon(epsilon); - LevelSetReaderType::Pointer levelSetReader1 = LevelSetReaderType::New(); + auto levelSetReader1 = LevelSetReaderType::New(); levelSetReader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(levelSetReader1->Update()); - FeatureReaderType::Pointer featureReader = FeatureReaderType::New(); + auto featureReader = FeatureReaderType::New(); featureReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(featureReader->Update()); - MultiLevelSetType::Pointer levelSetFilter = MultiLevelSetType::New(); + auto levelSetFilter = MultiLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( levelSetFilter, ScalarChanAndVeseDenseLevelSetImageFilter, MultiphaseDenseFiniteDifferenceImageFilter); @@ -116,7 +116,7 @@ itkScalarChanAndVeseDenseLevelSetImageFilterTest4(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(levelSetFilter->Update()); - WriterType::Pointer writer1 = WriterType::New(); + auto writer1 = WriterType::New(); writer1->SetInput(levelSetFilter->GetOutput()); writer1->UseCompressionOn(); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx index 96cd400f626..7264edd1fcc 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest1.cxx @@ -144,7 +144,7 @@ itkScalarChanAndVeseLevelSetFunctionTest1(int, char *[]) using ChanAndVeseLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunctionTestHelper; - ChanAndVeseLevelSetFunctionType::Pointer function = ChanAndVeseLevelSetFunctionType::New(); + auto function = ChanAndVeseLevelSetFunctionType::New(); std::cout << "GetNameOfClass() = " << function->GetNameOfClass() << std::endl; function->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx index 85ee1d3ee14..e2990faec06 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseLevelSetFunctionTest2.cxx @@ -93,7 +93,7 @@ itkScalarChanAndVeseLevelSetFunctionTest2(int, char *[]) using ChanAndVeseLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunctionTest2Helper; - ChanAndVeseLevelSetFunctionType::Pointer function = ChanAndVeseLevelSetFunctionType::New(); + auto function = ChanAndVeseLevelSetFunctionType::New(); std::cout << "GetNameOfClass() = " << function->GetNameOfClass() << std::endl; function->Print(std::cout); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx index b930b4d7b8f..a55c1e150dc 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest1.cxx @@ -37,7 +37,7 @@ itkScalarChanAndVeseSparseLevelSetImageFilterTest1(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarChanAndVeseLevelSetFunction; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; @@ -49,7 +49,7 @@ itkScalarChanAndVeseSparseLevelSetImageFilterTest1(int, char *[]) RegionBasedLevelSetFunctionType, SharedDataHelperType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( filter, ScalarChanAndVeseSparseLevelSetImageFilter, MultiphaseSparseFiniteDifferenceImageFilter); diff --git a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx index 166eacf6640..7b7cc7efad5 100644 --- a/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx +++ b/Modules/Nonunit/Review/test/itkScalarChanAndVeseSparseLevelSetImageFilterTest2.cxx @@ -69,23 +69,23 @@ itkScalarChanAndVeseSparseLevelSetImageFilterTest2(int argc, char * argv[]) using DomainFunctionType = itk::AtanRegularizedHeavisideStepFunction; - DomainFunctionType::Pointer domainFunction = DomainFunctionType::New(); + auto domainFunction = DomainFunctionType::New(); domainFunction->SetEpsilon(epsilon); - LevelSetReaderType::Pointer levelSetReader1 = LevelSetReaderType::New(); + auto levelSetReader1 = LevelSetReaderType::New(); levelSetReader1->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(levelSetReader1->Update()); - FeatureReaderType::Pointer featureReader = FeatureReaderType::New(); + auto featureReader = FeatureReaderType::New(); featureReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(featureReader->Update()); - MultiLevelSetType::Pointer levelSetFilter = MultiLevelSetType::New(); + auto levelSetFilter = MultiLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( levelSetFilter, ScalarChanAndVeseSparseLevelSetImageFilter, MultiphaseSparseFiniteDifferenceImageFilter); @@ -108,7 +108,7 @@ itkScalarChanAndVeseSparseLevelSetImageFilterTest2(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(levelSetFilter->Update()); - WriterType::Pointer writer1 = WriterType::New(); + auto writer1 = WriterType::New(); writer1->SetInput(levelSetFilter->GetOutput()); writer1->UseCompressionOn(); diff --git a/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx b/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx index 304577d73e7..4c532d0f1ff 100644 --- a/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx +++ b/Modules/Nonunit/Review/test/itkScalarRegionBasedLevelSetFunctionTest.cxx @@ -155,7 +155,7 @@ itkScalarRegionBasedLevelSetFunctionTest(int, char *[]) using RegionBasedLevelSetFunctionType = itk::ScalarRegionBasedLevelSetFunctionTestHelper; - RegionBasedLevelSetFunctionType::Pointer function = RegionBasedLevelSetFunctionType::New(); + auto function = RegionBasedLevelSetFunctionType::New(); if (function.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx index 738894e8c1b..217beafd7b2 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1.cxx @@ -48,7 +48,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1(int argc, char * using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -63,7 +63,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1(int argc, char * RegionType region = reader->GetOutput()->GetBufferedRegion(); - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(reader->GetOutput()); function->ThresholdAbove(1); // >= 1 @@ -79,7 +79,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest1(int argc, char * } std::cout << std::endl; - ImageType::Pointer visitedImage = ImageType::New(); + auto visitedImage = ImageType::New(); visitedImage->SetRegions(region); visitedImage->Allocate(true); // initialize // buffer to zero diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx index 7f8c3b5f81b..6f0b38b8b79 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2.cxx @@ -49,7 +49,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2(int, char *[]) region.SetIndex(0, 0); region.SetIndex(1, 0); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(region); inputImage->Allocate(true); // initialize // buffer to zero @@ -88,7 +88,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest2(int, char *[]) } } - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); function->ThresholdAbove(1); // >= 1 diff --git a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx index 9dc69ac9e3a..9f0a9a63c72 100644 --- a/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx +++ b/Modules/Nonunit/Review/test/itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3.cxx @@ -51,7 +51,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3(int, char *[]) region.SetIndex(1, 0); region.SetIndex(2, 0); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(region); inputImage->Allocate(true); // initialize // buffer to zero @@ -90,7 +90,7 @@ itkShapedFloodFilledImageFunctionConditionalConstIteratorTest3(int, char *[]) } } - FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); function->ThresholdAbove(1); // >= 1 diff --git a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx index 794f13b7b2d..952bab98672 100644 --- a/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkStochasticFractalDimensionImageFilterTest.cxx @@ -36,12 +36,12 @@ class Helper using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer imageReader = ReaderType::New(); + auto imageReader = ReaderType::New(); imageReader->SetFileName(argv[2]); imageReader->Update(); using FractalFilterType = itk::StochasticFractalDimensionImageFilter; - typename FractalFilterType::Pointer fractalFilter = FractalFilterType::New(); + auto fractalFilter = FractalFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(fractalFilter, StochasticFractalDimensionImageFilter, ImageToImageFilter); @@ -74,7 +74,7 @@ class Helper maskLabel = static_cast(std::stod(argv[6])); } - typename ReaderType::Pointer labelImageReader = ReaderType::New(); + auto labelImageReader = ReaderType::New(); labelImageReader->SetFileName(argv[5]); labelImageReader->Update(); @@ -82,7 +82,7 @@ class Helper using ThresholderType = itk::BinaryThresholdImageFilter; - typename ThresholderType::Pointer thresholder = ThresholderType::New(); + auto thresholder = ThresholderType::New(); thresholder->SetInput(labelImageReader->GetOutput()); thresholder->SetInsideValue(1); thresholder->SetOutsideValue(0); @@ -106,7 +106,7 @@ class Helper std::cout << " (elapsed time: " << timer.GetMean() << ")" << std::endl; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(fractalFilter->GetOutput()); writer->SetFileName(argv[3]); writer->UseCompressionOn(); diff --git a/Modules/Nonunit/Review/test/itkVoxBoCUBImageIOTest.cxx b/Modules/Nonunit/Review/test/itkVoxBoCUBImageIOTest.cxx index 9b1fcea010f..f8fe20a507d 100644 --- a/Modules/Nonunit/Review/test/itkVoxBoCUBImageIOTest.cxx +++ b/Modules/Nonunit/Review/test/itkVoxBoCUBImageIOTest.cxx @@ -41,8 +41,8 @@ itkVoxBoCUBImageIOTest(int argc, char * argv[]) itk::VoxBoCUBImageIOFactory::RegisterOneFactory(); - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); diff --git a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx index 426c419224a..dbbab466607 100644 --- a/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpHarmonicEnergyCalculatorTest.cxx @@ -53,7 +53,7 @@ itkWarpHarmonicEnergyCalculatorTest(int argc, char * argv[]) using RegionType = itk::ImageRegion; // Create the input image - DisplacementFieldType::Pointer inputDisplacementField = DisplacementFieldType::New(); + auto inputDisplacementField = DisplacementFieldType::New(); // Define its size, and start index SizeType size; @@ -86,7 +86,7 @@ itkWarpHarmonicEnergyCalculatorTest(int argc, char * argv[]) // Create the calculator - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(calculator, WarpHarmonicEnergyCalculator, Object); diff --git a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx index 012f1d43af4..8d85e1a5884 100644 --- a/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx +++ b/Modules/Nonunit/Review/test/itkWarpJacobianDeterminantFilterTest.cxx @@ -48,7 +48,7 @@ itkWarpJacobianDeterminantFilterTest(int, char *[]) using RegionType = itk::ImageRegion; // Create two images - DisplacementFieldType::Pointer inputDisplacementField = DisplacementFieldType::New(); + auto inputDisplacementField = DisplacementFieldType::New(); // Define their size, and start index SizeType size; @@ -91,7 +91,7 @@ itkWarpJacobianDeterminantFilterTest(int, char *[]) // Create one Filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Connect the input images diff --git a/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx b/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx index 046993641b2..e0125f74e68 100644 --- a/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx +++ b/Modules/Numerics/Eigen/test/itkEigenAnalysis2DImageFilterTest.cxx @@ -130,9 +130,9 @@ class EigenAnalysis2DImageFilterTester Run() { // Create the images - typename myImageType::Pointer inputImageXX = myImageType::New(); - typename myImageType::Pointer inputImageXY = myImageType::New(); - typename myImageType::Pointer inputImageYY = myImageType::New(); + auto inputImageXX = myImageType::New(); + auto inputImageXY = myImageType::New(); + auto inputImageYY = myImageType::New(); InitializeImage(inputImageXX, std::cos(itk::Math::pi / 6.0)); @@ -141,8 +141,8 @@ class EigenAnalysis2DImageFilterTester // Create a Filter - typename myFilterType::Pointer filter = myFilterType::New(); - itk::SimpleFilterWatcher watcher(filter); + auto filter = myFilterType::New(); + itk::SimpleFilterWatcher watcher(filter); // Connect the input images filter->SetInput1(inputImageXX); diff --git a/Modules/Numerics/FEM/include/itkFEMFactory.h b/Modules/Numerics/FEM/include/itkFEMFactory.h index 718bab1b111..62185b1f281 100644 --- a/Modules/Numerics/FEM/include/itkFEMFactory.h +++ b/Modules/Numerics/FEM/include/itkFEMFactory.h @@ -45,7 +45,7 @@ class FEMFactory : public FEMFactoryBase static void RegisterType() { - typename T::Pointer t = T::New(); + auto t = T::New(); FEMFactoryBase::Pointer f = FEMFactoryBase::GetFactory(); diff --git a/Modules/Numerics/FEM/include/itkFEMFactoryBase.h b/Modules/Numerics/FEM/include/itkFEMFactoryBase.h index e6036aa42a4..5cc1eb681c6 100644 --- a/Modules/Numerics/FEM/include/itkFEMFactoryBase.h +++ b/Modules/Numerics/FEM/include/itkFEMFactoryBase.h @@ -82,7 +82,7 @@ class ITKFEM_EXPORT FEMFactoryBase : public ObjectFactoryBase if (m_Factory == nullptr) { // Make and register the factory - FEMFactoryBase::Pointer p = FEMFactoryBase::New(); + auto p = FEMFactoryBase::New(); if (p.IsNull()) { std::ostringstream message; diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.h b/Modules/Numerics/FEM/include/itkFEMRobustSolver.h index 6437b162655..a1a4bf4f062 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.h +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.h @@ -41,10 +41,10 @@ namespace fem * \code using FEMObjectType = itk::fem::FEMObject<3>; - FEMObjectObjectType::Pointer fem = FEMObjectObjectType::New(); + auto fem = FEMObjectObjectType::New(); ... using FEMSolverType = itk::fem::RobustSolver<3>; - FEMSolverType::Pointer solver = FEMSolverType::New(); + auto solver = FEMSolverType::New(); solver->SetInput( fem ); solver->Update(); diff --git a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx index fce722eab24..69d0404c40c 100644 --- a/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx +++ b/Modules/Numerics/FEM/include/itkFEMRobustSolver.hxx @@ -538,7 +538,7 @@ RobustSolver::DeleteLandmarksOutOfMesh() using LoadIdentifier = typename FEMObjectType::LoadIdentifier; using VectorContainerType = itk::VectorContainer; - typename VectorContainerType::Pointer newLoadContainer = VectorContainerType::New(); + auto newLoadContainer = VectorContainerType::New(); LoadIdentifier numToRemoveLoads = NumericTraits::ZeroValue(); diff --git a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h index e47771c0931..dd40209b1b7 100644 --- a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h +++ b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.h @@ -92,7 +92,7 @@ namespace fem ; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(displacementPointSet); filter->SetConfidencePointSet(confidencePointSet); //optional diff --git a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx index 3c21bb7024d..88906912048 100644 --- a/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx +++ b/Modules/Numerics/FEM/include/itkFEMScatteredDataPointSetToImageFilter.hxx @@ -431,7 +431,7 @@ FEMScatteredDataPointSetToImageFilterSetCoordinates(point); node->SetGlobalNumber(it.Index()); @@ -476,7 +476,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -500,7 +500,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -525,7 +525,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -551,7 +551,7 @@ FEMScatteredDataPointSetToImageFilter(cell); @@ -654,7 +654,7 @@ FEMScatteredDataPointSetToImageFilterSetSource(point); load->SetRealDisplacement(displacement); diff --git a/Modules/Numerics/FEM/include/itkFEMSolver.h b/Modules/Numerics/FEM/include/itkFEMSolver.h index 99ffe818a12..e7c5b7e3773 100644 --- a/Modules/Numerics/FEM/include/itkFEMSolver.h +++ b/Modules/Numerics/FEM/include/itkFEMSolver.h @@ -50,10 +50,10 @@ namespace fem * \code using FEMObjectType = itk::fem::FEMObject<3>; - FEMObjectObjectType::Pointer fem = FEMObjectObjectType::New(); + auto fem = FEMObjectObjectType::New(); ... using FEMSolverType = itk::fem::Solver<3>; - FEMSolverType::Pointer solver = FEMSolverType::New(); + auto solver = FEMSolverType::New(); solver->SetInput( fem ); solver->Update(); diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearLineStressTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearLineStressTest.cxx index 2ebbf2e272f..2a49f00b0d3 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearLineStressTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearLineStressTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearLineStressTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -99,7 +99,7 @@ itkFEMElement2DC0LinearLineStressTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralMembraneTest.cxx index a94d9a75824..d77e18474dc 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralMembraneTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearQuadrilateralMembraneTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -78,7 +78,7 @@ itkFEMElement2DC0LinearQuadrilateralMembraneTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainItpackTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainItpackTest.cxx index a5892a1727d..91337328d0d 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainItpackTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainItpackTest.cxx @@ -37,7 +37,7 @@ itkFEMElement2DC0LinearQuadrilateralStrainItpackTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using SpatialObjectType = itk::SpatialObject<2>; using SpatialObjectPointer = SpatialObjectType::Pointer; @@ -115,7 +115,7 @@ itkFEMElement2DC0LinearQuadrilateralStrainItpackTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainTest.cxx index 8c37ef62ac1..5d85c0d3041 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStrainTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearQuadrilateralStrainTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -78,7 +78,7 @@ itkFEMElement2DC0LinearQuadrilateralStrainTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx index 572bccab364..1908e70b9f0 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTest.cxx @@ -33,10 +33,10 @@ itkFEMElement2DC0LinearQuadrilateralStressTest(int argc, char * argv[]) constexpr unsigned int Dimension = 2; using Solver2DType = itk::fem::Solver; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMObjectType = itk::fem::FEMObject; - FEMObjectType::Pointer femObject = FEMObjectType::New(); + auto femObject = FEMObjectType::New(); using NodeType = itk::fem::Element::Node; NodeType::Pointer n1; @@ -153,7 +153,7 @@ itkFEMElement2DC0LinearQuadrilateralStressTest(int argc, char * argv[]) // to write the deformed mesh // Testing the fe mesh validity using FEMObjectSpatialObjectType = itk::FEMObjectSpatialObject; - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTestFEMObject.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTestFEMObject.cxx index bdf8998b820..305338c1c07 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTestFEMObject.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearQuadrilateralStressTestFEMObject.cxx @@ -33,7 +33,7 @@ itkFEMElement2DC0LinearQuadrilateralStressTestFEMObject(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using FEMObjectType = itk::fem::FEMObject<2>; - FEMObjectType::Pointer femObject = FEMObjectType::New(); + auto femObject = FEMObjectType::New(); itk::fem::Node::Pointer n1; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleMembraneTest.cxx index 8992e7df037..deb32552544 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleMembraneTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearTriangleMembraneTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -78,7 +78,7 @@ itkFEMElement2DC0LinearTriangleMembraneTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStrainTest.cxx index b428a095d97..7f1e2383696 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStrainTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearTriangleStrainTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -79,7 +79,7 @@ itkFEMElement2DC0LinearTriangleStrainTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStressTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStressTest.cxx index d1024042a91..c6a49652581 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStressTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0LinearTriangleStressTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0LinearTriangleStressTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -79,7 +79,7 @@ itkFEMElement2DC0LinearTriangleStressTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStrainTest.cxx index 7a1a3ef84bd..385dd1a0814 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStrainTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0QuadraticTriangleStrainTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -79,7 +79,7 @@ itkFEMElement2DC0QuadraticTriangleStrainTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStressTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStressTest.cxx index 030adb97a28..40c2468ae59 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStressTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC0QuadraticTriangleStressTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC0QuadraticTriangleStressTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -79,7 +79,7 @@ itkFEMElement2DC0QuadraticTriangleStressTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DC1BeamTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DC1BeamTest.cxx index bc385101b27..a0b7f0cdf4d 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DC1BeamTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DC1BeamTest.cxx @@ -36,7 +36,7 @@ itkFEMElement2DC1BeamTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -102,7 +102,7 @@ itkFEMElement2DC1BeamTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DMembraneTest.cxx index 6f42c778c7d..4724e3c8837 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DMembraneTest.cxx @@ -61,7 +61,7 @@ itkFEMElement2DMembraneTest(int, char *[]) m->SetMomentOfInertia(0.004); using MembraneElementType = itk::fem::Element2DC0LinearQuadrilateralMembrane; - MembraneElementType::Pointer e0 = MembraneElementType::New(); + auto e0 = MembraneElementType::New(); e0->SetGlobalNumber(0); e0->SetNode(0, n0); diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DQuadraticTriangularTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DQuadraticTriangularTest.cxx index a5cf61a20dd..f0a1f214f13 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DQuadraticTriangularTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DQuadraticTriangularTest.cxx @@ -48,7 +48,7 @@ itkFEMElement2DQuadraticTriangularTest(int, char *[]) using ElasticityType = itk::fem::MaterialLinearElasticity; - ElasticityType::Pointer m = ElasticityType::New(); + auto m = ElasticityType::New(); m->SetGlobalNumber(0); m->SetYoungsModulus(300.0); @@ -56,7 +56,7 @@ itkFEMElement2DQuadraticTriangularTest(int, char *[]) m->SetMomentOfInertia(0.004); using StrainType = itk::fem::Element2DC0QuadraticTriangularStrain; - StrainType::Pointer e0 = StrainType::New(); + auto e0 = StrainType::New(); e0->SetGlobalNumber(0); e0->SetNode(0, n0); diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DStrainTest.cxx index d6a1fd95850..b3f15cd50b3 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DStrainTest.cxx @@ -53,7 +53,7 @@ itkFEMElement2DStrainTest(int, char *[]) using ElasticityType = itk::fem::MaterialLinearElasticity; - ElasticityType::Pointer m = ElasticityType::New(); + auto m = ElasticityType::New(); m->SetGlobalNumber(0); m->SetYoungsModulus(30000.0); @@ -62,7 +62,7 @@ itkFEMElement2DStrainTest(int, char *[]) using StrainType = itk::fem::Element2DC0LinearQuadrilateralStrain; - StrainType::Pointer e0 = StrainType::New(); + auto e0 = StrainType::New(); e0->SetGlobalNumber(0); e0->SetNode(0, n0); diff --git a/Modules/Numerics/FEM/test/itkFEMElement2DTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement2DTest.cxx index a16694fc2cc..f4bf0e1edfd 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement2DTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement2DTest.cxx @@ -136,7 +136,7 @@ itkFEMElement2DTest(int argc, char * argv[]) itk::fem::LinearSystemWrapperVNL lsw_vnl; for (int s = 0; s < numsolvers; ++s) { - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); solver->SetInput(femSO->GetFEMObject()); if (s == 2) diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronMembraneTest.cxx index 3753d1853b6..007ad718379 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronMembraneTest.cxx @@ -36,7 +36,7 @@ itkFEMElement3DC0LinearHexahedronMembraneTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver3DType = itk::fem::Solver<3>; - Solver3DType::Pointer solver = Solver3DType::New(); + auto solver = Solver3DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<3>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -102,7 +102,7 @@ itkFEMElement3DC0LinearHexahedronMembraneTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<3>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx index b8be6a0923d..496c691d8b2 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearHexahedronStrainTest.cxx @@ -36,7 +36,7 @@ itkFEMElement3DC0LinearHexahedronStrainTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver3DType = itk::fem::Solver<3>; - Solver3DType::Pointer solver = Solver3DType::New(); + auto solver = Solver3DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<3>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -102,7 +102,7 @@ itkFEMElement3DC0LinearHexahedronStrainTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<3>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronMembraneTest.cxx index ebcfd7ca5fc..c6ec872bc61 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronMembraneTest.cxx @@ -36,7 +36,7 @@ itkFEMElement3DC0LinearTetrahedronMembraneTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver3DType = itk::fem::Solver<3>; - Solver3DType::Pointer solver = Solver3DType::New(); + auto solver = Solver3DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<3>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -95,7 +95,7 @@ itkFEMElement3DC0LinearTetrahedronMembraneTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<3>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronStrainTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronStrainTest.cxx index ee0a6006314..6253306b9b2 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronStrainTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DC0LinearTetrahedronStrainTest.cxx @@ -38,7 +38,7 @@ itkFEMElement3DC0LinearTetrahedronStrainTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver3DType = itk::fem::Solver<3>; - Solver3DType::Pointer solver = Solver3DType::New(); + auto solver = Solver3DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<3>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -104,7 +104,7 @@ itkFEMElement3DC0LinearTetrahedronStrainTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<3>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DMembraneTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DMembraneTest.cxx index 56d7b0595c2..ece84a128a0 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DMembraneTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DMembraneTest.cxx @@ -80,7 +80,7 @@ itkFEMElement3DMembraneTest(int, char *[]) n7->SetCoordinates(pt); using ElasticityType = itk::fem::MaterialLinearElasticity; - ElasticityType::Pointer m = ElasticityType::New(); + auto m = ElasticityType::New(); m->SetGlobalNumber(0); m->SetYoungsModulus(10000.0); m->SetCrossSectionalArea(0.02); @@ -88,7 +88,7 @@ itkFEMElement3DMembraneTest(int, char *[]) m->SetPoissonsRatio(0.4); using ElementMembraneType = itk::fem::Element3DC0LinearHexahedronMembrane; - ElementMembraneType::Pointer e0 = ElementMembraneType::New(); + auto e0 = ElementMembraneType::New(); e0->SetGlobalNumber(0); e0->SetNode(0, n0); diff --git a/Modules/Numerics/FEM/test/itkFEMElement3DTest.cxx b/Modules/Numerics/FEM/test/itkFEMElement3DTest.cxx index d1ffda313ae..9efc64ba3cc 100644 --- a/Modules/Numerics/FEM/test/itkFEMElement3DTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMElement3DTest.cxx @@ -153,7 +153,7 @@ itkFEMElement3DTest(int argc, char * argv[]) itk::fem::LinearSystemWrapperVNL lsw_vnl; for (int s = 0; s < numsolvers; ++s) { - SolverType::Pointer solver = SolverType::New(); + auto solver = SolverType::New(); solver->SetInput(femSO->GetFEMObject()); if (s == 2) diff --git a/Modules/Numerics/FEM/test/itkFEMGenerateMeshTest.cxx b/Modules/Numerics/FEM/test/itkFEMGenerateMeshTest.cxx index 6a5e085fa03..dcdc4201710 100644 --- a/Modules/Numerics/FEM/test/itkFEMGenerateMeshTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMGenerateMeshTest.cxx @@ -59,7 +59,7 @@ itkFEMGenerateMeshTest(int, char *[]) using ElasticityType = itk::fem::MaterialLinearElasticity; // Create the material - ElasticityType::Pointer m = ElasticityType::New(); + auto m = ElasticityType::New(); m->SetGlobalNumber(0); m->SetYoungsModulus(1000.); @@ -71,7 +71,7 @@ itkFEMGenerateMeshTest(int, char *[]) // Create the element type using StrainType = itk::fem::Element2DC0LinearQuadrilateralStrain; - StrainType::Pointer e1 = StrainType::New(); + auto e1 = StrainType::New(); e1->SetMaterial(dynamic_cast(m)); diff --git a/Modules/Numerics/FEM/test/itkFEMLandmarkLoadImplementationTest.cxx b/Modules/Numerics/FEM/test/itkFEMLandmarkLoadImplementationTest.cxx index 17db9d23cef..b63db191b5e 100644 --- a/Modules/Numerics/FEM/test/itkFEMLandmarkLoadImplementationTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLandmarkLoadImplementationTest.cxx @@ -37,7 +37,7 @@ itkFEMLandmarkLoadImplementationTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -80,7 +80,7 @@ itkFEMLandmarkLoadImplementationTest(int argc, char * argv[]) solver->Update(); // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTest.cxx b/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTest.cxx index 0607379ffd2..3c6dd17fee4 100644 --- a/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTest.cxx @@ -36,7 +36,7 @@ itkFEMLoadBCMFCTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -102,7 +102,7 @@ itkFEMLoadBCMFCTest(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTestUser.cxx b/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTestUser.cxx index dd275915cc0..e3a9d6a44c9 100644 --- a/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTestUser.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLoadBCMFCTestUser.cxx @@ -37,10 +37,10 @@ itkFEMLoadBCMFCTestUser(int argc, char *[]) itk::FEMFactoryBase::RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMObjectType = itk::fem::FEMObject<2>; - FEMObjectType::Pointer femObject = FEMObjectType::New(); + auto femObject = FEMObjectType::New(); itk::fem::LinearSystemWrapperVNL vnlSolver; @@ -232,7 +232,7 @@ itkFEMLoadBCMFCTestUser(int argc, char *[]) // to write the deformed mesh // Testing the fe mesh validity /* using FEMObjectSpatialObjectType = itk::FEMObjectSpatialObject<2>; - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<2>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMLoadEdgeTest.cxx b/Modules/Numerics/FEM/test/itkFEMLoadEdgeTest.cxx index e25dba96912..8ae9cbc64cd 100644 --- a/Modules/Numerics/FEM/test/itkFEMLoadEdgeTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLoadEdgeTest.cxx @@ -36,7 +36,7 @@ itkFEMLoadEdgeTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMLoadGravConstTest.cxx b/Modules/Numerics/FEM/test/itkFEMLoadGravConstTest.cxx index 0d7e224b87f..9e409a37467 100644 --- a/Modules/Numerics/FEM/test/itkFEMLoadGravConstTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLoadGravConstTest.cxx @@ -36,7 +36,7 @@ itkFEMLoadGravConstTest(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<2>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMLoadPointTestUser.cxx b/Modules/Numerics/FEM/test/itkFEMLoadPointTestUser.cxx index bf7163cb730..ce8bf4dbbd8 100644 --- a/Modules/Numerics/FEM/test/itkFEMLoadPointTestUser.cxx +++ b/Modules/Numerics/FEM/test/itkFEMLoadPointTestUser.cxx @@ -44,10 +44,10 @@ itkFEMLoadPointTestUser(int, char *[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using FEMObjectType = itk::fem::FEMObject<2>; - FEMObjectType::Pointer femObject = FEMObjectType::New(); + auto femObject = FEMObjectType::New(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); itk::fem::Element::Node::Pointer n1; diff --git a/Modules/Numerics/FEM/test/itkFEMPArrayTest.cxx b/Modules/Numerics/FEM/test/itkFEMPArrayTest.cxx index a6110f8ce8f..69ee3a185fb 100644 --- a/Modules/Numerics/FEM/test/itkFEMPArrayTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMPArrayTest.cxx @@ -37,7 +37,7 @@ itkFEMPArrayTest(int, char *[]) ArrayType array; - NodeType::Pointer n1 = NodeType::New(); + auto n1 = NodeType::New(); ElementType::VectorType pt(2); pt[0] = 0.; @@ -81,7 +81,7 @@ itkFEMPArrayTest(int, char *[]) } // try an element with GN larger than the array size - NodeType::Pointer n2 = NodeType::New(); + auto n2 = NodeType::New(); pt[0] = 0.; pt[1] = 3.; n2->SetCoordinates(pt); diff --git a/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx b/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx index dbf6637fa36..964b104dd42 100644 --- a/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMRobustSolverTest.cxx @@ -84,9 +84,9 @@ itkFEMRobustSolverTest(int, char *[]) /** intepolation grid type alias support */ using InterpolationGridType = itk::Image; - SolverType::Pointer solver = SolverType::New(); + auto solver = SolverType::New(); - FEMObjectType::Pointer femObject = FEMObjectType::New(); + auto femObject = FEMObjectType::New(); /** initialize material */ MaterialContainerType * materialContainer = femObject->GetModifiableMaterialContainer(); @@ -99,7 +99,7 @@ itkFEMRobustSolverTest(int, char *[]) materialContainer->Initialize(); - MaterialType::Pointer material = MaterialType::New(); + auto material = MaterialType::New(); material->SetYoungsModulus(3000.0); material->SetPoissonsRatio(0.45); @@ -132,7 +132,7 @@ itkFEMRobustSolverTest(int, char *[]) point[0] = i; point[1] = j; - NodeType::Pointer n = NodeType::New(); + auto n = NodeType::New(); n->SetCoordinates(point); n->SetGlobalNumber(globalNumbering); @@ -164,7 +164,7 @@ itkFEMRobustSolverTest(int, char *[]) unsigned int rigthUpperNodeIndex = i + 1 + (elementDimensionX + 1) * (j + 1); unsigned int leftUpperNodeIndex = i + (elementDimensionX + 1) * (j + 1); - ElementType::Pointer quadrilateral = ElementType::New(); + auto quadrilateral = ElementType::New(); quadrilateral->SetNode(0, femObject->GetNode(leftBottomNodeIndex)); quadrilateral->SetNode(1, femObject->GetNode(rightBottomNodeIndex)); @@ -227,19 +227,19 @@ itkFEMRobustSolverTest(int, char *[]) displacement3[0] = 1.0; displacement3[1] = 1.0; - LoadType::Pointer load0 = LoadType::New(); + auto load0 = LoadType::New(); load0->SetSource(featurePoint0); load0->SetRealDisplacement(displacement0); - LoadType::Pointer load1 = LoadType::New(); + auto load1 = LoadType::New(); load1->SetSource(featurePoint1); load1->SetRealDisplacement(displacement1); - LoadType::Pointer load2 = LoadType::New(); + auto load2 = LoadType::New(); load2->SetSource(featurePoint2); load2->SetRealDisplacement(displacement2); - LoadType::Pointer load3 = LoadType::New(); + auto load3 = LoadType::New(); load3->SetSource(featurePoint3); load3->SetRealDisplacement(displacement3); diff --git a/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx b/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx index 5ff6e6d6320..c4f06d1f31c 100644 --- a/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMScatteredDataPointSetToImageFilterTest.cxx @@ -65,14 +65,14 @@ itkFEMScatteredDataPointSetToImageFilterTest(int, char *[]) using ConstIteratorType = itk::ImageRegionConstIterator; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Construct a feature point set - FeaturePointSetType::Pointer featurePoints = FeaturePointSetType::New(); - PointType p0; - PointType p1; - PointType p2; - PointType p3; + auto featurePoints = FeaturePointSetType::New(); + PointType p0; + PointType p1; + PointType p2; + PointType p3; // point is on the bottom boundary p0[0] = 1.0; p0[1] = 0.0; diff --git a/Modules/Numerics/FEM/test/itkFEMSolverHyperbolicTest.cxx b/Modules/Numerics/FEM/test/itkFEMSolverHyperbolicTest.cxx index 30e40f39404..fd6d88b5f11 100644 --- a/Modules/Numerics/FEM/test/itkFEMSolverHyperbolicTest.cxx +++ b/Modules/Numerics/FEM/test/itkFEMSolverHyperbolicTest.cxx @@ -208,7 +208,7 @@ itkFEMSolverHyperbolicTest(int ac, char * av[]) * Third, create the FEM solver object and generate the solution */ - FEMSolverType::Pointer SH = FEMSolverType::New(); + auto SH = FEMSolverType::New(); SH->SetInput(femSO->GetFEMObject()); SH->SetTimeStep(.5); SH->SetNumberOfIterations(niter); diff --git a/Modules/Numerics/FEM/test/itkFEMSolverTest2D.cxx b/Modules/Numerics/FEM/test/itkFEMSolverTest2D.cxx index fde7ca460c0..e48fcf241c3 100644 --- a/Modules/Numerics/FEM/test/itkFEMSolverTest2D.cxx +++ b/Modules/Numerics/FEM/test/itkFEMSolverTest2D.cxx @@ -35,7 +35,7 @@ itkFEMSolverTest2D(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver2DType = itk::fem::Solver<2>; - Solver2DType::Pointer solver = Solver2DType::New(); + auto solver = Solver2DType::New(); using SpatialObjectType = itk::SpatialObject<2>; using SpatialObjectPointer = SpatialObjectType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkFEMSolverTest3D.cxx b/Modules/Numerics/FEM/test/itkFEMSolverTest3D.cxx index bffce31e222..8b6de17637e 100644 --- a/Modules/Numerics/FEM/test/itkFEMSolverTest3D.cxx +++ b/Modules/Numerics/FEM/test/itkFEMSolverTest3D.cxx @@ -36,7 +36,7 @@ itkFEMSolverTest3D(int argc, char * argv[]) itk::FEMFactoryBase::GetFactory()->RegisterDefaultTypes(); using Solver3DType = itk::fem::Solver<3>; - Solver3DType::Pointer solver = Solver3DType::New(); + auto solver = Solver3DType::New(); using FEMSpatialObjectReaderType = itk::FEMSpatialObjectReader<3>; using FEMSpatialObjectReaderPointer = FEMSpatialObjectReaderType::Pointer; @@ -103,7 +103,7 @@ itkFEMSolverTest3D(int argc, char * argv[]) } // to write the deformed mesh - FEMObjectSpatialObjectType::Pointer femSODef = FEMObjectSpatialObjectType::New(); + auto femSODef = FEMObjectSpatialObjectType::New(); femSODef->SetFEMObject(solver->GetOutput()); using FEMSpatialObjectWriterType = itk::FEMSpatialObjectWriter<3>; using FEMSpatialObjectWriterPointer = FEMSpatialObjectWriterType::Pointer; diff --git a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx index d0cd1bb1010..0bcbee4d261 100644 --- a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx +++ b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter2DTest.cxx @@ -49,7 +49,7 @@ itkImageToRectilinearFEMObjectFilter2DTest(int argc, char * argv[]) numberOfElements[0] = static_cast(std::stoi(argv[4])); numberOfElements[1] = static_cast(std::stoi(argv[5])); - ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -63,14 +63,14 @@ itkImageToRectilinearFEMObjectFilter2DTest(int argc, char * argv[]) m->SetMomentOfInertia(0.004); using MembraneElementType = itk::fem::Element2DC0LinearQuadrilateralMembrane; - MembraneElementType::Pointer e0 = MembraneElementType::New(); + auto e0 = MembraneElementType::New(); e0->SetGlobalNumber(0); if (dynamic_cast(m.GetPointer())) { e0->SetMaterial(dynamic_cast(m.GetPointer())); } using MeshFilterType = itk::fem::ImageToRectilinearFEMObjectFilter; - MeshFilterType::Pointer meshFilter = MeshFilterType::New(); + auto meshFilter = MeshFilterType::New(); meshFilter->SetInput(reader->GetOutput()); meshFilter->SetPixelsPerElement(pixelsPerElement); meshFilter->SetElement(e0); diff --git a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx index df6ee7d58bb..c4389b55570 100644 --- a/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx +++ b/Modules/Numerics/FEM/test/itkImageToRectilinearFEMObjectFilter3DTest.cxx @@ -51,7 +51,7 @@ itkImageToRectilinearFEMObjectFilter3DTest(int argc, char * argv[]) numberOfElements[1] = static_cast(std::stoi(argv[6])); numberOfElements[2] = static_cast(std::stoi(argv[7])); - ImageFileReaderType::Pointer reader = ImageFileReaderType::New(); + auto reader = ImageFileReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); @@ -65,7 +65,7 @@ itkImageToRectilinearFEMObjectFilter3DTest(int argc, char * argv[]) m->SetMomentOfInertia(0.004); using MembraneElementType = itk::fem::Element3DC0LinearHexahedronMembrane; - MembraneElementType::Pointer e0 = MembraneElementType::New(); + auto e0 = MembraneElementType::New(); e0->SetGlobalNumber(0); if (dynamic_cast(m.GetPointer())) { @@ -73,7 +73,7 @@ itkImageToRectilinearFEMObjectFilter3DTest(int argc, char * argv[]) } using MeshFilterType = itk::fem::ImageToRectilinearFEMObjectFilter; - MeshFilterType::Pointer meshFilter = MeshFilterType::New(); + auto meshFilter = MeshFilterType::New(); meshFilter->SetInput(reader->GetOutput()); meshFilter->SetPixelsPerElement(pixelsPerElement); meshFilter->SetElement(e0); diff --git a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx index 28f310c95ae..7a7822ecef0 100644 --- a/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx +++ b/Modules/Numerics/NarrowBand/include/itkNarrowBandImageFilterBase.hxx @@ -36,7 +36,7 @@ NarrowBandImageFilterBase::CopyInputToOutput() { // First need to subtract the iso-surface value from the input image. using ShiftScaleFilterType = ShiftScaleImageFilter; - typename ShiftScaleFilterType::Pointer shiftScaleFilter = ShiftScaleFilterType::New(); + auto shiftScaleFilter = ShiftScaleFilterType::New(); shiftScaleFilter->SetInput(this->GetInput()); shiftScaleFilter->SetShift(-m_IsoSurfaceValue); shiftScaleFilter->Update(); diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx index ceca22e60f7..e7f64f18dba 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandImageFilterBaseTest.cxx @@ -132,7 +132,7 @@ itkNarrowBandImageFilterBaseTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetLargestPossibleRegion(region); inputImage->SetBufferedRegion(region); inputImage->SetRequestedRegion(region); @@ -151,8 +151,8 @@ itkNarrowBandImageFilterBaseTest(int argc, char * argv[]) } using RandomSourceType = itk::RandomImageSource; - RandomSourceType::Pointer randomSource = RandomSourceType::New(); - ImageType::SizeValueType tam[2]; + auto randomSource = RandomSourceType::New(); + ImageType::SizeValueType tam[2]; tam[0] = 64; tam[1] = 64; randomSource->SetSize(tam); @@ -164,25 +164,25 @@ itkNarrowBandImageFilterBaseTest(int argc, char * argv[]) randomSource->SetNumberOfWorkUnits(1); using AddFilterType = itk::AddImageFilter; - AddFilterType::Pointer addFilter = AddFilterType::New(); + auto addFilter = AddFilterType::New(); addFilter->SetInput1(inputImage); addFilter->SetInput2(randomSource->GetOutput()); using FilterType = itk::NbTestClass; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(addFilter->GetOutput()); filter->Print(std::cout); try { using RescaleType = itk::RescaleIntensityImageFilter; - RescaleType::Pointer rescale = RescaleType::New(); + auto rescale = RescaleType::New(); rescale->SetInput(filter->GetOutput()); rescale->SetOutputMinimum(0); rescale->SetOutputMaximum(255); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescale->GetOutput()); writer->SetFileName(argv[1]); writer->Write(); diff --git a/Modules/Numerics/NarrowBand/test/itkNarrowBandTest.cxx b/Modules/Numerics/NarrowBand/test/itkNarrowBandTest.cxx index a9f653e6a96..e699a2789bb 100644 --- a/Modules/Numerics/NarrowBand/test/itkNarrowBandTest.cxx +++ b/Modules/Numerics/NarrowBand/test/itkNarrowBandTest.cxx @@ -29,7 +29,7 @@ itkNarrowBandTest(int, char *[]) using BandType = itk::NarrowBand; using RegionType = BandType::RegionType; - BandType::Pointer band = BandType::New(); + auto band = BandType::New(); band->Reserve(100); // Create nodes BandNodeType node; diff --git a/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx index 5e2c57685ec..5138c0d8595 100644 --- a/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkAmoebaOptimizerTest.cxx @@ -272,7 +272,7 @@ AmoebaTest1() using OptimizerType = itk::AmoebaOptimizer; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // set optimizer parameters itkOptimizer->SetMaximumNumberOfIterations(10); @@ -283,7 +283,7 @@ AmoebaTest1() double fTolerance = 0.001; itkOptimizer->SetFunctionConvergenceTolerance(fTolerance); - amoebaTestF1::Pointer costFunction = amoebaTestF1::New(); + auto costFunction = amoebaTestF1::New(); itkOptimizer->SetCostFunction(costFunction); std::cout << "itkOptimizer->GetCostFunction(): " << itkOptimizer->GetCostFunction() << std::endl; @@ -376,7 +376,7 @@ AmoebaTest1() itkOptimizer->SetInitialPosition(currentValue); - CommandIterationUpdateAmoeba::Pointer observer = CommandIterationUpdateAmoeba::New(); + auto observer = CommandIterationUpdateAmoeba::New(); itkOptimizer->AddObserver(itk::FunctionEvaluationIterationEvent(), observer); try @@ -449,7 +449,7 @@ AmoebaTest2() std::cout << "Amoeba Optimizer Test 2\n \n"; using OptimizerType = itk::AmoebaOptimizer; - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // set optimizer parameters unsigned int maxIterations = 100; @@ -476,11 +476,11 @@ AmoebaTest2() itkOptimizer->SetInitialPosition(initialParameters); // the function we want to optimize - amoebaTestF2::Pointer costFunction = amoebaTestF2::New(); + auto costFunction = amoebaTestF2::New(); itkOptimizer->SetCostFunction(costFunction); // observe the iterations - CommandIterationUpdateAmoeba::Pointer observer = CommandIterationUpdateAmoeba::New(); + auto observer = CommandIterationUpdateAmoeba::New(); itkOptimizer->AddObserver(itk::IterationEvent(), observer); try diff --git a/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx index 09cdec74ee7..9aa1c3c870f 100644 --- a/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkConjugateGradientOptimizerTest.cxx @@ -164,11 +164,11 @@ itkConjugateGradientOptimizerTest(int, char *[]) using vnlOptimizerType = OptimizerType::InternalOptimizerType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction adaptor - conjugateCostFunction::Pointer costFunction = conjugateCostFunction::New(); + auto costFunction = conjugateCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); @@ -203,7 +203,7 @@ itkConjugateGradientOptimizerTest(int, char *[]) itkOptimizer->SetInitialPosition(currentValue); - CommandIterationUpdateConjugateGradient::Pointer observer = CommandIterationUpdateConjugateGradient::New(); + auto observer = CommandIterationUpdateConjugateGradient::New(); itkOptimizer->AddObserver(itk::IterationEvent(), observer); itkOptimizer->AddObserver(itk::FunctionEvaluationIterationEvent(), observer); diff --git a/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx index dc07a4267a9..c2844f796bf 100644 --- a/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkCumulativeGaussianOptimizerTest.cxx @@ -42,11 +42,11 @@ itkCumulativeGaussianOptimizerTest(int, char *[]) // Typedef and initialization for the Cumulative Gaussian Optimizer. using CumulativeGaussianOptimizerType = itk::CumulativeGaussianOptimizer; - CumulativeGaussianOptimizerType::Pointer optimizer = CumulativeGaussianOptimizerType::New(); + auto optimizer = CumulativeGaussianOptimizerType::New(); // Typedef and initialization for the Cumulative Gaussian Cost Function. using CostFunctionType = itk::CumulativeGaussianCostFunction; - CostFunctionType::Pointer costFunction = CostFunctionType::New(); + auto costFunction = CostFunctionType::New(); // Declare and initialize the data array. // CostFunctionType::MeasureType * cumGaussianArray = new CostFunctionType::MeasureType(); diff --git a/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx index 47f8c59a451..75f1e6b7680 100644 --- a/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkExhaustiveOptimizerTest.cxx @@ -152,15 +152,15 @@ itkExhaustiveOptimizerTest(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Index observer (enables us to check if all positions were indeed visisted): - IndexObserver::Pointer idxObserver = IndexObserver::New(); + auto idxObserver = IndexObserver::New(); itkOptimizer->AddObserver(itk::IterationEvent(), idxObserver); // Declaration of the CostFunction - RSGCostFunction::Pointer costFunction = RSGCostFunction::New(); + auto costFunction = RSGCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx index 49dd8627ed2..90e720ed213 100644 --- a/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkFRPROptimizerTest.cxx @@ -114,11 +114,11 @@ itkFRPROptimizerTest(int, char *[]) using OptimizerType = itk::FRPROptimizer; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - FRPRGradientCostFunction::Pointer costFunction = FRPRGradientCostFunction::New(); + auto costFunction = FRPRGradientCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx index c191d96a6a1..a900ff801fa 100644 --- a/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkGradientDescentOptimizerTest.cxx @@ -117,11 +117,11 @@ itkGradientDescentOptimizerTest(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - gradientCostFunction::Pointer costFunction = gradientCostFunction::New(); + auto costFunction = gradientCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx index e02b354c347..cd5d61b4bd3 100644 --- a/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkInitializationBiasedParticleSwarmOptimizerTest.cxx @@ -111,7 +111,7 @@ IBPSOTest1() // the function we want to optimize itk::ParticleSwarmTestF1::Pointer costFunction = itk::ParticleSwarmTestF1::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); @@ -217,7 +217,7 @@ IBPSOTest2() // the function we want to optimize itk::ParticleSwarmTestF2::Pointer costFunction = itk::ParticleSwarmTestF2::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); @@ -296,7 +296,7 @@ IBPSOTest3() // the function we want to optimize itk::ParticleSwarmTestF3::Pointer costFunction = itk::ParticleSwarmTestF3::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); diff --git a/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx index c0382a39c34..452cc313d55 100644 --- a/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLBFGSBOptimizerTest.cxx @@ -183,13 +183,13 @@ itkLBFGSBOptimizerTest(int, char *[]) using OptimizerType = itk::LBFGSBOptimizer; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->Print(std::cout); // Declaration of the CostFunction adaptor - LBFGSBCostFunction::Pointer costFunction = LBFGSBCostFunction::New(); + auto costFunction = LBFGSBCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); @@ -231,7 +231,7 @@ itkLBFGSBOptimizerTest(int, char *[]) itkOptimizer->Print(std::cout); - EventChecker::Pointer eventChecker = EventChecker::New(); + auto eventChecker = EventChecker::New(); itkOptimizer->AddObserver(itk::StartEvent(), eventChecker); itkOptimizer->AddObserver(itk::IterationEvent(), eventChecker); itkOptimizer->AddObserver(itk::EndEvent(), eventChecker); diff --git a/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx index c3223c6c5bf..8bef2a7d633 100644 --- a/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLBFGSOptimizerTest.cxx @@ -118,10 +118,10 @@ itkLBFGSOptimizerTest(int, char *[]) using vnlOptimizerType = OptimizerType::InternalOptimizerType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction adapter - LBFGSCostFunction::Pointer costFunction = LBFGSCostFunction::New(); + auto costFunction = LBFGSCostFunction::New(); // Set some optimizer parameters itkOptimizer->SetTrace(false); diff --git a/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx index 15eb026df92..7de2d9a2834 100644 --- a/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkLevenbergMarquardtOptimizerTest.cxx @@ -236,10 +236,10 @@ itkRunLevenbergMarquardOptimization(bool useGradient, using vnlOptimizerType = OptimizerType::InternalOptimizerType; // Declaration of a itkOptimizer - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); // Declaration of the CostFunction adaptor - LMCostFunction::Pointer costFunction = LMCostFunction::New(); + auto costFunction = LMCostFunction::New(); using ParametersType = LMCostFunction::ParametersType; ParametersType parameters(LMCostFunction::SpaceDimension); @@ -289,7 +289,7 @@ itkRunLevenbergMarquardOptimization(bool useGradient, optimizer->SetInitialPosition(currentValue); - CommandIterationUpdateLevenbergMarquardt::Pointer observer = CommandIterationUpdateLevenbergMarquardt::New(); + auto observer = CommandIterationUpdateLevenbergMarquardt::New(); optimizer->AddObserver(itk::IterationEvent(), observer); optimizer->AddObserver(itk::FunctionEvaluationIterationEvent(), observer); diff --git a/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx index c340f09c479..1de56be14db 100644 --- a/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkOnePlusOneEvolutionaryOptimizerTest.cxx @@ -150,7 +150,7 @@ itkOnePlusOneEvolutionaryOptimizerTest(int, char *[]) using OptimizerType = itk::OnePlusOneEvolutionaryOptimizer; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itk::OnePlusOneCommandIterationUpdate::Pointer observer = itk::OnePlusOneCommandIterationUpdate::New(); itkOptimizer->AddObserver(itk::IterationEvent(), observer); @@ -179,7 +179,7 @@ itkOnePlusOneEvolutionaryOptimizerTest(int, char *[]) using GeneratorType = itk::Statistics::NormalVariateGenerator; - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); itkOptimizer->SetNormalVariateGenerator(generator); itkOptimizer->SetInitialPosition(initialPosition); diff --git a/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx b/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx index 571b5c78d4d..080b12b8e9b 100644 --- a/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkOptimizersHierarchyTest.cxx @@ -43,7 +43,7 @@ itkOptimizersHierarchyTest(int, char *[]) bool pass = true; using OptimizerType = itk::Optimizer; - OptimizerType::Pointer genericOptimizer = OptimizerType::New(); + auto genericOptimizer = OptimizerType::New(); unsigned int spaceDimension = 10; @@ -88,35 +88,35 @@ itkOptimizersHierarchyTest(int, char *[]) } using NonLinearOptimizerType = itk::NonLinearOptimizer; - NonLinearOptimizerType::Pointer nonLinearOptimizer = NonLinearOptimizerType::New(); + auto nonLinearOptimizer = NonLinearOptimizerType::New(); if (nonLinearOptimizer.IsNull()) { pass = false; } using SingleValuedNonLinearOptimizerType = itk::SingleValuedNonLinearOptimizer; - SingleValuedNonLinearOptimizerType::Pointer singleValuedOptimizer = SingleValuedNonLinearOptimizerType::New(); + auto singleValuedOptimizer = SingleValuedNonLinearOptimizerType::New(); if (singleValuedOptimizer.IsNull()) { pass = false; } using AmoebaOptimizerType = itk::AmoebaOptimizer; - AmoebaOptimizerType::Pointer amoeba = AmoebaOptimizerType::New(); + auto amoeba = AmoebaOptimizerType::New(); if (amoeba.IsNull()) { pass = false; } using ConjugateGradientOptimizerType = itk::ConjugateGradientOptimizer; - ConjugateGradientOptimizerType::Pointer conjugate = ConjugateGradientOptimizerType::New(); + auto conjugate = ConjugateGradientOptimizerType::New(); if (conjugate.IsNull()) { pass = false; } using LBFGSOptimizerType = itk::LBFGSOptimizer; - LBFGSOptimizerType::Pointer lbfgs = LBFGSOptimizerType::New(); + auto lbfgs = LBFGSOptimizerType::New(); if (lbfgs.IsNull()) { pass = false; @@ -124,35 +124,35 @@ itkOptimizersHierarchyTest(int, char *[]) // Note that a "Versor" is a Unit Quaternion using VersorOptimizerType = itk::VersorTransformOptimizer; - VersorOptimizerType::Pointer versoropt = VersorOptimizerType::New(); + auto versoropt = VersorOptimizerType::New(); if (versoropt.IsNull()) { pass = false; } using QuaternionOptimizerType = itk::QuaternionRigidTransformGradientDescentOptimizer; - QuaternionOptimizerType::Pointer quaternionopt = QuaternionOptimizerType::New(); + auto quaternionopt = QuaternionOptimizerType::New(); if (quaternionopt.IsNull()) { pass = false; } using OnePlusOneEvolutionaryOptimizerType = itk::OnePlusOneEvolutionaryOptimizer; - OnePlusOneEvolutionaryOptimizerType::Pointer onePlusOne = OnePlusOneEvolutionaryOptimizerType::New(); + auto onePlusOne = OnePlusOneEvolutionaryOptimizerType::New(); if (onePlusOne.IsNull()) { pass = false; } using CumulativeGaussianOptimizerType = itk::CumulativeGaussianOptimizer; - CumulativeGaussianOptimizerType::Pointer cumgaussopt = CumulativeGaussianOptimizerType::New(); + auto cumgaussopt = CumulativeGaussianOptimizerType::New(); if (cumgaussopt.IsNull()) { pass = false; } using CumulativeGaussianCostFunctionType = itk::CumulativeGaussianCostFunction; - CumulativeGaussianCostFunctionType::Pointer cumgausstype = CumulativeGaussianCostFunctionType::New(); + auto cumgausstype = CumulativeGaussianCostFunctionType::New(); if (cumgausstype.IsNull()) { pass = false; diff --git a/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx index 8dc3f2c4510..0cadad6faf6 100644 --- a/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkParticleSwarmOptimizerTest.cxx @@ -111,7 +111,7 @@ PSOTest1() // the function we want to optimize itk::ParticleSwarmTestF1::Pointer costFunction = itk::ParticleSwarmTestF1::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); @@ -209,7 +209,7 @@ PSOTest2() // the function we want to optimize itk::ParticleSwarmTestF2::Pointer costFunction = itk::ParticleSwarmTestF2::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); @@ -288,7 +288,7 @@ PSOTest3() // the function we want to optimize itk::ParticleSwarmTestF3::Pointer costFunction = itk::ParticleSwarmTestF3::New(); - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itkOptimizer->UseSeedOn(); itkOptimizer->SetSeed(8775070 + seedOffset++); diff --git a/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx index f2faa78cd34..0f7a03888ac 100644 --- a/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkPowellOptimizerTest.cxx @@ -99,11 +99,11 @@ itkPowellOptimizerTest(int, char *[]) using OptimizerType = itk::PowellOptimizer; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - PowellBoundedCostFunction::Pointer costFunction = PowellBoundedCostFunction::New(); + auto costFunction = PowellBoundedCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx index 9fec532a769..676945da4a8 100644 --- a/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkRegularStepGradientDescentOptimizerTest.cxx @@ -113,11 +113,11 @@ itkRegularStepGradientDescentOptimizerTest(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - RSGCostFunction::Pointer costFunction = RSGCostFunction::New(); + auto costFunction = RSGCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx index 0a3ba562c3b..71dd5e967d4 100644 --- a/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkSPSAOptimizerTest.cxx @@ -110,10 +110,10 @@ itkSPSAOptimizerTest(int, char *[]) using ScalesType = OptimizerType::ScalesType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - SPSACostFunction::Pointer costFunction = SPSACostFunction::New(); + auto costFunction = SPSACostFunction::New(); itkOptimizer->SetCostFunction(costFunction); using ParametersType = SPSACostFunction::ParametersType; diff --git a/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx index 8867442b5e3..8deb2a199c8 100644 --- a/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkVersorRigid3DTransformOptimizerTest.cxx @@ -231,11 +231,11 @@ itkVersorRigid3DTransformOptimizerTest(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction adaptor - versorRigid3DCostFunction::Pointer costFunction = versorRigid3DCostFunction::New(); + auto costFunction = versorRigid3DCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx b/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx index 7aabcdf6924..892af7981a5 100644 --- a/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx +++ b/Modules/Numerics/Optimizers/test/itkVersorTransformOptimizerTest.cxx @@ -187,11 +187,11 @@ itkVersorTransformOptimizerTest(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction adaptor - versorCostFunction::Pointer costFunction = versorCostFunction::New(); + auto costFunction = versorCostFunction::New(); itkOptimizer->SetCostFunction(costFunction); diff --git a/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx b/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx index b46b3df020a..cefad5c579a 100644 --- a/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx +++ b/Modules/Numerics/Optimizersv4/include/itkWindowConvergenceMonitoringFunction.hxx @@ -84,7 +84,7 @@ WindowConvergenceMonitoringFunction::GetConvergenceValue() const -> Rea spacing[0] = 0.1; using BSplinerType = BSplineScatteredDataPointSetToImageFilter; - typename BSplinerType::Pointer bspliner = BSplinerType::New(); + auto bspliner = BSplinerType::New(); bspliner->SetOrigin(origin); bspliner->SetSpacing(spacing); bspliner->SetSize(size); @@ -95,7 +95,7 @@ WindowConvergenceMonitoringFunction::GetConvergenceValue() const -> Rea bspliner->SetNumberOfControlPoints(ncps); bspliner->SetNumberOfWorkUnits(1); - typename EnergyProfileType::Pointer energyProfileWindow = EnergyProfileType::New(); + auto energyProfileWindow = EnergyProfileType::New(); energyProfileWindow->Initialize(); for (unsigned int n = 0; n < this->m_WindowSize; ++n) @@ -111,7 +111,7 @@ WindowConvergenceMonitoringFunction::GetConvergenceValue() const -> Rea bspliner->Update(); using BSplinerFunctionType = BSplineControlPointImageFunction; - typename BSplinerFunctionType::Pointer bsplinerFunction = BSplinerFunctionType::New(); + auto bsplinerFunction = BSplinerFunctionType::New(); bsplinerFunction->SetOrigin(origin); bsplinerFunction->SetSpacing(spacing); bsplinerFunction->SetSize(size); diff --git a/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx index 44245164f3f..396a3fd5e12 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAmoebaOptimizerv4Test.cxx @@ -337,7 +337,7 @@ AmoebaTest1() using OptimizerType = itk::AmoebaOptimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // set optimizer parameters itkOptimizer->SetNumberOfIterations(10); @@ -348,7 +348,7 @@ AmoebaTest1() double fTolerance = 0.001; itkOptimizer->SetFunctionConvergenceTolerance(fTolerance); - itkAmoebaOptimizerv4TestMetric1::Pointer metric = itkAmoebaOptimizerv4TestMetric1::New(); + auto metric = itkAmoebaOptimizerv4TestMetric1::New(); itkOptimizer->SetMetric(metric); std::cout << "itkOptimizer->GetMetric(): " << itkOptimizer->GetMetric() << std::endl; @@ -438,7 +438,7 @@ AmoebaTest2() std::cout << "Amoeba Optimizer Test 2\n \n"; using OptimizerType = itk::AmoebaOptimizerv4; - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // set optimizer parameters unsigned int maxIterations = 100; @@ -463,13 +463,13 @@ AmoebaTest2() initialParameters[0] = -100; // the function we want to optimize - itkAmoebaOptimizerv4TestMetric2::Pointer metric = itkAmoebaOptimizerv4TestMetric2::New(); + auto metric = itkAmoebaOptimizerv4TestMetric2::New(); itkOptimizer->SetMetric(metric); metric->SetParameters(initialParameters); // observe the iterations - CommandIterationUpdateAmoeba::Pointer observer = CommandIterationUpdateAmoeba::New(); + auto observer = CommandIterationUpdateAmoeba::New(); itkOptimizer->AddObserver(itk::IterationEvent(), observer); try diff --git a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx index 0867df690af..9644ea1d349 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationOnVectorTest.cxx @@ -74,12 +74,12 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number // Transform for the moving image using MovingTransformType = TMovingTransform; - typename MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); // Transform for the fixed image using FixedTransformType = itk::IdentityTransform; - typename FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // ParametersType for the moving transform @@ -90,7 +90,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number VectorImageToImageMetricTraitsv4; using MetricType = itk::MeanSquaresImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Assign images and transforms to the metric. metric->SetFixedImage(fixedImage); @@ -104,14 +104,14 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number // Optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); // Instantiate an Observer to report the progress of the Optimization using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Optimizer parameter scales estimator @@ -123,7 +123,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number if (scalesOption.compare("shift") == 0) { std::cout << "Testing RegistrationParameterScalesFromPhysicalShift" << std::endl; - typename ShiftScalesEstimatorType::Pointer shiftScalesEstimator = ShiftScalesEstimatorType::New(); + auto shiftScalesEstimator = ShiftScalesEstimatorType::New(); shiftScalesEstimator->SetMetric(metric); shiftScalesEstimator->SetTransformForward(true); // default scalesEstimator = shiftScalesEstimator; @@ -131,7 +131,7 @@ itkAutoScaledGradientDescentRegistrationOnVectorTestTemplated(int number else { std::cout << "Testing RegistrationParameterScalesFromJacobian" << std::endl; - typename JacobianScalesEstimatorType::Pointer jacobianScalesEstimator = JacobianScalesEstimatorType::New(); + auto jacobianScalesEstimator = JacobianScalesEstimatorType::New(); jacobianScalesEstimator->SetMetric(metric); jacobianScalesEstimator->SetTransformForward(true); // default scalesEstimator = jacobianScalesEstimator; diff --git a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx index ebdaf1c763e..ed9075cece1 100644 --- a/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkAutoScaledGradientDescentRegistrationTest.cxx @@ -78,12 +78,12 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat // Transform for the moving image using MovingTransformType = TMovingTransform; - typename MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); // Transform for the fixed image using FixedTransformType = itk::IdentityTransform; - typename FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // ParametersType for the moving transform @@ -91,7 +91,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat // Metric using MetricType = itk::MeanSquaresImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Assign images and transforms to the metric. metric->SetFixedImage(fixedImage); @@ -106,14 +106,14 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat // Optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); // Instantiate an Observer to report the progress of the Optimization using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Optimizer parameter scales estimator @@ -128,7 +128,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat if (usePhysicalSpaceForShift) { std::cout << "Testing RegistrationParameterScalesFrom*Physical*Shift" << std::endl; - typename PhysicalShiftScalesEstimatorType::Pointer shiftScalesEstimator = PhysicalShiftScalesEstimatorType::New(); + auto shiftScalesEstimator = PhysicalShiftScalesEstimatorType::New(); shiftScalesEstimator->SetMetric(metric); shiftScalesEstimator->SetTransformForward(true); // default scalesEstimator = shiftScalesEstimator; @@ -136,7 +136,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat else { std::cout << "Testing RegistrationParameterScalesFrom*Index*Shift" << std::endl; - typename IndexShiftScalesEstimatorType::Pointer shiftScalesEstimator = IndexShiftScalesEstimatorType::New(); + auto shiftScalesEstimator = IndexShiftScalesEstimatorType::New(); shiftScalesEstimator->SetMetric(metric); shiftScalesEstimator->SetTransformForward(true); // default scalesEstimator = shiftScalesEstimator; @@ -145,7 +145,7 @@ itkAutoScaledGradientDescentRegistrationTestTemplated(int numberOfIterat else { std::cout << "Testing RegistrationParameterScalesFrom*Jacobian*" << std::endl; - typename JacobianScalesEstimatorType::Pointer jacobianScalesEstimator = JacobianScalesEstimatorType::New(); + auto jacobianScalesEstimator = JacobianScalesEstimatorType::New(); jacobianScalesEstimator->SetMetric(metric); jacobianScalesEstimator->SetTransformForward(true); // default scalesEstimator = jacobianScalesEstimator; diff --git a/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx index c06d3146a58..5489d383501 100644 --- a/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkConjugateGradientLineSearchOptimizerv4Test.cxx @@ -208,7 +208,7 @@ itkConjugateGradientLineSearchOptimizerv4Test(int, char *[]) using ScalesType = OptimizerType::ScalesType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric ConjugateGradientLineSearchOptimizerv4TestMetric::Pointer metric = @@ -278,8 +278,8 @@ itkConjugateGradientLineSearchOptimizerv4Test(int, char *[]) itkOptimizer->Print(std::cout); std::cout << "Stop description = " << itkOptimizer->GetStopConditionDescription() << std::endl; - OptimizerType::Pointer badOptimizer = OptimizerType::New(); - bool caught = false; + auto badOptimizer = OptimizerType::New(); + bool caught = false; try { badOptimizer->GetCurrentPosition(); diff --git a/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx index fc1e0ae63e0..3752034ce65 100644 --- a/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkExhaustiveOptimizerv4Test.cxx @@ -201,15 +201,15 @@ itkExhaustiveOptimizerv4Test(int, char *[]) // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Index observer (enables us to check if all positions were indeed visisted): - IndexObserver::Pointer idxObserver = IndexObserver::New(); + auto idxObserver = IndexObserver::New(); itkOptimizer->AddObserver(itk::IterationEvent(), idxObserver); // Declaration of the CostFunction - ExhaustiveOptv4Metric::Pointer metric = ExhaustiveOptv4Metric::New(); + auto metric = ExhaustiveOptv4Metric::New(); itkOptimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx index 8bb863358bb..8b3eb952a2b 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentLineSearchOptimizerv4Test.cxx @@ -210,7 +210,7 @@ itkGradientDescentLineSearchOptimizerv4Test(int, char *[]) using ScalesType = OptimizerType::ScalesType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric GradientDescentLineSearchOptimizerv4TestMetric::Pointer metric = @@ -264,8 +264,8 @@ itkGradientDescentLineSearchOptimizerv4Test(int, char *[]) itkOptimizer->Print(std::cout); std::cout << "Stop description = " << itkOptimizer->GetStopConditionDescription() << std::endl; - OptimizerType::Pointer badOptimizer = OptimizerType::New(); - bool caught = false; + auto badOptimizer = OptimizerType::New(); + bool caught = false; try { badOptimizer->GetCurrentPosition(); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx index 74379a1f6b0..9152e1773ef 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerBasev4Test.cxx @@ -170,8 +170,8 @@ itkGradientDescentOptimizerBasev4Test(int, char *[]) using MetricType = GradientDescentOptimizerBasev4TestMetric; - MetricType::Pointer metric = MetricType::New(); - GradientDescentOptimizerBasev4TestOptimizer::Pointer optimizer = GradientDescentOptimizerBasev4TestOptimizer::New(); + auto metric = MetricType::New(); + auto optimizer = GradientDescentOptimizerBasev4TestOptimizer::New(); /* exercise some methods */ optimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx index 6e41f0a3e6d..b2389184674 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test.cxx @@ -203,10 +203,10 @@ itkGradientDescentOptimizerv4Test(int, char *[]) using ScalesType = OptimizerType::ScalesType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric - GradientDescentOptimizerv4TestMetric::Pointer metric = GradientDescentOptimizerv4TestMetric::New(); + auto metric = GradientDescentOptimizerv4TestMetric::New(); itkOptimizer->SetMetric(metric); @@ -333,8 +333,8 @@ itkGradientDescentOptimizerv4Test(int, char *[]) } std::cout << "\nTest the Exception if the optimizer is not set properly:" << std::endl; - OptimizerType::Pointer badOptimizer = OptimizerType::New(); - bool caught = false; + auto badOptimizer = OptimizerType::New(); + bool caught = false; try { badOptimizer->GetCurrentPosition(); diff --git a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test2.cxx b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test2.cxx index c5cbc6fad82..ccac46d9d53 100644 --- a/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test2.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkGradientDescentOptimizerv4Test2.cxx @@ -145,10 +145,10 @@ itkGradientDescentOptimizerv4Test2(int, char *[]) using ScalesType = OptimizerType::ScalesType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric - GradientDescentOptimizerv4Test2Metric::Pointer metric = GradientDescentOptimizerv4Test2Metric::New(); + auto metric = GradientDescentOptimizerv4Test2Metric::New(); itkOptimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx index eef5a74d6bc..ed2832fe814 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGS2Optimizerv4Test.cxx @@ -160,10 +160,10 @@ itkLBFGS2Optimizerv4Test(int, char *[]) using OptimizerType = itk::LBFGS2Optimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the metric - itkLBFGS2Optimizerv4TestMetric::Pointer metric = itkLBFGS2Optimizerv4TestMetric::New(); + auto metric = itkLBFGS2Optimizerv4TestMetric::New(); // Set some optimizer parameters itkOptimizer->SetHessianApproximationAccuracy(5); diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx index 80aee8b7546..675461c979f 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGSBOptimizerv4Test.cxx @@ -234,10 +234,10 @@ itkLBFGSBOptimizerv4Test(int, char *[]) using OptimizerType = itk::LBFGSBOptimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the metric - LBFGSBOptimizerv4TestMetric::Pointer metric = LBFGSBOptimizerv4TestMetric::New(); + auto metric = LBFGSBOptimizerv4TestMetric::New(); itkOptimizer->SetMetric(metric); @@ -288,7 +288,7 @@ itkLBFGSBOptimizerv4Test(int, char *[]) itkOptimizer->Print(std::cout); - EventChecker::Pointer eventChecker = EventChecker::New(); + auto eventChecker = EventChecker::New(); itkOptimizer->AddObserver(itk::StartEvent(), eventChecker); itkOptimizer->AddObserver(itk::IterationEvent(), eventChecker); itkOptimizer->AddObserver(itk::EndEvent(), eventChecker); @@ -420,7 +420,7 @@ itkLBFGSBOptimizerv4Test(int, char *[]) // std::cout << std::endl << "Test in unbounded mode:" << std::endl; - OptimizerType::Pointer itkOptimizer2 = OptimizerType::New(); + auto itkOptimizer2 = OptimizerType::New(); // Set up boundary conditions select.Fill(0); diff --git a/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx index b4e8cdfec64..e7f806d44b9 100644 --- a/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkLBFGSOptimizerv4Test.cxx @@ -162,10 +162,10 @@ itkLBFGSOptimizerv4Test(int, char *[]) using vnlOptimizerType = vnl_lbfgs; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the metric - itkLBFGSOptimizerv4TestMetric::Pointer metric = itkLBFGSOptimizerv4TestMetric::New(); + auto metric = itkLBFGSOptimizerv4TestMetric::New(); // Set some optimizer parameters itkOptimizer->SetTrace(false); diff --git a/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx index dae7a5a981c..80bce065bae 100644 --- a/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkMultiGradientOptimizerv4Test.cxx @@ -327,12 +327,12 @@ itkMultiGradientOptimizerv4Test(int, char *[]) using ParametersType = MultiGradientOptimizerv4TestMetric::ParametersType; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric - MultiGradientOptimizerv4TestMetric::Pointer metric = MultiGradientOptimizerv4TestMetric::New(); - MultiGradientOptimizerv4TestMetric2::Pointer metric2 = MultiGradientOptimizerv4TestMetric2::New(); - constexpr unsigned int spaceDimension = 2; + auto metric = MultiGradientOptimizerv4TestMetric::New(); + auto metric2 = MultiGradientOptimizerv4TestMetric2::New(); + constexpr unsigned int spaceDimension = 2; itkOptimizer->SetMetric(metric); itkOptimizer->SetNumberOfIterations(50); diff --git a/Modules/Numerics/Optimizersv4/test/itkMultiStartOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkMultiStartOptimizerv4Test.cxx index 9ccedbcf3d9..28e70eb3170 100644 --- a/Modules/Numerics/Optimizersv4/test/itkMultiStartOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkMultiStartOptimizerv4Test.cxx @@ -208,10 +208,10 @@ itkMultiStartOptimizerv4Test(int, char *[]) using OptimizerType = itk::MultiStartOptimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the Metric - MultiStartOptimizerv4TestMetric::Pointer metric = MultiStartOptimizerv4TestMetric::New(); + auto metric = MultiStartOptimizerv4TestMetric::New(); itkOptimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectMetricBaseTest.cxx b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectMetricBaseTest.cxx index 1f8cc8ac485..1e8959b7e2b 100644 --- a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectMetricBaseTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectMetricBaseTest.cxx @@ -119,7 +119,7 @@ itkObjectToObjectMetricBaseTest(int, char *[]) using ImageType = itk::Image; using ObjectMetricType = ObjectToObjectMetricTestMetric; - ObjectMetricType::Pointer objectMetric = ObjectMetricType::New(); + auto objectMetric = ObjectMetricType::New(); objectMetric->Print(std::cout); diff --git a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx index 30de541acf1..da4e0151647 100644 --- a/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkObjectToObjectOptimizerBaseTest.cxx @@ -152,8 +152,8 @@ itkObjectToObjectOptimizerBaseTest(int, char *[]) using MetricType = ObjectToObjectOptimizerBaseTestMetric; - MetricType::Pointer metric = MetricType::New(); - ObjectToObjectOptimizerBaseTestOptimizer::Pointer optimizer = ObjectToObjectOptimizerBaseTestOptimizer::New(); + auto metric = MetricType::New(); + auto optimizer = ObjectToObjectOptimizerBaseTestOptimizer::New(); if (optimizer->GetStopConditionDescription() != std::string("Placeholder test return string")) { diff --git a/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx index cc709cfe03d..b9c1cc810d2 100644 --- a/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkOnePlusOneEvolutionaryOptimizerv4Test.cxx @@ -198,7 +198,7 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) using OptimizerType = itk::OnePlusOneEvolutionaryOptimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); itk::OnePlusOneCommandIterationUpdate::Pointer observer = itk::OnePlusOneCommandIterationUpdate::New(); itkOptimizer->AddObserver(itk::IterationEvent(), observer); @@ -222,7 +222,7 @@ itkOnePlusOneEvolutionaryOptimizerv4Test(int, char *[]) itkOptimizer->SetMaximumIteration(8000); using GeneratorType = itk::Statistics::NormalVariateGenerator; - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); itkOptimizer->SetNormalVariateGenerator(generator); // Set the initial position by setting the metric diff --git a/Modules/Numerics/Optimizersv4/test/itkOptimizerParameterScalesEstimatorTest.cxx b/Modules/Numerics/Optimizersv4/test/itkOptimizerParameterScalesEstimatorTest.cxx index 173a19fa39c..f693dfb2236 100644 --- a/Modules/Numerics/Optimizersv4/test/itkOptimizerParameterScalesEstimatorTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkOptimizerParameterScalesEstimatorTest.cxx @@ -76,7 +76,7 @@ class OptimizerParameterScalesEstimatorTest : public itk::OptimizerParameterScal int itkOptimizerParameterScalesEstimatorTest(int, char *[]) { - OptimizerParameterScalesEstimatorTest::Pointer scalesEstimator = OptimizerParameterScalesEstimatorTest::New(); + auto scalesEstimator = OptimizerParameterScalesEstimatorTest::New(); OptimizerParameterScalesEstimatorTest::ScalesType scales; scalesEstimator->Print(std::cout); diff --git a/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx index 66bdce9ceb8..ceecbf4d4d2 100644 --- a/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkPowellOptimizerv4Test.cxx @@ -148,11 +148,11 @@ itkPowellOptimizerv4Test(int, char *[]) using OptimizerType = itk::PowellOptimizerv4; // Declaration of a itkOptimizer - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); // Declaration of the CostFunction - PowellBoundedMetric::Pointer metric = PowellBoundedMetric::New(); + auto metric = PowellBoundedMetric::New(); itkOptimizer->SetMetric(metric); diff --git a/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx index cec7a4ce8c2..f2d543ee9bc 100644 --- a/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkQuasiNewtonOptimizerv4Test.cxx @@ -77,12 +77,12 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, // Transform for the moving image using MovingTransformType = TMovingTransform; - typename MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); // Transform for the fixed image using FixedTransformType = itk::IdentityTransform; - typename FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // ParametersType for the moving transform @@ -90,7 +90,7 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, // Metric using MetricType = itk::MeanSquaresImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Assign images and transforms to the metric. metric->SetFixedImage(fixedImage); @@ -105,14 +105,14 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, // Optimizer using OptimizerType = itk::QuasiNewtonOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); // Instantiate an Observer to report the progress of the Optimization using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Optimizer parameter scales estimator @@ -127,7 +127,7 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, if (usePhysicalSpaceForShift) { std::cout << "Testing RegistrationParameterScalesFrom*Physical*Shift" << std::endl; - typename PhysicalShiftScalesEstimatorType::Pointer shiftScalesEstimator = PhysicalShiftScalesEstimatorType::New(); + auto shiftScalesEstimator = PhysicalShiftScalesEstimatorType::New(); shiftScalesEstimator->SetMetric(metric); shiftScalesEstimator->SetTransformForward(true); // default scalesEstimator = shiftScalesEstimator; @@ -135,7 +135,7 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, else { std::cout << "Testing RegistrationParameterScalesFrom*Index*Shift" << std::endl; - typename IndexShiftScalesEstimatorType::Pointer shiftScalesEstimator = IndexShiftScalesEstimatorType::New(); + auto shiftScalesEstimator = IndexShiftScalesEstimatorType::New(); shiftScalesEstimator->SetMetric(metric); shiftScalesEstimator->SetTransformForward(true); // default scalesEstimator = shiftScalesEstimator; @@ -144,7 +144,7 @@ itkQuasiNewtonOptimizerv4TestTemplated(int numberOfIterations, else { std::cout << "Testing RegistrationParameterScalesFromJacobian" << std::endl; - typename JacobianScalesEstimatorType::Pointer jacobianScalesEstimator = JacobianScalesEstimatorType::New(); + auto jacobianScalesEstimator = JacobianScalesEstimatorType::New(); jacobianScalesEstimator->SetMetric(metric); scalesEstimator = jacobianScalesEstimator; } diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx index 6b06b9cba6d..5f6e352dc41 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesEstimatorTest.cxx @@ -233,8 +233,8 @@ itkRegistrationParameterScalesEstimatorTest(int, char *[]) using MovingImageType = itk::Image; using VirtualImageType = itk::Image; - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); VirtualImageType::Pointer virtualImage = fixedImage; MovingImageType::SizeType size; @@ -246,17 +246,17 @@ itkRegistrationParameterScalesEstimatorTest(int, char *[]) // Transform begins using MovingTransformType = itk::AffineTransform; - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); using FixedTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // Transform done // Metric begins using MetricType = RegistrationParameterScalesEstimatorTestMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetVirtualDomainFromImage(virtualImage); metric->SetFixedImage(fixedImage); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx index 02d8596a624..9d97b3dc8c5 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromIndexShiftTest.cxx @@ -124,8 +124,8 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) using MovingImageType = itk::Image; using VirtualImageType = itk::Image; - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); VirtualImageType::Pointer virtualImage = fixedImage; MovingImageType::SizeType size; @@ -137,17 +137,17 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) // Transform begins using MovingTransformType = itk::AffineTransform; - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); using FixedTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // Transform done // Metric using MetricType = RegistrationParameterScalesFromIndexShiftTestMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetVirtualDomainFromImage(virtualImage); metric->SetFixedImage(fixedImage); @@ -264,7 +264,7 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) VectorType zero; zero.Fill(0.0); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); field->SetSpacing(virtualImage->GetSpacing()); field->SetOrigin(virtualImage->GetOrigin()); @@ -272,7 +272,7 @@ itkRegistrationParameterScalesFromIndexShiftTest(int, char *[]) field->Allocate(); field->FillBuffer(zero); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetDisplacementField(field); metric->SetMovingTransform(displacementTransform); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx index ed8956b4978..5950d4bb631 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromJacobianTest.cxx @@ -124,8 +124,8 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) using MovingImageType = itk::Image; using VirtualImageType = itk::Image; - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); VirtualImageType::Pointer virtualImage = fixedImage; MovingImageType::SizeType size; @@ -137,17 +137,17 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) // Transform begins using MovingTransformType = itk::AffineTransform; - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); using FixedTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // Transform done // Metric begins using MetricType = RegistrationParameterScalesFromJacobianTestMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetVirtualDomainFromImage(virtualImage); metric->SetFixedImage(fixedImage); @@ -269,7 +269,7 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) VectorType zero; zero.Fill(0.0); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); field->SetSpacing(virtualImage->GetSpacing()); field->SetOrigin(virtualImage->GetOrigin()); @@ -277,7 +277,7 @@ itkRegistrationParameterScalesFromJacobianTest(int, char *[]) field->Allocate(); field->FillBuffer(zero); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetDisplacementField(field); metric->SetMovingTransform(displacementTransform); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx index d5e0c746ba3..f0b7e064516 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftPointSetTest.cxx @@ -86,9 +86,9 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) using PointSetType = itk::PointSet; using PointType = PointSetType::PointType; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); itk::Size virtualDomainSize; @@ -118,16 +118,16 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) // Transforms using MovingTransformType = itk::AffineTransform; - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); using FixedTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // Metric using MetricType = RegistrationParameterScalesFromPhysicalShiftPointSetTestMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); @@ -297,7 +297,7 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) index.Fill(0); region.SetIndex(index); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(region); double spacing[2] = { 1.0, 1.0 }; field->SetSpacing(spacing); @@ -306,7 +306,7 @@ itkRegistrationParameterScalesFromPhysicalShiftPointSetTest(int, char *[]) field->Allocate(); field->FillBuffer(zero); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetDisplacementField(field); metric->SetMovingTransform(displacementTransform); // We must initialize the metric so it will create a virtual domain from the displacement field. diff --git a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx index 80ff4321095..2bb11797379 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegistrationParameterScalesFromPhysicalShiftTest.cxx @@ -124,8 +124,8 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) using MovingImageType = itk::Image; using VirtualImageType = itk::Image; - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); VirtualImageType::Pointer virtualImage = fixedImage; MovingImageType::SizeType size; @@ -136,16 +136,16 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) // Transforms using MovingTransformType = itk::AffineTransform; - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto movingTransform = MovingTransformType::New(); movingTransform->SetIdentity(); using FixedTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); + auto fixedTransform = FixedTransformType::New(); fixedTransform->SetIdentity(); // Metric using MetricType = RegistrationParameterScalesFromPhysicalShiftTestMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetVirtualDomainFromImage(virtualImage); metric->SetFixedImage(fixedImage); @@ -311,7 +311,7 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) VectorType zero; zero.Fill(0.0); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(virtualImage->GetLargestPossibleRegion()); field->SetSpacing(virtualImage->GetSpacing()); field->SetOrigin(virtualImage->GetOrigin()); @@ -319,7 +319,7 @@ itkRegistrationParameterScalesFromPhysicalShiftTest(int, char *[]) field->Allocate(); field->FillBuffer(zero); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetDisplacementField(field); metric->SetMovingTransform(displacementTransform); diff --git a/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx b/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx index bd68dd03db3..e031580910f 100644 --- a/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkRegularStepGradientDescentOptimizerv4Test.cxx @@ -166,10 +166,10 @@ RegularStepGradientDescentOptimizerv4TestHelper( { using ScalesType = typename OptimizerType::ScalesType; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); // Declaration of the metric - RSGv4TestMetric::Pointer metric = RSGv4TestMetric::New(); + auto metric = RSGv4TestMetric::New(); optimizer->SetMetric(metric); @@ -275,7 +275,7 @@ itkRegularStepGradientDescentOptimizerv4Test(int, char *[]) using OptimizerType = itk::RegularStepGradientDescentOptimizerv4; - OptimizerType::Pointer itkOptimizer = OptimizerType::New(); + auto itkOptimizer = OptimizerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( itkOptimizer, RegularStepGradientDescentOptimizerv4, GradientDescentOptimizerv4Template); diff --git a/Modules/Numerics/Optimizersv4/test/itkWindowConvergenceMonitoringFunctionTest.cxx b/Modules/Numerics/Optimizersv4/test/itkWindowConvergenceMonitoringFunctionTest.cxx index f72fffd2047..450d3f6e864 100644 --- a/Modules/Numerics/Optimizersv4/test/itkWindowConvergenceMonitoringFunctionTest.cxx +++ b/Modules/Numerics/Optimizersv4/test/itkWindowConvergenceMonitoringFunctionTest.cxx @@ -24,7 +24,7 @@ itkWindowConvergenceMonitoringFunctionTest(int itkNotUsed(argc), char *[]) using RealType = float; using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction; - ConvergenceMonitoringType::Pointer convergenceMonitoring = ConvergenceMonitoringType::New(); + auto convergenceMonitoring = ConvergenceMonitoringType::New(); convergenceMonitoring->SetWindowSize(10); diff --git a/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx index 39b629eb149..98ef1c5bace 100644 --- a/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkCovarianceSampleFilter.hxx @@ -66,7 +66,7 @@ CovarianceSampleFilter::MakeOutput(DataObjectPointerArraySizeType index { MatrixType covarianceMatrix(measurementVectorSize, measurementVectorSize); covarianceMatrix.SetIdentity(); - typename MatrixDecoratedType::Pointer decoratedCovarianceMatrix = MatrixDecoratedType::New(); + auto decoratedCovarianceMatrix = MatrixDecoratedType::New(); decoratedCovarianceMatrix->Set(covarianceMatrix); return decoratedCovarianceMatrix.GetPointer(); } @@ -77,7 +77,7 @@ CovarianceSampleFilter::MakeOutput(DataObjectPointerArraySizeType index (void)mean; // for complainty pants : valgrind NumericTraits::SetLength(mean, this->GetMeasurementVectorSize()); // NumericTraits::SetLength also initializes array to zero - typename MeasurementVectorDecoratedType::Pointer decoratedMean = MeasurementVectorDecoratedType::New(); + auto decoratedMean = MeasurementVectorDecoratedType::New(); decoratedMean->Set(mean); return decoratedMean.GetPointer(); } @@ -129,7 +129,7 @@ CovarianceSampleFilter::GenerateData() // calculate mean using MeanFilterType = MeanSampleFilter; - typename MeanFilterType::Pointer meanFilter = MeanFilterType::New(); + auto meanFilter = MeanFilterType::New(); meanFilter->SetInput(input); meanFilter->Update(); diff --git a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx index c190a38c4b2..e6f0492e4c0 100644 --- a/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx +++ b/Modules/Numerics/Statistics/include/itkExpectationMaximizationMixtureModelEstimator.hxx @@ -362,7 +362,7 @@ ExpectationMaximizationMixtureModelEstimator::GetOutput() const -> cons for (size_t i = 0; i < numberOfComponents; ++i) { parameters = m_ComponentVector[i]->GetFullParameters(); - typename GaussianMembershipFunctionType::Pointer membershipFunction = GaussianMembershipFunctionType::New(); + auto membershipFunction = GaussianMembershipFunctionType::New(); membershipFunction->SetMeasurementVectorSize(measurementVectorSize); unsigned int parameterIndex = 0; for (unsigned int j = 0; j < measurementVectorSize; ++j) diff --git a/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx index 5296a9a8223..439d046d02f 100644 --- a/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkMeanSampleFilter.hxx @@ -66,7 +66,7 @@ MeanSampleFilter::MakeOutput(DataObjectPointerArraySizeType itkNotUsed( (void)mean; // for complainty pants : valgrind NumericTraits::SetLength(mean, this->GetMeasurementVectorSize()); // NumericTraits::SetLength also initializes array to zero - typename MeasurementVectorDecoratedType::Pointer decoratedMean = MeasurementVectorDecoratedType::New(); + auto decoratedMean = MeasurementVectorDecoratedType::New(); decoratedMean->Set(mean); return decoratedMean.GetPointer(); } diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthFeaturesFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthFeaturesFilter.hxx index 00674204167..94916ef7003 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthFeaturesFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthFeaturesFilter.hxx @@ -129,7 +129,7 @@ ScalarImageToRunLengthFeaturesFilter::Full { this->m_RunLengthMatrixGenerator->SetOffset(offsetIt.Value()); this->m_RunLengthMatrixGenerator->Update(); - typename RunLengthFeaturesFilterType::Pointer runLengthMatrixCalculator = RunLengthFeaturesFilterType::New(); + auto runLengthMatrixCalculator = RunLengthFeaturesFilterType::New(); runLengthMatrixCalculator->SetInput(this->m_RunLengthMatrixGenerator->GetOutput()); runLengthMatrixCalculator->Update(); @@ -215,7 +215,7 @@ ScalarImageToRunLengthFeaturesFilter::Fast this->m_RunLengthMatrixGenerator->SetOffset(offsetIt.Value()); this->m_RunLengthMatrixGenerator->Update(); - typename RunLengthFeaturesFilterType::Pointer runLengthMatrixCalculator = RunLengthFeaturesFilterType::New(); + auto runLengthMatrixCalculator = RunLengthFeaturesFilterType::New(); runLengthMatrixCalculator->SetInput(this->m_RunLengthMatrixGenerator->GetOutput()); runLengthMatrixCalculator->Update(); diff --git a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx index 11ab1e0a5ef..2919e1102b1 100644 --- a/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.hxx @@ -157,7 +157,7 @@ ScalarImageToRunLengthMatrixFilter::Ge // moving the allocation out of loop of offsets // while keeping FillBuffer with boolean false in each loop using BoolImageType = Image; - typename BoolImageType::Pointer alreadyVisitedImage = BoolImageType::New(); + auto alreadyVisitedImage = BoolImageType::New(); alreadyVisitedImage->CopyInformation(inputImage); alreadyVisitedImage->SetRegions(inputImage->GetRequestedRegion()); alreadyVisitedImage->Allocate(); diff --git a/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx b/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx index b2c490acfcc..ce4ae08cdbf 100644 --- a/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx +++ b/Modules/Numerics/Statistics/include/itkWeightedCovarianceSampleFilter.hxx @@ -91,7 +91,7 @@ WeightedCovarianceSampleFilter::ComputeCovarianceMatrixWithWeightingFun const WeightingFunctionType * const weightingFunction = this->GetWeightingFunction(); using WeightedMeanFilterType = WeightedMeanSampleFilter; - typename WeightedMeanFilterType::Pointer meanFilter = WeightedMeanFilterType::New(); + auto meanFilter = WeightedMeanFilterType::New(); meanFilter->SetInput(input); meanFilter->SetWeightingFunction(weightingFunction); @@ -188,7 +188,7 @@ WeightedCovarianceSampleFilter::ComputeCovarianceMatrixWithWeights() const WeightArrayType & weightsArray = this->GetWeights(); using WeightedMeanFilterType = WeightedMeanSampleFilter; - typename WeightedMeanFilterType::Pointer meanFilter = WeightedMeanFilterType::New(); + auto meanFilter = WeightedMeanFilterType::New(); meanFilter->SetInput(input); meanFilter->SetWeights(weightsArray); diff --git a/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx index 423f8f0b7fe..42320f36ff5 100644 --- a/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkChiSquareDistributionTest.cxx @@ -32,7 +32,7 @@ itkChiSquareDistributionTest(int, char *[]) using DistributionType = itk::Statistics::ChiSquareDistribution; - DistributionType::Pointer distributionFunction = DistributionType::New(); + auto distributionFunction = DistributionType::New(); std::cout << "GetNameOfClass() = " << distributionFunction->GetNameOfClass() << std::endl; std::cout << "HasMean() = " << distributionFunction->HasMean() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx index c650673e98f..f67171dac21 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest.cxx @@ -36,7 +36,7 @@ itkCovarianceSampleFilterTest(int, char *[]) using ImageType = itk::Image; using MaskImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::SizeType size; ImageType::IndexType index; @@ -68,7 +68,7 @@ itkCovarianceSampleFilterTest(int, char *[]) // creates an ImageToListSampleAdaptor object using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer sampleGeneratingFilter = ImageToListSampleFilterType::New(); + auto sampleGeneratingFilter = ImageToListSampleFilterType::New(); sampleGeneratingFilter->SetInput(image); @@ -85,7 +85,7 @@ itkCovarianceSampleFilterTest(int, char *[]) using ListSampleType = ImageToListSampleFilterType::ListSampleType; using CovarianceSampleFilterType = itk::Statistics::CovarianceSampleFilter; - CovarianceSampleFilterType::Pointer covarianceFilter = CovarianceSampleFilterType::New(); + auto covarianceFilter = CovarianceSampleFilterType::New(); std::cout << "GetNameOfClass() = " << covarianceFilter->GetNameOfClass() << std::endl; @@ -152,7 +152,7 @@ itkCovarianceSampleFilterTest(int, char *[]) using MeanSampleFilterType = itk::Statistics::MeanSampleFilter; - MeanSampleFilterType::Pointer meanFilter = MeanSampleFilterType::New(); + auto meanFilter = MeanSampleFilterType::New(); meanFilter->SetInput(sampleGeneratingFilter->GetOutput()); try diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx index 4701f4bd544..873add801d4 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest2.cxx @@ -31,7 +31,7 @@ itkCovarianceSampleFilterTest2(int, char *[]) using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -54,7 +54,7 @@ itkCovarianceSampleFilterTest2(int, char *[]) using CovarianceMatrixType = FilterType::MatrixType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); @@ -125,7 +125,7 @@ itkCovarianceSampleFilterTest2(int, char *[]) // use orthogonal meausrment vectors - SampleType::Pointer sample2 = SampleType::New(); + auto sample2 = SampleType::New(); sample2->SetMeasurementVectorSize(MeasurementVectorSize); @@ -211,7 +211,7 @@ itkCovarianceSampleFilterTest2(int, char *[]) } - SampleType::Pointer sample3 = SampleType::New(); + auto sample3 = SampleType::New(); sample2->SetMeasurementVectorSize(MeasurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx index 21ba3286212..1da57e69718 100644 --- a/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkCovarianceSampleFilterTest3.cxx @@ -71,7 +71,7 @@ itkCovarianceSampleFilterTest3(int, char *[]) using SampleType = HistogramType; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); HistogramType::SizeType size(MeasurementVectorSize); HistogramType::MeasurementVectorType lowerBound(MeasurementVectorSize); @@ -87,7 +87,7 @@ itkCovarianceSampleFilterTest3(int, char *[]) using MembershipFunctionType = itk::Statistics::MahalanobisDistanceMetric; - MembershipFunctionType::Pointer memberFunction = MembershipFunctionType::New(); + auto memberFunction = MembershipFunctionType::New(); using MeanVectorType = MembershipFunctionType::MeanVectorType; @@ -140,7 +140,7 @@ itkCovarianceSampleFilterTest3(int, char *[]) using FilterType = itk::Statistics::MyCovarianceSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // test if exception is thrown if a derived class tries to create diff --git a/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx b/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx index 94c669f8361..7e93cbf757c 100644 --- a/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDecisionRuleTest.cxx @@ -77,7 +77,7 @@ itkDecisionRuleTest(int, char *[]) using MembershipVectorType = DecisionRuleType::MembershipVectorType; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); std::cout << decisionRule->GetNameOfClass() << std::endl; std::cout << decisionRule->DecisionRuleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx b/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx index bc09f57a1f6..781b7e51a05 100644 --- a/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx +++ b/Modules/Numerics/Statistics/test/itkDenseFrequencyContainer2Test.cxx @@ -28,7 +28,7 @@ itkDenseFrequencyContainer2Test(int, char *[]) using DenseFrequencyContainer2Type = itk::Statistics::DenseFrequencyContainer2; - DenseFrequencyContainer2Type::Pointer container = DenseFrequencyContainer2Type::New(); + auto container = DenseFrequencyContainer2Type::New(); using AbsoluteFrequencyType = DenseFrequencyContainer2Type::AbsoluteFrequencyType; diff --git a/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx index 695d32157cb..68577887957 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceMetricTest.cxx @@ -77,7 +77,7 @@ itkDistanceMetricTest(int, char *[]) using MeasurementVectorSizeType = DistanceMetricType::MeasurementVectorSizeType; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; std::cout << distance->DistanceMetricType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx b/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx index ed78e37f286..edcf4b05259 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceMetricTest2.cxx @@ -75,7 +75,7 @@ itkDistanceMetricTest2(int, char *[]) using MeasurementVectorSizeType = DistanceMetricType::MeasurementVectorSizeType; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; std::cout << distance->DistanceMetricType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx b/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx index dcbb9471daa..88f609a8f38 100644 --- a/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkDistanceToCentroidMembershipFunctionTest.cxx @@ -29,7 +29,7 @@ itkDistanceToCentroidMembershipFunctionTest(int, char *[]) using MembershipFunctionType = itk::Statistics::DistanceToCentroidMembershipFunction; - MembershipFunctionType::Pointer function = MembershipFunctionType::New(); + auto function = MembershipFunctionType::New(); std::cout << function->GetNameOfClass() << std::endl; @@ -38,7 +38,7 @@ itkDistanceToCentroidMembershipFunctionTest(int, char *[]) using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; using MeasurementVectorSizeType = DistanceMetricType::MeasurementVectorSizeType; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); function->SetDistanceMetric(distanceMetric); if (function->GetDistanceMetric() != distanceMetric) diff --git a/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx index ead565a3d61..c68abd0104c 100644 --- a/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkEuclideanDistanceMetricTest.cxx @@ -27,7 +27,7 @@ itkEuclideanDistanceMetricTest(int, char *[]) using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx index 8344ee28db1..f8124b789f1 100644 --- a/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkEuclideanSquareDistanceMetricTest.cxx @@ -27,7 +27,7 @@ itkEuclideanSquareDistanceMetricTest(int, char *[]) using DistanceMetricType = itk::Statistics::EuclideanSquareDistanceMetric; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx b/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx index e33872bd63d..a45a6b42977 100644 --- a/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkExpectationMaximizationMixtureModelEstimatorTest.cxx @@ -94,7 +94,7 @@ itkExpectationMaximizationMixtureModelEstimatorTest(int argc, char * argv[]) initialProportions[1] = 0.5; /* Loading point data */ - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); PointSetType::PointsContainerPointer pointsContainer = PointSetType::PointsContainer::New(); pointsContainer->Reserve(dataSize); pointSet->SetPoints(pointsContainer); @@ -123,7 +123,7 @@ itkExpectationMaximizationMixtureModelEstimatorTest(int argc, char * argv[]) dataStream.close(); /* Importing the point set to the sample */ - DataSampleType::Pointer sample = DataSampleType::New(); + auto sample = DataSampleType::New(); sample->SetPointSet(pointSet); @@ -138,7 +138,7 @@ itkExpectationMaximizationMixtureModelEstimatorTest(int argc, char * argv[]) } /* Estimating */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); estimator->SetSample(sample); estimator->SetMaximumIteration(maximumIteration); estimator->SetInitialProportions(initialProportions); diff --git a/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx index 925c021d27a..3faeb07c19c 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianDistributionTest.cxx @@ -31,7 +31,7 @@ itkGaussianDistributionTest(int, char *[]) using DistributionType = itk::Statistics::GaussianDistribution; - DistributionType::Pointer distributionFunction = DistributionType::New(); + auto distributionFunction = DistributionType::New(); std::cout << "GetNameOfClass() = " << distributionFunction->GetNameOfClass() << std::endl; std::cout << "HasMean() = " << distributionFunction->HasMean() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx index c1f1ab7f0db..a5bab3d6aec 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianMembershipFunctionTest.cxx @@ -29,7 +29,7 @@ itkGaussianMembershipFunctionTest(int, char *[]) using MembershipFunctionType = itk::Statistics::GaussianMembershipFunction; using MeasurementVectorSizeType = MembershipFunctionType::MeasurementVectorSizeType; - MembershipFunctionType::Pointer function = MembershipFunctionType::New(); + auto function = MembershipFunctionType::New(); std::cout << function->GetNameOfClass() << std::endl; function->Print(std::cout); diff --git a/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx index bc3dbc994b0..0d299585bec 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianMixtureModelComponentTest.cxx @@ -69,7 +69,7 @@ itkGaussianMixtureModelComponentTest(int argc, char * argv[]) initialProportions[1] = 0.5; /* Loading point data */ - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); PointSetType::PointsContainerPointer pointsContainer = PointSetType::PointsContainer::New(); pointsContainer->Reserve(dataSize); pointSet->SetPoints(pointsContainer); @@ -98,7 +98,7 @@ itkGaussianMixtureModelComponentTest(int argc, char * argv[]) dataStream.close(); /* Importing the point set to the sample */ - DataSampleType::Pointer sample = DataSampleType::New(); + auto sample = DataSampleType::New(); sample->SetPointSet(pointSet); diff --git a/Modules/Numerics/Statistics/test/itkGaussianRandomSpatialNeighborSubsamplerTest.cxx b/Modules/Numerics/Statistics/test/itkGaussianRandomSpatialNeighborSubsamplerTest.cxx index b39c2d18910..ebaaf841fef 100644 --- a/Modules/Numerics/Statistics/test/itkGaussianRandomSpatialNeighborSubsamplerTest.cxx +++ b/Modules/Numerics/Statistics/test/itkGaussianRandomSpatialNeighborSubsamplerTest.cxx @@ -48,8 +48,8 @@ itkGaussianRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) using SamplerType = itk::Statistics::GaussianRandomSpatialNeighborSubsampler; using WriterType = itk::ImageFileWriter; - FloatImage::Pointer inImage = FloatImage::New(); - SizeType sz; + auto inImage = FloatImage::New(); + SizeType sz; sz.Fill(35); IndexType idx; idx.Fill(0); @@ -61,10 +61,10 @@ itkGaussianRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) inImage->Allocate(true); // initialize buffer // to zero - AdaptorType::Pointer sample = AdaptorType::New(); + auto sample = AdaptorType::New(); sample->SetImage(inImage); - SamplerType::Pointer sampler_orig = SamplerType::New(); + auto sampler_orig = SamplerType::New(); sampler_orig->SetSample(sample); sampler_orig->SetSampleRegion(region); sampler_orig->SetRadius(20); @@ -123,7 +123,7 @@ itkGaussianRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) if (!outFile.empty()) { - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outFile); writer->SetInput(inImage); try diff --git a/Modules/Numerics/Statistics/test/itkHistogramTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramTest.cxx index 679e23d09d3..a39f4a2657c 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramTest.cxx @@ -35,7 +35,7 @@ itkHistogramTest(int, char *[]) // create a histogram with 3 components measurement vectors using HistogramType = itk::Statistics::Histogram; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(histogram, Histogram, Sample); @@ -255,7 +255,7 @@ itkHistogramTest(int, char *[]) // Histogram with SparseFrequencyContainer2 using SparseHistogramType = itk::Statistics::Histogram; - SparseHistogramType::Pointer sparseHistogram = SparseHistogramType::New(); + auto sparseHistogram = SparseHistogramType::New(); sparseHistogram->SetMeasurementVectorSize(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx index a9b00a02d29..a91f45c9760 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterNaNTest.cxx @@ -30,7 +30,7 @@ itkHistogramToTextureFeaturesFilterNaNTest(int, char *[]) using ImageType = itk::Image; // Build a constant image - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::SizeType size; size.Fill(256); @@ -41,7 +41,7 @@ itkHistogramToTextureFeaturesFilterNaNTest(int, char *[]) // Generate co-occurence matrix using MatrixGeneratorType = itk::Statistics::ScalarImageToCooccurrenceMatrixFilter; - MatrixGeneratorType::Pointer generator = MatrixGeneratorType::New(); + auto generator = MatrixGeneratorType::New(); MatrixGeneratorType::OffsetType offset; offset.Fill(1); generator->SetOffset(offset); @@ -49,7 +49,7 @@ itkHistogramToTextureFeaturesFilterNaNTest(int, char *[]) generator->Update(); using TextureFilterType = itk::Statistics::HistogramToTextureFeaturesFilter; - TextureFilterType::Pointer filter = TextureFilterType::New(); + auto filter = TextureFilterType::New(); filter->SetInput(generator->GetOutput()); filter->Update(); diff --git a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx index ca675093ced..7653e5be37e 100644 --- a/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkHistogramToTextureFeaturesFilterTest.cxx @@ -31,7 +31,7 @@ itkHistogramToTextureFeaturesFilterTest(int, char *[]) //------------------------------------------------------ using MeasurementType = float; using HistogramType = itk::Statistics::Histogram; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); constexpr unsigned int measurementVectorSize = 2; @@ -101,7 +101,7 @@ itkHistogramToTextureFeaturesFilterTest(int, char *[]) using HistogramToTextureFeaturesFilterType = itk::Statistics::HistogramToTextureFeaturesFilter; - HistogramToTextureFeaturesFilterType::Pointer filter = HistogramToTextureFeaturesFilterType::New(); + auto filter = HistogramToTextureFeaturesFilterType::New(); std::cout << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx index f7b97c0103d..68a82674dcd 100644 --- a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest.cxx @@ -35,7 +35,7 @@ itkImageToHistogramFilterTest(int, char *[]) int result = EXIT_SUCCESS; - RGBImageType::Pointer image = RGBImageType::New(); + auto image = RGBImageType::New(); RGBImageType::RegionType region; RGBImageType::SizeType size; @@ -80,8 +80,8 @@ itkImageToHistogramFilterTest(int, char *[]) using HistogramSizeType = HistogramFilterType::HistogramSizeType; using HistogramType = HistogramFilterType::HistogramType; - HistogramFilterType::Pointer filter = HistogramFilterType::New(); - itk::SimpleFilterWatcher watcher(filter, "filter"); + auto filter = HistogramFilterType::New(); + itk::SimpleFilterWatcher watcher(filter, "filter"); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, ImageToHistogramFilter, ImageSink); // Exercise the method NameOfClass(); @@ -310,7 +310,7 @@ itkImageToHistogramFilterTest(int, char *[]) hsize[2] = 1; // number of bins for the Blue channel // Compute the tails of the histrogram automatically - InputBooleanObjectType::Pointer autoMinMaxInputObject = InputBooleanObjectType::New(); + auto autoMinMaxInputObject = InputBooleanObjectType::New(); autoMinMaxInputObject->Set(true); filter->SetAutoMinimumMaximumInput(autoMinMaxInputObject); diff --git a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx index 35f1eeabc2e..88e3eaaa9bf 100644 --- a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest2.cxx @@ -52,14 +52,14 @@ itkImageToHistogramFilterTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using HistogramFilterType = itk::Statistics::ImageToHistogramFilter; - HistogramFilterType::Pointer histogramFilter = HistogramFilterType::New(); - itk::SimpleFilterWatcher watcher(histogramFilter, "filter"); + auto histogramFilter = HistogramFilterType::New(); + itk::SimpleFilterWatcher watcher(histogramFilter, "filter"); using HistogramMeasurementVectorType = HistogramFilterType::HistogramMeasurementVectorType; diff --git a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest3.cxx index fd94eca0297..b8c2a006eac 100644 --- a/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToHistogramFilterTest3.cxx @@ -39,7 +39,7 @@ itkImageToHistogramFilterTest3(int argc, char * argv[]) using ScalarImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -54,7 +54,7 @@ itkImageToHistogramFilterTest3(int argc, char * argv[]) using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(reader->GetOutput()); const int NumberOfBins = static_cast(imageMax - imageMin + 1); diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx index 084a7b1d45c..9c727230ad4 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest.cxx @@ -32,7 +32,7 @@ itkImageToListSampleAdaptorTestTemplate() // Now generate a random image using SourceType = itk::RandomImageSource; - typename SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); itk::SizeValueType size[Dimension] = { 17, 8, 20 }; itk::SizeValueType totalSize = size[0] * size[1] * size[2]; @@ -45,14 +45,14 @@ itkImageToListSampleAdaptorTestTemplate() source->SetMax(static_cast(maxValue)); using ComposeFilterType = itk::ComposeImageFilter; - typename ComposeFilterType::Pointer composeFilter = ComposeFilterType::New(); + auto composeFilter = ComposeFilterType::New(); composeFilter->SetInput(source->GetOutput()); composeFilter->Update(); // creates a sample using ImageToListSampleAdaptorType = itk::Statistics::ImageToListSampleAdaptor; - typename ImageToListSampleAdaptorType::Pointer sample = ImageToListSampleAdaptorType::New(); + auto sample = ImageToListSampleAdaptorType::New(); // Test if the methods throw exceptions if invoked before setting the image try diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx index eabca25b189..5250876e2e3 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleAdaptorTest2.cxx @@ -32,7 +32,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) constexpr unsigned int ImageDimension = 3; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::IndexType start; ImageType::SizeType size; @@ -59,7 +59,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) // define an adaptor type using ImageToListSampleAdaptorType = itk::Statistics::ImageToListSampleAdaptor; - ImageToListSampleAdaptorType::Pointer adaptor = ImageToListSampleAdaptorType::New(); + auto adaptor = ImageToListSampleAdaptorType::New(); adaptor->SetImage(image); @@ -119,7 +119,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) constexpr unsigned int vMeasurementVectorSize = 4; - VariableLengthImageType::Pointer vImage = VariableLengthImageType::New(); + auto vImage = VariableLengthImageType::New(); VariableLengthImageType::IndexType vStart; VariableLengthImageType::SizeType vSize; @@ -152,7 +152,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) // define an adaptor for the image with variable length vector type using VariableLengthImageToListSampleAdaptorType = itk::Statistics::ImageToListSampleAdaptor; - VariableLengthImageToListSampleAdaptorType::Pointer vAdaptor = VariableLengthImageToListSampleAdaptorType::New(); + auto vAdaptor = VariableLengthImageToListSampleAdaptorType::New(); vAdaptor->SetImage(vImage); @@ -195,7 +195,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) using RGBImageType = itk::Image; - RGBImageType::Pointer rgbImage = RGBImageType::New(); + auto rgbImage = RGBImageType::New(); RGBImageType::IndexType rgbStart; RGBImageType::SizeType rgbSize; @@ -228,7 +228,7 @@ itkImageToListSampleAdaptorTest2(int, char *[]) // define an adaptor for the image with variable length vector type using RGBImageToListSampleAdaptorType = itk::Statistics::ImageToListSampleAdaptor; - RGBImageToListSampleAdaptorType::Pointer rgbAdaptor = RGBImageToListSampleAdaptorType::New(); + auto rgbAdaptor = RGBImageToListSampleAdaptorType::New(); rgbAdaptor->SetImage(rgbImage); diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest.cxx index cf2bd2baae2..e69921f66be 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest.cxx @@ -33,7 +33,7 @@ using MaskImageType = itk::Image; static ImageType::Pointer CreateImage() { - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::IndexType start; ImageType::SizeType size; @@ -63,7 +63,7 @@ CreateImage() static MaskImageType::Pointer CreateMaskImage() { - MaskImageType::Pointer image = MaskImageType::New(); + auto image = MaskImageType::New(); MaskImageType::IndexType start; MaskImageType::SizeType size; @@ -101,7 +101,7 @@ CreateMaskImage() static MaskImageType::Pointer CreateLargerMaskImage() { - MaskImageType::Pointer image = MaskImageType::New(); + auto image = MaskImageType::New(); MaskImageType::IndexType start; MaskImageType::SizeType size; @@ -128,7 +128,7 @@ itkImageToListSampleFilterTest(int, char *[]) // Generate a list sample from "image" confined to the mask, "maskImage". using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer filter = ImageToListSampleFilterType::New(); + auto filter = ImageToListSampleFilterType::New(); bool pass = true; std::string failureMeassage = ""; diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx index 38022f3eec2..688e830d4f0 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest2.cxx @@ -35,7 +35,7 @@ itkImageToListSampleFilterTest2(int, char *[]) using MaskImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::IndexType start; ImageType::SizeType size; @@ -59,7 +59,7 @@ itkImageToListSampleFilterTest2(int, char *[]) ++it; } - MaskImageType::Pointer maskImage = MaskImageType::New(); + auto maskImage = MaskImageType::New(); maskImage->SetRegions(region); maskImage->Allocate(true); // initialize // buffer to zero @@ -86,7 +86,7 @@ itkImageToListSampleFilterTest2(int, char *[]) // Generate a list sample from "image" confined to the mask, "maskImage". using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer filter = ImageToListSampleFilterType::New(); + auto filter = ImageToListSampleFilterType::New(); filter->SetInput(image); filter->SetMaskImage(maskImage); diff --git a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx index cf50ffaaae4..5ed2d145846 100644 --- a/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkImageToListSampleFilterTest3.cxx @@ -37,7 +37,7 @@ itkImageToListSampleFilterTest3(int, char *[]) using PixelType = ImageType::PixelType; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetNumberOfComponentsPerPixel(MeasurementVectorSize); @@ -67,7 +67,7 @@ itkImageToListSampleFilterTest3(int, char *[]) ++it; } - MaskImageType::Pointer maskImage = MaskImageType::New(); + auto maskImage = MaskImageType::New(); maskImage->SetRegions(region); maskImage->Allocate(true); // initialize // buffer to zero @@ -95,7 +95,7 @@ itkImageToListSampleFilterTest3(int, char *[]) // Generate a list sample from "image" confined to the mask, "maskImage". using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer filter = ImageToListSampleFilterType::New(); + auto filter = ImageToListSampleFilterType::New(); filter->SetInput(image); filter->SetMaskImage(maskImage); diff --git a/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx index e8f7d59d2f7..d0dc4abf0d8 100644 --- a/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkJointDomainImageToListSampleAdaptorTest.cxx @@ -32,7 +32,7 @@ itkJointDomainImageToListSampleAdaptorTest(int, char *[]) constexpr unsigned int ImageDimension = 3; using ImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::IndexType start; ImageType::SizeType size; @@ -64,7 +64,7 @@ itkJointDomainImageToListSampleAdaptorTest(int, char *[]) // define an adaptor type using JointDomainImageToListSampleAdaptorType = itk::Statistics::JointDomainImageToListSampleAdaptor; - JointDomainImageToListSampleAdaptorType::Pointer adaptor = JointDomainImageToListSampleAdaptorType::New(); + auto adaptor = JointDomainImageToListSampleAdaptorType::New(); // Test if the methods throw exceptions if invoked before setting the image try { diff --git a/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx index 0416aab5d7d..b22f00f8419 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeBasedKmeansEstimatorTest.cxx @@ -60,7 +60,7 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) /* Loading point data */ using PointSetType = itk::PointSet; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); PointSetType::PointsContainerPointer pointsContainer = PointSetType::PointsContainer::New(); pointsContainer->Reserve(dataSize); pointSet->SetPoints(pointsContainer); @@ -85,13 +85,13 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) /* Importing the point set to the sample */ using DataSampleType = stat::PointSetToListSampleAdaptor; - DataSampleType::Pointer sample = DataSampleType::New(); + auto sample = DataSampleType::New(); sample->SetPointSet(pointSet); /* Creating k-d tree */ using Generator = stat::WeightedCentroidKdTreeGenerator; - Generator::Pointer generator = Generator::New(); + auto generator = Generator::New(); generator->SetSample(sample); generator->SetBucketSize(bucketSize); @@ -99,7 +99,7 @@ itkKdTreeBasedKmeansEstimatorTest(int argc, char * argv[]) /* Searching kmeans */ using Estimator = stat::KdTreeBasedKmeansEstimator; - Estimator::Pointer estimator = Estimator::New(); + auto estimator = Estimator::New(); std::cout << estimator->GetNameOfClass() << std::endl; estimator->Print(std::cout); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx index 6e6154e9233..9bb00bcb0bb 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeGeneratorTest.cxx @@ -30,7 +30,7 @@ itkKdTreeGeneratorTest(int, char *[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); MeasurementVectorType mv(measurementVectorSize); @@ -42,7 +42,7 @@ itkKdTreeGeneratorTest(int, char *[]) } using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); std::cout << "KdTreeGenerator class name: " << treeGenerator->GetNameOfClass() << std::endl; @@ -81,7 +81,7 @@ itkKdTreeGeneratorTest(int, char *[]) queryPoint[1] = 7.0; using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); DistanceMetricType::OriginType origin(measurementVectorSize); for (unsigned int i = 0; i < measurementVectorSize; ++i) { @@ -123,7 +123,7 @@ itkKdTreeGeneratorTest(int, char *[]) using MeasurementVectorType = itk::Vector; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(2); MeasurementVectorType mv; @@ -135,7 +135,7 @@ itkKdTreeGeneratorTest(int, char *[]) } using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); treeGenerator->SetSample(sample); treeGenerator->SetBucketSize(16); @@ -172,7 +172,7 @@ itkKdTreeGeneratorTest(int, char *[]) queryPoint[1] = 7.0; using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); DistanceMetricType::OriginType origin(2); for (unsigned int i = 0; i < MeasurementVectorType::Length; ++i) { diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx index 0690434c8de..4d53318746a 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest1.cxx @@ -45,7 +45,7 @@ itkKdTreeTest1(int argc, char * argv[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); // @@ -62,7 +62,7 @@ itkKdTreeTest1(int argc, char * argv[]) } using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); const unsigned int bucketSize = std::stoi(argv[3]); @@ -94,7 +94,7 @@ itkKdTreeTest1(int argc, char * argv[]) using OriginType = DistanceMetricType::OriginType; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); OriginType origin(measurementVectorSize); for (unsigned int k = 0; k < sample->Size(); ++k) diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx index f42e9669055..25813dcfb5a 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest2.cxx @@ -42,7 +42,7 @@ itkKdTreeTest2(int argc, char * argv[]) using MeasurementVectorType = itk::Vector; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(Dimension); MeasurementVectorType mv; @@ -63,7 +63,7 @@ itkKdTreeTest2(int argc, char * argv[]) pntFile.close(); using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); const unsigned int bucketSize = std::stoi(argv[2]); @@ -78,7 +78,7 @@ itkKdTreeTest2(int argc, char * argv[]) TreeType::Pointer tree = treeGenerator->GetOutput(); using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); DistanceMetricType::OriginType origin(Dimension); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx index b3e4832cf34..7411a9be814 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTest3.cxx @@ -46,7 +46,7 @@ itkKdTreeTest3(int argc, char * argv[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); // @@ -62,7 +62,7 @@ itkKdTreeTest3(int argc, char * argv[]) } using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); const unsigned int bucketSize = std::stoi(argv[4]); @@ -99,7 +99,7 @@ itkKdTreeTest3(int argc, char * argv[]) using OriginType = DistanceMetricType::OriginType; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); OriginType origin(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx b/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx index 1f3f7dcad5d..f3610d4631d 100644 --- a/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx +++ b/Modules/Numerics/Statistics/test/itkKdTreeTestSamplePoints.cxx @@ -28,7 +28,7 @@ itkKdTreeTestSamplePoints(int, char *[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); constexpr unsigned int numberOfDataPoints = 5; @@ -58,7 +58,7 @@ itkKdTreeTestSamplePoints(int, char *[]) sample->PushBack(mv5); using TreeGeneratorType = itk::Statistics::KdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); constexpr unsigned int bucketSize = 1; @@ -85,7 +85,7 @@ itkKdTreeTestSamplePoints(int, char *[]) using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; using OriginType = DistanceMetricType::OriginType; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); OriginType origin(measurementVectorSize); for (unsigned int k = 0; k < sample->Size(); ++k) diff --git a/Modules/Numerics/Statistics/test/itkListSampleTest.cxx b/Modules/Numerics/Statistics/test/itkListSampleTest.cxx index c1ca05cd844..9601a08e892 100644 --- a/Modules/Numerics/Statistics/test/itkListSampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkListSampleTest.cxx @@ -35,7 +35,7 @@ itkListSampleTest(int argc, char * argv[]) unsigned int sampleSize = 25; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -393,7 +393,7 @@ itkListSampleTest(int argc, char * argv[]) using VariableSizeListSampleType = itk::Statistics::ListSample; - VariableSizeListSampleType::Pointer variableSizeSample = VariableSizeListSampleType::New(); + auto variableSizeSample = VariableSizeListSampleType::New(); constexpr unsigned int initialSize = 19; variableSizeSample->SetMeasurementVectorSize(initialSize); diff --git a/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx index b8009ee74ba..671d95c89e2 100644 --- a/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMahalanobisDistanceMetricTest.cxx @@ -27,7 +27,7 @@ itkMahalanobisDistanceMetricTest(int, char *[]) using DistanceMetricType = itk::Statistics::MahalanobisDistanceMetric; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx b/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx index 353485301c8..09be255c71a 100644 --- a/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx +++ b/Modules/Numerics/Statistics/test/itkManhattanDistanceMetricTest.cxx @@ -27,7 +27,7 @@ itkManhattanDistanceMetricTest(int, char *[]) using DistanceMetricType = itk::Statistics::ManhattanDistanceMetric; - DistanceMetricType::Pointer distance = DistanceMetricType::New(); + auto distance = DistanceMetricType::New(); std::cout << distance->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkMaximumDecisionRuleTest.cxx b/Modules/Numerics/Statistics/test/itkMaximumDecisionRuleTest.cxx index d60fb239973..6606a508f0f 100644 --- a/Modules/Numerics/Statistics/test/itkMaximumDecisionRuleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMaximumDecisionRuleTest.cxx @@ -29,7 +29,7 @@ itkMaximumDecisionRuleTest(int, char *[]) std::cout << "Testing MaximumDecionRule " << std::endl << std::endl; using DecisionRuleType = itk::Statistics::MaximumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); DecisionRuleType::MembershipVectorType discriminantScores; discriminantScores.resize(3); diff --git a/Modules/Numerics/Statistics/test/itkMaximumRatioDecisionRuleTest.cxx b/Modules/Numerics/Statistics/test/itkMaximumRatioDecisionRuleTest.cxx index f48e1b9987f..eb95c8a4c6e 100644 --- a/Modules/Numerics/Statistics/test/itkMaximumRatioDecisionRuleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMaximumRatioDecisionRuleTest.cxx @@ -29,7 +29,7 @@ itkMaximumRatioDecisionRuleTest(int, char *[]) std::cout << "Testing MaximumRatioDecionRule " << std::endl << std::endl; using DecisionRuleType = itk::Statistics::MaximumRatioDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); DecisionRuleType::MembershipVectorType discriminantScores; discriminantScores.resize(3); diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx index 689114ad415..ff6c25cbd9b 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest.cxx @@ -33,7 +33,7 @@ itkMeanSampleFilterTest(int, char *[]) using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -54,7 +54,7 @@ itkMeanSampleFilterTest(int, char *[]) using FilterType = itk::Statistics::MeanSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx index 674adebbbf6..fc14b0e394c 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest2.cxx @@ -34,7 +34,7 @@ itkMeanSampleFilterTest2(int, char *[]) using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -56,7 +56,7 @@ itkMeanSampleFilterTest2(int, char *[]) using FilterType = itk::Statistics::MeanSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); diff --git a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx index fbbf630949f..e85e60a226a 100644 --- a/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkMeanSampleFilterTest3.cxx @@ -32,7 +32,7 @@ itkMeanSampleFilterTest3(int, char *[]) using SampleType = HistogramType; - HistogramType::Pointer histogram = HistogramType::New(); + auto histogram = HistogramType::New(); HistogramType::SizeType size(MeasurementVectorSize); HistogramType::MeasurementVectorType lowerBound(MeasurementVectorSize); @@ -48,7 +48,7 @@ itkMeanSampleFilterTest3(int, char *[]) using MembershipFunctionType = itk::Statistics::MahalanobisDistanceMetric; - MembershipFunctionType::Pointer memberFunction = MembershipFunctionType::New(); + auto memberFunction = MembershipFunctionType::New(); using MeanVectorType = MembershipFunctionType::MeanVectorType; @@ -101,7 +101,7 @@ itkMeanSampleFilterTest3(int, char *[]) using FilterType = itk::Statistics::MeanSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(histogram); diff --git a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx index 85756b996bd..b315248da6c 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest.cxx @@ -69,7 +69,7 @@ itkMembershipFunctionBaseTest(int, char *[]) using MembershipFunctionBaseType = itk::Statistics::MembershipFunctionBaseTest::MyMembershipFunctionBase; - MembershipFunctionBaseType::Pointer function = MembershipFunctionBaseType::New(); + auto function = MembershipFunctionBaseType::New(); std::cout << function->GetNameOfClass() << std::endl; std::cout << function->MembershipFunctionBaseType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx index 10ca2b7979f..c79b0b1ae15 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipFunctionBaseTest2.cxx @@ -71,7 +71,7 @@ itkMembershipFunctionBaseTest2(int, char *[]) using MembershipFunctionBaseType = itk::Statistics::MembershipFunctionBaseTest::MyMembershipFunctionBase; - MembershipFunctionBaseType::Pointer function = MembershipFunctionBaseType::New(); + auto function = MembershipFunctionBaseType::New(); std::cout << function->GetNameOfClass() << std::endl; std::cout << function->MembershipFunctionBaseType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx index 562b3325707..6607052adee 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest1.cxx @@ -35,10 +35,10 @@ itkMembershipSampleTest1(int, char *[]) using MembershipSampleType = itk::Statistics::MembershipSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); - MembershipSampleType::Pointer membershipSample = MembershipSampleType::New(); + auto membershipSample = MembershipSampleType::New(); membershipSample->SetSample(sample); diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx index 5dfa735745f..199f61aaa1e 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest2.cxx @@ -35,10 +35,10 @@ itkMembershipSampleTest2(int, char *[]) using MembershipSampleType = itk::Statistics::MembershipSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); - MembershipSampleType::Pointer membershipSample = MembershipSampleType::New(); + auto membershipSample = MembershipSampleType::New(); membershipSample->SetSample(sample); diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx index 04d8137e774..e7c1ec8a775 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest3.cxx @@ -35,11 +35,11 @@ itkMembershipSampleTest3(int, char *[]) using MembershipSampleType = itk::Statistics::MembershipSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); - MembershipSampleType::Pointer membershipSample = MembershipSampleType::New(); + auto membershipSample = MembershipSampleType::New(); membershipSample->SetSample(sample); diff --git a/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx b/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx index 2b5f4ff0577..d45fe92b419 100644 --- a/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkMembershipSampleTest4.cxx @@ -35,11 +35,11 @@ itkMembershipSampleTest4(int, char *[]) using MembershipSampleType = itk::Statistics::MembershipSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); - MembershipSampleType::Pointer membershipSample = MembershipSampleType::New(); + auto membershipSample = MembershipSampleType::New(); membershipSample->SetSample(sample); diff --git a/Modules/Numerics/Statistics/test/itkMinimumDecisionRuleTest.cxx b/Modules/Numerics/Statistics/test/itkMinimumDecisionRuleTest.cxx index 6c75dbaec67..3c541257948 100644 --- a/Modules/Numerics/Statistics/test/itkMinimumDecisionRuleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMinimumDecisionRuleTest.cxx @@ -29,7 +29,7 @@ itkMinimumDecisionRuleTest(int, char *[]) std::cout << "Testing MinimumDecionRule " << std::endl << std::endl; using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); DecisionRuleType::MembershipVectorType discriminantScores; discriminantScores.resize(3); diff --git a/Modules/Numerics/Statistics/test/itkMixtureModelComponentBaseTest.cxx b/Modules/Numerics/Statistics/test/itkMixtureModelComponentBaseTest.cxx index 769cda67326..ae4963ff7cc 100644 --- a/Modules/Numerics/Statistics/test/itkMixtureModelComponentBaseTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMixtureModelComponentBaseTest.cxx @@ -70,7 +70,7 @@ itkMixtureModelComponentBaseTest(int, char *[]) using ComponentType = itk::Statistics::MixtureModelComponentBaseTestHelper; - ComponentType::Pointer component = ComponentType::New(); + auto component = ComponentType::New(); std::cout << "component->GetWeights(): " << component->GetWeights() << std::endl; component->RunTests(); diff --git a/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx b/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx index e4764ec67cf..3a6302040ea 100644 --- a/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkNeighborhoodSamplerTest1.cxx @@ -36,9 +36,9 @@ itkNeighborhoodSamplerTest1(int, char *[]) using RadiusType = FilterType::RadiusType; using InputRadiusObjectType = FilterType::InputRadiusObjectType; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Test GetInput() before setting the input if (filter->GetInput() != nullptr) @@ -100,7 +100,7 @@ itkNeighborhoodSamplerTest1(int, char *[]) } - InputRadiusObjectType::Pointer radiusObject1 = InputRadiusObjectType::New(); + auto radiusObject1 = InputRadiusObjectType::New(); radiusObject1->Set(radius1); @@ -120,7 +120,7 @@ itkNeighborhoodSamplerTest1(int, char *[]) return EXIT_FAILURE; } - InputRadiusObjectType::Pointer radiusObject2 = InputRadiusObjectType::New(); + auto radiusObject2 = InputRadiusObjectType::New(); radiusObject2->Set(radius2); diff --git a/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx b/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx index 81f71cdcc05..5c65ad58649 100644 --- a/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkNormalVariateGeneratorTest1.cxx @@ -23,7 +23,7 @@ itkNormalVariateGeneratorTest1(int, char *[]) { using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); diff --git a/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx index e5de5dc454b..058192ea5d7 100644 --- a/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkPointSetToListSampleAdaptorTest.cxx @@ -27,7 +27,7 @@ itkPointSetToListSampleAdaptorTest(int, char *[]) using PointSetType = itk::PointSet; using PointSetToListSampleAdaptorType = itk::Statistics::PointSetToListSampleAdaptor; - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); PointSetType::PointType point; unsigned int numberOfPoints = 10; @@ -39,7 +39,7 @@ itkPointSetToListSampleAdaptorTest(int, char *[]) pointSet->SetPoint(i, point); } - PointSetToListSampleAdaptorType::Pointer listSample = PointSetToListSampleAdaptorType::New(); + auto listSample = PointSetToListSampleAdaptorType::New(); bool exceptionsProperlyCaught = true; // Test if the methods throw exceptions if invoked before setting the pointset diff --git a/Modules/Numerics/Statistics/test/itkProbabilityDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkProbabilityDistributionTest.cxx index 7b9bd29de89..142c3ee2365 100644 --- a/Modules/Numerics/Statistics/test/itkProbabilityDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkProbabilityDistributionTest.cxx @@ -109,7 +109,7 @@ itkProbabilityDistributionTest(int, char *[]) using DistributionType = itk::Statistics::ProbabilityDistributionTestingHelper; - DistributionType::Pointer distributionFunction = DistributionType::New(); + auto distributionFunction = DistributionType::New(); std::cout << "GetNameOfClass() = " << distributionFunction->GetNameOfClass() << std::endl; std::cout << "HasMean() = " << distributionFunction->HasMean() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx b/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx index a82df0cc65d..509b6baa704 100644 --- a/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx +++ b/Modules/Numerics/Statistics/test/itkRandomVariateGeneratorBaseTest.cxx @@ -60,7 +60,7 @@ itkRandomVariateGeneratorBaseTest(int, char *[]) { using GeneratorType = itk::Statistics::VariateGeneratorTestHelper; - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); std::cout << generator->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSampleTest.cxx b/Modules/Numerics/Statistics/test/itkSampleTest.cxx index 65231bd6547..566af1ee220 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest.cxx @@ -126,7 +126,7 @@ itkSampleTest(int, char *[]) using SampleType = itk::Statistics::SampleTest::MySample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); std::cout << sample->GetNameOfClass() << std::endl; std::cout << sample->SampleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx index aca41c19969..4c0a05ae276 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest2.cxx @@ -133,7 +133,7 @@ itkSampleTest2(int, char *[]) using SampleType = itk::Statistics::SampleTest::MySample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); std::cout << sample->GetNameOfClass() << std::endl; std::cout << sample->SampleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx index 863621d6fc0..ce39608febb 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest3.cxx @@ -134,7 +134,7 @@ itkSampleTest3(int, char *[]) using SampleType = itk::Statistics::SampleTest::MySample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); std::cout << sample->GetNameOfClass() << std::endl; std::cout << sample->SampleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx index 601176df4a7..da91b6dc21c 100644 --- a/Modules/Numerics/Statistics/test/itkSampleTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleTest4.cxx @@ -134,7 +134,7 @@ itkSampleTest4(int, char *[]) using SampleType = itk::Statistics::SampleTest::MySample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); std::cout << sample->GetNameOfClass() << std::endl; std::cout << sample->SampleType::Superclass::GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx index de8802de439..89e652326ce 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest.cxx @@ -45,9 +45,9 @@ itkSampleToHistogramFilterTest(int, char *[]) using InputHistogramMeasurementObjectType = FilterType::InputHistogramMeasurementObjectType; using InputHistogramMeasurementVectorObjectType = FilterType::InputHistogramMeasurementVectorObjectType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); // Test GetInput() before setting the input if (filter->GetInput() != nullptr) @@ -179,7 +179,7 @@ itkSampleToHistogramFilterTest(int, char *[]) } - InputHistogramSizeObjectType::Pointer histogramSizeObject = InputHistogramSizeObjectType::New(); + auto histogramSizeObject = InputHistogramSizeObjectType::New(); histogramSizeObject->Set(histogramSize1); @@ -285,7 +285,7 @@ itkSampleToHistogramFilterTest(int, char *[]) } - InputHistogramMeasurementObjectType::Pointer marginalScaleObject1 = InputHistogramMeasurementObjectType::New(); + auto marginalScaleObject1 = InputHistogramMeasurementObjectType::New(); marginalScaleObject1->Set(marginalScale1); @@ -305,7 +305,7 @@ itkSampleToHistogramFilterTest(int, char *[]) return EXIT_FAILURE; } - InputHistogramMeasurementObjectType::Pointer marginalScaleObject2 = InputHistogramMeasurementObjectType::New(); + auto marginalScaleObject2 = InputHistogramMeasurementObjectType::New(); marginalScaleObject2->Set(marginalScale2); @@ -621,7 +621,7 @@ itkSampleToHistogramFilterTest(int, char *[]) } - InputBooleanObjectType::Pointer autoMinimumMaximumObject1 = InputBooleanObjectType::New(); + auto autoMinimumMaximumObject1 = InputBooleanObjectType::New(); autoMinimumMaximumObject1->Set(autoMinimumMaximum1); @@ -641,7 +641,7 @@ itkSampleToHistogramFilterTest(int, char *[]) return EXIT_FAILURE; } - InputBooleanObjectType::Pointer autoMinimumMaximumObject2 = InputBooleanObjectType::New(); + auto autoMinimumMaximumObject2 = InputBooleanObjectType::New(); autoMinimumMaximumObject2->Set(autoMinimumMaximum2); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx index 92f1fbd3e70..b32a07816e9 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest2.cxx @@ -37,8 +37,8 @@ itkSampleToHistogramFilterTest2(int, char *[]) using HistogramSizeType = FilterType::HistogramSizeType; using HistogramMeasurementVectorType = FilterType::HistogramMeasurementVectorType; - FilterType::Pointer filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto filter = FilterType::New(); + auto sample = SampleType::New(); HistogramMeasurementVectorType minimum(numberOfComponents); HistogramMeasurementVectorType maximum(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx index b8c0812c3dc..fd89ed509bc 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest3.cxx @@ -37,8 +37,8 @@ itkSampleToHistogramFilterTest3(int, char *[]) using HistogramSizeType = FilterType::HistogramSizeType; using HistogramMeasurementVectorType = FilterType::HistogramMeasurementVectorType; - FilterType::Pointer filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto filter = FilterType::New(); + auto sample = SampleType::New(); HistogramMeasurementVectorType minimum(numberOfComponents); HistogramMeasurementVectorType maximum(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx index fc200114145..2fbb56fa5ae 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest4.cxx @@ -50,9 +50,9 @@ itkSampleToHistogramFilterTest4(int, char *[]) using HistogramSizeType = FilterType::HistogramSizeType; using HistogramMeasurementVectorType = FilterType::HistogramMeasurementVectorType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); HistogramMeasurementVectorType minimum(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx index a3ddd7e3b16..81d1bf22e45 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest5.cxx @@ -67,11 +67,11 @@ itkSampleToHistogramFilterTest5(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); - ImageToListSampleFilterType::Pointer imageToSampleFilter = ImageToListSampleFilterType::New(); + auto imageToSampleFilter = ImageToListSampleFilterType::New(); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); reader->SetFileName(argv[1]); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx index 97c21d5dedf..095f777bb59 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest6.cxx @@ -47,8 +47,8 @@ itkSampleToHistogramFilterTest6(int, char *[]) using HistogramSizeType = FilterType::HistogramSizeType; using HistogramMeasurementVectorType = FilterType::HistogramMeasurementVectorType; - FilterType::Pointer filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto filter = FilterType::New(); + auto sample = SampleType::New(); HistogramMeasurementVectorType minimum(numberOfComponents); HistogramMeasurementVectorType maximum(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx index cc150c680dc..63537917147 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToHistogramFilterTest7.cxx @@ -38,8 +38,8 @@ itkSampleToHistogramFilterTest7(int, char *[]) using HistogramSizeType = FilterType::HistogramSizeType; using HistogramMeasurementVectorType = FilterType::HistogramMeasurementVectorType; - FilterType::Pointer filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto filter = FilterType::New(); + auto sample = SampleType::New(); HistogramMeasurementVectorType minimum(numberOfComponents); diff --git a/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx b/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx index 23062e4446e..c5b539bb934 100644 --- a/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkSampleToSubsampleFilterTest1.cxx @@ -78,9 +78,9 @@ itkSampleToSubsampleFilterTest1(int, char *[]) using FilterType = itk::Statistics::itkSampleToSubsampleFilter1Namespace::SubsamplerTester; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Test GetInput() before setting the input if (filter->GetInput() != nullptr) diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx index 72030bdb710..7daad4d37cd 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceListSampleFilterTest.cxx @@ -36,7 +36,7 @@ itkScalarImageToCooccurrenceListSampleFilterTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -81,7 +81,7 @@ itkScalarImageToCooccurrenceListSampleFilterTest(int, char *[]) using CooccurrenceListType = itk::Statistics::ScalarImageToCooccurrenceListSampleFilter; - CooccurrenceListType::Pointer filter = CooccurrenceListType::New(); + auto filter = CooccurrenceListType::New(); filter->Print(std::cout); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx index 0776c5ab68e..e3d7915efe6 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest.cxx @@ -40,7 +40,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -98,7 +98,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) using FilterType = itk::Statistics::ScalarImageToCooccurrenceMatrixFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Invoke update before adding an input. An exception should be // thrown. @@ -232,7 +232,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) //-------------------------------------------------------------------------- - FilterType::Pointer filter0 = FilterType::New(); + auto filter0 = FilterType::New(); filter0->SetInput(image); filter0->SetOffsets(offsetV); @@ -268,7 +268,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) //-------------------------------------------------------------------------- // First a histogram with 2 bins per axis - FilterType::Pointer filter2 = FilterType::New(); + auto filter2 = FilterType::New(); filter2->SetInput(image); InputImageType::OffsetType offset3 = { { 0, 1 } }; @@ -303,7 +303,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) // Next a histogram with a smaller range. - FilterType::Pointer filter3 = FilterType::New(); + auto filter3 = FilterType::New(); filter3->SetInput(image); InputImageType::OffsetType offset4 = { { 1, 1 } }; @@ -361,7 +361,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest(int, char *[]) } // Next a histogram with a truncated range. - FilterType::Pointer filter4 = FilterType::New(); + auto filter4 = FilterType::New(); filter4->SetInput(image); filter4->SetOffsets(offsetV); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx index 067dd269406..6e117aa13c5 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToCooccurrenceMatrixFilterTest2.cxx @@ -40,8 +40,8 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); - InputImageType::Pointer mask = InputImageType::New(); + auto image = InputImageType::New(); + auto mask = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -125,7 +125,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) using FilterType = itk::Statistics::ScalarImageToCooccurrenceMatrixFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(image); @@ -271,7 +271,7 @@ itkScalarImageToCooccurrenceMatrixFilterTest2(int, char *[]) passed = false; } - FilterType::Pointer filter2 = FilterType::New(); + auto filter2 = FilterType::New(); filter2->SetInput(image); filter2->SetMaskImage(mask); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx index 62a068d371e..381b7910b33 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthFeaturesFilterTest.cxx @@ -39,7 +39,7 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -80,7 +80,7 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) // 1 1 1 1 1 //-------------------------------------------------------------------------- - InputImageType::Pointer mask = InputImageType::New(); + auto mask = InputImageType::New(); mask->SetRegions(region); mask->Allocate(); @@ -104,7 +104,7 @@ itkScalarImageToRunLengthFeaturesFilterTest(int, char *[]) using RunLengthFilterType = itk::Statistics::ScalarImageToRunLengthFeaturesFilter; // First test: just use the defaults. - RunLengthFilterType::Pointer texFilter = RunLengthFilterType::New(); + auto texFilter = RunLengthFilterType::New(); // Invoke update before adding an input. An exception should be // thrown. diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx index 4e7794ed5bb..97613e81e58 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx @@ -41,8 +41,8 @@ itkScalarImageToRunLengthMatrixFilterTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); - InputImageType::Pointer mask = InputImageType::New(); + auto image = InputImageType::New(); + auto mask = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -114,7 +114,7 @@ itkScalarImageToRunLengthMatrixFilterTest(int, char *[]) using FilterType = itk::Statistics::ScalarImageToRunLengthMatrixFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(image); diff --git a/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx b/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx index bc1eff578a2..fc1d6645252 100644 --- a/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkScalarImageToTextureFeaturesFilterTest.cxx @@ -40,7 +40,7 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) using InputImageIterator = itk::ImageRegionIterator; - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::SizeType inputImageSize = { { IMGWIDTH, IMGHEIGHT } }; @@ -81,7 +81,7 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) // 1 1 1 1 1 //-------------------------------------------------------------------------- - InputImageType::Pointer mask = InputImageType::New(); + auto mask = InputImageType::New(); mask->SetRegions(region); mask->Allocate(); @@ -106,7 +106,7 @@ itkScalarImageToTextureFeaturesFilterTest(int, char *[]) itk::Statistics::ScalarImageToTextureFeaturesFilter; // First test: just use the defaults. - TextureFilterType::Pointer texFilter = TextureFilterType::New(); + auto texFilter = TextureFilterType::New(); // Invoke update before adding an input. An exception should be // thrown. diff --git a/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx b/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx index 761ddf9e80b..4f2b322804e 100644 --- a/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx +++ b/Modules/Numerics/Statistics/test/itkSparseFrequencyContainer2Test.cxx @@ -27,7 +27,7 @@ itkSparseFrequencyContainer2Test(int, char *[]) using SparseFrequencyContainer2Type = itk::Statistics::SparseFrequencyContainer2; - SparseFrequencyContainer2Type::Pointer container = SparseFrequencyContainer2Type::New(); + auto container = SparseFrequencyContainer2Type::New(); using AbsoluteFrequencyType = SparseFrequencyContainer2Type::AbsoluteFrequencyType; diff --git a/Modules/Numerics/Statistics/test/itkSpatialNeighborSubsamplerTest.cxx b/Modules/Numerics/Statistics/test/itkSpatialNeighborSubsamplerTest.cxx index 96e63ea1ba7..d26dc625af8 100644 --- a/Modules/Numerics/Statistics/test/itkSpatialNeighborSubsamplerTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSpatialNeighborSubsamplerTest.cxx @@ -74,8 +74,8 @@ itkSpatialNeighborSubsamplerTest(int, char *[]) using SamplerType = itk::Statistics::SpatialNeighborSubsampler; using IteratorType = itk::ImageRegionConstIteratorWithIndex; - ImageType::Pointer inImage = ImageType::New(); - SizeType sz; + auto inImage = ImageType::New(); + SizeType sz; sz.Fill(25); IndexType idx; idx.Fill(0); @@ -97,10 +97,10 @@ itkSpatialNeighborSubsamplerTest(int, char *[]) regionConstraint.SetSize(szConstraint); regionConstraint.SetIndex(idxConstraint); - AdaptorType::Pointer sample = AdaptorType::New(); + auto sample = AdaptorType::New(); sample->SetImage(inImage); - SamplerType::Pointer sampler_orig = SamplerType::New(); + auto sampler_orig = SamplerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(sampler_orig, SpatialNeighborSubsampler, RegionConstrainedSubsampler); diff --git a/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx index f998c54d104..f9c4c86db74 100644 --- a/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkStandardDeviationPerComponentSampleFilterTest.cxx @@ -37,7 +37,7 @@ itkStandardDeviationPerComponentSampleFilterTest(int, char *[]) using ImageType = itk::Image; using MaskImageType = itk::Image; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::SizeType size; ImageType::IndexType index; @@ -71,7 +71,7 @@ itkStandardDeviationPerComponentSampleFilterTest(int, char *[]) // creates an ImageToListSampleAdaptor object using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer sampleGeneratingFilter = ImageToListSampleFilterType::New(); + auto sampleGeneratingFilter = ImageToListSampleFilterType::New(); sampleGeneratingFilter->SetInput(image); @@ -163,7 +163,7 @@ itkStandardDeviationPerComponentSampleFilterTest(int, char *[]) using CovarianceSampleFilterType = itk::Statistics::CovarianceSampleFilter; - CovarianceSampleFilterType::Pointer covarianceFilter = CovarianceSampleFilterType::New(); + auto covarianceFilter = CovarianceSampleFilterType::New(); covarianceFilter->SetInput(sampleGeneratingFilter->GetOutput()); try diff --git a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx index 58f425851e4..ce6cfdd0b80 100644 --- a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx +++ b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest.cxx @@ -30,7 +30,7 @@ itkStatisticsAlgorithmTest(int, char *[]) using MeasurementVectorType = itk::Array; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); SampleType::MeasurementVectorType lower(measurementVectorSize); SampleType::MeasurementVectorType upper(measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx index d75bc02b415..a3bac3bd668 100644 --- a/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkStatisticsAlgorithmTest2.cxx @@ -106,7 +106,7 @@ itkStatisticsAlgorithmTest2(int, char *[]) std::string whereFail = ""; // creats an image and allocate memory - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(5); @@ -123,11 +123,11 @@ itkStatisticsAlgorithmTest2(int, char *[]) image->Allocate(); // creates an ImageToListSampleAdaptor object - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetImage(image); // creates a Subsample obeject using the ImageToListSampleAdaptor object - SubsampleType::Pointer subsample = SubsampleType::New(); + auto subsample = SubsampleType::New(); subsample->SetSample(sample); // each algorithm test will be compared with the sorted diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx index 433063e19e9..af705a6cb02 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest.cxx @@ -33,7 +33,7 @@ itkSubsampleTest(int, char *[]) // Now generate a random image using SourceType = itk::RandomImageSource; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); itk::SizeValueType size[3] = { 17, 8, 20 }; itk::SizeValueType totalSize = size[0] * size[1] * size[2]; @@ -54,13 +54,13 @@ itkSubsampleTest(int, char *[]) using MaskPixelImageType = itk::Image; using ImageCastFilterType = itk::ComposeImageFilter; - ImageCastFilterType::Pointer castFilter = ImageCastFilterType::New(); + auto castFilter = ImageCastFilterType::New(); castFilter->SetInput(source->GetOutput()); castFilter->Update(); using ImageToListSampleFilterType = itk::Statistics::ImageToListSampleFilter; - ImageToListSampleFilterType::Pointer filter = ImageToListSampleFilterType::New(); + auto filter = ImageToListSampleFilterType::New(); filter->SetInput(castFilter->GetOutput()); try @@ -77,7 +77,7 @@ itkSubsampleTest(int, char *[]) using SubsampleType = itk::Statistics::Subsample; - SubsampleType::Pointer subsample = SubsampleType::New(); + auto subsample = SubsampleType::New(); std::cout << subsample->GetNameOfClass() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx index 499dd072444..faa4f3ee0ac 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest2.cxx @@ -33,7 +33,7 @@ itkSubsampleTest2(int, char *[]) unsigned int sampleSize = 10; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); @@ -50,7 +50,7 @@ itkSubsampleTest2(int, char *[]) // tests begin using SubsampleType = itk::Statistics::Subsample; - SubsampleType::Pointer subSample = SubsampleType::New(); + auto subSample = SubsampleType::New(); subSample->SetSample(sample); // Add measurement vectors in sample with even id number to subSample @@ -78,7 +78,7 @@ itkSubsampleTest2(int, char *[]) } using CascadedSubsampleType = itk::Statistics::Subsample; - CascadedSubsampleType::Pointer subSample2 = CascadedSubsampleType::New(); + auto subSample2 = CascadedSubsampleType::New(); subSample2->SetSample(subSample); // Add measurement vectors in subsample with even id number to subSample2 diff --git a/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx b/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx index 20039288236..e55ae7d9cfc 100644 --- a/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx +++ b/Modules/Numerics/Statistics/test/itkSubsampleTest3.cxx @@ -32,7 +32,7 @@ itkSubsampleTest3(int, char *[]) using MeasurementVectorType = itk::FixedArray; using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -53,7 +53,7 @@ itkSubsampleTest3(int, char *[]) using SubsampleType = itk::Statistics::Subsample; - SubsampleType::Pointer subsample = SubsampleType::New(); + auto subsample = SubsampleType::New(); subsample->SetSample(sample); @@ -62,7 +62,7 @@ itkSubsampleTest3(int, char *[]) using FilterType = itk::Statistics::MeanSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(subsample); diff --git a/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx b/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx index 37c93d4a36e..44dd3693806 100644 --- a/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx +++ b/Modules/Numerics/Statistics/test/itkTDistributionTest.cxx @@ -31,7 +31,7 @@ itkTDistributionTest(int, char *[]) using DistributionType = itk::Statistics::TDistribution; - DistributionType::Pointer distributionFunction = DistributionType::New(); + auto distributionFunction = DistributionType::New(); std::cout << "GetNameOfClass() = " << distributionFunction->GetNameOfClass() << std::endl; std::cout << "HasMean() = " << distributionFunction->HasMean() << std::endl; diff --git a/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx b/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx index 4c8a1e03026..3de5af38013 100644 --- a/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx +++ b/Modules/Numerics/Statistics/test/itkUniformRandomSpatialNeighborSubsamplerTest.cxx @@ -47,8 +47,8 @@ itkUniformRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) using SamplerType = itk::Statistics::UniformRandomSpatialNeighborSubsampler; using WriterType = itk::ImageFileWriter; - FloatImage::Pointer inImage = FloatImage::New(); - SizeType sz; + auto inImage = FloatImage::New(); + SizeType sz; sz.Fill(35); IndexType idx; idx.Fill(0); @@ -60,10 +60,10 @@ itkUniformRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) inImage->Allocate(true); // initialize buffer // to zero - AdaptorType::Pointer sample = AdaptorType::New(); + auto sample = AdaptorType::New(); sample->SetImage(inImage); - SamplerType::Pointer sampler_orig = SamplerType::New(); + auto sampler_orig = SamplerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(sampler_orig, UniformRandomSpatialNeighborSubsampler, SpatialNeighborSubsampler); @@ -103,7 +103,7 @@ itkUniformRandomSpatialNeighborSubsamplerTest(int argc, char * argv[]) { const std::string outFileName(argv[2]); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outFileName); writer->SetInput(inImage); diff --git a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx index 11e450dfee2..7e9fd733c73 100644 --- a/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx +++ b/Modules/Numerics/Statistics/test/itkVectorContainerToListSampleAdaptorTest.cxx @@ -29,7 +29,7 @@ itkVectorContainerToListSampleAdaptorTest(int, char *[]) using AdaptorType = itk::Statistics::VectorContainerToListSampleAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(adaptor, VectorContainerToListSampleAdaptor, ListSample); @@ -44,8 +44,8 @@ itkVectorContainerToListSampleAdaptorTest(int, char *[]) ITK_TRY_EXPECT_EXCEPTION(adaptor->GetTotalFrequency()); // Set the vector container - unsigned int containerSize = 3; - ContainerType::Pointer container = ContainerType::New(); + unsigned int containerSize = 3; + auto container = ContainerType::New(); container->Reserve(containerSize); for (unsigned int i = 0; i < container->Size(); ++i) { diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx index 324f146f272..3fc117d7cd4 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest1.cxx @@ -44,7 +44,7 @@ itkWeightedCentroidKdTreeGeneratorTest1(int argc, char * argv[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); // @@ -60,7 +60,7 @@ itkWeightedCentroidKdTreeGeneratorTest1(int argc, char * argv[]) } using TreeGeneratorType = itk::Statistics::WeightedCentroidKdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); std::cout << treeGenerator->GetNameOfClass() << std::endl; treeGenerator->Print(std::cout); @@ -92,8 +92,8 @@ itkWeightedCentroidKdTreeGeneratorTest1(int argc, char * argv[]) // Check that for every point in the sample, its closest point is itself. // using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); - bool testFailed = false; + auto distanceMetric = DistanceMetricType::New(); + bool testFailed = false; for (unsigned int k = 0; k < sample->Size(); ++k) { diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx index 865ef065df1..ccb65ca9970 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest8.cxx @@ -46,7 +46,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); // // Generate a sample of random points @@ -61,7 +61,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) } using TreeGeneratorType = itk::Statistics::WeightedCentroidKdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); std::cout << treeGenerator->GetNameOfClass() << std::endl; treeGenerator->Print(std::cout); @@ -93,7 +93,7 @@ itkWeightedCentroidKdTreeGeneratorTest8(int argc, char * argv[]) // Check that for every point in the sample, its closest point is itself. // using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); bool testFailed = false; DistanceMetricType::OriginType origin; ::itk::NumericTraits::SetLength(origin, measurementVectorSize); diff --git a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx index bb2a35d4149..f199832659d 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCentroidKdTreeGeneratorTest9.cxx @@ -38,7 +38,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) // Random number generator using NumberGeneratorType = itk::Statistics::MersenneTwisterRandomVariateGenerator; - NumberGeneratorType::Pointer randomNumberGenerator = NumberGeneratorType::New(); + auto randomNumberGenerator = NumberGeneratorType::New(); randomNumberGenerator->Initialize(); using MeasurementVectorType = itk::VariableLengthVector; @@ -46,7 +46,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) constexpr SampleType::MeasurementVectorSizeType measurementVectorSize = 2; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(measurementVectorSize); // @@ -62,7 +62,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) } using TreeGeneratorType = itk::Statistics::WeightedCentroidKdTreeGenerator; - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); std::cout << treeGenerator->GetNameOfClass() << std::endl; treeGenerator->Print(std::cout); @@ -95,7 +95,7 @@ itkWeightedCentroidKdTreeGeneratorTest9(int argc, char * argv[]) using DistanceMetricType = itk::Statistics::EuclideanDistanceMetric; DistanceMetricType::OriginType origin; ::itk::NumericTraits::SetLength(origin, measurementVectorSize); - DistanceMetricType::Pointer distanceMetric = DistanceMetricType::New(); + auto distanceMetric = DistanceMetricType::New(); bool testFailed = false; diff --git a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx index bc3a20ce643..fe49ebdce7a 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest.cxx @@ -67,11 +67,11 @@ itkWeightedCovarianceSampleFilterTest(int, char *[]) using MeasurementVectorRealType = FilterType::MeasurementVectorRealType; using CovarianceMatrixType = FilterType::MatrixType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); MeasurementVectorType measure; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -342,7 +342,7 @@ itkWeightedCovarianceSampleFilterTest(int, char *[]) }; // end of class // set a constant 1.0 weight using a function - WeightedCovarianceSampleTestFunction1::Pointer weightFunction = WeightedCovarianceSampleTestFunction1::New(); + auto weightFunction = WeightedCovarianceSampleTestFunction1::New(); filter->SetWeightingFunction(weightFunction); try diff --git a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx index 47223f3907c..2c098a4b89e 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedCovarianceSampleFilterTest2.cxx @@ -67,12 +67,12 @@ itkWeightedCovarianceSampleFilterTest2(int, char *[]) using CovarianceMatrixType = FilterType::MatrixType; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); MeasurementVectorType2 measure; itk::NumericTraits::SetLength(measure, MeasurementVectorSize2); - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize2); @@ -349,7 +349,7 @@ itkWeightedCovarianceSampleFilterTest2(int, char *[]) }; // end of class // set a constant 1.0 weight using a function - WeightedCovarianceSampleTestFunction2::Pointer weightFunction = WeightedCovarianceSampleTestFunction2::New(); + auto weightFunction = WeightedCovarianceSampleTestFunction2::New(); filter->SetWeightingFunction(weightFunction); try diff --git a/Modules/Numerics/Statistics/test/itkWeightedMeanSampleFilterTest.cxx b/Modules/Numerics/Statistics/test/itkWeightedMeanSampleFilterTest.cxx index 2a0ed5b9e54..9bda8c8bc97 100644 --- a/Modules/Numerics/Statistics/test/itkWeightedMeanSampleFilterTest.cxx +++ b/Modules/Numerics/Statistics/test/itkWeightedMeanSampleFilterTest.cxx @@ -79,7 +79,7 @@ itkWeightedMeanSampleFilterTest(int, char *[]) using SampleType = itk::Statistics::ListSample; - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(MeasurementVectorSize); @@ -100,7 +100,7 @@ itkWeightedMeanSampleFilterTest(int, char *[]) using FilterType = itk::Statistics::WeightedMeanSampleFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << filter->GetNameOfClass() << std::endl; filter->Print(std::cout); @@ -217,7 +217,7 @@ itkWeightedMeanSampleFilterTest(int, char *[]) } // set the weight using a function - WeightedMeanTestFunction::Pointer weightFunction = WeightedMeanTestFunction::New(); + auto weightFunction = WeightedMeanTestFunction::New(); filter->SetWeightingFunction(weightFunction); try diff --git a/Modules/Registration/Common/include/itkBSplineTransformParametersAdaptor.hxx b/Modules/Registration/Common/include/itkBSplineTransformParametersAdaptor.hxx index 3a3ba0cbc40..042372bcf00 100644 --- a/Modules/Registration/Common/include/itkBSplineTransformParametersAdaptor.hxx +++ b/Modules/Registration/Common/include/itkBSplineTransformParametersAdaptor.hxx @@ -250,8 +250,8 @@ BSplineTransformParametersAdaptor::AdaptTransformParameters() * This code is copied from the itk-example * DeformableRegistration6.cxx . */ - typename UpsampleFilterType::Pointer upsampler = UpsampleFilterType::New(); - typename CoefficientUpsampleFunctionType::Pointer coeffUpsampleFunction = CoefficientUpsampleFunctionType::New(); + auto upsampler = UpsampleFilterType::New(); + auto coeffUpsampleFunction = CoefficientUpsampleFunctionType::New(); upsampler->SetInterpolator(coeffUpsampleFunction); upsampler->SetSize(newGridSize); @@ -261,7 +261,7 @@ BSplineTransformParametersAdaptor::AdaptTransformParameters() upsampler->SetOutputDirection(newGridDirection); upsampler->SetInput(this->m_Transform->GetCoefficientImages()[j]); - typename DecompositionFilterType::Pointer decompositionFilter = DecompositionFilterType::New(); + auto decompositionFilter = DecompositionFilterType::New(); decompositionFilter->SetSplineOrder(TransformType::SplineOrder); decompositionFilter->SetInput(upsampler->GetOutput()); diff --git a/Modules/Registration/Common/include/itkConstantVelocityFieldTransformParametersAdaptor.hxx b/Modules/Registration/Common/include/itkConstantVelocityFieldTransformParametersAdaptor.hxx index 71bbed7e136..6c21946dd4f 100644 --- a/Modules/Registration/Common/include/itkConstantVelocityFieldTransformParametersAdaptor.hxx +++ b/Modules/Registration/Common/include/itkConstantVelocityFieldTransformParametersAdaptor.hxx @@ -199,15 +199,15 @@ ConstantVelocityFieldTransformParametersAdaptor::AdaptTransformParam const DirectionType newFieldDirection = this->GetRequiredDirection(); using IdentityTransformType = IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); using LinearInterpolatorType = LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); interpolator->SetInputImage(this->m_Transform->GetConstantVelocityField()); using ResamplerType = ResampleImageFilter; - typename ResamplerType::Pointer resampler = ResamplerType::New(); + auto resampler = ResamplerType::New(); resampler->SetInput(this->m_Transform->GetConstantVelocityField()); resampler->SetOutputDirection(newFieldDirection); resampler->SetOutputOrigin(newFieldOrigin); diff --git a/Modules/Registration/Common/include/itkDisplacementFieldTransformParametersAdaptor.hxx b/Modules/Registration/Common/include/itkDisplacementFieldTransformParametersAdaptor.hxx index 3635217111a..3e76db1d2f4 100644 --- a/Modules/Registration/Common/include/itkDisplacementFieldTransformParametersAdaptor.hxx +++ b/Modules/Registration/Common/include/itkDisplacementFieldTransformParametersAdaptor.hxx @@ -195,15 +195,15 @@ DisplacementFieldTransformParametersAdaptor::AdaptTransformParameter const DirectionType newFieldDirection = this->GetRequiredDirection(); using IdentityTransformType = IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); using LinearInterpolatorType = LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); interpolator->SetInputImage(this->m_Transform->GetDisplacementField()); using ResamplerType = ResampleImageFilter; - typename ResamplerType::Pointer resampler = ResamplerType::New(); + auto resampler = ResamplerType::New(); resampler->SetInput(this->m_Transform->GetDisplacementField()); resampler->SetOutputDirection(newFieldDirection); resampler->SetOutputOrigin(newFieldOrigin); @@ -219,10 +219,10 @@ DisplacementFieldTransformParametersAdaptor::AdaptTransformParameter typename DisplacementFieldType::Pointer newInverseDisplacementField = nullptr; if (this->m_Transform->GetInverseDisplacementField()) { - typename LinearInterpolatorType::Pointer inverseInterpolator = LinearInterpolatorType::New(); + auto inverseInterpolator = LinearInterpolatorType::New(); inverseInterpolator->SetInputImage(this->m_Transform->GetInverseDisplacementField()); - typename ResamplerType::Pointer inverseResampler = ResamplerType::New(); + auto inverseResampler = ResamplerType::New(); inverseResampler->SetInput(this->m_Transform->GetInverseDisplacementField()); inverseResampler->SetOutputDirection(newFieldDirection); inverseResampler->SetOutputOrigin(newFieldOrigin); diff --git a/Modules/Registration/Common/include/itkHistogramImageToImageMetric.hxx b/Modules/Registration/Common/include/itkHistogramImageToImageMetric.hxx index 3d23c7131c0..6e440f7003d 100644 --- a/Modules/Registration/Common/include/itkHistogramImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkHistogramImageToImageMetric.hxx @@ -198,13 +198,13 @@ HistogramImageToImageMetric::GetDerivative(const Tran derivative = DerivativeType(ParametersDimension); derivative.Fill(NumericTraits::ZeroValue()); - typename HistogramType::Pointer pHistogram = HistogramType::New(); + auto pHistogram = HistogramType::New(); pHistogram->SetMeasurementVectorSize(2); this->ComputeHistogram(parameters, *pHistogram); for (unsigned int i = 0; i < ParametersDimension; ++i) { - typename HistogramType::Pointer pHistogram2 = HistogramType::New(); + auto pHistogram2 = HistogramType::New(); pHistogram2->SetMeasurementVectorSize(2); this->CopyHistogram(*pHistogram2, *pHistogram); diff --git a/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx b/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx index 39d67b3e15a..874818810d6 100644 --- a/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx +++ b/Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.hxx @@ -291,7 +291,7 @@ KappaStatisticImageToImageMetric::ComputeGradient() { const unsigned int dim = MovingImageType::ImageDimension; - typename GradientImageType::Pointer tempGradientImage = GradientImageType::New(); + auto tempGradientImage = GradientImageType::New(); tempGradientImage->SetRegions(this->m_MovingImage->GetBufferedRegion().GetSize()); tempGradientImage->Allocate(); tempGradientImage->Update(); diff --git a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx index 489df86779c..aec19226e3b 100644 --- a/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx +++ b/Modules/Registration/Common/include/itkLandmarkBasedTransformInitializer.hxx @@ -89,7 +89,7 @@ LandmarkBasedTransformInitializer::Intern using FilterType = BSplineScatteredDataPointSetToImageFilter; using WeightsContainerType = typename FilterType::WeightsContainerType; - typename WeightsContainerType::Pointer weights = WeightsContainerType::New(); + auto weights = WeightsContainerType::New(); weights->Reserve(numberOfLandMarks); if (!m_LandmarkWeight.empty()) @@ -114,7 +114,7 @@ LandmarkBasedTransformInitializer::Intern } // Set a pointSet from the input landmarks - typename PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); pointSet->Initialize(); PointsContainerConstIterator fixedIt = m_FixedLandmarks.begin(); @@ -135,7 +135,7 @@ LandmarkBasedTransformInitializer::Intern const typename VectorImageType::SpacingType spacing = this->m_ReferenceImage->GetSpacing(); const typename VectorImageType::DirectionType direction = this->m_ReferenceImage->GetDirection(); - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Define the parametric domain. filter->SetOrigin(origin); filter->SetSpacing(spacing); @@ -166,7 +166,7 @@ LandmarkBasedTransformInitializer::Intern for (unsigned int j = 0; j < ImageDimension; ++j) { using SelectorType = VectorIndexSelectionCastImageFilter; - typename SelectorType::Pointer selector = SelectorType::New(); + auto selector = SelectorType::New(); selector->SetInput(filter->GetPhiLattice()); selector->SetIndex(j); @@ -641,7 +641,7 @@ LandmarkBasedTransformInitializer::Intern itkWarningMacro(<< "Less than 2 landmarks available. Rotation is not computed"); } - typename Rigid2DTransformType::Pointer t = Rigid2DTransformType::New(); + auto t = Rigid2DTransformType::New(); t->SetIdentity(); t->SetAngle(rotationAngle); diff --git a/Modules/Registration/Common/include/itkMeanSquareRegistrationFunction.hxx b/Modules/Registration/Common/include/itkMeanSquareRegistrationFunction.hxx index d1d178634f8..3bf231b92bc 100644 --- a/Modules/Registration/Common/include/itkMeanSquareRegistrationFunction.hxx +++ b/Modules/Registration/Common/include/itkMeanSquareRegistrationFunction.hxx @@ -48,7 +48,7 @@ MeanSquareRegistrationFunction::M this->SetFixedImage(nullptr); m_FixedImageGradientCalculator = GradientCalculatorType::New(); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = itkDynamicCastInDebugMode(interp.GetPointer()); } diff --git a/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx b/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx index 94f3d570031..cb673cecd8e 100644 --- a/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx +++ b/Modules/Registration/Common/include/itkMultiResolutionPyramidImageFilter.hxx @@ -238,8 +238,8 @@ MultiResolutionPyramidImageFilter::GenerateData() using ResampleShrinkerType = ResampleImageFilter; using ShrinkerType = ShrinkImageFilter; - typename CasterType::Pointer caster = CasterType::New(); - typename SmootherType::Pointer smoother = SmootherType::New(); + auto caster = CasterType::New(); + auto smoother = SmootherType::New(); typename ImageToImageType::Pointer shrinkerFilter; // @@ -257,7 +257,7 @@ MultiResolutionPyramidImageFilter::GenerateData() { resampleShrinker = ResampleShrinkerType::New(); using LinearInterpolatorType = itk::LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); resampleShrinker->SetInterpolator(interpolator); resampleShrinker->SetDefaultPixelValue(0); shrinkerFilter = resampleShrinker.GetPointer(); @@ -294,7 +294,7 @@ MultiResolutionPyramidImageFilter::GenerateData() if (!this->GetUseShrinkImageFilter()) { using IdentityTransformType = itk::IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); resampleShrinker->SetOutputParametersFromImage(outputPtr); resampleShrinker->SetTransform(identityTransform); } diff --git a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx index a0cf33ae2ad..9e784ecb6b1 100644 --- a/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx +++ b/Modules/Registration/Common/include/itkRecursiveMultiResolutionPyramidImageFilter.hxx @@ -66,9 +66,9 @@ RecursiveMultiResolutionPyramidImageFilter::GenerateD using ResampleShrinkerType = ResampleImageFilter; using ShrinkerType = ShrinkImageFilter; - typename CasterType::Pointer caster = CasterType::New(); - typename CopierType::Pointer copier = CopierType::New(); - typename SmootherType::Pointer smoother = SmootherType::New(); + auto caster = CasterType::New(); + auto copier = CopierType::New(); + auto smoother = SmootherType::New(); typename ImageToImageType::Pointer shrinkerFilter; // @@ -86,9 +86,9 @@ RecursiveMultiResolutionPyramidImageFilter::GenerateD { resampleShrinker = ResampleShrinkerType::New(); using LinearInterpolatorType = itk::LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); using IdentityTransformType = itk::IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); resampleShrinker->SetInterpolator(interpolator); resampleShrinker->SetDefaultPixelValue(0); resampleShrinker->SetTransform(identityTransform); diff --git a/Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx b/Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx index a2dd0ac1801..f039c230ca2 100644 --- a/Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx +++ b/Modules/Registration/Common/include/itkTimeVaryingBSplineVelocityFieldTransformParametersAdaptor.hxx @@ -284,7 +284,7 @@ TimeVaryingBSplineVelocityFieldTransformParametersAdaptor::AdaptTran { using SelectionFilterType = VectorIndexSelectionCastImageFilter; - typename SelectionFilterType::Pointer selector = SelectionFilterType::New(); + auto selector = SelectionFilterType::New(); selector->SetInput(this->m_Transform->GetTimeVaryingVelocityFieldControlPointLattice()); selector->SetIndex(j); @@ -299,8 +299,8 @@ TimeVaryingBSplineVelocityFieldTransformParametersAdaptor::AdaptTran * This code is copied from the itk-example * DeformableRegistration6.cxx . */ - typename UpsampleFilterType::Pointer upsampler = UpsampleFilterType::New(); - typename CoefficientUpsampleFunctionType::Pointer coeffUpsampleFunction = CoefficientUpsampleFunctionType::New(); + auto upsampler = UpsampleFilterType::New(); + auto coeffUpsampleFunction = CoefficientUpsampleFunctionType::New(); upsampler->SetInterpolator(coeffUpsampleFunction); upsampler->SetSize(requiredLatticeSize); @@ -310,7 +310,7 @@ TimeVaryingBSplineVelocityFieldTransformParametersAdaptor::AdaptTran upsampler->SetOutputDirection(requiredLatticeDirection); upsampler->SetInput(selector->GetOutput()); - typename DecompositionFilterType::Pointer decompositionFilter = DecompositionFilterType::New(); + auto decompositionFilter = DecompositionFilterType::New(); decompositionFilter->SetSplineOrder(this->m_Transform->GetSplineOrder()); decompositionFilter->SetInput(upsampler->GetOutput()); decompositionFilter->Update(); diff --git a/Modules/Registration/Common/include/itkTimeVaryingVelocityFieldTransformParametersAdaptor.hxx b/Modules/Registration/Common/include/itkTimeVaryingVelocityFieldTransformParametersAdaptor.hxx index 4a59fc5761b..e9a506fe300 100644 --- a/Modules/Registration/Common/include/itkTimeVaryingVelocityFieldTransformParametersAdaptor.hxx +++ b/Modules/Registration/Common/include/itkTimeVaryingVelocityFieldTransformParametersAdaptor.hxx @@ -195,16 +195,16 @@ TimeVaryingVelocityFieldTransformParametersAdaptor::AdaptTransformPa const DirectionType newFieldDirection = this->GetRequiredDirection(); using IdentityTransformType = IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); using LinearInterpolatorType = LinearInterpolateImageFunction; - typename LinearInterpolatorType::Pointer interpolator = LinearInterpolatorType::New(); + auto interpolator = LinearInterpolatorType::New(); interpolator->SetInputImage(this->m_Transform->GetVelocityField()); using ResamplerType = ResampleImageFilter; - typename ResamplerType::Pointer resampler = ResamplerType::New(); + auto resampler = ResamplerType::New(); resampler->SetInput(this->m_Transform->GetVelocityField()); resampler->SetOutputDirection(newFieldDirection); resampler->SetOutputOrigin(newFieldOrigin); diff --git a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index b4883bb6e1d..5d8eda3605d 100644 --- a/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -46,7 +46,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) direction.SetIdentity(); using DisplacementFieldType = TransformType::DisplacementFieldType; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetOrigin(origin); displacementField->SetSpacing(spacing); displacementField->SetRegions(size); @@ -70,7 +70,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) */ std::cout << "Initialize transform." << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetConstantVelocityField(displacementField); transform->IntegrateVelocityField(); @@ -98,7 +98,7 @@ itkBSplineExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) } using AdaptorType = itk::BSplineExponentialDiffeomorphicTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredSize(requiredSize); adaptor->SetRequiredSpacing(requiredSpacing); diff --git a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index 763ca6da2e1..cbdd22dec9e 100644 --- a/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -46,7 +46,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, direction.SetIdentity(); using DisplacementFieldType = TransformType::DisplacementFieldType; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetOrigin(origin); displacementField->SetSpacing(spacing); displacementField->SetRegions(size); @@ -70,7 +70,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, */ std::cout << "Initialize transform." << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); TransformType::InputPointType point; @@ -97,7 +97,7 @@ itkBSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, } using AdaptorType = itk::BSplineSmoothingOnUpdateDisplacementFieldTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredSize(requiredSize); adaptor->SetRequiredSpacing(requiredSpacing); diff --git a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx index 48afb5b01f3..552b7aa4f23 100644 --- a/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkBSplineTransformParametersAdaptorTest.cxx @@ -50,7 +50,7 @@ itkBSplineTransformParametersAdaptorTest(int, char *[]) /** * Instantiate a transform */ - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetTransformDomainOrigin(origin); transform->SetTransformDomainPhysicalDimensions(dimensions); transform->SetTransformDomainMeshSize(meshSize); @@ -95,7 +95,7 @@ itkBSplineTransformParametersAdaptorTest(int, char *[]) TransformType::SizeType gridSizeBefore = transform->GetCoefficientImages()[0]->GetLargestPossibleRegion().GetSize(); using AdaptorType = itk::BSplineTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredTransformDomainMeshSize(requiredMeshSize); adaptor->SetRequiredTransformDomainOrigin(transform->GetTransformDomainOrigin()); diff --git a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx index 5b24f6c45e6..91e5bda1a05 100644 --- a/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkBlockMatchingImageFilterTest.cxx @@ -65,7 +65,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; // Set up the reader - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); try { @@ -80,7 +80,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) // Reduce region of interest by SEARCH_RADIUS using RegionOfInterestFilterType = itk::RegionOfInterestImageFilter; - RegionOfInterestFilterType::Pointer regionOfInterestFilter = RegionOfInterestFilterType::New(); + auto regionOfInterestFilter = RegionOfInterestFilterType::New(); regionOfInterestFilter->SetInput(reader->GetOutput()); @@ -101,7 +101,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) using PointSetType = FeatureSelectionFilterType::FeaturePointsType; // Feature Selection - FeatureSelectionFilterType::Pointer featureSelectionFilter = FeatureSelectionFilterType::New(); + auto featureSelectionFilter = FeatureSelectionFilterType::New(); featureSelectionFilter->SetInput(regionOfInterestFilter->GetOutput()); featureSelectionFilter->SetSelectFraction(selectFraction); @@ -110,7 +110,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) // Create transformed image from input to match with using TranslationTransformType = itk::TranslationTransform; - TranslationTransformType::Pointer transform = TranslationTransformType::New(); + auto transform = TranslationTransformType::New(); TranslationTransformType::OutputVectorType translation; // move each pixel in input image 5 pixels along first(0) dimension translation[0] = 20.0; @@ -119,14 +119,14 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) transform->Translate(translation); using ResampleImageFilterType = itk::ResampleImageFilter; - ResampleImageFilterType::Pointer resampleFilter = ResampleImageFilterType::New(); + auto resampleFilter = ResampleImageFilterType::New(); resampleFilter->SetTransform(transform); resampleFilter->SetInput(reader->GetOutput()); resampleFilter->SetReferenceImage(reader->GetOutput()); resampleFilter->UseReferenceImageOn(); using BlockMatchingFilterType = itk::BlockMatchingImageFilter; - BlockMatchingFilterType::Pointer blockMatchingFilter = BlockMatchingFilterType::New(); + auto blockMatchingFilter = BlockMatchingFilterType::New(); // inputs (all required) blockMatchingFilter->SetFixedImage(resampleFilter->GetOutput()); @@ -164,7 +164,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) // create RGB copy of input image using RGBFilterType = itk::ScalarToRGBColormapImageFilter; - RGBFilterType::Pointer colormapImageFilter = RGBFilterType::New(); + auto colormapImageFilter = RGBFilterType::New(); colormapImageFilter->SetColormap(itk::ScalarToRGBColormapImageFilterEnums::RGBColormapFilter::Grey); colormapImageFilter->SetInput(reader->GetOutput()); @@ -231,7 +231,7 @@ itkBlockMatchingImageFilterTest(int argc, char * argv[]) // Set up the writer using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(outputImage); diff --git a/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx index 27feaddae8b..b57ec94eb34 100644 --- a/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkCenteredTransformInitializerTest.cxx @@ -70,11 +70,11 @@ RunTest(itk::SmartPointer fixedImage, itk::SmartPointer; - typename InitializerType::Pointer initializer = InitializerType::New(); + auto initializer = InitializerType::New(); initializer->SetFixedImage(fixedImage); initializer->SetMovingImage(movingImage); @@ -275,8 +275,8 @@ itkCenteredTransformInitializerTest(int, char *[]) region.SetIndex(index); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); @@ -357,8 +357,8 @@ itkCenteredTransformInitializerTest(int, char *[]) DirectionType movingDirection = (z * y * x).GetMatrix(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); fixedImage->SetRegions(fixedRegion); fixedImage->SetSpacing(spacing); diff --git a/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx index 8505deef612..b2392145984 100644 --- a/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkCenteredVersorTransformInitializerTest.cxx @@ -82,8 +82,8 @@ itkCenteredVersorTransformInitializerTest(int, char *[]) region.SetIndex(index); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); @@ -147,13 +147,13 @@ itkCenteredVersorTransformInitializerTest(int, char *[]) ++mi; } - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetIdentity(); using InitializerType = itk::CenteredVersorTransformInitializer; - InitializerType::Pointer initializer = InitializerType::New(); + auto initializer = InitializerType::New(); initializer->SetFixedImage(fixedImage); initializer->SetMovingImage(movingImage); diff --git a/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx index baabe5d724a..353fa9c91d7 100644 --- a/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkCompareHistogramImageToImageMetricTest.cxx @@ -52,8 +52,8 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -79,7 +79,7 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) using ScalesType = MetricType::ScalesType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( metric, KullbackLeiblerCompareHistogramImageToImageMetric, CompareHistogramImageToImageMetric); @@ -105,13 +105,13 @@ itkCompareHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx index 5a55c8ae117..d604716ac62 100644 --- a/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkCorrelationCoefficientHistogramImageToImageMetricTest.cxx @@ -52,8 +52,8 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -79,7 +79,7 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) using ScalesType = MetricType::ScalesType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); unsigned int nBins = 256; MetricType::HistogramType::SizeType histSize; @@ -95,13 +95,13 @@ itkCorrelationCoefficientHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx index acf565840e3..23166e42da9 100644 --- a/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkDisplacementFieldTransformParametersAdaptorTest.cxx @@ -46,7 +46,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) direction.SetIdentity(); using DisplacementFieldType = TransformType::DisplacementFieldType; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetOrigin(origin); displacementField->SetSpacing(spacing); displacementField->SetRegions(size); @@ -69,7 +69,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) */ std::cout << "Initialize transform." << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); TransformType::InputPointType point; @@ -96,7 +96,7 @@ itkDisplacementFieldTransformParametersAdaptorTest(int, char *[]) } using AdaptorType = itk::DisplacementFieldTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredSize(requiredSize); adaptor->SetRequiredSpacing(requiredSpacing); diff --git a/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx b/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx index 3e358b23a3a..3cc8eda9850 100644 --- a/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx +++ b/Modules/Registration/Common/test/itkEuclideanDistancePointMetricTest.cxx @@ -41,15 +41,15 @@ CompareMeshSources(bool computeSquaredDistance) using IdentityType = itk::IdentityTransform; - typename FixedSourceType::Pointer fixed = FixedSourceType::New(); + auto fixed = FixedSourceType::New(); fixed->Update(); - typename MovingSourceType::Pointer moving = MovingSourceType::New(); + auto moving = MovingSourceType::New(); moving->Update(); - typename IdentityType::Pointer identity = IdentityType::New(); + auto identity = IdentityType::New(); - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetComputeSquaredDistance(computeSquaredDistance); ITK_TEST_SET_GET_VALUE(computeSquaredDistance, metric->GetComputeSquaredDistance()); @@ -92,7 +92,7 @@ itkEuclideanDistancePointMetricTest(int argc, char * argv[]) using MetricType = itk::EuclideanDistancePointMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, EuclideanDistancePointMetric, PointSetToPointSetMetric); diff --git a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx index 7a7db060f97..ffb5517eea5 100644 --- a/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest.cxx @@ -47,7 +47,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) direction.SetIdentity(); using DisplacementFieldType = TransformType::DisplacementFieldType; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetOrigin(origin); displacementField->SetSpacing(spacing); displacementField->SetRegions(size); @@ -71,7 +71,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) */ std::cout << "Initialize transform." << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetConstantVelocityField(displacementField); transform->IntegrateVelocityField(); @@ -99,7 +99,7 @@ itkGaussianExponentialDiffeomorphicTransformParametersAdaptorTest(int, char *[]) } using AdaptorType = itk::GaussianExponentialDiffeomorphicTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredSize(requiredSize); adaptor->SetRequiredSpacing(requiredSpacing); diff --git a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx index 5ef52dda2c2..bda4c29de7e 100644 --- a/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx +++ b/Modules/Registration/Common/test/itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest.cxx @@ -47,7 +47,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, direction.SetIdentity(); using DisplacementFieldType = TransformType::DisplacementFieldType; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->SetOrigin(origin); displacementField->SetSpacing(spacing); displacementField->SetRegions(size); @@ -71,7 +71,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, */ std::cout << "Initialize transform." << std::endl; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetDisplacementField(displacementField); TransformType::InputPointType point; @@ -98,7 +98,7 @@ itkGaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptorTest(int, } using AdaptorType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransformParametersAdaptor; - AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); adaptor->SetTransform(transform); adaptor->SetRequiredSize(requiredSize); adaptor->SetRequiredSpacing(requiredSpacing); diff --git a/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx index 1ddf246dc0b..f0dd75c9ee3 100644 --- a/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkGradientDifferenceImageToImageMetricTest.cxx @@ -47,8 +47,8 @@ itkGradientDifferenceImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -75,7 +75,7 @@ itkGradientDifferenceImageToImageMetricTest(int, char *[]) using DerivativeType = MetricType::DerivativeType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Plug the images into the metric. metric->SetFixedImage(fixedImage); @@ -84,13 +84,13 @@ itkGradientDifferenceImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx index 0aaf7907a31..1c6f12f60a1 100644 --- a/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkHistogramImageToImageMetricTest.cxx @@ -48,8 +48,8 @@ itkHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -76,7 +76,7 @@ itkHistogramImageToImageMetricTest(int, char *[]) using DerivativeType = MetricType::DerivativeType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); unsigned int nBins = 256; MetricType::HistogramType::SizeType histSize; @@ -92,13 +92,13 @@ itkHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx index ee1cf3ecaa4..375b027129a 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest.cxx @@ -62,13 +62,13 @@ itkImageRegistrationMethodTest(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); FixedImageType::SizeType size; size.Fill(4); // the size of image have to be at least 4 in each dimension to diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx index a828cf3cb81..a34a158ed0a 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_1.cxx @@ -69,13 +69,13 @@ itkImageRegistrationMethodTest_1(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -102,7 +102,7 @@ itkImageRegistrationMethodTest_1(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx index 7c3118a8263..76451d09014 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_10.cxx @@ -69,13 +69,13 @@ itkImageRegistrationMethodTest_10(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -102,7 +102,7 @@ itkImageRegistrationMethodTest_10(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx index f9ddab2fd36..61a58221d22 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_11.cxx @@ -57,13 +57,13 @@ itkImageRegistrationMethodTest_11(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); registration->SetMetric(metric); @@ -87,12 +87,12 @@ itkImageRegistrationMethodTest_11(int, char *[]) // // Now verify that they can be changed // - MetricType::Pointer metric2 = MetricType::New(); - TransformType::Pointer transform2 = TransformType::New(); - OptimizerType::Pointer optimizer2 = OptimizerType::New(); - FixedImageType::Pointer fixedImage2 = FixedImageType::New(); - MovingImageType::Pointer movingImage2 = MovingImageType::New(); - InterpolatorType::Pointer interpolator2 = InterpolatorType::New(); + auto metric2 = MetricType::New(); + auto transform2 = TransformType::New(); + auto optimizer2 = OptimizerType::New(); + auto fixedImage2 = FixedImageType::New(); + auto movingImage2 = MovingImageType::New(); + auto interpolator2 = InterpolatorType::New(); registration->SetMetric(metric2); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx index 1690e480912..a766fdd37b4 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_12.cxx @@ -70,13 +70,13 @@ itkImageRegistrationMethodTest_12(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -103,7 +103,7 @@ itkImageRegistrationMethodTest_12(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx index cc1871fd975..d496dcaf937 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_13.cxx @@ -125,13 +125,13 @@ itkImageRegistrationMethodTest_13(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); /********************************************************* * Set up the two input images. diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx index c3b51857f66..93460d6099f 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_14.cxx @@ -132,13 +132,13 @@ itkImageRegistrationMethodTest_14(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); /********************************************************* * Set up the two input images. @@ -235,7 +235,7 @@ itkImageRegistrationMethodTest_14(int, char *[]) * Set up the optimizer observer ******************************************************************/ using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx index 8a8b0f05beb..64b61514a0d 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_15.cxx @@ -108,13 +108,13 @@ itkImageRegistrationMethodTest_15(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); /********************************************************* * Set up the two input images. @@ -210,7 +210,7 @@ itkImageRegistrationMethodTest_15(int, char *[]) * Set up the optimizer observer ******************************************************************/ using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx index 41eb00578f0..d314c395f57 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_16.cxx @@ -77,13 +77,13 @@ DoRegistration() using CommandIterationType = itk::CommandIterationUpdate; - typename MetricType::Pointer metric = MetricType::New(); - typename TransformType::Pointer transform = TransformType::New(); - typename OptimizerType::Pointer optimizer = OptimizerType::New(); - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - typename RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - typename ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -110,7 +110,7 @@ DoRegistration() metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx index c19ce510543..a5e48c58525 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_17.cxx @@ -114,13 +114,13 @@ itkImageRegistrationMethodTest_17(int, char *[]) using RegistrationType = itk::ImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); /********************************************************* * Set up the two input images. @@ -216,7 +216,7 @@ itkImageRegistrationMethodTest_17(int, char *[]) * Set up the optimizer observer ******************************************************************/ using CommandIterationType = itk::CommandIterationUpdate; - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx index c136271f0f6..fb8c4622383 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_2.cxx @@ -69,13 +69,13 @@ itkImageRegistrationMethodTest_2(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -102,7 +102,7 @@ itkImageRegistrationMethodTest_2(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx index f493690a520..72055aa7402 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_3.cxx @@ -70,13 +70,13 @@ itkImageRegistrationMethodTest_3(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -103,7 +103,7 @@ itkImageRegistrationMethodTest_3(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx index 5d6c175e4c6..e071ec36bd0 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_4.cxx @@ -70,13 +70,13 @@ itkImageRegistrationMethodTest_4(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -103,7 +103,7 @@ itkImageRegistrationMethodTest_4(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx index f1221e48f1e..e51026fa692 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_5.cxx @@ -69,13 +69,13 @@ itkImageRegistrationMethodTest_5_Func(int argc, char * argv[], bool subtractMean using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -105,7 +105,7 @@ itkImageRegistrationMethodTest_5_Func(int argc, char * argv[], bool subtractMean metric->SetSubtractMean(subtractMean); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx index 3719cb20e80..05edb1e26c9 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_6.cxx @@ -69,13 +69,13 @@ itkImageRegistrationMethodTest_6(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -102,7 +102,7 @@ itkImageRegistrationMethodTest_6(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx index 5c15fd9b412..2b833324067 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_7.cxx @@ -70,13 +70,13 @@ itkImageRegistrationMethodTest_7(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -103,7 +103,7 @@ itkImageRegistrationMethodTest_7(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx index cbf00a12c07..c6cb6a72965 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_8.cxx @@ -70,13 +70,13 @@ itkImageRegistrationMethodTest_8(int argc, char * argv[]) using CommandIterationType = itk::CommandIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -103,7 +103,7 @@ itkImageRegistrationMethodTest_8(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx index 0bbe15d38a7..a01b1881222 100644 --- a/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx +++ b/Modules/Registration/Common/test/itkImageRegistrationMethodTest_9.cxx @@ -71,13 +71,13 @@ itkImageRegistrationMethodTest_9(int argc, char * argv[]) using CommandIterationType = itk::CommandVnlIterationUpdate; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto registration = RegistrationType::New(); - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); SizeType size; size[0] = 100; @@ -104,7 +104,7 @@ itkImageRegistrationMethodTest_9(int argc, char * argv[]) metric->SetFixedImageRegion(fixedImage->GetBufferedRegion()); // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx b/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx index 357fdac85e6..6f9a516c84c 100644 --- a/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkImageToSpatialObjectRegistrationTest.cxx @@ -213,9 +213,9 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) using EllipseType = itk::EllipseSpatialObject<2>; // Create a group with 3 ellipses linked by lines. - EllipseType::Pointer ellipse1 = EllipseType::New(); - EllipseType::Pointer ellipse2 = EllipseType::New(); - EllipseType::Pointer ellipse3 = EllipseType::New(); + auto ellipse1 = EllipseType::New(); + auto ellipse2 = EllipseType::New(); + auto ellipse3 = EllipseType::New(); // Set the radius ellipse1->SetRadiusInObjectSpace(10); @@ -241,7 +241,7 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) ellipse3->GetModifiableObjectToParentTransform()->SetOffset(offset); ellipse3->Update(); - GroupType::Pointer group = GroupType::New(); + auto group = GroupType::New(); group->AddChild(ellipse1); group->AddChild(ellipse2); group->AddChild(ellipse3); @@ -250,7 +250,7 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) using ImageType = itk::Image; using SpatialObjectToImageFilterType = itk::SpatialObjectToImageFilter; - SpatialObjectToImageFilterType::Pointer imageFilter = SpatialObjectToImageFilterType::New(); + auto imageFilter = SpatialObjectToImageFilterType::New(); imageFilter->SetInput(group); ImageType::SizeType size; size[0] = 200; @@ -262,7 +262,7 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) // blurr the image to have a global maximum using GaussianFilterType = itk::DiscreteGaussianImageFilter; - GaussianFilterType::Pointer gaussianFilter = GaussianFilterType::New(); + auto gaussianFilter = GaussianFilterType::New(); gaussianFilter->SetInput(image); constexpr double variance = 20; @@ -271,23 +271,23 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) image = gaussianFilter->GetOutput(); using RegistrationType = itk::ImageToSpatialObjectRegistrationMethod; - RegistrationType::Pointer registration = RegistrationType::New(); + auto registration = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registration, ImageToSpatialObjectRegistrationMethod, ProcessObject); using MetricType = itk::SimpleImageToSpatialObjectMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << "metric = " << metric << std::endl; using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); using OptimizerType = itk::OnePlusOneEvolutionaryOptimizer; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); using TransformType = itk::Euler2DTransform<>; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); std::cout << "Number of Parameters : " << metric->GetNumberOfParameters() << std::endl; @@ -398,7 +398,7 @@ itkImageToSpatialObjectRegistrationTest(int, char *[]) optimizer->SetMaximumIteration(500); using IterationCallbackType = itk::IterationCallback; - IterationCallbackType::Pointer callback = IterationCallbackType::New(); + auto callback = IterationCallbackType::New(); callback->SetOptimizer(optimizer); registration->SetOptimizer(optimizer); diff --git a/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx index 4ebbd017a5e..58154153b1c 100644 --- a/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkKappaStatisticImageToImageMetricTest.cxx @@ -58,14 +58,14 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) double epsilon = 0.000001; - TransformType::Pointer transform = TransformType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); FixedImageType::SizeType fixedImageSize; fixedImageSize.Fill(128); // Create fixed image - FixedImageType::Pointer fixedImage = FixedImageType::New(); + auto fixedImage = FixedImageType::New(); fixedImage->SetRegions(fixedImageSize); fixedImage->Allocate(true); // initialize buffer to zero fixedImage->Update(); @@ -84,7 +84,7 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) movingImageSize.Fill(128); // Create moving image - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto movingImage = MovingImageType::New(); movingImage->SetRegions(movingImageSize); movingImage->Allocate(true); // initialize buffer to zero movingImage->Update(); @@ -99,7 +99,7 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) } } - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(metric, KappaStatisticImageToImageMetric, ImageToImageMetric); @@ -160,12 +160,12 @@ itkKappaStatisticImageToImageMetricTest(int, char *[]) // metric->ComputeGradient(); - GradientImageType::Pointer xGradImage = GradientImageType::New(); + auto xGradImage = GradientImageType::New(); xGradImage->SetRegions(movingImageSize); xGradImage->Allocate(true); // initialize buffer to zero xGradImage->Update(); - GradientImageType::Pointer yGradImage = GradientImageType::New(); + auto yGradImage = GradientImageType::New(); yGradImage->SetRegions(movingImageSize); yGradImage->Allocate(true); // initialize buffer to zero yGradImage->Update(); diff --git a/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx index 8fcf9c238dc..fce3eef72c8 100644 --- a/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkKullbackLeiblerCompareHistogramImageToImageMetricTest.cxx @@ -58,25 +58,25 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - MovingImageType::Pointer imgMoving = MovingImageType::New(); + auto imgMoving = MovingImageType::New(); imgMoving->SetLargestPossibleRegion(region); imgMoving->SetBufferedRegion(region); imgMoving->SetRequestedRegion(region); imgMoving->Allocate(); - FixedImageType::Pointer imgFixed = FixedImageType::New(); + auto imgFixed = FixedImageType::New(); imgFixed->SetLargestPossibleRegion(region); imgFixed->SetBufferedRegion(region); imgFixed->SetRequestedRegion(region); imgFixed->Allocate(); - MovingImageType::Pointer imgTrainingMoving = MovingImageType::New(); + auto imgTrainingMoving = MovingImageType::New(); imgTrainingMoving->SetLargestPossibleRegion(region); imgTrainingMoving->SetBufferedRegion(region); imgTrainingMoving->SetRequestedRegion(region); imgTrainingMoving->Allocate(); - FixedImageType::Pointer imgTrainingFixed = FixedImageType::New(); + auto imgTrainingFixed = FixedImageType::New(); imgTrainingFixed->SetLargestPossibleRegion(region); imgTrainingFixed->SetBufferedRegion(region); imgTrainingFixed->SetRequestedRegion(region); @@ -167,8 +167,8 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) using TransformType = itk::AffineTransform; using ParametersType = TransformType::ParametersType; - TransformType::Pointer transformer = TransformType::New(); - TransformType::Pointer TrainingTransform = TransformType::New(); + auto transformer = TransformType::New(); + auto TrainingTransform = TransformType::New(); transformer->SetIdentity(); TrainingTransform->SetIdentity(); @@ -177,15 +177,15 @@ itkKullbackLeiblerCompareHistogramImageToImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - InterpolatorType::Pointer TrainingInterpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); + auto TrainingInterpolator = InterpolatorType::New(); //------------------------------------------------------------ // Set up the metric //------------------------------------------------------------ using MetricType = itk::KullbackLeiblerCompareHistogramImageToImageMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // connect the interpolator metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx b/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx index 4b6d0be2091..633bf69d51c 100644 --- a/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx +++ b/Modules/Registration/Common/test/itkLandmarkBasedTransformInitializerTest.cxx @@ -28,7 +28,7 @@ typename itk::Image::Pointer CreateTestImage() { using FixedImageType = itk::Image; - typename FixedImageType::Pointer image = FixedImageType::New(); + auto image = FixedImageType::New(); typename FixedImageType::RegionType fRegion; typename FixedImageType::SizeType fSize; @@ -182,7 +182,7 @@ template bool test1() { - typename TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); std::cout << "Testing Landmark alignment with " << transform->GetNameOfClass() << std::endl; using PixelType = unsigned char; @@ -192,7 +192,7 @@ test1() using TransformInitializerType = itk::LandmarkBasedTransformInitializer; - typename TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); typename TransformInitializerType::LandmarkPointContainer fixedLandmarks; typename TransformInitializerType::LandmarkPointContainer movingLandmarks; @@ -234,7 +234,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) using TransformType = itk::Rigid2DTransform; using TransformInitializerType = itk::LandmarkBasedTransformInitializer; - TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(initializer, LandmarkBasedTransformInitializer, Object); @@ -315,9 +315,9 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) ImageType::Pointer movingImage = CreateTestImage(); using TransformType = itk::AffineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); using TransformInitializerType = itk::LandmarkBasedTransformInitializer; - TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(initializer, LandmarkBasedTransformInitializer, Object); @@ -427,11 +427,11 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) // Set the transform type constexpr unsigned int SplineOrder = 3; using TransformType = itk::BSplineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); using TransformInitializerType = itk::LandmarkBasedTransformInitializer; - TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(initializer, LandmarkBasedTransformInitializer, Object); @@ -468,7 +468,7 @@ itkLandmarkBasedTransformInitializerTest(int, char *[]) using TransformInitializerType = itk::LandmarkBasedTransformInitializer; - TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(initializer, LandmarkBasedTransformInitializer, Object); } diff --git a/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx index e7950084f6b..f0a05df0ab4 100644 --- a/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMatchCardinalityImageToImageMetricTest.cxx @@ -42,10 +42,10 @@ itkMatchCardinalityImageToImageMetricTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - ReaderType::Pointer reader = ReaderType::New(); - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto reader = ReaderType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto interpolator = InterpolatorType::New(); MetricType::ParametersType offset(2); diff --git a/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx index 303f7bd05d5..f3b9f381fee 100644 --- a/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMattesMutualInformationImageToImageMetricTest.cxx @@ -72,7 +72,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, imgOrigin[0] = 0.0; imgOrigin[1] = 0.0; - typename MovingImageType::Pointer imgMoving = MovingImageType::New(); + auto imgMoving = MovingImageType::New(); imgMoving->SetLargestPossibleRegion(region); imgMoving->SetBufferedRegion(region); imgMoving->SetRequestedRegion(region); @@ -80,7 +80,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, imgMoving->SetSpacing(imgSpacing); imgMoving->SetOrigin(imgOrigin); - typename FixedImageType::Pointer imgFixed = FixedImageType::New(); + auto imgFixed = FixedImageType::New(); imgFixed->SetLargestPossibleRegion(region); imgFixed->SetBufferedRegion(region); imgFixed->SetRequestedRegion(region); @@ -134,13 +134,13 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, } // Setup a fixed image mask for the image - typename MovingImageType::Pointer imgMovingMask = MovingImageType::New(); + auto imgMovingMask = MovingImageType::New(); imgMovingMask->CopyInformation(imgMoving); imgMovingMask->SetRegions(region); imgMovingMask->Allocate(true); // initialize // buffer to zero - typename FixedImageType::Pointer imgFixedMask = FixedImageType::New(); + auto imgFixedMask = FixedImageType::New(); imgFixedMask->CopyInformation(imgFixed); imgFixedMask->SetRegions(region); imgFixedMask->Allocate(true); // initialize @@ -184,14 +184,14 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, using TransformType = itk::AffineTransform; using ParametersType = typename TransformType::ParametersType; - typename TransformType::Pointer transformer = TransformType::New(); + auto transformer = TransformType::New(); //------------------------------------------------------------ // Set up the metric //------------------------------------------------------------ using MetricType = itk::MattesMutualInformationImageToImageMetric; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Sanity check before metric is run, these should be nullptr; if (metric->GetJointPDFDerivatives().IsNotNull()) @@ -259,11 +259,11 @@ TestMattesMetricWithAffineTransform(TInterpolator * interpolator, // convert mask image to mask using ImageMaskSpatialObjectType = itk::ImageMaskSpatialObject; - typename ImageMaskSpatialObjectType::Pointer soMovingMask = ImageMaskSpatialObjectType::New(); + auto soMovingMask = ImageMaskSpatialObjectType::New(); soMovingMask->SetImage(imgMovingMask); soMovingMask->Update(); - typename ImageMaskSpatialObjectType::Pointer soFixedMask = ImageMaskSpatialObjectType::New(); + auto soFixedMask = ImageMaskSpatialObjectType::New(); soFixedMask->SetImage(imgFixedMask); soFixedMask->Update(); @@ -473,7 +473,7 @@ TestMattesMetricWithBSplineTransform(TInterpolator * interpolator, imgOrigin[0] = 0.0; imgOrigin[1] = 0.0; - typename MovingImageType::Pointer imgMoving = MovingImageType::New(); + auto imgMoving = MovingImageType::New(); imgMoving->SetLargestPossibleRegion(region); imgMoving->SetBufferedRegion(region); imgMoving->SetRequestedRegion(region); @@ -481,7 +481,7 @@ TestMattesMetricWithBSplineTransform(TInterpolator * interpolator, imgMoving->SetSpacing(imgSpacing); imgMoving->SetOrigin(imgOrigin); - typename FixedImageType::Pointer imgFixed = FixedImageType::New(); + auto imgFixed = FixedImageType::New(); imgFixed->SetLargestPossibleRegion(region); imgFixed->SetBufferedRegion(region); imgFixed->SetRequestedRegion(region); @@ -547,7 +547,7 @@ TestMattesMetricWithBSplineTransform(TInterpolator * interpolator, typename TransformType::MeshSizeType meshSize; meshSize.Fill(4); - typename TransformType::Pointer transformer = TransformType::New(); + auto transformer = TransformType::New(); transformer->SetTransformDomainPhysicalDimensions(dimensions); transformer->SetTransformDomainOrigin(imgFixed->GetOrigin()); @@ -561,7 +561,7 @@ TestMattesMetricWithBSplineTransform(TInterpolator * interpolator, //------------------------------------------------------------ using MetricType = itk::MattesMutualInformationImageToImageMetric; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // connect the interpolator metric->SetInterpolator(interpolator); @@ -724,7 +724,7 @@ itkMattesMutualInformationImageToImageMetricTest(int argc, char * argv[]) // Test metric with a linear interpolator using LinearInterpolatorType = itk::LinearInterpolateImageFunction; - LinearInterpolatorType::Pointer linearInterpolator = LinearInterpolatorType::New(); + auto linearInterpolator = LinearInterpolatorType::New(); failed = TestMattesMetricWithAffineTransform( linearInterpolator, useSampling, useExplicitJointPDFDerivatives, useCachingBSplineWeights); @@ -748,7 +748,7 @@ itkMattesMutualInformationImageToImageMetricTest(int argc, char * argv[]) // Test metric with a BSpline interpolator using BSplineInterpolatorType = itk::BSplineInterpolateImageFunction; - BSplineInterpolatorType::Pointer bSplineInterpolator = BSplineInterpolatorType::New(); + auto bSplineInterpolator = BSplineInterpolatorType::New(); bSplineInterpolator->SetSplineOrder(3); diff --git a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx index c2c67d3f866..fe94b191f57 100644 --- a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferenceImageMetricTest.cxx @@ -69,8 +69,8 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -99,7 +99,7 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->Print(std::cout); //----------------------------------------------------------- @@ -114,7 +114,7 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -124,7 +124,7 @@ itkMeanReciprocalSquareDifferenceImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx index 8167e8b6e2a..84e2a4bdbcd 100644 --- a/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanReciprocalSquareDifferencePointSetToImageMetricTest.cxx @@ -70,8 +70,8 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -96,7 +96,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) // the fixed image //----------------------------------------------------------- using FixedPointSetType = itk::PointSet; - FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); constexpr unsigned int numberOfPoints = 100; @@ -151,7 +151,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); //----------------------------------------------------------- @@ -166,7 +166,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -176,7 +176,7 @@ itkMeanReciprocalSquareDifferencePointSetToImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx index 39b4f773ae0..33420213999 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresHistogramImageToImageMetricTest.cxx @@ -53,8 +53,8 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -80,7 +80,7 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) using ScalesType = MetricType::ScalesType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); unsigned int nBins = 256; MetricType::HistogramType::SizeType histSize; @@ -96,13 +96,13 @@ itkMeanSquaresHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx index 973d317e15c..15d995b9aa0 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresImageMetricTest.cxx @@ -69,8 +69,8 @@ itkMeanSquaresImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -99,7 +99,7 @@ itkMeanSquaresImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); //----------------------------------------------------------- @@ -114,7 +114,7 @@ itkMeanSquaresImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -124,7 +124,7 @@ itkMeanSquaresImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx index b0ca348774d..6989b5bb259 100644 --- a/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMeanSquaresPointSetToImageMetricTest.cxx @@ -70,8 +70,8 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -96,7 +96,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) // the fixed image //----------------------------------------------------------- using FixedPointSetType = itk::PointSet; - FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); constexpr unsigned int numberOfPoints = 100; @@ -151,7 +151,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); //----------------------------------------------------------- @@ -166,7 +166,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -176,7 +176,7 @@ itkMeanSquaresPointSetToImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx index 89ca2dcdce2..76263db513c 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest.cxx @@ -71,15 +71,15 @@ itkMultiResolutionImageRegistrationMethodTest(int, char *[]) using RegistrationType = itk::MultiResolutionImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - FixedImagePyramidType::Pointer fixedImagePyramid = FixedImagePyramidType::New(); - MovingImagePyramidType::Pointer movingImagePyramid = MovingImagePyramidType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto fixedImagePyramid = FixedImagePyramidType::New(); + auto movingImagePyramid = MovingImagePyramidType::New(); + auto registration = RegistrationType::New(); FixedImageType::SizeType size; size.Fill(8); diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx index c00cd075ea3..97a983b0a3c 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_1.cxx @@ -113,8 +113,8 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) * Set up the two input images. * One image scaled and shifted with respect to the other. **********************************************************/ - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); double displacement[dimension] = { 7, 3, 2 }; double scale[dimension] = { 0.80, 1.0, 1.0 }; @@ -190,13 +190,13 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) * the number of computation levels */ { - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - FixedImagePyramidType::Pointer fixedImagePyramid = FixedImagePyramidType::New(); - MovingImagePyramidType::Pointer movingImagePyramid = MovingImagePyramidType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto fixedImagePyramid = FixedImagePyramidType::New(); + auto movingImagePyramid = MovingImagePyramidType::New(); + auto registration = RegistrationType::New(); /****************************************************************** * Set up the optimizer. @@ -414,13 +414,13 @@ itkMultiResolutionImageRegistrationMethodTest_1(int, char *[]) { - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - FixedImagePyramidType::Pointer fixedImagePyramid = FixedImagePyramidType::New(); - MovingImagePyramidType::Pointer movingImagePyramid = MovingImagePyramidType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto interpolator = InterpolatorType::New(); + auto fixedImagePyramid = FixedImagePyramidType::New(); + auto movingImagePyramid = MovingImagePyramidType::New(); + auto registration = RegistrationType::New(); /****************************************************************** * Set up the optimizer. diff --git a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx index 87e37303e68..200c0e47fe6 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionImageRegistrationMethodTest_2.cxx @@ -102,15 +102,15 @@ itkMultiResolutionImageRegistrationMethodTest_2(int, char *[]) using RegistrationType = itk::MultiResolutionImageRegistrationMethod; - MetricType::Pointer metric = MetricType::New(); - TransformType::Pointer transform = TransformType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); - FixedImageType::Pointer fixedImage = FixedImageType::New(); - MovingImageType::Pointer movingImage = MovingImageType::New(); - InterpolatorType::Pointer interpolator = InterpolatorType::New(); - FixedImagePyramidType::Pointer fixedImagePyramid = FixedImagePyramidType::New(); - MovingImagePyramidType::Pointer movingImagePyramid = MovingImagePyramidType::New(); - RegistrationType::Pointer registration = RegistrationType::New(); + auto metric = MetricType::New(); + auto transform = TransformType::New(); + auto optimizer = OptimizerType::New(); + auto fixedImage = FixedImageType::New(); + auto movingImage = MovingImageType::New(); + auto interpolator = InterpolatorType::New(); + auto fixedImagePyramid = FixedImagePyramidType::New(); + auto movingImagePyramid = MovingImagePyramidType::New(); + auto registration = RegistrationType::New(); /********************************************************* * Set up the two input images. diff --git a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx index de7092dafa3..ea01990f6e3 100644 --- a/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkMultiResolutionPyramidImageFilterTest.cxx @@ -74,7 +74,7 @@ GetCenterOfMass(const ImageType * volume) typename ImageType::PointType CenterOfMass; { using momentsCalculatorType = itk::ImageMomentsCalculator; - typename momentsCalculatorType::Pointer moments = momentsCalculatorType::New(); + auto moments = momentsCalculatorType::New(); moments->SetImage(volume); moments->Compute(); typename ImageType::PointType::VectorType tempCenterOfMass = moments->GetCenterOfGravity(); @@ -150,7 +150,7 @@ itkMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) direction[1][2] = 1; direction[2][0] = 1; - InputImageType::Pointer imgTarget = InputImageType::New(); + auto imgTarget = InputImageType::New(); imgTarget->SetLargestPossibleRegion(region); imgTarget->SetBufferedRegion(region); imgTarget->SetRequestedRegion(region); diff --git a/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx index c649030256e..c2004f8874a 100644 --- a/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMutualInformationHistogramImageToImageMetricTest.cxx @@ -52,8 +52,8 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -79,7 +79,7 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) using ScalesType = MetricType::ScalesType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); unsigned int nBins = 256; MetricType::HistogramType::SizeType histSize; @@ -95,13 +95,13 @@ itkMutualInformationHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx b/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx index 52d39b3f9a6..cff150d4dd6 100644 --- a/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx +++ b/Modules/Registration/Common/test/itkMutualInformationMetricTest.cxx @@ -54,13 +54,13 @@ itkMutualInformationMetricTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - MovingImageType::Pointer imgMoving = MovingImageType::New(); + auto imgMoving = MovingImageType::New(); imgMoving->SetLargestPossibleRegion(region); imgMoving->SetBufferedRegion(region); imgMoving->SetRequestedRegion(region); imgMoving->Allocate(); - FixedImageType::Pointer imgFixed = FixedImageType::New(); + auto imgFixed = FixedImageType::New(); imgFixed->SetLargestPossibleRegion(region); imgFixed->SetBufferedRegion(region); imgFixed->SetRequestedRegion(region); @@ -118,21 +118,21 @@ itkMutualInformationMetricTest(int, char *[]) using TransformType = itk::AffineTransform; using ParametersType = TransformType::ParametersType; - TransformType::Pointer transformer = TransformType::New(); + auto transformer = TransformType::New(); //------------------------------------------------------------ // Set up a interpolator //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); //------------------------------------------------------------ // Set up the metric //------------------------------------------------------------ using MetricType = itk::MutualInformationImageToImageMetric; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // connect the interpolator metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx index 124782af2c4..2e5ef5278f4 100644 --- a/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedCorrelationImageMetricTest.cxx @@ -69,8 +69,8 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -99,7 +99,7 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); //----------------------------------------------------------- @@ -114,7 +114,7 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -124,7 +124,7 @@ itkNormalizedCorrelationImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx index 2f59c0364cb..4056d4f2455 100644 --- a/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedCorrelationPointSetToImageMetricTest.cxx @@ -70,8 +70,8 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -96,7 +96,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) // the fixed image //----------------------------------------------------------- using FixedPointSetType = itk::PointSet; - FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); constexpr unsigned int numberOfPoints = 100; @@ -142,7 +142,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); //----------------------------------------------------------- @@ -157,7 +157,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); @@ -167,7 +167,7 @@ itkNormalizedCorrelationPointSetToImageMetricTest(int, char *[]) //------------------------------------------------------------ using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); diff --git a/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx b/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx index 1e9a28e7111..aaa2a9de301 100644 --- a/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx +++ b/Modules/Registration/Common/test/itkNormalizedMutualInformationHistogramImageToImageMetricTest.cxx @@ -53,8 +53,8 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); movingImageSource->SetSize(movingImageSize); movingImageSource->SetOrigin(movingImageOrigin); @@ -80,7 +80,7 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) using ScalesType = MetricType::ScalesType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); unsigned int nBins = 256; MetricType::HistogramType::SizeType histSize; @@ -96,13 +96,13 @@ itkNormalizedMutualInformationHistogramImageToImageMetricTest(int, char *[]) // Set up a transform. using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); metric->SetTransform(transform); // Set up an interpolator. using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); interpolator->SetInputImage(movingImage); metric->SetInterpolator(interpolator); diff --git a/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx index e35db9b14b4..92a040b573a 100644 --- a/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToImageRegistrationTest.cxx @@ -50,7 +50,7 @@ itkPointSetToImageRegistrationTest(int, char *[]) using ImageSourceType = itk::testhelper::ImageRegistrationMethodImageSource; - ImageSourceType::Pointer imageSource = ImageSourceType::New(); + auto imageSource = ImageSourceType::New(); itk::Size size; size[0] = 100; @@ -66,7 +66,7 @@ itkPointSetToImageRegistrationTest(int, char *[]) // the fixed image. // using FixedPointSetType = itk::PointSet; - FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); constexpr unsigned int numberOfPoints = 10000; @@ -111,31 +111,31 @@ itkPointSetToImageRegistrationTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Set up the Transform using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); // Set up the Interpolator using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); // Set up the Optimizer using OptimizerType = itk::RegularStepGradientDescentOptimizer; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); // Set up the Registration method using RegistrationType = itk::PointSetToImageRegistrationMethod; - RegistrationType::Pointer registration = RegistrationType::New(); + auto registration = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registration, PointSetToImageRegistrationMethod, ProcessObject); using CommandIterationType = itk::CommandIterationUpdate; // Instantiate an Observer to report the progress of the Optimization - CommandIterationType::Pointer iterationCommand = CommandIterationType::New(); + auto iterationCommand = CommandIterationType::New(); iterationCommand->SetOptimizer(optimizer); // Scale the translation components of the Transform in the Optimizer diff --git a/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx index 579ba5b9cfd..9ce9808cf87 100644 --- a/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToPointSetRegistrationTest.cxx @@ -41,7 +41,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) // Fixed Point Set using FixedPointSetType = itk::PointSet; - FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); constexpr unsigned int numberOfPoints = 500; @@ -68,7 +68,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) // Moving Point Set using MovingPointSetType = itk::PointSet; - MovingPointSetType::Pointer movingPointSet = MovingPointSetType::New(); + auto movingPointSet = MovingPointSetType::New(); movingPointSet->SetPointData(MovingPointSetType::PointDataContainer::New()); @@ -95,21 +95,21 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) using TransformBaseType = MetricType::TransformType; using ParametersType = TransformBaseType::ParametersType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Set up the Transform using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); // Set up the Optimizer using OptimizerType = itk::LevenbergMarquardtOptimizer; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetUseCostFunctionGradient(false); // Set up the Registration method using RegistrationType = itk::PointSetToPointSetRegistrationMethod; - RegistrationType::Pointer registration = RegistrationType::New(); + auto registration = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registration, PointSetToPointSetRegistrationMethod, ProcessObject); @@ -189,7 +189,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) using ImageType = itk::Image; using PSToImageFilterType = itk::PointSetToImageFilter; - PSToImageFilterType::Pointer psToImageFilter = PSToImageFilterType::New(); + auto psToImageFilter = PSToImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(psToImageFilter, PointSetToImageFilter, ImageSource); @@ -210,7 +210,7 @@ itkPointSetToPointSetRegistrationTest(int, char *[]) BinaryImageType::Pointer binaryImage = psToImageFilter->GetOutput(); using DDFilterType = itk::DanielssonDistanceMapImageFilter; - DDFilterType::Pointer ddFilter = DDFilterType::New(); + auto ddFilter = DDFilterType::New(); ddFilter->SetInput(binaryImage); diff --git a/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx b/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx index c289721e5a7..6989b15c144 100644 --- a/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx +++ b/Modules/Registration/Common/test/itkPointSetToSpatialObjectDemonsRegistrationTest.cxx @@ -30,7 +30,7 @@ itkPointSetToSpatialObjectDemonsRegistrationTest(int, char *[]) using EllipseType = itk::EllipseSpatialObject; // Create a ellipse. - EllipseType::Pointer ellipse = EllipseType::New(); + auto ellipse = EllipseType::New(); // Set the radius ellipse->SetRadiusInObjectSpace(50); @@ -47,14 +47,14 @@ itkPointSetToSpatialObjectDemonsRegistrationTest(int, char *[]) using SphereType = itk::RegularSphereMeshSource; - SphereType::Pointer sphereSource = SphereType::New(); + auto sphereSource = SphereType::New(); sphereSource->Update(); using DemonsRegistrationType = itk::PointSetToSpatialObjectDemonsRegistration; - DemonsRegistrationType::Pointer demonsRegistration = DemonsRegistrationType::New(); + auto demonsRegistration = DemonsRegistrationType::New(); demonsRegistration->SetFixedPointSet(sphereSource->GetOutput()); demonsRegistration->SetMovingSpatialObject(ellipse); diff --git a/Modules/Registration/Common/test/itkPointsLocatorTest.cxx b/Modules/Registration/Common/test/itkPointsLocatorTest.cxx index 5581267584a..2b5443328d4 100644 --- a/Modules/Registration/Common/test/itkPointsLocatorTest.cxx +++ b/Modules/Registration/Common/test/itkPointsLocatorTest.cxx @@ -31,11 +31,11 @@ testPointsLocatorTest() using PointType = itk::Point; using PointsContainerType = TPointsContainer; - typename PointsContainerType::Pointer points = PointsContainerType::New(); + auto points = PointsContainerType::New(); points->Initialize(); using PointsLocatorType = itk::PointsLocator; - typename PointsLocatorType::Pointer pointsLocator = PointsLocatorType::New(); + auto pointsLocator = PointsLocatorType::New(); /** * Create a simple point set structure that will create a non-degenerate diff --git a/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx b/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx index 400c05c53e8..fb529b9b69e 100644 --- a/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx +++ b/Modules/Registration/Common/test/itkRecursiveMultiResolutionPyramidImageFilterTest.cxx @@ -104,7 +104,7 @@ itkRecursiveMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer imgTarget = InputImageType::New(); + auto imgTarget = InputImageType::New(); imgTarget->SetLargestPossibleRegion(region); imgTarget->SetBufferedRegion(region); imgTarget->SetRequestedRegion(region); @@ -153,7 +153,7 @@ itkRecursiveMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) */ using PyramidType = itk::RecursiveMultiResolutionPyramidImageFilter; using ScheduleType = PyramidType::ScheduleType; - PyramidType::Pointer pyramid = PyramidType::New(); + auto pyramid = PyramidType::New(); pyramid->SetUseShrinkImageFilter(useShrinkFilter); pyramid->SetInput(imgTarget); @@ -299,18 +299,18 @@ itkRecursiveMultiResolutionPyramidImageFilterTest(int argc, char * argv[]) std::cout << std::endl; using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(pyramid->GetInput()); - PyramidType::Pointer pyramid2 = PyramidType::New(); + auto pyramid2 = PyramidType::New(); pyramid2->SetInput(caster->GetOutput()); pyramid2->SetUseShrinkImageFilter(useShrinkFilter); pyramid2->SetNumberOfLevels(pyramid->GetNumberOfLevels()); pyramid2->SetSchedule(pyramid->GetSchedule()); using StreamerType = itk::StreamingImageFilter; - StreamerType::Pointer streamer = StreamerType::New(); + auto streamer = StreamerType::New(); streamer->SetInput(pyramid2->GetOutput(testLevel)); streamer->Update(); diff --git a/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx b/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx index 552dc2f5b8d..b88de1efa71 100644 --- a/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx +++ b/Modules/Registration/FEM/include/itkFEMFiniteDifferenceFunctionLoad.hxx @@ -72,7 +72,7 @@ FiniteDifferenceFunctionLoad::InitializeIteration() if (!m_DifferenceFunction) { - typename defaultRegistrationFunctionType::Pointer drfp = defaultRegistrationFunctionType::New(); + auto drfp = defaultRegistrationFunctionType::New(); this->SetMetric(static_cast(drfp)); } diff --git a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx index 19159998162..74c937010ac 100644 --- a/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx +++ b/Modules/Registration/FEM/include/itkFEMRegistrationFilter.hxx @@ -76,7 +76,7 @@ FEMRegistrationFilter::FEMRegistrationFil m_StandardDeviations.Fill(1.0); // Set up the default interpolator - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_Interpolator = static_cast(interp.GetPointer()); m_Interpolator->SetInputImage(m_Field); } @@ -243,10 +243,10 @@ template void FEMRegistrationFilter::WarpImage(const MovingImageType * ImageToWarp) { - typename WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using WarperCoordRepType = typename WarperType::CoordRepType; using InterpolatorType1 = itk::LinearInterpolateImageFunction; - typename InterpolatorType1::Pointer interpolator = InterpolatorType1::New(); + auto interpolator = InterpolatorType1::New(); warper = WarperType::New(); warper->SetInput(ImageToWarp); @@ -276,7 +276,7 @@ FEMRegistrationFilter::CreateMesh(unsigne m_Material->SetYoungsModulus(this->GetElasticity(m_CurrentLevel)); itkDebugMacro(<< " Generating regular Quad mesh " << std::endl); - typename ImageToMeshType::Pointer meshFilter = ImageToMeshType::New(); + auto meshFilter = ImageToMeshType::New(); meshFilter->SetInput(m_MovingImage); meshFilter->SetPixelsPerElement(pixPerElement); meshFilter->SetElement(&*m_Element); @@ -291,7 +291,7 @@ FEMRegistrationFilter::CreateMesh(unsigne m_Material->SetYoungsModulus(this->GetElasticity(m_CurrentLevel)); itkDebugMacro(<< " Generating regular Hex mesh " << std::endl); - typename ImageToMeshType::Pointer meshFilter = ImageToMeshType::New(); + auto meshFilter = ImageToMeshType::New(); meshFilter->SetInput(m_MovingImage); meshFilter->SetPixelsPerElement(pixPerElement); meshFilter->SetElement(&*m_Element); @@ -781,13 +781,13 @@ FEMRegistrationFilter::ComputeJacobian() m_MinJacobian = 1.0; using JacobianFilterType = typename itk::DisplacementFieldJacobianDeterminantFilter; - typename JacobianFilterType::Pointer jacobianFilter = JacobianFilterType::New(); + auto jacobianFilter = JacobianFilterType::New(); jacobianFilter->SetInput(m_Field); jacobianFilter->Update(); m_FloatImage = jacobianFilter->GetOutput(); using StatisticsFilterType = typename itk::StatisticsImageFilter; - typename StatisticsFilterType::Pointer statisticsFilter = StatisticsFilterType::New(); + auto statisticsFilter = StatisticsFilterType::New(); statisticsFilter->SetInput(m_FloatImage); statisticsFilter->Update(); @@ -812,10 +812,10 @@ FEMRegistrationFilter::EnforceDiffeomorph this->SmoothDisplacementField(); } - typename WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using WarperCoordRepType = typename WarperType::CoordRepType; using InterpolatorType1 = itk::LinearInterpolateImageFunction; - typename InterpolatorType1::Pointer interpolator = InterpolatorType1::New(); + auto interpolator = InterpolatorType1::New(); // If using landmarks, warp them if (m_UseLandmarks) @@ -979,7 +979,7 @@ FEMRegistrationFilter::SmoothDisplacement { using GaussianFilterType = RecursiveGaussianImageFilter; - typename GaussianFilterType::Pointer smoother = GaussianFilterType::New(); + auto smoother = GaussianFilterType::New(); for (unsigned int dim = 0; dim < ImageDimension; ++dim) { @@ -1016,7 +1016,7 @@ FEMRegistrationFilter::ExpandVectorField( itkDebugMacro(<< expandFactors[i] << " "); } itkDebugMacro(<< std::endl); - typename ExpanderType::Pointer m_FieldExpander = ExpanderType::New(); + auto m_FieldExpander = ExpanderType::New(); m_FieldExpander->SetInput(field); m_FieldExpander->SetExpandFactors(expandFactors); // use default @@ -1109,7 +1109,7 @@ FEMRegistrationFilter::MultiResSolve() { itkDebugMacro(<< " Beginning level " << m_CurrentLevel << std::endl); - typename SolverType::Pointer solver = SolverType::New(); + auto solver = SolverType::New(); if (m_Maxiters[m_CurrentLevel] > 0) { @@ -1376,7 +1376,7 @@ template void FEMRegistrationFilter::AddLandmark(PointType source, PointType target) { - typename LoadLandmark::Pointer newLandmark = LoadLandmark::New(); + auto newLandmark = LoadLandmark::New(); vnl_vector localSource; vnl_vector localTarget; @@ -1401,7 +1401,7 @@ FEMRegistrationFilter::InsertLandmark(uns PointType source, PointType target) { - typename LoadLandmark::Pointer newLandmark = LoadLandmark::New(); + auto newLandmark = LoadLandmark::New(); vnl_vector localSource; vnl_vector localTarget; diff --git a/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx b/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx index caf6d15e3ca..a50864b8087 100644 --- a/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx +++ b/Modules/Registration/FEM/include/itkMIRegistrationFunction.hxx @@ -53,7 +53,7 @@ MIRegistrationFunction::MIRegistr { m_MovingImageGradientCalculator = GradientCalculatorType::New(); } - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = static_cast(interp.GetPointer()); } diff --git a/Modules/Registration/FEM/include/itkNCCRegistrationFunction.hxx b/Modules/Registration/FEM/include/itkNCCRegistrationFunction.hxx index c9b49d47f5c..d05a6e48f37 100644 --- a/Modules/Registration/FEM/include/itkNCCRegistrationFunction.hxx +++ b/Modules/Registration/FEM/include/itkNCCRegistrationFunction.hxx @@ -46,7 +46,7 @@ NCCRegistrationFunction::NCCRegis m_FixedImageSpacing.Fill(1.0); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = static_cast(interp.GetPointer()); } diff --git a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx index 8858a0a34dc..3447819b28d 100644 --- a/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMFiniteDifferenceFunctionLoadTest.cxx @@ -128,19 +128,19 @@ CreateMesh(InputImageType * image, unsigned int elementWidth = 1) } // Set up image to mesh filter - MeshFilterType::Pointer meshFilter = MeshFilterType::New(); + auto meshFilter = MeshFilterType::New(); meshFilter->SetInput(image); meshFilter->SetPixelsPerElement(pixelsPerElement); - MaterialType::Pointer material = MaterialType::New(); + auto material = MaterialType::New(); if (ImageDimension == 2) { - Element2DType::Pointer element = Element2DType::New(); + auto element = Element2DType::New(); element->SetMaterial(material); meshFilter->SetElement(element); } else { - Element3DType::Pointer element = Element3DType::New(); + auto element = Element3DType::New(); element->SetMaterial(material); meshFilter->SetElement(element); } @@ -161,7 +161,7 @@ RunTest(InputImageType * fixedImage, InputImageType::SpacingType spacing = fixedImage->GetSpacing(); InputImageType::PointType origin = fixedImage->GetOrigin(); - ImageMetricLoadType::Pointer load = ImageMetricLoadType::New(); + auto load = ImageMetricLoadType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(load, FiniteDifferenceFunctionLoad, LoadElement); @@ -274,7 +274,7 @@ RunTest(InputImageType * fixedImage, // Write to vector image using FieldWriterType = itk::ImageFileWriter; - FieldWriterType::Pointer fieldWriter = FieldWriterType::New(); + auto fieldWriter = FieldWriterType::New(); std::ostringstream outFilenameStream; outFilenameStream << filenamePrefix << "ForcesWithMetric" << metricType << ".vtk"; @@ -333,7 +333,7 @@ RunTest(InputImageType * fixedImage, } // end of for(each element) // Write to vector image - FieldWriterType::Pointer forceFieldWriter = FieldWriterType::New(); + auto forceFieldWriter = FieldWriterType::New(); std::ostringstream vectorOutFilenameStream; vectorOutFilenameStream << filenamePrefix << "NodalForcesWithMetric" << metricType << ".vtk"; @@ -388,11 +388,11 @@ itkFEMFiniteDifferenceFunctionLoadTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer movingImage = InputImageType::New(); - InputImageType::Pointer fixedImage = InputImageType::New(); + auto movingImage = InputImageType::New(); + auto fixedImage = InputImageType::New(); - DeformationFieldImageType::Pointer initField = DeformationFieldImageType::New(); - DeformationFieldImageType::Pointer outField = DeformationFieldImageType::New(); + auto initField = DeformationFieldImageType::New(); + auto outField = DeformationFieldImageType::New(); movingImage->SetLargestPossibleRegion(region); movingImage->SetBufferedRegion(region); @@ -442,8 +442,8 @@ itkFEMFiniteDifferenceFunctionLoadTest(int argc, char * argv[]) FillImage(initField, zeroVec); using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); - std::string filename(filenamePrefix); + auto writer = ImageWriterType::New(); + std::string filename(filenamePrefix); writer->SetInput(movingImage); writer->SetFileName((filename + "MovingImage.mha").c_str()); @@ -456,7 +456,7 @@ itkFEMFiniteDifferenceFunctionLoadTest(int argc, char * argv[]) // Create mesh from image FEMObjectType::Pointer femObject = CreateMesh(fixedImage, PixelsPerElement); - SolverType::Pointer solver = SolverType::New(); + auto solver = SolverType::New(); solver->SetInput(femObject); // Test FinitDifferenceFunctionLoad with four metric types diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx index 7f64db57f75..79cb3e281d7 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilter2DTest.cxx @@ -109,10 +109,10 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer movingImage = InputImageType::New(); - InputImageType::Pointer fixedImage = InputImageType::New(); + auto movingImage = InputImageType::New(); + auto fixedImage = InputImageType::New(); - DeformationFieldImageType::Pointer initField = DeformationFieldImageType::New(); + auto initField = DeformationFieldImageType::New(); movingImage->SetLargestPossibleRegion(region); movingImage->SetBufferedRegion(region); @@ -157,7 +157,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) // Run registration and warp moving for (unsigned int met = 0; met < 4; ++met) { - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registrator, FEMRegistrationFilter, ImageToImageFilter); @@ -280,7 +280,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) material->SetDensityHeatProduct(1.0); // Create the element type - ElementType::Pointer element1 = ElementType::New(); + auto element1 = ElementType::New(); element1->SetMaterial(dynamic_cast(&*material)); registrator->SetElement(&*element1); registrator->SetMaterial(material); @@ -313,7 +313,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetDisplacementField()); writer->Update(); @@ -327,7 +327,7 @@ itkFEMRegistrationFilter2DTest(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetWarpedImage()); writer->Update(); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx index 9c80be4e054..dc4c14bbaf0 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest.cxx @@ -110,10 +110,10 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer movingImage = InputImageType::New(); - InputImageType::Pointer fixedImage = InputImageType::New(); + auto movingImage = InputImageType::New(); + auto fixedImage = InputImageType::New(); - DeformationFieldImageType::Pointer initField = DeformationFieldImageType::New(); + auto initField = DeformationFieldImageType::New(); movingImage->SetLargestPossibleRegion(region); movingImage->SetBufferedRegion(region); @@ -159,7 +159,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) // Run registration and warp moving for (unsigned int met = 0; met < 4; ++met) { - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registrator, FEMRegistrationFilter, ImageToImageFilter); @@ -282,7 +282,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) material->SetDensityHeatProduct(1.0); // Create the element type - ElementType::Pointer element1 = ElementType::New(); + auto element1 = ElementType::New(); element1->SetMaterial(dynamic_cast(&*material)); registrator->SetElement(&*element1); registrator->SetMaterial(material); @@ -317,7 +317,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetDisplacementField()); writer->Update(); @@ -331,7 +331,7 @@ itkFEMRegistrationFilterTest(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetWarpedImage()); writer->Update(); diff --git a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx index 971f0b6eef5..eb196dde257 100644 --- a/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx +++ b/Modules/Registration/FEM/test/itkFEMRegistrationFilterTest2.cxx @@ -122,10 +122,10 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - InputImageType::Pointer movingImage = InputImageType::New(); - InputImageType::Pointer fixedImage = InputImageType::New(); + auto movingImage = InputImageType::New(); + auto fixedImage = InputImageType::New(); - DeformationFieldImageType::Pointer initField = DeformationFieldImageType::New(); + auto initField = DeformationFieldImageType::New(); movingImage->SetLargestPossibleRegion(region); movingImage->SetBufferedRegion(region); @@ -177,7 +177,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) // Run registration and warp moving for (unsigned int met = 0; met < 4; ++met) { - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registrator, FEMRegistrationFilter, ImageToImageFilter); @@ -307,7 +307,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) material->SetDensityHeatProduct(1.0); // Create the element type - ElementType::Pointer element1 = ElementType::New(); + auto element1 = ElementType::New(); element1->SetMaterial(dynamic_cast(&*material)); registrator->SetElement(&*element1); registrator->SetMaterial(material); @@ -340,7 +340,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetDisplacementField()); writer->Update(); @@ -354,7 +354,7 @@ itkFEMRegistrationFilterTest2(int argc, char * argv[]) outFileName += ss.str(); outFileName += ".mhd"; using ImageWriterType = itk::ImageFileWriter; - ImageWriterType::Pointer writer = ImageWriterType::New(); + auto writer = ImageWriterType::New(); writer->SetFileName(outFileName); writer->SetInput(registrator->GetWarpedImage()); writer->Update(); diff --git a/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx b/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx index f70bb93baec..8411da99c78 100644 --- a/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx +++ b/Modules/Registration/FEM/test/itkMIRegistrationFunctionTest.cxx @@ -57,8 +57,8 @@ itkMIRegistrationFunctionTest(int, char *[]) FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; MovingImageType::PointValueType movingImageOrigin[] = { 0.0f, 0.0f }; - MovingImageSourceType::Pointer movingImageSource = MovingImageSourceType::New(); - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto movingImageSource = MovingImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -81,7 +81,7 @@ itkMIRegistrationFunctionTest(int, char *[]) // Set up the metric using MetricFunctionType = itk::MIRegistrationFunction; - MetricFunctionType::Pointer metricFunction = MetricFunctionType::New(); + auto metricFunction = MetricFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(metricFunction, MIRegistrationFunction, PDEDeformableRegistrationFunction); diff --git a/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx b/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx index a70c0dba3b8..93c4c9ea416 100644 --- a/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx +++ b/Modules/Registration/FEM/test/itkPhysicsBasedNonRigidRegistrationMethodTest.cxx @@ -63,19 +63,19 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; // Read fixed image - ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(fixedImageReader->Update()); // Read moving image - ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[2]); ITK_TRY_EXPECT_NO_EXCEPTION(movingImageReader->Update()); // Read mask image - ImageReaderType::Pointer maskImageReader = ImageReaderType::New(); + auto maskImageReader = ImageReaderType::New(); maskImageReader->SetFileName(argv[3]); ITK_TRY_EXPECT_NO_EXCEPTION(maskImageReader->Update()); @@ -83,7 +83,7 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) // Read mesh using MeshReaderType = itk::VTKTetrahedralMeshReader; - MeshReaderType::Pointer meshReader = MeshReaderType::New(); + auto meshReader = MeshReaderType::New(); meshReader->SetFileName(argv[4]); ITK_TRY_EXPECT_NO_EXCEPTION(meshReader->Update()); @@ -96,7 +96,7 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) MeshType, DeformationFieldType>; - PBNRRFilterType::Pointer filter = PBNRRFilterType::New(); + auto filter = PBNRRFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, PhysicsBasedNonRigidRegistrationMethod, ImageToImageFilter); @@ -158,10 +158,10 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) // Warp image using WarpFilterType = itk::WarpImageFilter; - WarpFilterType::Pointer warpFilter = WarpFilterType::New(); + auto warpFilter = WarpFilterType::New(); using InterpolatorType = itk::LinearInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warpFilter->SetInterpolator(interpolator); warpFilter->SetInput(movingImageReader->GetOutput()); @@ -174,7 +174,7 @@ itkPhysicsBasedNonRigidRegistrationMethodTest(int argc, char * argv[]) // Write warped image to file using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(warpFilter->GetOutput()); diff --git a/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx b/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx index b532cc5ff24..87d7f912c38 100644 --- a/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx +++ b/Modules/Registration/FEM/test/itkVTKTetrahedralMeshReader.hxx @@ -34,7 +34,7 @@ VTKTetrahedralMeshReader::VTKTetrahedralMeshReader() // // Create the output // - typename TOutputMesh::Pointer output = TOutputMesh::New(); + auto output = TOutputMesh::New(); this->ProcessObject::SetNumberOfRequiredOutputs(1); this->ProcessObject::SetNthOutput(0, output.GetPointer()); } diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.h b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.h index e83db784180..ed8b1a20b94 100644 --- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.h +++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFilter.h @@ -184,7 +184,7 @@ class GPUDemonsRegistrationFilterFactory : public itk::ObjectFactoryBase static void RegisterOneFactory() { - GPUDemonsRegistrationFilterFactory::Pointer factory = GPUDemonsRegistrationFilterFactory::New(); + auto factory = GPUDemonsRegistrationFilterFactory::New(); ObjectFactoryBase::RegisterFactory(factory); } diff --git a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx index 7561ecefdd9..187d9bfb742 100644 --- a/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx +++ b/Modules/Registration/GPUPDEDeformable/include/itkGPUDemonsRegistrationFunction.hxx @@ -49,7 +49,7 @@ GPUDemonsRegistrationFunction::GP m_Normalizer = 1.0; m_FixedImageGradientCalculator = GradientCalculatorType::New(); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = static_cast(interp.GetPointer()); diff --git a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx index 99c37067f2a..1c5fd21ace5 100644 --- a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx @@ -236,8 +236,8 @@ itkGPUDemons(int, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - typename FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - typename MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[3]); movingImageReader->SetFileName(argv[4]); @@ -248,15 +248,15 @@ itkGPUDemons(int, char * argv[]) using FixedImageCasterType = itk::CastImageFilter; using MovingImageCasterType = itk::CastImageFilter; - typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New(); - typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New(); + auto fixedImageCaster = FixedImageCasterType::New(); + auto movingImageCaster = MovingImageCasterType::New(); fixedImageCaster->SetInput(fixedImageReader->GetOutput()); movingImageCaster->SetInput(movingImageReader->GetOutput()); // maching intensity histogram using MatchingFilterType = itk::HistogramMatchingImageFilter; - typename MatchingFilterType::Pointer matcher = MatchingFilterType::New(); + auto matcher = MatchingFilterType::New(); matcher->SetInput(movingImageCaster->GetOutput()); matcher->SetReferenceImage(fixedImageCaster->GetOutput()); @@ -271,7 +271,7 @@ itkGPUDemons(int, char * argv[]) using RegistrationFilterType = itk::GPUDemonsRegistrationFilter; - typename RegistrationFilterType::Pointer filter = RegistrationFilterType::New(); + auto filter = RegistrationFilterType::New(); using ProgressType = ShowProgressObject; ProgressType progressWatch(filter); @@ -302,9 +302,9 @@ itkGPUDemons(int, char * argv[]) // warp the image with the deformation field using WarperType = itk::WarpImageFilter; using InterpolatorType = itk::LinearInterpolateImageFunction; - typename WarperType::Pointer warper = WarperType::New(); - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); + auto warper = WarperType::New(); + auto interpolator = InterpolatorType::New(); + typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); warper->SetInput(movingImageReader->GetOutput()); warper->SetInterpolator(interpolator); @@ -321,8 +321,8 @@ itkGPUDemons(int, char * argv[]) using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); - typename CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); char * outName = AppendFileName(argv[5], "_gpu"); writer->SetFileName(outName); @@ -351,8 +351,8 @@ itkCPUDemons(int, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - typename FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - typename MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[3]); movingImageReader->SetFileName(argv[4]); @@ -363,15 +363,15 @@ itkCPUDemons(int, char * argv[]) using FixedImageCasterType = itk::CastImageFilter; using MovingImageCasterType = itk::CastImageFilter; - typename FixedImageCasterType::Pointer fixedImageCaster = FixedImageCasterType::New(); - typename MovingImageCasterType::Pointer movingImageCaster = MovingImageCasterType::New(); + auto fixedImageCaster = FixedImageCasterType::New(); + auto movingImageCaster = MovingImageCasterType::New(); fixedImageCaster->SetInput(fixedImageReader->GetOutput()); movingImageCaster->SetInput(movingImageReader->GetOutput()); // maching intensity histogram using MatchingFilterType = itk::HistogramMatchingImageFilter; - typename MatchingFilterType::Pointer matcher = MatchingFilterType::New(); + auto matcher = MatchingFilterType::New(); matcher->SetInput(movingImageCaster->GetOutput()); matcher->SetReferenceImage(fixedImageCaster->GetOutput()); @@ -386,7 +386,7 @@ itkCPUDemons(int, char * argv[]) using RegistrationFilterType = itk::DemonsRegistrationFilter; - typename RegistrationFilterType::Pointer filter = RegistrationFilterType::New(); + auto filter = RegistrationFilterType::New(); using ProgressType = ShowProgressObject; ProgressType progressWatch(filter); @@ -411,9 +411,9 @@ itkCPUDemons(int, char * argv[]) // warp the image with the deformation field using WarperType = itk::WarpImageFilter; using InterpolatorType = itk::LinearInterpolateImageFunction; - typename WarperType::Pointer warper = WarperType::New(); - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); + auto warper = WarperType::New(); + auto interpolator = InterpolatorType::New(); + typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); warper->SetInput(movingImageReader->GetOutput()); warper->SetInterpolator(interpolator); @@ -429,8 +429,8 @@ itkCPUDemons(int, char * argv[]) using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); - typename CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); char * outName = AppendFileName(argv[5], "_cpu"); writer->SetFileName(outName); diff --git a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx index 06445d0bdd9..deaa935250c 100644 --- a/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx +++ b/Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest2.cxx @@ -139,9 +139,9 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -178,7 +178,7 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(initField); caster->InPlaceOff(); @@ -186,7 +186,7 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::GPUDemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(caster->GetOutput()); registrator->SetMovingImage(moving); @@ -241,11 +241,11 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); warper->SetDisplacementField(registrator->GetOutput()); @@ -268,14 +268,14 @@ itkGPUDemonsRegistrationFilterTest2(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer fixedWriter = WriterType::New(); + auto fixedWriter = WriterType::New(); fixedWriter->SetFileName(argv[1]); fixedWriter->SetInput(fixed); fixedWriter->Update(); - WriterType::Pointer warpedWriter = WriterType::New(); + auto warpedWriter = WriterType::New(); warpedWriter->SetFileName(argv[2]); diff --git a/Modules/Registration/Metricsv4/include/itkExpectationBasedPointSetToPointSetMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkExpectationBasedPointSetToPointSetMetricv4.hxx index 8b78934fa72..0e30c0751ec 100644 --- a/Modules/Registration/Metricsv4/include/itkExpectationBasedPointSetToPointSetMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkExpectationBasedPointSetToPointSetMetricv4.hxx @@ -131,7 +131,7 @@ typename LightObject::Pointer ExpectationBasedPointSetToPointSetMetricv4:: InternalClone() const { - typename Self::Pointer rval = Self::New(); + auto rval = Self::New(); rval->SetMovingPointSet(this->m_MovingPointSet); rval->SetFixedPointSet(this->m_FixedPointSet); rval->SetPointSetSigma(this->m_PointSetSigma); diff --git a/Modules/Registration/Metricsv4/include/itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx index 195179d851b..cca996c80a3 100644 --- a/Modules/Registration/Metricsv4/include/itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkJensenHavrdaCharvatTsallisPointSetToPointSetMetricv4.hxx @@ -182,7 +182,7 @@ template typename LightObject::Pointer JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4::InternalClone() const { - typename Self::Pointer rval = Self::New(); + auto rval = Self::New(); rval->SetMovingPointSet(this->m_MovingPointSet); rval->SetFixedPointSet(this->m_FixedPointSet); rval->SetPointSetSigma(this->m_PointSetSigma); diff --git a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx index b469c948a5b..f92580c2d90 100644 --- a/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkJointHistogramMutualInformationImageToImageMetricv4.hxx @@ -261,7 +261,7 @@ JointHistogramMutualInformationImageToImageMetricv4m_VarianceForJointPDFSmoothing > NumericTraits::ZeroValue()) { using DgType = DiscreteGaussianImageFilter; - typename DgType::Pointer dg = DgType::New(); + auto dg = DgType::New(); dg->SetInput(this->m_JointPDF); dg->SetVariance(this->m_VarianceForJointPDFSmoothing); dg->UseImageSpacingOff(); diff --git a/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx b/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx index c6ccaf11fc4..9908551475b 100644 --- a/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx +++ b/Modules/Registration/Metricsv4/include/itkLabeledPointSetToPointSetMetricv4.hxx @@ -34,7 +34,7 @@ LabeledPointSetToPointSetMetricv4; - typename DefaultMetricType::Pointer euclideanMetric = DefaultMetricType::New(); + auto euclideanMetric = DefaultMetricType::New(); this->m_PointSetMetric = euclideanMetric; this->m_UsePointSetData = true; @@ -130,7 +130,7 @@ typename LabeledPointSetToPointSetMetricv4:: GetLabeledFixedPointSet(const LabelType label) const { - typename FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New(); + auto fixedPointSet = FixedPointSetType::New(); fixedPointSet->Initialize(); typename FixedPointSetType::PointIdentifier count = NumericTraits::ZeroValue(); @@ -156,7 +156,7 @@ typename LabeledPointSetToPointSetMetricv4:: GetLabeledMovingPointSet(const LabelType label) const { - typename MovingPointSetType::Pointer movingPointSet = MovingPointSetType::New(); + auto movingPointSet = MovingPointSetType::New(); movingPointSet->Initialize(); typename MovingPointSetType::PointIdentifier count = NumericTraits::ZeroValue(); diff --git a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx index a2d97210ba7..dd2bff64901 100644 --- a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageMetricv4Test.cxx @@ -134,19 +134,19 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) using DisplacementTransformType = itk::DisplacementFieldTransform; using FieldType = DisplacementTransformType::DisplacementFieldType; - IdentityTransformType::Pointer transformFId = IdentityTransformType::New(); + auto transformFId = IdentityTransformType::New(); - IdentityTransformType::Pointer transformMId = IdentityTransformType::New(); + auto transformMId = IdentityTransformType::New(); if (transformMId.IsNull()) { std::cerr << "transformMId == nullptr" << std::endl; return EXIT_FAILURE; } - DisplacementTransformType::Pointer transformMdisplacement = DisplacementTransformType::New(); - TranslationTransformType::Pointer transformMtranslation = TranslationTransformType::New(); - TranslationTransformType::Pointer transformMtranslation2 = TranslationTransformType::New(); - CompositeTransformType::Pointer transformMComp = CompositeTransformType::New(); - CompositeTransformType::Pointer transformFComp = CompositeTransformType::New(); + auto transformMdisplacement = DisplacementTransformType::New(); + auto transformMtranslation = TranslationTransformType::New(); + auto transformMtranslation2 = TranslationTransformType::New(); + auto transformMComp = CompositeTransformType::New(); + auto transformFComp = CompositeTransformType::New(); constexpr itk::SizeValueType imageSize = 6; @@ -166,14 +166,14 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -204,7 +204,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) float def_value = -0.5; zero.Fill(def_value); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(fixedImage->GetLargestPossibleRegion()); field->SetSpacing(fixedImage->GetSpacing()); field->SetOrigin(fixedImage->GetOrigin()); @@ -212,7 +212,7 @@ itkANTSNeighborhoodCorrelationImageToImageMetricv4Test(int, char ** const) field->Allocate(); field->FillBuffer(zero); - FieldType::Pointer fieldInv = FieldType::New(); + auto fieldInv = FieldType::New(); zero.Fill(def_value * (-1.0)); fieldInv->SetRegions(fixedImage->GetLargestPossibleRegion()); diff --git a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx index 833192e3866..42f84d62ee7 100644 --- a/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkANTSNeighborhoodCorrelationImageToImageRegistrationTest.cxx @@ -104,8 +104,8 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -118,23 +118,23 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -155,12 +155,12 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); itk::Size radSize; radSize.Fill(2); metric->SetRadius(radSize); @@ -189,7 +189,7 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetLearningRate(learningRate); optimizer->SetNumberOfIterations(numberOfIterations); @@ -284,8 +284,8 @@ itkANTSNeighborhoodCorrelationImageToImageRegistrationTest(int argc, char * argv using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx index 2efc6991ae3..466ca50646b 100644 --- a/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkCorrelationImageToImageMetricv4Test.cxx @@ -142,14 +142,14 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -199,8 +199,8 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); @@ -208,7 +208,7 @@ itkCorrelationImageToImageMetricv4Test(int, char ** const) /* The metric */ using MetricType = itk::CorrelationImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx index 047fbb5d182..49018177ea1 100644 --- a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4RegistrationTest.cxx @@ -125,8 +125,8 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -139,7 +139,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // scale the images to [0,1] using FixedRescaleFilterType = itk::RescaleIntensityImageFilter; - FixedRescaleFilterType::Pointer fixedRescaleFilter = FixedRescaleFilterType::New(); + auto fixedRescaleFilter = FixedRescaleFilterType::New(); fixedRescaleFilter->SetInput(fixedImage); fixedRescaleFilter->SetOutputMinimum(itk::NumericTraits::ZeroValue()); fixedRescaleFilter->SetOutputMaximum(itk::NumericTraits::OneValue()); @@ -147,7 +147,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) fixedImage = fixedRescaleFilter->GetOutput(); using MovingRescaleFilterType = itk::RescaleIntensityImageFilter; - MovingRescaleFilterType::Pointer movingRescaleFilter = MovingRescaleFilterType::New(); + auto movingRescaleFilter = MovingRescaleFilterType::New(); movingRescaleFilter->SetInput(movingImage); movingRescaleFilter->SetOutputMinimum(itk::NumericTraits::ZeroValue()); movingRescaleFilter->SetOutputMaximum(itk::NumericTraits::OneValue()); @@ -156,7 +156,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // histogram matching of values using MatchingFilterType = itk::HistogramMatchingImageFilter; - MatchingFilterType::Pointer matchingFilter = MatchingFilterType::New(); + auto matchingFilter = MatchingFilterType::New(); matchingFilter->SetInput(movingImage); matchingFilter->SetReferenceImage(fixedImage); matchingFilter->ThresholdAtMeanIntensityOn(); @@ -167,10 +167,10 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) /** Displacement field transform */ using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -191,7 +191,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // The metric using MetricType = itk::DemonsImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Assign images and transforms. metric->SetFixedImage(fixedImage); @@ -242,7 +242,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // Optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -276,7 +276,7 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // warp the image with the displacement field using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); resample->SetTransform(displacementTransform); resample->SetInput(movingImageReader->GetOutput()); @@ -289,12 +289,12 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[3]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string path = itksys::SystemTools::GetFilenamePath(outfilename); - std::string defout = path + std::string("/") + name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[3]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string path = itksys::SystemTools::GetFilenamePath(outfilename); + std::string defout = path + std::string("/") + name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -305,8 +305,8 @@ itkDemonsImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx index faa8cbe2bda..7c5173e39ab 100644 --- a/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkDemonsImageToImageMetricv4Test.cxx @@ -51,14 +51,14 @@ itkDemonsImageToImageMetricv4Test(int, char ** const) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -93,12 +93,12 @@ itkDemonsImageToImageMetricv4Test(int, char ** const) using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); field->SetRegions(fixedImage->GetLargestPossibleRegion()); field->CopyInformation(fixedImage); field->Allocate(); @@ -112,7 +112,7 @@ itkDemonsImageToImageMetricv4Test(int, char ** const) /* The metric */ using MetricType = itk::DemonsImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx index df903bd9dff..f42e24b0091 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricRegistrationTest.cxx @@ -77,10 +77,10 @@ itkEuclideanDistancePointSetMetricRegistrationTestRun(unsigned int using PointType = typename PointSetType::PointType; using CoordRepType = typename PointType::CoordRepType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Create a few points and apply a small rotation to make the moving point set @@ -130,14 +130,14 @@ itkEuclideanDistancePointSetMetricRegistrationTestRun(unsigned int // optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); optimizer->SetMaximumStepSizeInPhysicalUnits(maximumPhysicalStepSize); using CommandType = itkEuclideanDistancePointSetMetricRegistrationTestCommandIterationUpdate; - typename CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); // optimizer->AddObserver( itk::IterationEvent(), observer ); // start @@ -226,11 +226,11 @@ itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) // metric using PointSetType = itk::PointSet; using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); // transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << "XX Test with affine transform: " << std::endl; int oneResult = @@ -247,7 +247,7 @@ itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) // using DisplacementFieldTransformType = itk::DisplacementFieldTransform; - DisplacementFieldTransformType::Pointer displacementTransform = DisplacementFieldTransformType::New(); + auto displacementTransform = DisplacementFieldTransformType::New(); // Setup the physical space to match the point set virtual domain, // which is defined by the fixed point set since the fixed transform @@ -279,7 +279,7 @@ itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) region.SetSize(regionSize); region.SetIndex(regionIndex); - FieldType::Pointer displacementField = FieldType::New(); + auto displacementField = FieldType::New(); displacementField->SetOrigin(origin); displacementField->SetDirection(direction); displacementField->SetSpacing(spacing); @@ -292,7 +292,7 @@ itkEuclideanDistancePointSetMetricRegistrationTest(int argc, char * argv[]) // metric using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric2 = PointSetMetricType::New(); + auto metric2 = PointSetMetricType::New(); // If we don't set the virtual domain when using a displacement field transform, the // metric takes it from the transform during initialization. // metric2->SetVirtualDomain( spacing, origin, direction, region ); diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest.cxx index 569bfd29d86..b1080ed75e5 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest.cxx @@ -30,10 +30,10 @@ itkEuclideanDistancePointSetMetricTestRun() using PointType = typename PointSetType::PointType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Produce two simple point sets of 1) a circle and 2) the same circle with an offset; @@ -71,12 +71,12 @@ itkEuclideanDistancePointSetMetricTestRun() // Simple translation transform for moving point set // using TranslationTransformType = itk::TranslationTransform; - typename TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // Instantiate the metric using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - typename PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(translationTransform); diff --git a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx index 47ab0dff3d1..49a9c218a24 100644 --- a/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkEuclideanDistancePointSetMetricTest2.cxx @@ -36,10 +36,10 @@ itkEuclideanDistancePointSetMetricTest2Run() using PointType = typename PointSetType::PointType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Create a few points and apply a small offset to make the moving points @@ -92,7 +92,7 @@ itkEuclideanDistancePointSetMetricTest2Run() std::cout << "Testing with displacement field transform." << std::endl; // using DisplacementFieldTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; using DisplacementFieldTransformType = itk::DisplacementFieldTransform; - typename DisplacementFieldTransformType::Pointer displacementTransform = DisplacementFieldTransformType::New(); + auto displacementTransform = DisplacementFieldTransformType::New(); // Setup the physical space to match the point set virtual domain, // which is defined by the fixed point set since the fixed transform @@ -123,7 +123,7 @@ itkEuclideanDistancePointSetMetricTest2Run() region.SetSize(regionSize); region.SetIndex(regionIndex); - typename FieldType::Pointer displacementField = FieldType::New(); + auto displacementField = FieldType::New(); displacementField->SetOrigin(origin); displacementField->SetDirection(direction); displacementField->SetSpacing(spacing); @@ -136,7 +136,7 @@ itkEuclideanDistancePointSetMetricTest2Run() // Instantiate the metric using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - typename PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(displacementTransform); @@ -208,7 +208,7 @@ itkEuclideanDistancePointSetMetricTest2Run() } // Test with no valid points. - typename PointSetType::Pointer fixedPoints2 = PointSetType::New(); + auto fixedPoints2 = PointSetType::New(); fixedPoints2->Initialize(); fixedPoint[0] = -pointMax; fixedPoint[1] = 0.0; diff --git a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx index 965042b06f4..162a2578a1a 100644 --- a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricRegistrationTest.cxx @@ -74,10 +74,10 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) using PointType = PointSetType::PointType; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); @@ -134,12 +134,12 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) } using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); // Instantiate the metric using PointSetMetricType = itk::ExpectationBasedPointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetPointSetSigma(2.0); @@ -158,14 +158,14 @@ itkExpectationBasedPointSetMetricRegistrationTest(int argc, char * argv[]) // optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); optimizer->SetMaximumStepSizeInPhysicalUnits(3.0); using CommandType = itkExpectationBasedPointSetMetricRegistrationTestCommandIterationUpdate; - CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); optimizer->AddObserver(itk::IterationEvent(), observer); optimizer->SetMinimumConvergenceValue(0.0); diff --git a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx index ea6cbdc237a..68216795a93 100644 --- a/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkExpectationBasedPointSetMetricTest.cxx @@ -30,10 +30,10 @@ itkExpectationBasedPointSetMetricTestRun() using PointType = typename PointSetType::PointType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Produce two simple point sets of 1) a circle and 2) the same circle with an offset; @@ -69,12 +69,12 @@ itkExpectationBasedPointSetMetricTestRun() // Simple translation transform for moving point set using TranslationTransformType = itk::TranslationTransform; - typename TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // Instantiate the metric using PointSetMetricType = itk::ExpectationBasedPointSetToPointSetMetricv4; - typename PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(translationTransform); diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx index 4af6edf8938..0375be53e70 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4RegistrationTest.cxx @@ -73,7 +73,7 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, typename TImage::DirectionType direction; direction.Fill(itk::NumericTraits::OneValue()); - typename GaussianImageSourceType::Pointer fixedImageSource = GaussianImageSourceType::New(); + auto fixedImageSource = GaussianImageSourceType::New(); fixedImageSource->SetSize(size); fixedImageSource->SetOrigin(origin); @@ -99,7 +99,7 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, // shift the fixed image to get the moving image using CyclicShiftFilterType = itk::CyclicShiftImageFilter; - typename CyclicShiftFilterType::Pointer shiftFilter = CyclicShiftFilterType::New(); + auto shiftFilter = CyclicShiftFilterType::New(); typename CyclicShiftFilterType::OffsetType imageShift; typename CyclicShiftFilterType::OffsetValueType maxImageShift = boundary - 1; imageShift.Fill(maxImageShift); @@ -111,7 +111,7 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, // create an affine transform using TranslationTransformType = itk::TranslationTransform; - typename TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // setup metric @@ -173,7 +173,7 @@ ImageToImageMetricv4RegistrationTestRun(typename TMetric::Pointer metric, // optimizer // using OptimizerType = itk::GradientDescentOptimizerv4; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -264,7 +264,7 @@ itkImageToImageMetricv4RegistrationTestRunAll(int argc, char * argv[]) if (!doSampling) { using MetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << std::endl << "*** ANTSNeighborhoodCorrelation metric: " << std::endl; if (ImageToImageMetricv4RegistrationTestRun( metric, numberOfIterations1, maximumStepSize1, doSampling, doGradientFilter) != EXIT_SUCCESS) @@ -276,7 +276,7 @@ itkImageToImageMetricv4RegistrationTestRunAll(int argc, char * argv[]) // Correlation { using MetricType = itk::CorrelationImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << std::endl << "*** Correlation metric: " << std::endl; if (ImageToImageMetricv4RegistrationTestRun( metric, numberOfIterations1, maximumStepSize1, doSampling, doGradientFilter) != EXIT_SUCCESS) @@ -288,7 +288,7 @@ itkImageToImageMetricv4RegistrationTestRunAll(int argc, char * argv[]) // Joint Histogram { using MetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << std::endl << "*** JointHistogramMutualInformation metric: " << std::endl; if (ImageToImageMetricv4RegistrationTestRun( metric, numberOfIterations1, maximumStepSize1, doSampling, doGradientFilter) != EXIT_SUCCESS) @@ -300,7 +300,7 @@ itkImageToImageMetricv4RegistrationTestRunAll(int argc, char * argv[]) // Mattes { using MetricType = itk::MattesMutualInformationImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << std::endl << "*** MattesMutualInformation metric: " << std::endl; if (ImageToImageMetricv4RegistrationTestRun( metric, numberOfIterations2, maximumStepSize2, doSampling, doGradientFilter) != EXIT_SUCCESS) @@ -312,7 +312,7 @@ itkImageToImageMetricv4RegistrationTestRunAll(int argc, char * argv[]) // MeanSquares { using MetricType = itk::MeanSquaresImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); std::cout << std::endl << "*** MeanSquares metric: " << std::endl; if (ImageToImageMetricv4RegistrationTestRun( metric, numberOfIterations1, maximumStepSize1, doSampling, doGradientFilter) != EXIT_SUCCESS) diff --git a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx index 2bbc6418827..7b9ef3cde40 100644 --- a/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkImageToImageMetricv4Test.cxx @@ -427,14 +427,14 @@ itkImageToImageMetricv4Test(int, char ** const) direction.SetIdentity(); // Create simple test images. - ImageToImageMetricv4TestImageType::Pointer fixedImage = ImageToImageMetricv4TestImageType::New(); + auto fixedImage = ImageToImageMetricv4TestImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageToImageMetricv4TestImageType::Pointer movingImage = ImageToImageMetricv4TestImageType::New(); + auto movingImage = ImageToImageMetricv4TestImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -464,8 +464,8 @@ itkImageToImageMetricv4Test(int, char ** const) // Transforms using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); @@ -552,9 +552,9 @@ itkImageToImageMetricv4Test(int, char ** const) // Create a displacement field transform using DisplacementTransformType = itk::DisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using FieldType = DisplacementTransformType::DisplacementFieldType; - FieldType::Pointer field = FieldType::New(); // This is based on itk::Image + auto field = FieldType::New(); // This is based on itk::Image FieldType::SizeType defsize; FieldType::IndexType start; diff --git a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx index de6ecce416a..702b06c9687 100644 --- a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest.cxx @@ -78,10 +78,10 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg using PointType = PointSetType::PointType; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); @@ -138,12 +138,12 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg } using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); // Instantiate the metric using PointSetMetricType = itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetPointSetSigma(1.0); @@ -166,14 +166,14 @@ itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTest(int argc, char * arg // optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); optimizer->SetMaximumStepSizeInPhysicalUnits(3.0); using CommandType = itkJensenHavrdaCharvatTsallisPointSetMetricRegistrationTestCommandIterationUpdate; - CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); optimizer->AddObserver(itk::IterationEvent(), observer); optimizer->SetMinimumConvergenceValue(0.0); diff --git a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx index 28b87622482..db78c2f4a74 100644 --- a/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJensenHavrdaCharvatTsallisPointSetMetricTest.cxx @@ -30,10 +30,10 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun() using PointType = typename PointSetType::PointType; using VectorType = typename PointType::VectorType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Produce two simple point sets of 1) a circle and 2) the same circle with an offset @@ -80,7 +80,7 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun() // Simple translation transform for moving point set using TranslationTransformType = itk::TranslationTransform; - typename TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // check various alpha values between accepted values of [1.0, 2.0] @@ -97,7 +97,7 @@ itkJensenHavrdaCharvatTsallisPointSetMetricTestRun() // Instantiate the metric ( alpha = 1.0 ) using PointSetMetricType = itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4; - typename PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(translationTransform); diff --git a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx index f7a2565461d..f1101145b3f 100644 --- a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageMetricv4Test.cxx @@ -51,14 +51,14 @@ itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -88,14 +88,14 @@ itkJointHistogramMutualInformationImageToImageMetricv4Test(int, char *[]) /* Transforms */ using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); /* The metric */ using MetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx index 032deb55ee7..9574771d5ae 100644 --- a/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkJointHistogramMutualInformationImageToImageRegistrationTest.cxx @@ -176,8 +176,8 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -190,25 +190,25 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -228,13 +228,13 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetNumberOfHistogramBins(20); using PointType = PointSetType::PointType; @@ -284,9 +284,9 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); using JointPDFStatusType = JointPDFStatus; - JointPDFStatusType::Pointer jointPDFStatus = JointPDFStatusType::New(); + auto jointPDFStatus = JointPDFStatusType::New(); jointPDFStatus->SetOutputFileNameBase(argv[3]); jointPDFStatus->SetMIMetric(metric); // optimizer->AddObserver( itk::IterationEvent(), jointPDFStatus ); @@ -354,12 +354,12 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[3]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string path = itksys::SystemTools::GetFilenamePath(outfilename); - std::string defout = path + std::string("/") + name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[3]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string path = itksys::SystemTools::GetFilenamePath(outfilename); + std::string defout = path + std::string("/") + name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -369,8 +369,8 @@ itkJointHistogramMutualInformationImageToImageRegistrationTest(int argc, char * using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx index ff73f886df2..4d097c1e809 100644 --- a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricRegistrationTest.cxx @@ -69,10 +69,10 @@ itkLabeledPointSetMetricRegistrationTestPerMetric(unsigned int numberOfIteration using PointSetType = typename PointSetMetricType::FixedPointSetType; using PointType = typename PointSetType::PointType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // two circles with a small offset @@ -111,11 +111,11 @@ itkLabeledPointSetMetricRegistrationTestPerMetric(unsigned int numberOfIteration } using AffineTransformType = itk::AffineTransform; - typename AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); using LabeledPointSetMetricType = itk::LabeledPointSetToPointSetMetricv4; - typename LabeledPointSetMetricType::Pointer metric = LabeledPointSetMetricType::New(); + auto metric = LabeledPointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(transform); @@ -133,14 +133,14 @@ itkLabeledPointSetMetricRegistrationTestPerMetric(unsigned int numberOfIteration // optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); optimizer->SetMaximumStepSizeInPhysicalUnits(3.0); using CommandType = itkLabeledPointSetMetricRegistrationTestCommandIterationUpdate; - typename CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); optimizer->AddObserver(itk::IterationEvent(), observer); optimizer->SetMinimumConvergenceValue(0.0); @@ -201,8 +201,8 @@ itkLabeledPointSetMetricRegistrationTest(int argc, char * argv[]) { using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); - int success = + auto metric = PointSetMetricType::New(); + int success = itkLabeledPointSetMetricRegistrationTestPerMetric(numberOfIterations, metric.GetPointer()); allSuccess *= success; @@ -210,7 +210,7 @@ itkLabeledPointSetMetricRegistrationTest(int argc, char * argv[]) { using PointSetMetricType = itk::ExpectationBasedPointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetPointSetSigma(2.0); metric->SetEvaluationKNeighborhood(3); int success = @@ -221,7 +221,7 @@ itkLabeledPointSetMetricRegistrationTest(int argc, char * argv[]) { using PointSetMetricType = itk::JensenHavrdaCharvatTsallisPointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetPointSetSigma(1.0); metric->SetKernelSigma(10.0); metric->SetUseAnisotropicCovariances(false); diff --git a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricTest.cxx b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricTest.cxx index 6c172156963..1192120df6d 100644 --- a/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkLabeledPointSetMetricTest.cxx @@ -32,10 +32,10 @@ itkLabeledPointSetMetricTestRun() using PointType = typename PointSetType::PointType; - typename PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - typename PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // Produce two simple point sets of 1) a circle and 2) the same circle with an offset; @@ -81,12 +81,12 @@ itkLabeledPointSetMetricTestRun() // Simple translation transform for moving point set // using TranslationTransformType = itk::TranslationTransform; - typename TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // Instantiate the metric using PointSetMetricType = itk::LabeledPointSetToPointSetMetricv4; - typename PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); metric->SetFixedPointSet(fixedPoints); metric->SetMovingPointSet(movingPoints); metric->SetMovingTransform(translationTransform); diff --git a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx index 1b1646ece41..49a6ad019ef 100644 --- a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4RegistrationTest.cxx @@ -85,8 +85,8 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -99,25 +99,25 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -137,13 +137,13 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::MattesMutualInformationImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetNumberOfHistogramBins(20); if (!doSampling) @@ -196,7 +196,7 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -266,12 +266,12 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[3]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string path = itksys::SystemTools::GetFilenamePath(outfilename); - std::string defout = path + std::string("/") + name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[3]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string path = itksys::SystemTools::GetFilenamePath(outfilename); + std::string defout = path + std::string("/") + name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -281,8 +281,8 @@ itkMattesMutualInformationImageToImageMetricv4RegistrationTest(int argc, char * using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx index 2e28ebcc9e9..7133baba78f 100644 --- a/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMattesMutualInformationImageToImageMetricv4Test.cxx @@ -77,7 +77,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo imgOrigin[0] = 0.001; imgOrigin[1] = -0.002; - typename MovingImageType::Pointer imgMoving = MovingImageType::New(); + auto imgMoving = MovingImageType::New(); imgMoving->SetLargestPossibleRegion(region); imgMoving->SetBufferedRegion(region); imgMoving->SetRequestedRegion(region); @@ -85,7 +85,7 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo imgMoving->SetSpacing(imgSpacing); imgMoving->SetOrigin(imgOrigin); - typename FixedImageType::Pointer imgFixed = FixedImageType::New(); + auto imgFixed = FixedImageType::New(); imgFixed->SetLargestPossibleRegion(region); imgFixed->SetBufferedRegion(region); imgFixed->SetRequestedRegion(region); @@ -141,12 +141,12 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo } // Setup a fixed image mask for the image - typename MovingImageType::Pointer imgMovingMask = MovingImageType::New(); + auto imgMovingMask = MovingImageType::New(); imgMovingMask->CopyInformation(imgMoving); imgMovingMask->SetRegions(region); imgMovingMask->Allocate(true); // initialize buffer to zero - typename FixedImageType::Pointer imgFixedMask = FixedImageType::New(); + auto imgFixedMask = FixedImageType::New(); imgFixedMask->CopyInformation(imgFixed); imgFixedMask->SetRegions(region); imgFixedMask->Allocate(true); // initialize buffer to zero @@ -192,14 +192,14 @@ TestMattesMetricWithAffineTransform(TInterpolator * const interpolator, const bo using TransformType = itk::AffineTransform; using ParametersType = typename TransformType::ParametersType; - typename TransformType::Pointer transformer = TransformType::New(); + auto transformer = TransformType::New(); //------------------------------------------------------------ // Set up the metric //------------------------------------------------------------ using MetricType = itk::MattesMutualInformationImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // Sanity check before metric is run, these should be nullptr; if (metric->GetJointPDFDerivatives().IsNotNull()) @@ -452,7 +452,7 @@ itkMattesMutualInformationImageToImageMetricv4Test(int, char *[]) // Test metric with a linear interpolator using LinearInterpolatorType = itk::LinearInterpolateImageFunction; - LinearInterpolatorType::Pointer linearInterpolator = LinearInterpolatorType::New(); + auto linearInterpolator = LinearInterpolatorType::New(); std::cout << "Test metric with a linear interpolator." << std::endl; bool useSampling = false; @@ -475,7 +475,7 @@ itkMattesMutualInformationImageToImageMetricv4Test(int, char *[]) // Test metric with a BSpline interpolator using BSplineInterpolatorType = itk::BSplineInterpolateImageFunction; - BSplineInterpolatorType::Pointer bSplineInterpolator = BSplineInterpolatorType::New(); + auto bSplineInterpolator = BSplineInterpolatorType::New(); bSplineInterpolator->SetSplineOrder(3); useSampling = false; diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx index 7e93679d872..dc6eaa2aced 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx @@ -53,14 +53,14 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest(int, char ** const) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -100,8 +100,8 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest(int, char ** const) using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); @@ -110,7 +110,7 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest(int, char ** const) using MetricTraitsType = itk::VectorImageToImageMetricTraitsv4; using MetricType = itk::MeanSquaresImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx index 750647fee3c..16dfdd4202c 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4OnVectorTest2.cxx @@ -49,14 +49,14 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest2Run(typename TMetric::MeasureType direction.SetIdentity(); /* Create simple test images. */ - typename ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - typename ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -90,13 +90,13 @@ itkMeanSquaresImageToImageMetricv4OnVectorTest2Run(typename TMetric::MeasureType using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - typename FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - typename MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); - typename TMetric::Pointer metric = TMetric::New(); + auto metric = TMetric::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx index 08dca29ad67..1f34418e326 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest.cxx @@ -77,8 +77,8 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -91,25 +91,25 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -129,13 +129,13 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::MeanSquaresImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); using PointType = PointSetType::PointType; PointSetType::Pointer pset(PointSetType::New()); @@ -180,7 +180,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -248,12 +248,12 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[3]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string path = itksys::SystemTools::GetFilenamePath(outfilename); - std::string defout = path + std::string("/") + name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[3]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string path = itksys::SystemTools::GetFilenamePath(outfilename); + std::string defout = path + std::string("/") + name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -263,8 +263,8 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx index 1b4fb81f017..0df7684123e 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4RegistrationTest2.cxx @@ -97,8 +97,8 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -110,27 +110,27 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // the metric using MetricType = itk::MeanSquaresImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); using PointType = PointSetType::PointType; PointSetType::Pointer pset(PointSetType::New()); @@ -177,7 +177,7 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) // optimizer using OptimizerType = itk::LBFGSOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -213,8 +213,8 @@ itkMeanSquaresImageToImageMetricv4RegistrationTest2(int argc, char * argv[]) using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx index aa43095edb4..872132c5cac 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4SpeedTest.cxx @@ -54,14 +54,14 @@ itkMeanSquaresImageToImageMetricv4SpeedTest(int argc, char * argv[]) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -95,8 +95,8 @@ itkMeanSquaresImageToImageMetricv4SpeedTest(int argc, char * argv[]) using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); @@ -104,7 +104,7 @@ itkMeanSquaresImageToImageMetricv4SpeedTest(int argc, char * argv[]) /* The metric */ using MetricType = itk::MeanSquaresImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx index 7fe0d726ff7..23d1e614398 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4Test.cxx @@ -50,14 +50,14 @@ itkMeanSquaresImageToImageMetricv4Test(int, char ** const) direction.SetIdentity(); /* Create simple test images. */ - ImageType::Pointer fixedImage = ImageType::New(); + auto fixedImage = ImageType::New(); fixedImage->SetRegions(region); fixedImage->SetSpacing(spacing); fixedImage->SetOrigin(origin); fixedImage->SetDirection(direction); fixedImage->Allocate(); - ImageType::Pointer movingImage = ImageType::New(); + auto movingImage = ImageType::New(); movingImage->SetRegions(region); movingImage->SetSpacing(spacing); movingImage->SetOrigin(origin); @@ -91,8 +91,8 @@ itkMeanSquaresImageToImageMetricv4Test(int, char ** const) using FixedTransformType = itk::TranslationTransform; using MovingTransformType = itk::TranslationTransform; - FixedTransformType::Pointer fixedTransform = FixedTransformType::New(); - MovingTransformType::Pointer movingTransform = MovingTransformType::New(); + auto fixedTransform = FixedTransformType::New(); + auto movingTransform = MovingTransformType::New(); fixedTransform->SetIdentity(); movingTransform->SetIdentity(); @@ -100,7 +100,7 @@ itkMeanSquaresImageToImageMetricv4Test(int, char ** const) /* The metric */ using MetricType = itk::MeanSquaresImageToImageMetricv4; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); /* Assign images and transforms. * By not setting a virtual domain image or virtual domain settings, diff --git a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx index 56a4fa9f7f9..9015df9de20 100644 --- a/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMeanSquaresImageToImageMetricv4VectorRegistrationTest.cxx @@ -82,8 +82,8 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -96,24 +96,24 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = DisplacementTransformType::DisplacementFieldType; - DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -133,7 +133,7 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric @@ -143,7 +143,7 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] using MetricType = itk::MeanSquaresImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); using PointType = PointSetType::PointType; PointSetType::Pointer pset(PointSetType::New()); @@ -191,7 +191,7 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] // std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfAffineIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -282,12 +282,12 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[3]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string path = itksys::SystemTools::GetFilenamePath(outfilename); - std::string defout = path + std::string("/") + name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[3]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string path = itksys::SystemTools::GetFilenamePath(outfilename); + std::string defout = path + std::string("/") + name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -297,8 +297,8 @@ itkMeanSquaresImageToImageMetricv4VectorRegistrationTest(int argc, char * argv[] using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx index 86d8160724e..6468cfdc178 100644 --- a/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMetricImageGradientTest.cxx @@ -225,7 +225,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, direction.SetIdentity(); // Create simple test images. - typename ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); image->SetRegions(region); image->SetSpacing(spacing); image->SetOrigin(origin); @@ -258,7 +258,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, // Create a "moving" image using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); resample->SetTransform(transform); resample->SetInput(image); resample->SetOutputParametersFromImage(image); @@ -282,7 +282,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); // moving writer->SetFileName(outputPath + "_moving.nii.gz"); writer->SetInput(movingImage); @@ -305,7 +305,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, // compute Dm directly from graient image using CentralDifferenceCalculatorType = itk::CentralDifferenceImageFunction; - typename CentralDifferenceCalculatorType::Pointer movingCalculator = CentralDifferenceCalculatorType::New(); + auto movingCalculator = CentralDifferenceCalculatorType::New(); movingCalculator->UseImageDirectionOn(); movingCalculator->SetInputImage(movingImage); mappedMovingImageGradientGroundtruth = movingCalculator->Evaluate(mappedPoint); @@ -313,7 +313,7 @@ itkMetricImageGradientTestRunTest(unsigned int imageSize, // compute Dm using Metricv4 routine typename ImageType::PointType mappedMovingPoint; typename ImageType::PixelType mappedMovingPixelValue; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetFixedImage(image); metric->SetMovingImage(movingImage); @@ -411,7 +411,7 @@ itkMetricImageGradientTest(int argc, char * argv[]) using TransformType = itk::AffineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetIdentity(); transform->Rotate2D(itk::Math::pi * rotationDegrees / 180); @@ -431,7 +431,7 @@ itkMetricImageGradientTest(int argc, char * argv[]) { // Transform using TransformType = itk::AffineTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); transform->SetIdentity(); double angleRad = itk::Math::pi * rotationDegrees / 180; // transform->SetRotation( angleRad, angleRad, angleRad ); diff --git a/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx index 00c1711b840..c5fb2cdabcb 100644 --- a/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMultiGradientImageToImageMetricv4RegistrationTest.cxx @@ -72,8 +72,8 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); movingImageReader->SetFileName(argv[2]); @@ -86,32 +86,32 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::MattesMutualInformationImageToImageMetricv4; using MetricType2 = itk::MeanSquaresImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); metric->SetNumberOfHistogramBins(20); - MetricType2::Pointer metric2 = MetricType2::New(); + auto metric2 = MetricType2::New(); if (false) { @@ -167,7 +167,7 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) shiftScaleEstimator->SetMetric(metric); shiftScaleEstimator->EstimateScales(scales); using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetScales(scales); /** Set just 1 iteration for the sub-optimizer */ @@ -182,7 +182,7 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) RegistrationParameterScalesFromShiftType2::New(); shiftScaleEstimator2->SetMetric(metric2); shiftScaleEstimator2->EstimateScales(scales); - OptimizerType::Pointer optimizer2 = OptimizerType::New(); + auto optimizer2 = OptimizerType::New(); optimizer2->SetMetric(metric2); optimizer2->SetScales(scales); /** Set just 1 iteration for the sub-optimizer */ @@ -192,7 +192,7 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) std::cout << "now declare optimizer to combine the 2 sub-optimizers " << std::endl; using MOptimizerType = itk::MultiGradientOptimizerv4; - MOptimizerType::Pointer MOptimizer = MOptimizerType::New(); + auto MOptimizer = MOptimizerType::New(); MOptimizer->GetOptimizersList().push_back(optimizer); MOptimizer->GetOptimizersList().push_back(optimizer2); std::cout << "set the # of iterations " << std::endl; @@ -216,8 +216,8 @@ itkMultiGradientImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[3]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx index 990d9b7a799..4e87df771ac 100644 --- a/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkMultiStartImageToImageMetricv4RegistrationTest.cxx @@ -78,22 +78,22 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); fixedImageReader->SetFileName(argv[1]); fixedImageReader->Update(); - MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); movingImageReader->SetFileName(argv[2]); movingImageReader->Update(); // get the images using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer fixedcaster = CastFilterType::New(); + auto fixedcaster = CastFilterType::New(); fixedcaster->SetInput(fixedImageReader->GetOutput()); // resample->GetOutput() fixedcaster->Update(); InternalImageType::Pointer fixedImage = fixedcaster->GetOutput(); // get the images - CastFilterType::Pointer movingcaster = CastFilterType::New(); + auto movingcaster = CastFilterType::New(); movingcaster->SetInput(movingImageReader->GetOutput()); movingcaster->Update(); InternalImageType::Pointer movingImage = movingcaster->GetOutput(); @@ -117,7 +117,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) foffset[0] = fpoint[0]; foffset[1] = fpoint[1]; - AffineTransformType::Pointer affineTransformGroundTruth = AffineTransformType::New(); + auto affineTransformGroundTruth = AffineTransformType::New(); affineTransformGroundTruth->SetIdentity(); affineTransformGroundTruth->Translate(moffset); affineTransformGroundTruth->Rotate2D(itk::Math::pi); @@ -125,7 +125,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); resample->SetTransform(affineTransformGroundTruth); resample->SetInput(movingImage); resample->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -135,19 +135,19 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) resample->SetDefaultPixelValue(0); resample->Update(); - AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params prior to optimization " << affineTransform->GetParameters() << std::endl; // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric using MetricType = itk::CorrelationImageToImageMetricv4; using PointSetType = MetricType::FixedSampledPointSetType; - MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); // metric->SetNumberOfHistogramBins(20); using PointType = PointSetType::PointType; PointSetType::Pointer pset(PointSetType::New()); @@ -184,7 +184,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) shiftScaleEstimator->SetMetric(metric); using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -193,13 +193,13 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) optimizer->SetMinimumConvergenceValue(-1.e-5); using MOptimizerType = itk::MultiStartOptimizerv4; - MOptimizerType::Pointer MOptimizer = MOptimizerType::New(); + auto MOptimizer = MOptimizerType::New(); MOptimizerType::ParametersListType parametersList = MOptimizer->GetParametersList(); float rotplus = 10; // for ( float i = 180; i <= 180; i+=rotplus ) for (float i = 0; i < 360; i += rotplus) { - AffineTransformType::Pointer aff = AffineTransformType::New(); + auto aff = AffineTransformType::New(); aff->SetIdentity(); float rad = (float)i * itk::Math::pi / 180.0; aff->Translate(moffset); @@ -224,7 +224,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) << MOptimizer->GetBestParametersIndex() << std::endl; std::cout << " Ground truth parameters: " << affineTransformGroundTruth->GetParameters() << std::endl; // warp the image with the displacement field - ResampleFilterType::Pointer resampleout = ResampleFilterType::New(); + auto resampleout = ResampleFilterType::New(); resampleout->SetTransform(affineTransform); resampleout->SetInput(movingImage); if (rotateinput) @@ -237,7 +237,7 @@ itkMultiStartImageToImageMetricv4RegistrationTest(int argc, char * argv[]) resampleout->Update(); // write the warped image into a file using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(resampleout->GetOutput()); writer->Update(); diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx index 0d5b8f92f70..179bb75e998 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4RegistrationTest.cxx @@ -101,7 +101,7 @@ ObjectToObjectMultiMetricv4RegistrationTestCreateImages(typename TImage::Pointer typename TImage::DirectionType direction; direction.Fill(itk::NumericTraits::OneValue()); - typename GaussianImageSourceType::Pointer fixedImageSource = GaussianImageSourceType::New(); + auto fixedImageSource = GaussianImageSourceType::New(); fixedImageSource->SetSize(size); fixedImageSource->SetOrigin(origin); @@ -127,7 +127,7 @@ ObjectToObjectMultiMetricv4RegistrationTestCreateImages(typename TImage::Pointer // shift the fixed image to get the moving image using CyclicShiftFilterType = itk::CyclicShiftImageFilter; - typename CyclicShiftFilterType::Pointer shiftFilter = CyclicShiftFilterType::New(); + auto shiftFilter = CyclicShiftFilterType::New(); typename CyclicShiftFilterType::OffsetValueType maxImageShift = boundary - 1; imageShift.Fill(maxImageShift); imageShift[0] = maxImageShift / 2; @@ -162,7 +162,7 @@ ObjectToObjectMultiMetricv4RegistrationTestRun(typename TMetric::Pointer & // optimizer // using OptimizerType = itk::GradientDescentOptimizerv4; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); @@ -172,7 +172,7 @@ ObjectToObjectMultiMetricv4RegistrationTestRun(typename TMetric::Pointer & optimizer->SetDoEstimateLearningRateAtEachIteration(!estimateStepOnce); using CommandType = itkObjectToObjectMultiMetricv4RegistrationTestCommandIterationUpdate; - typename CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); // optimizer->AddObserver( itk::IterationEvent(), observer ); optimizer->StartOptimization(); @@ -211,7 +211,7 @@ itkObjectToObjectMultiMetricv4RegistrationTest(int argc, char * argv[]) // create an affine transform using TranslationTransformType = itk::TranslationTransform; - TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); // create images @@ -221,7 +221,7 @@ itkObjectToObjectMultiMetricv4RegistrationTest(int argc, char * argv[]) ObjectToObjectMultiMetricv4RegistrationTestCreateImages(fixedImage, movingImage, imageShift); using CorrelationMetricType = itk::CorrelationImageToImageMetricv4; - CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); correlationMetric->SetFixedImage(fixedImage); correlationMetric->SetMovingImage(movingImage); correlationMetric->SetMovingTransform(translationTransform); @@ -237,13 +237,13 @@ itkObjectToObjectMultiMetricv4RegistrationTest(int argc, char * argv[]) correlationMetric, numberOfIterations, singleValueResult, singleDerivativeResult, 1.0, true); std::cout << "*** multi-variate metric: " << std::endl; - CorrelationMetricType::Pointer metric2 = CorrelationMetricType::New(); + auto metric2 = CorrelationMetricType::New(); metric2->SetFixedImage(fixedImage); metric2->SetMovingImage(movingImage); metric2->SetMovingTransform(translationTransform); using MultiMetricType = itk::ObjectToObjectMultiMetricv4; - MultiMetricType::Pointer multiMetric = MultiMetricType::New(); + auto multiMetric = MultiMetricType::New(); multiMetric->AddMetric(correlationMetric); multiMetric->AddMetric(metric2); multiMetric->AddMetric(metric2); @@ -326,12 +326,12 @@ itkObjectToObjectMultiMetricv4RegistrationTest(int argc, char * argv[]) // Test with two different metric types // using MeanSquaresMetricType = itk::MeanSquaresImageToImageMetricv4; - MeanSquaresMetricType::Pointer meanSquaresMetric = MeanSquaresMetricType::New(); + auto meanSquaresMetric = MeanSquaresMetricType::New(); meanSquaresMetric->SetFixedImage(fixedImage); meanSquaresMetric->SetMovingImage(movingImage); meanSquaresMetric->SetMovingTransform(translationTransform); - MultiMetricType::Pointer multiMetric2 = MultiMetricType::New(); + auto multiMetric2 = MultiMetricType::New(); multiMetric2->AddMetric(correlationMetric); multiMetric2->AddMetric(meanSquaresMetric); multiMetric2->Initialize(); diff --git a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx index 14e08cc7cf6..2408f2fbc5f 100644 --- a/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx +++ b/Modules/Registration/Metricsv4/test/itkObjectToObjectMultiMetricv4Test.cxx @@ -215,7 +215,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) FixedImageType::SizeValueType fixedImageSize[] = { 100, 100 }; FixedImageType::SpacingValueType fixedImageSpacing[] = { 1.0f, 1.0f }; FixedImageType::PointValueType fixedImageOrigin[] = { 0.0f, 0.0f }; - FixedImageSourceType::Pointer fixedImageSource = FixedImageSourceType::New(); + auto fixedImageSource = FixedImageSourceType::New(); fixedImageSource->SetSize(fixedImageSize); fixedImageSource->SetOrigin(fixedImageOrigin); @@ -226,7 +226,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) FixedImageType::Pointer fixedImage = fixedImageSource->GetOutput(); using ShiftScaleFilterType = itk::ShiftScaleImageFilter; - ShiftScaleFilterType::Pointer shiftFilter = ShiftScaleFilterType::New(); + auto shiftFilter = ShiftScaleFilterType::New(); shiftFilter->SetInput(fixedImage); shiftFilter->SetShift(2.0); shiftFilter->Update(); @@ -234,7 +234,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) // Set up the metric. using MultiMetricType = ObjectToObjectMultiMetricv4TestMultiMetricType; - MultiMetricType::Pointer multiVariateMetric = MultiMetricType::New(); + auto multiVariateMetric = MultiMetricType::New(); // Instantiate and Add metrics to the queue using JointHistorgramMetrictype = @@ -244,10 +244,10 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) itk::MattesMutualInformationImageToImageMetricv4; using ANTSNCMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - MeanSquaresMetricType::Pointer m1 = MeanSquaresMetricType::New(); - MattesMutualInformationMetricType::Pointer m2 = MattesMutualInformationMetricType::New(); - JointHistorgramMetrictype::Pointer m3 = JointHistorgramMetrictype::New(); - ANTSNCMetricType::Pointer m4 = ANTSNCMetricType::New(); + auto m1 = MeanSquaresMetricType::New(); + auto m2 = MattesMutualInformationMetricType::New(); + auto m3 = JointHistorgramMetrictype::New(); + auto m4 = ANTSNCMetricType::New(); // Set up a transform using TransformType = itk::Transform; @@ -263,20 +263,20 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) VectorType zero; zero.Fill(0.0); - FieldType::Pointer field = FieldType::New(); + auto field = FieldType::New(); field->SetRegions(fixedImage->GetBufferedRegion()); field->SetSpacing(fixedImage->GetSpacing()); field->SetOrigin(fixedImage->GetOrigin()); field->Allocate(); field->FillBuffer(zero); - DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); displacementTransform->SetDisplacementField(field); transform = displacementTransform; } else { - TranslationTransformType::Pointer translationTransform = TranslationTransformType::New(); + auto translationTransform = TranslationTransformType::New(); translationTransform->SetIdentity(); transform = translationTransform; } @@ -360,14 +360,14 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) } std::cout << "*** Test with mismatched transforms *** " << std::endl; - TranslationTransformType::Pointer transform2 = TranslationTransformType::New(); + auto transform2 = TranslationTransformType::New(); m4->SetMovingTransform(transform2); ITK_TRY_EXPECT_EXCEPTION(multiVariateMetric->Initialize()); m4->SetMovingTransform(transform); std::cout << "*** Test with proper CompositeTransform ***" << std::endl; using CompositeTransformType = itk::CompositeTransform; - CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(transform2); compositeTransform->AddTransform(transform); compositeTransform->SetOnlyMostRecentTransformToOptimizeOn(); @@ -394,8 +394,8 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) // Test with adding point set metrics // using PointSetType = itk::PointSet; - PointSetType::Pointer fixedPoints = PointSetType::New(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); fixedPoints->Initialize(); movingPoints->Initialize(); @@ -412,8 +412,8 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) using ExpectationPointSetMetricType = itk::ExpectationBasedPointSetToPointSetMetricv4; using EuclideanPointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - ExpectationPointSetMetricType::Pointer expectationPointSetMetric = ExpectationPointSetMetricType::New(); - EuclideanPointSetMetricType::Pointer euclideanPointSetMetric = EuclideanPointSetMetricType::New(); + auto expectationPointSetMetric = ExpectationPointSetMetricType::New(); + auto euclideanPointSetMetric = EuclideanPointSetMetricType::New(); expectationPointSetMetric->SetFixedPointSet(fixedPoints); expectationPointSetMetric->SetMovingPointSet(movingPoints); @@ -444,7 +444,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) // Exercise basic operation with a scales estimator // using ScalesEstimatorMultiType = itk::RegistrationParameterScalesFromPhysicalShift; - ScalesEstimatorMultiType::Pointer shiftScaleEstimator = ScalesEstimatorMultiType::New(); + auto shiftScaleEstimator = ScalesEstimatorMultiType::New(); shiftScaleEstimator->SetMetric(multiVariateMetric); // Have to assign virtual domain sampling points when using a point set with scales estimator shiftScaleEstimator->SetVirtualDomainPointSet(expectationPointSetMetric->GetVirtualTransformedPointSet()); @@ -470,7 +470,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) step.Fill(itk::NumericTraits::OneValue()); using ScalesEstimatorMeanSquaresType = itk::RegistrationParameterScalesFromPhysicalShift; - ScalesEstimatorMeanSquaresType::Pointer singleShiftScaleEstimator = ScalesEstimatorMeanSquaresType::New(); + auto singleShiftScaleEstimator = ScalesEstimatorMeanSquaresType::New(); singleShiftScaleEstimator->SetMetric(m1); m1->Initialize(); singleShiftScaleEstimator->EstimateScales(singleScales); @@ -478,7 +478,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) singleStep = singleShiftScaleEstimator->EstimateStepScale(step); std::cout << "Single metric estimated stepScale: " << singleStep << std::endl; - MultiMetricType::Pointer multiSingleMetric = MultiMetricType::New(); + auto multiSingleMetric = MultiMetricType::New(); multiSingleMetric->AddMetric(m1); multiSingleMetric->Initialize(); shiftScaleEstimator->SetMetric(multiSingleMetric); @@ -487,7 +487,7 @@ itkObjectToObjectMultiMetricv4TestRun(bool useDisplacementTransform) multiSingleStep = shiftScaleEstimator->EstimateStepScale(step); std::cout << "multi-single estimated stepScale: " << multiSingleStep << std::endl; - MultiMetricType::Pointer multiDoubleMetric = MultiMetricType::New(); + auto multiDoubleMetric = MultiMetricType::New(); multiDoubleMetric->AddMetric(m1); multiDoubleMetric->AddMetric(m1); multiDoubleMetric->Initialize(); diff --git a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx index 1d6637fccdc..cdbf0d18d35 100644 --- a/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkDemonsRegistrationFunction.hxx @@ -49,7 +49,7 @@ DemonsRegistrationFunction::Demon m_Normalizer = 1.0; m_FixedImageGradientCalculator = GradientCalculatorType::New(); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = static_cast(interp.GetPointer()); diff --git a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx index f6da3d63204..bd7e04057af 100644 --- a/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkESMDemonsRegistrationFunction.hxx @@ -58,7 +58,7 @@ ESMDemonsRegistrationFunction::ES this->m_UseGradientType = GradientEnum::Symmetric; - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = itkDynamicCastInDebugMode(interp.GetPointer()); diff --git a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx index c94da2477ff..bcdcf4a2ea5 100644 --- a/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkFastSymmetricForcesDemonsRegistrationFunction.hxx @@ -48,7 +48,7 @@ FastSymmetricForcesDemonsRegistrationFunction(interp.GetPointer()); diff --git a/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFunction.hxx index ebcffaba13c..7b382e6d7fa 100644 --- a/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkLevelSetMotionRegistrationFunction.hxx @@ -46,7 +46,7 @@ LevelSetMotionRegistrationFunctionSetMovingImage(nullptr); this->SetFixedImage(nullptr); - typename DefaultInterpolatorType::Pointer interp = DefaultInterpolatorType::New(); + auto interp = DefaultInterpolatorType::New(); m_MovingImageInterpolator = static_cast(interp.GetPointer()); diff --git a/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.hxx b/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.hxx index 4254daa344f..142e691d232 100644 --- a/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.hxx +++ b/Modules/Registration/PDEDeformable/include/itkMultiResolutionPDEDeformableRegistration.hxx @@ -48,7 +48,7 @@ MultiResolutionPDEDeformableRegistrationRemoveRequiredInputName("Primary"); - typename DefaultRegistrationType::Pointer registrator = DefaultRegistrationType::New(); + auto registrator = DefaultRegistrationType::New(); m_RegistrationFilter = registrator.GetPointer(); m_MovingImagePyramid = MovingImagePyramidType::New(); @@ -380,7 +380,7 @@ MultiResolutionPDEDeformableRegistration; - typename GaussianFilterType::Pointer smoother = GaussianFilterType::New(); + auto smoother = GaussianFilterType::New(); for (unsigned int dim = 0; dim < DisplacementFieldType::ImageDimension; ++dim) { diff --git a/Modules/Registration/PDEDeformable/include/itkPDEDeformableRegistrationFilter.hxx b/Modules/Registration/PDEDeformable/include/itkPDEDeformableRegistrationFilter.hxx index 815ca1d1fc5..9ce56656e84 100644 --- a/Modules/Registration/PDEDeformable/include/itkPDEDeformableRegistrationFilter.hxx +++ b/Modules/Registration/PDEDeformable/include/itkPDEDeformableRegistrationFilter.hxx @@ -343,8 +343,8 @@ PDEDeformableRegistrationFilter:: using OperatorType = GaussianOperator; using SmootherType = VectorNeighborhoodOperatorImageFilter; - auto * oper = new OperatorType; - typename SmootherType::Pointer smoother = SmootherType::New(); + auto * oper = new OperatorType; + auto smoother = SmootherType::New(); using PixelContainerPointer = typename DisplacementFieldType::PixelContainerPointer; PixelContainerPointer swapPtr; diff --git a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx index 7d000aef19b..16728c8f027 100644 --- a/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx +++ b/Modules/Registration/PDEDeformable/include/itkSymmetricForcesDemonsRegistrationFunction.hxx @@ -45,7 +45,7 @@ SymmetricForcesDemonsRegistrationFunction(interp.GetPointer()); diff --git a/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx index 8357b18bc77..763fb84fb03 100644 --- a/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkCurvatureRegistrationFilterTest.cxx @@ -128,9 +128,9 @@ itkCurvatureRegistrationFilterTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -170,7 +170,7 @@ itkCurvatureRegistrationFilterTest(int, char *[]) std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::CurvatureRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(initField); registrator->SetMovingImage(moving); @@ -197,11 +197,11 @@ itkCurvatureRegistrationFilterTest(int, char *[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); @@ -242,7 +242,7 @@ itkCurvatureRegistrationFilterTest(int, char *[]) std::cout << "Test failed - too many pixels different." << std::endl; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(warper->GetOutput()); writer->SetFileName("warped.png"); writer->Update(); diff --git a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx index d94e30ddeca..37b1a02607d 100644 --- a/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDemonsRegistrationFilterTest.cxx @@ -129,9 +129,9 @@ itkDemonsRegistrationFilterTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -168,7 +168,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(initField); caster->InPlaceOff(); @@ -176,7 +176,7 @@ itkDemonsRegistrationFilterTest(int, char *[]) std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::DemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(caster->GetOutput()); registrator->SetMovingImage(moving); @@ -222,11 +222,11 @@ itkDemonsRegistrationFilterTest(int, char *[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); diff --git a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx index 5308b82c08a..cebeb452aec 100644 --- a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest.cxx @@ -143,9 +143,9 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) direction.SetIdentity(); direction(1, 1) = -1; - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -185,7 +185,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(initField); caster->InPlaceOff(); @@ -194,7 +194,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) using RegistrationType = itk::DiffeomorphicDemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(caster->GetOutput()); @@ -279,11 +279,11 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); @@ -318,9 +318,9 @@ itkDiffeomorphicDemonsRegistrationFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer1 = WriterType::New(); - WriterType::Pointer writer2 = WriterType::New(); - WriterType::Pointer writer3 = WriterType::New(); + auto writer1 = WriterType::New(); + auto writer2 = WriterType::New(); + auto writer3 = WriterType::New(); writer1->SetFileName("fixedImage.mha"); writer2->SetFileName("movingImage.mha"); diff --git a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx index 8e94bd9a000..1e6d8e45e67 100644 --- a/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx +++ b/Modules/Registration/PDEDeformable/test/itkDiffeomorphicDemonsRegistrationFilterTest2.cxx @@ -76,13 +76,13 @@ itkDiffeomorphicDemonsRegistrationFilterTest2(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer fixedReader = ReaderType::New(); - ReaderType::Pointer movingReader = ReaderType::New(); + auto fixedReader = ReaderType::New(); + auto movingReader = ReaderType::New(); fixedReader->SetFileName(argv[1]); movingReader->SetFileName(argv[2]); - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[3]); @@ -95,7 +95,7 @@ itkDiffeomorphicDemonsRegistrationFilterTest2(int argc, char * argv[]) using RegistrationType = itk::DiffeomorphicDemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetMovingImage(movingReader->GetOutput()); registrator->SetFixedImage(fixedReader->GetOutput()); @@ -179,11 +179,11 @@ itkDiffeomorphicDemonsRegistrationFilterTest2(int argc, char * argv[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); const ImageType * fixed = fixedReader->GetOutput(); const ImageType * moving = movingReader->GetOutput(); diff --git a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx index cdbaf467a79..5a9cefd794c 100644 --- a/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkFastSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -127,9 +127,9 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -166,7 +166,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(initField); caster->InPlaceOff(); @@ -174,7 +174,7 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::FastSymmetricForcesDemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(caster->GetOutput()); registrator->SetMovingImage(moving); @@ -214,11 +214,11 @@ itkFastSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); diff --git a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx index 3c29ba135cd..2ce56a15246 100644 --- a/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkLevelSetMotionRegistrationFilterTest.cxx @@ -93,7 +93,7 @@ FillWithCircle(typename TImage::Pointer & image, } using SmoothingFilterType = itk::SmoothingRecursiveGaussianImageFilter; - typename SmoothingFilterType::Pointer smoother = SmoothingFilterType::New(); + auto smoother = SmoothingFilterType::New(); smoother->SetInput(image); smoother->SetSigma(1.0); smoother->Update(); @@ -146,9 +146,9 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -185,14 +185,14 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) initField->FillBuffer(zeroVec); using CasterType = itk::CastImageFilter; - CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(initField); caster->InPlaceOff(); std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::LevelSetMotionRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(registrator, LevelSetMotionRegistrationFilter, PDEDeformableRegistrationFilter); @@ -256,11 +256,11 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) // Warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); warper->SetDisplacementField(registrator->GetOutput()); @@ -275,7 +275,7 @@ itkLevelSetMotionRegistrationFilterTest(int argc, char * argv[]) warper->Update(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); if (argc > 1) { diff --git a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx index 798a8a85a80..3939ff79a42 100644 --- a/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkMultiResolutionPDEDeformableRegistrationTest.cxx @@ -182,9 +182,9 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) spacing.Fill(1.0); spacing[1] = 1.2; - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -231,7 +231,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) using RegistrationType = itk::MultiResolutionPDEDeformableRegistration; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetMovingImage(moving); registrator->SetFixedImage(fixed); @@ -256,19 +256,19 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) using CommandType = itk::SimpleMemberCommand; ShowProgressPDEObject progressWatch(registrator); - CommandType::Pointer command = CommandType::New(); + auto command = CommandType::New(); command->SetCallbackFunction(&progressWatch, &ShowProgressPDEObject::ShowIteration); registrator->AddObserver(itk::IterationEvent(), command); PDERegistrationController controller(registrator); using ControllerType = itk::SimpleMemberCommand>; - ControllerType::Pointer controllerCommand = ControllerType::New(); + auto controllerCommand = ControllerType::New(); controllerCommand->SetCallbackFunction(&controller, &PDERegistrationController::ShowProgress); registrator->AddObserver(itk::ProgressEvent(), controllerCommand); ShowProgressPDEObject innerWatch(registrator->GetModifiableRegistrationFilter()); innerWatch.m_Prefix = " "; - CommandType::Pointer innerCommand = CommandType::New(); + auto innerCommand = CommandType::New(); innerCommand->SetCallbackFunction(&innerWatch, &ShowProgressPDEObject::ShowProgress); registrator->GetRegistrationFilter()->AddObserver(itk::ProgressEvent(), innerCommand); @@ -282,11 +282,11 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) std::cout << "Warp moving image" << std::endl; using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); @@ -298,7 +298,7 @@ itkMultiResolutionPDEDeformableRegistrationTest(int argc, char * argv[]) warper->Update(); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(warper->GetOutput()); writer->SetFileName(argv[1]); writer->Update(); diff --git a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx index 1a7744ee626..b3c965c5b04 100644 --- a/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx +++ b/Modules/Registration/PDEDeformable/test/itkSymmetricForcesDemonsRegistrationFilterTest.cxx @@ -119,9 +119,9 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) region.SetSize(size); region.SetIndex(index); - ImageType::Pointer moving = ImageType::New(); - ImageType::Pointer fixed = ImageType::New(); - FieldType::Pointer initField = FieldType::New(); + auto moving = ImageType::New(); + auto fixed = ImageType::New(); + auto initField = FieldType::New(); moving->SetLargestPossibleRegion(region); moving->SetBufferedRegion(region); @@ -161,7 +161,7 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) std::cout << "Run registration and warp moving" << std::endl; using RegistrationType = itk::SymmetricForcesDemonsRegistrationFilter; - RegistrationType::Pointer registrator = RegistrationType::New(); + auto registrator = RegistrationType::New(); registrator->SetInitialDisplacementField(initField); registrator->SetMovingImage(moving); @@ -198,11 +198,11 @@ itkSymmetricForcesDemonsRegistrationFilterTest(int, char *[]) // warp moving image using WarperType = itk::WarpImageFilter; - WarperType::Pointer warper = WarperType::New(); + auto warper = WarperType::New(); using CoordRepType = WarperType::CoordRepType; using InterpolatorType = itk::NearestNeighborInterpolateImageFunction; - InterpolatorType::Pointer interpolator = InterpolatorType::New(); + auto interpolator = InterpolatorType::New(); warper->SetInput(moving); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkBSplineSyNImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkBSplineSyNImageRegistrationMethod.hxx index 92adc22d10b..908d73d6a94 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkBSplineSyNImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkBSplineSyNImageRegistrationMethod.hxx @@ -93,14 +93,14 @@ BSplineSyNImageRegistrationMethod; - typename ConvergenceMonitoringType::Pointer convergenceMonitoring = ConvergenceMonitoringType::New(); + auto convergenceMonitoring = ConvergenceMonitoringType::New(); convergenceMonitoring->SetWindowSize(this->m_ConvergenceWindowSize); IterationReporter reporter(this, 0, 1); while (this->m_CurrentIteration++ < this->m_NumberOfIterationsPerLevel[this->m_CurrentLevel] && !this->m_IsConverged) { - typename CompositeTransformType::Pointer fixedComposite = CompositeTransformType::New(); + auto fixedComposite = CompositeTransformType::New(); if (fixedInitialTransform != nullptr) { fixedComposite->AddTransform(fixedInitialTransform); @@ -110,7 +110,7 @@ BSplineSyNImageRegistrationMethodFlattenTransformQueue(); fixedComposite->SetOnlyMostRecentTransformToOptimizeOn(); - typename CompositeTransformType::Pointer movingComposite = CompositeTransformType::New(); + auto movingComposite = CompositeTransformType::New(); movingComposite->AddTransform(this->m_CompositeTransform); movingComposite->AddTransform(this->m_MovingToMiddleTransform->GetInverseTransform()); movingComposite->FlattenTransformQueue(); @@ -156,7 +156,7 @@ BSplineSyNImageRegistrationMethod; - typename ComposerType::Pointer fixedComposer = ComposerType::New(); + auto fixedComposer = ComposerType::New(); fixedComposer->SetDisplacementField(fixedToMiddleSmoothUpdateField); fixedComposer->SetWarpingField(this->m_FixedToMiddleTransform->GetDisplacementField()); fixedComposer->Update(); @@ -167,7 +167,7 @@ BSplineSyNImageRegistrationMethodSetDisplacementField(movingToMiddleSmoothUpdateField); movingComposer->SetWarpingField(this->m_MovingToMiddleTransform->GetDisplacementField()); movingComposer->Update(); @@ -282,7 +282,7 @@ typename BSplineSyNImageRegistrationMethodInitialize(); if (fixedPointSets[0]->GetNumberOfPoints() > 0) @@ -334,7 +334,7 @@ typename BSplineSyNImageRegistrationMethod; - typename MaskResamplerType::Pointer fixedMaskResampler = MaskResamplerType::New(); + auto fixedMaskResampler = MaskResamplerType::New(); fixedMaskResampler->SetTransform(fixedTransform); fixedMaskResampler->SetInput( dynamic_cast(const_cast(fixedImageMasks[0].GetPointer())) @@ -373,7 +373,7 @@ typename BSplineSyNImageRegistrationMethod; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(field); duplicator->Update(); @@ -387,7 +387,7 @@ typename BSplineSyNImageRegistrationMethodGetNumberOfPoints() > 0) { diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx index d409cc22b4b..1f79a88748b 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkImageRegistrationMethodv4.hxx @@ -73,7 +73,7 @@ ImageRegistrationMethodv4; - typename DefaultMetricType::Pointer mutualInformationMetric = DefaultMetricType::New(); + auto mutualInformationMetric = DefaultMetricType::New(); mutualInformationMetric->SetNumberOfHistogramBins(20); mutualInformationMetric->SetUseMovingImageGradientFilter(false); mutualInformationMetric->SetUseFixedImageGradientFilter(false); @@ -81,12 +81,12 @@ ImageRegistrationMethodv4m_Metric = mutualInformationMetric; using DefaultScalesEstimatorType = RegistrationParameterScalesFromPhysicalShift; - typename DefaultScalesEstimatorType::Pointer scalesEstimator = DefaultScalesEstimatorType::New(); + auto scalesEstimator = DefaultScalesEstimatorType::New(); scalesEstimator->SetMetric(mutualInformationMetric); scalesEstimator->SetTransformForward(true); using DefaultOptimizerType = GradientDescentOptimizerv4Template; - typename DefaultOptimizerType::Pointer optimizer = DefaultOptimizerType::New(); + auto optimizer = DefaultOptimizerType::New(); optimizer->SetLearningRate(1.0); optimizer->SetNumberOfIterations(1000); optimizer->SetScalesEstimator(scalesEstimator); @@ -475,7 +475,7 @@ ImageRegistrationMethodv4m_VirtualDomainImage.IsNotNull()) { - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(this->m_ShrinkFactorsPerLevel[level]); shrinkFilter->SetInput(this->m_VirtualDomainImage); @@ -496,7 +496,7 @@ ImageRegistrationMethodv4; - typename IdentityTransformType::Pointer defaultFixedInitialTransform = IdentityTransformType::New(); + auto defaultFixedInitialTransform = IdentityTransformType::New(); multiMetric->SetFixedTransform(defaultFixedInitialTransform); } multiMetric->SetMovingTransform(this->m_CompositeTransform); @@ -529,7 +529,7 @@ ImageRegistrationMethodv4; - typename CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(currentLevelVirtualDomainImage); caster->Update(); @@ -549,7 +549,7 @@ ImageRegistrationMethodv4; - typename IdentityTransformType::Pointer defaultFixedInitialTransform = IdentityTransformType::New(); + auto defaultFixedInitialTransform = IdentityTransformType::New(); imageMetric->SetFixedTransform(defaultFixedInitialTransform); } imageMetric->SetMovingTransform(this->m_CompositeTransform); @@ -570,7 +570,7 @@ ImageRegistrationMethodv4; - typename IdentityTransformType::Pointer defaultFixedInitialTransform = IdentityTransformType::New(); + auto defaultFixedInitialTransform = IdentityTransformType::New(); pointSetMetric->SetFixedTransform(defaultFixedInitialTransform); } pointSetMetric->SetMovingTransform(this->m_CompositeTransform); @@ -580,7 +580,7 @@ ImageRegistrationMethodv4; - typename CasterType::Pointer caster = CasterType::New(); + auto caster = CasterType::New(); caster->SetInput(currentLevelVirtualDomainImage); caster->Update(); @@ -968,13 +968,13 @@ ImageRegistrationMethodv4Initialize(); using SamplePointType = typename MetricSamplePointSetType::PointType; using RandomizerType = Statistics::MersenneTwisterRandomVariateGenerator; - typename RandomizerType::Pointer randomizer = RandomizerType::New(); + auto randomizer = RandomizerType::New(); if (m_ReseedIterator) { randomizer->SetSeed(); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx index 346446de6ee..4631d98f991 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkSyNImageRegistrationMethod.hxx @@ -75,13 +75,13 @@ SyNImageRegistrationMethodCopyInformation(virtualDomainImage); fixedDisplacementField->SetRegions(virtualDomainImage->GetBufferedRegion()); fixedDisplacementField->Allocate(); fixedDisplacementField->FillBuffer(zeroVector); - typename DisplacementFieldType::Pointer fixedInverseDisplacementField = DisplacementFieldType::New(); + auto fixedInverseDisplacementField = DisplacementFieldType::New(); fixedInverseDisplacementField->CopyInformation(virtualDomainImage); fixedInverseDisplacementField->SetRegions(virtualDomainImage->GetBufferedRegion()); fixedInverseDisplacementField->Allocate(); @@ -90,13 +90,13 @@ SyNImageRegistrationMethodm_FixedToMiddleTransform->SetDisplacementField(fixedDisplacementField); this->m_FixedToMiddleTransform->SetInverseDisplacementField(fixedInverseDisplacementField); - typename DisplacementFieldType::Pointer movingDisplacementField = DisplacementFieldType::New(); + auto movingDisplacementField = DisplacementFieldType::New(); movingDisplacementField->CopyInformation(virtualDomainImage); movingDisplacementField->SetRegions(virtualDomainImage->GetBufferedRegion()); movingDisplacementField->Allocate(); movingDisplacementField->FillBuffer(zeroVector); - typename DisplacementFieldType::Pointer movingInverseDisplacementField = DisplacementFieldType::New(); + auto movingInverseDisplacementField = DisplacementFieldType::New(); movingInverseDisplacementField->CopyInformation(virtualDomainImage); movingInverseDisplacementField->SetRegions(virtualDomainImage->GetBufferedRegion()); movingInverseDisplacementField->Allocate(); @@ -150,14 +150,14 @@ SyNImageRegistrationMethod; - typename ConvergenceMonitoringType::Pointer convergenceMonitoring = ConvergenceMonitoringType::New(); + auto convergenceMonitoring = ConvergenceMonitoringType::New(); convergenceMonitoring->SetWindowSize(this->m_ConvergenceWindowSize); IterationReporter reporter(this, 0, 1); while (this->m_CurrentIteration++ < this->m_NumberOfIterationsPerLevel[this->m_CurrentLevel] && !this->m_IsConverged) { - typename CompositeTransformType::Pointer fixedComposite = CompositeTransformType::New(); + auto fixedComposite = CompositeTransformType::New(); if (fixedInitialTransform != nullptr) { fixedComposite->AddTransform(fixedInitialTransform); @@ -166,7 +166,7 @@ SyNImageRegistrationMethodFlattenTransformQueue(); fixedComposite->SetOnlyMostRecentTransformToOptimizeOn(); - typename CompositeTransformType::Pointer movingComposite = CompositeTransformType::New(); + auto movingComposite = CompositeTransformType::New(); movingComposite->AddTransform(this->m_CompositeTransform); movingComposite->AddTransform(this->m_MovingToMiddleTransform->GetInverseTransform()); movingComposite->FlattenTransformQueue(); @@ -212,7 +212,7 @@ SyNImageRegistrationMethod; - typename ComposerType::Pointer fixedComposer = ComposerType::New(); + auto fixedComposer = ComposerType::New(); fixedComposer->SetDisplacementField(fixedToMiddleSmoothUpdateField); fixedComposer->SetWarpingField(this->m_FixedToMiddleTransform->GetDisplacementField()); fixedComposer->Update(); @@ -220,7 +220,7 @@ SyNImageRegistrationMethodGaussianSmoothDisplacementField( fixedComposer->GetOutput(), this->m_GaussianSmoothingVarianceForTheTotalField); - typename ComposerType::Pointer movingComposer = ComposerType::New(); + auto movingComposer = ComposerType::New(); movingComposer->SetDisplacementField(movingToMiddleSmoothUpdateField); movingComposer->SetWarpingField(this->m_MovingToMiddleTransform->GetDisplacementField()); movingComposer->Update(); @@ -352,7 +352,7 @@ typename SyNImageRegistrationMethod; - typename FixedResamplerType::Pointer fixedResampler = FixedResamplerType::New(); + auto fixedResampler = FixedResamplerType::New(); fixedResampler->SetInput(fixedImages[n]); fixedResampler->SetTransform(fixedTransform); fixedResampler->UseReferenceImageOn(); @@ -361,7 +361,7 @@ typename SyNImageRegistrationMethodUpdate(); using MovingResamplerType = ResampleImageFilter; - typename MovingResamplerType::Pointer movingResampler = MovingResamplerType::New(); + auto movingResampler = MovingResamplerType::New(); movingResampler->SetInput(movingImages[n]); movingResampler->SetTransform(movingTransform); movingResampler->UseReferenceImageOn(); @@ -384,7 +384,7 @@ typename SyNImageRegistrationMethodGetImage()); using FixedMaskResamplerType = ResampleImageFilter; - typename FixedMaskResamplerType::Pointer fixedMaskResampler = FixedMaskResamplerType::New(); + auto fixedMaskResampler = FixedMaskResamplerType::New(); fixedMaskResampler->SetInput(dynamic_cast( const_cast(fixedImageMasks[n].GetPointer())) ->GetImage()); @@ -395,7 +395,7 @@ typename SyNImageRegistrationMethodSetDefaultPixelValue(0); fixedMaskResampler->Update(); - typename ImageMaskSpatialObjectType::Pointer resampledFixedImageMask = ImageMaskSpatialObjectType::New(); + auto resampledFixedImageMask = ImageMaskSpatialObjectType::New(); resampledFixedImageMask->SetImage(fixedMaskResampler->GetOutput()); dynamic_cast(multiMetric->GetMetricQueue()[n].GetPointer()) @@ -414,7 +414,7 @@ typename SyNImageRegistrationMethodGetImage()); using MovingMaskResamplerType = ResampleImageFilter; - typename MovingMaskResamplerType::Pointer movingMaskResampler = MovingMaskResamplerType::New(); + auto movingMaskResampler = MovingMaskResamplerType::New(); movingMaskResampler->SetInput(dynamic_cast( const_cast(movingImageMasks[n].GetPointer())) ->GetImage()); @@ -425,7 +425,7 @@ typename SyNImageRegistrationMethodSetDefaultPixelValue(0); movingMaskResampler->Update(); - typename ImageMaskSpatialObjectType::Pointer resampledMovingImageMask = ImageMaskSpatialObjectType::New(); + auto resampledMovingImageMask = ImageMaskSpatialObjectType::New(); resampledMovingImageMask->SetImage(movingMaskResampler->GetOutput()); dynamic_cast(multiMetric->GetMetricQueue()[n].GetPointer()) @@ -486,7 +486,7 @@ typename SyNImageRegistrationMethod; - typename FixedResamplerType::Pointer fixedResampler = FixedResamplerType::New(); + auto fixedResampler = FixedResamplerType::New(); fixedResampler->SetInput(fixedImages[0]); fixedResampler->SetTransform(fixedTransform); fixedResampler->UseReferenceImageOn(); @@ -495,7 +495,7 @@ typename SyNImageRegistrationMethodUpdate(); using MovingResamplerType = ResampleImageFilter; - typename MovingResamplerType::Pointer movingResampler = MovingResamplerType::New(); + auto movingResampler = MovingResamplerType::New(); movingResampler->SetInput(movingImages[0]); movingResampler->SetTransform(movingTransform); movingResampler->UseReferenceImageOn(); @@ -517,7 +517,7 @@ typename SyNImageRegistrationMethodGetImage()); using FixedMaskResamplerType = ResampleImageFilter; - typename FixedMaskResamplerType::Pointer fixedMaskResampler = FixedMaskResamplerType::New(); + auto fixedMaskResampler = FixedMaskResamplerType::New(); fixedMaskResampler->SetInput(dynamic_cast( const_cast(fixedImageMasks[0].GetPointer())) ->GetImage()); @@ -528,7 +528,7 @@ typename SyNImageRegistrationMethodSetDefaultPixelValue(0); fixedMaskResampler->Update(); - typename ImageMaskSpatialObjectType::Pointer resampledFixedImageMask = ImageMaskSpatialObjectType::New(); + auto resampledFixedImageMask = ImageMaskSpatialObjectType::New(); resampledFixedImageMask->SetImage(fixedMaskResampler->GetOutput()); dynamic_cast(this->m_Metric.GetPointer())->SetFixedImageMask(resampledFixedImageMask); @@ -546,7 +546,7 @@ typename SyNImageRegistrationMethodGetImage()); using MovingMaskResamplerType = ResampleImageFilter; - typename MovingMaskResamplerType::Pointer movingMaskResampler = MovingMaskResamplerType::New(); + auto movingMaskResampler = MovingMaskResamplerType::New(); movingMaskResampler->SetInput(dynamic_cast( const_cast(movingImageMasks[0].GetPointer())) ->GetImage()); @@ -557,7 +557,7 @@ typename SyNImageRegistrationMethodSetDefaultPixelValue(0); movingMaskResampler->Update(); - typename ImageMaskSpatialObjectType::Pointer resampledMovingImageMask = ImageMaskSpatialObjectType::New(); + auto resampledMovingImageMask = ImageMaskSpatialObjectType::New(); resampledMovingImageMask->SetImage(movingMaskResampler->GetOutput()); dynamic_cast(this->m_Metric.GetPointer())->SetMovingImageMask(resampledMovingImageMask); @@ -575,7 +575,7 @@ typename SyNImageRegistrationMethodCopyInformation(virtualDomainImage); identityField->SetRegions(virtualDomainImage->GetLargestPossibleRegion()); identityField->Allocate(); @@ -627,7 +627,7 @@ typename SyNImageRegistrationMethodCopyInformation(virtualDomainImage); gradientField->SetRegions(virtualDomainImage->GetRequestedRegion()); gradientField->Allocate(); @@ -688,7 +688,7 @@ typename SyNImageRegistrationMethod; using MultiplierType = MultiplyImageFilter; - typename MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(updateField); multiplier->SetConstant(scale); @@ -711,7 +711,7 @@ typename SyNImageRegistrationMethod; - typename InverterType::Pointer inverter = InverterType::New(); + auto inverter = InverterType::New(); inverter->SetInput(field); inverter->SetInverseFieldInitialEstimate(inverseFieldEstimate); inverter->SetMaximumNumberOfIterations(20); @@ -735,7 +735,7 @@ typename SyNImageRegistrationMethod; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); + auto duplicator = DuplicatorType::New(); duplicator->SetInputImage(field); duplicator->Update(); @@ -751,7 +751,7 @@ typename SyNImageRegistrationMethod; - typename GaussianSmoothingSmootherType::Pointer smoother = GaussianSmoothingSmootherType::New(); + auto smoother = GaussianSmoothingSmootherType::New(); for (SizeValueType d = 0; d < ImageDimension; ++d) { @@ -849,12 +849,12 @@ SyNImageRegistrationMethod; - typename ComposerType::Pointer composer = ComposerType::New(); + auto composer = ComposerType::New(); composer->SetDisplacementField(this->m_MovingToMiddleTransform->GetInverseDisplacementField()); composer->SetWarpingField(this->m_FixedToMiddleTransform->GetDisplacementField()); composer->Update(); - typename ComposerType::Pointer inverseComposer = ComposerType::New(); + auto inverseComposer = ComposerType::New(); inverseComposer->SetDisplacementField(this->m_FixedToMiddleTransform->GetInverseDisplacementField()); inverseComposer->SetWarpingField(this->m_MovingToMiddleTransform->GetDisplacementField()); inverseComposer->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx index 3811297e883..0a3478ab65d 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx @@ -68,7 +68,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); TimeVaryingVelocityFieldControlPointLatticePointer velocityFieldLattice = @@ -130,7 +130,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethodCopyInformation(virtualDomainImage); identityField->SetRegions(virtualDomainImage->GetLargestPossibleRegion()); identityField->Allocate(); @@ -164,12 +164,12 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethodInitialize(); - typename WeightsContainerType::Pointer velocityFieldWeights = WeightsContainerType::New(); + auto velocityFieldWeights = WeightsContainerType::New(); velocityFieldWeights->Initialize(); // Monitor the convergence using ConvergenceMonitoringType = itk::Function::WindowConvergenceMonitoringFunction; - typename ConvergenceMonitoringType::Pointer convergenceMonitoring = ConvergenceMonitoringType::New(); + auto convergenceMonitoring = ConvergenceMonitoringType::New(); convergenceMonitoring->SetWindowSize(this->m_ConvergenceWindowSize); IterationReporter reporter(this, 0, 1); @@ -236,7 +236,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod; - typename DisplacementFieldDuplicatorType::Pointer fieldDuplicator = DisplacementFieldDuplicatorType::New(); + auto fieldDuplicator = DisplacementFieldDuplicatorType::New(); fieldDuplicator->SetInputImage(this->m_OutputTransform->GetDisplacementField()); fieldDuplicator->Update(); - typename DisplacementFieldDuplicatorType::Pointer inverseFieldDuplicator = DisplacementFieldDuplicatorType::New(); + auto inverseFieldDuplicator = DisplacementFieldDuplicatorType::New(); inverseFieldDuplicator->SetInputImage(this->m_OutputTransform->GetInverseDisplacementField()); inverseFieldDuplicator->Update(); @@ -411,7 +411,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< auto * fixedInitialTransform = const_cast(this->GetFixedInitialTransform()); - typename CompositeTransformType::Pointer fixedComposite = CompositeTransformType::New(); + auto fixedComposite = CompositeTransformType::New(); if (fixedInitialTransform != nullptr) { fixedComposite->AddTransform(fixedInitialTransform); @@ -441,7 +441,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< // Set up the moving composite transform for the current time point - typename CompositeTransformType::Pointer movingComposite = CompositeTransformType::New(); + auto movingComposite = CompositeTransformType::New(); movingComposite->AddTransform(this->m_CompositeTransform); movingComposite->AddTransform(movingDisplacementFieldTransform); movingComposite->FlattenTransformQueue(); @@ -634,7 +634,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< typename DisplacementFieldType::DirectionType identity; identity.SetIdentity(); - typename DisplacementFieldType::Pointer bsplineParametricDomainField = DisplacementFieldType::New(); + auto bsplineParametricDomainField = DisplacementFieldType::New(); bsplineParametricDomainField->CopyInformation(virtualDomainImage); bsplineParametricDomainField->SetRegions(virtualDomainImage->GetRequestedRegion()); bsplineParametricDomainField->SetDirection(identity); @@ -663,7 +663,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< ObjectToObjectMetricBaseTemplateEnums::MetricCategory::IMAGE_METRIC) { using FixedResamplerType = ResampleImageFilter; - typename FixedResamplerType::Pointer fixedResampler = FixedResamplerType::New(); + auto fixedResampler = FixedResamplerType::New(); fixedResampler->SetInput(fixedImages[n]); fixedResampler->SetTransform(fixedTransform); fixedResampler->UseReferenceImageOn(); @@ -672,7 +672,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< fixedResampler->Update(); using MovingResamplerType = ResampleImageFilter; - typename MovingResamplerType::Pointer movingResampler = MovingResamplerType::New(); + auto movingResampler = MovingResamplerType::New(); movingResampler->SetInput(movingImages[n]); movingResampler->SetTransform(movingTransform); movingResampler->UseReferenceImageOn(); @@ -695,7 +695,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< else if (this->m_Metric->GetMetricCategory() == ObjectToObjectMetricBaseTemplateEnums::MetricCategory::IMAGE_METRIC) { using FixedResamplerType = ResampleImageFilter; - typename FixedResamplerType::Pointer fixedResampler = FixedResamplerType::New(); + auto fixedResampler = FixedResamplerType::New(); fixedResampler->SetInput(fixedImages[0]); fixedResampler->SetTransform(fixedTransform); fixedResampler->UseReferenceImageOn(); @@ -704,7 +704,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< fixedResampler->Update(); using MovingResamplerType = ResampleImageFilter; - typename MovingResamplerType::Pointer movingResampler = MovingResamplerType::New(); + auto movingResampler = MovingResamplerType::New(); movingResampler->SetInput(movingImages[0]); movingResampler->SetTransform(movingTransform); movingResampler->UseReferenceImageOn(); @@ -756,7 +756,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< if (fixedImageMasks[0]) { using FixedMaskResamplerType = ResampleImageFilter; - typename FixedMaskResamplerType::Pointer fixedMaskResampler = FixedMaskResamplerType::New(); + auto fixedMaskResampler = FixedMaskResamplerType::New(); fixedMaskResampler->SetTransform(fixedTransform); fixedMaskResampler->SetInput( dynamic_cast(const_cast(fixedImageMasks[0].GetPointer())) @@ -777,7 +777,7 @@ TimeVaryingBSplineVelocityFieldImageRegistrationMethod< SizeValueType numberOfVelocityFieldPoints = velocityFieldPoints->GetNumberOfPoints(); - typename DisplacementFieldType::Pointer gradientField = DisplacementFieldType::New(); + auto gradientField = DisplacementFieldType::New(); gradientField->CopyInformation(virtualDomainImage); gradientField->SetRegions(virtualDomainImage->GetRequestedRegion()); gradientField->Allocate(); diff --git a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx index 34bc32881d0..1268fd000c6 100644 --- a/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx +++ b/Modules/Registration/RegistrationMethodsv4/include/itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx @@ -78,14 +78,14 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); typename DisplacementFieldTransformType::Pointer identityDisplacementFieldTransform = DisplacementFieldTransformType::New(); // This transform gets used for the moving image - typename DisplacementFieldDuplicatorType::Pointer fieldDuplicatorIdentity = DisplacementFieldDuplicatorType::New(); + auto fieldDuplicatorIdentity = DisplacementFieldDuplicatorType::New(); TimeVaryingVelocityFieldPointer velocityField = this->m_OutputTransform->GetModifiableVelocityField(); IndexValueType numberOfTimePoints = velocityField->GetLargestPossibleRegion().GetSize()[ImageDimension]; @@ -141,7 +141,7 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4; - typename ConvergenceMonitoringType::Pointer convergenceMonitoring = ConvergenceMonitoringType::New(); + auto convergenceMonitoring = ConvergenceMonitoringType::New(); convergenceMonitoring->SetWindowSize(this->m_ConvergenceWindowSize); // m_OutputTransform is the velocity field @@ -178,7 +178,7 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4m_OutputTransform->IntegrateVelocityField(); } - typename DisplacementFieldDuplicatorType::Pointer fieldDuplicator = DisplacementFieldDuplicatorType::New(); + auto fieldDuplicator = DisplacementFieldDuplicatorType::New(); fieldDuplicator->SetInputImage(this->m_OutputTransform->GetDisplacementField()); fieldDuplicator->Update(); @@ -216,7 +216,7 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4m_MovingSmoothImages.size(); ++n) { using MovingResamplerType = ResampleImageFilter; - typename MovingResamplerType::Pointer movingResampler = MovingResamplerType::New(); + auto movingResampler = MovingResamplerType::New(); movingResampler->SetTransform(this->m_CompositeTransform); movingResampler->SetInput(this->m_MovingSmoothImages[n]); movingResampler->SetSize(virtualDomainImage->GetRequestedRegion().GetSize()); @@ -227,7 +227,7 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4Update(); using FixedResamplerType = ResampleImageFilter; - typename FixedResamplerType::Pointer fixedResampler = FixedResamplerType::New(); + auto fixedResampler = FixedResamplerType::New(); fixedResampler->SetTransform(fixedDisplacementFieldTransform); fixedResampler->SetInput(this->m_FixedSmoothImages[n]); fixedResampler->SetSize(virtualDomainImage->GetRequestedRegion().GetSize()); @@ -305,7 +305,7 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4(metricDerivative.data_block()); using ImporterType = ImportImageFilter; - typename ImporterType::Pointer importer = ImporterType::New(); + auto importer = ImporterType::New(); importer->SetImportPointer( metricDerivativeFieldPointer, numberOfPixelsPerTimePoint, importFilterWillReleaseMemory); importer->SetRegion(virtualDomainImage->GetBufferedRegion()); @@ -317,12 +317,12 @@ TimeVaryingVelocityFieldImageRegistrationMethodv4; using MagnituderType = VectorMagnitudeImageFilter; - typename MagnituderType::Pointer magnituder = MagnituderType::New(); + auto magnituder = MagnituderType::New(); magnituder->SetInput(importer->GetOutput()); magnituder->Update(); using StatisticsImageFilterType = StatisticsImageFilter; - typename StatisticsImageFilterType::Pointer stats = StatisticsImageFilterType::New(); + auto stats = StatisticsImageFilterType::New(); stats->SetInput(magnituder->GetOutput()); stats->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx index 150908900b2..053de2ae924 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineExponentialImageRegistrationTest.cxx @@ -127,14 +127,14 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -144,7 +144,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; using GradientDescentOptimizerv4Type = itk::GradientDescentOptimizerv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -176,7 +176,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) affineOptimizer->SetDoEstimateLearningRateAtEachIteration(true); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); { @@ -214,13 +214,13 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using VectorType = itk::Vector; VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); @@ -233,7 +233,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) typename DisplacementFieldRegistrationType::Pointer displacementFieldSimple = DisplacementFieldRegistrationType::New(); - typename DisplacementFieldTransformType::Pointer fieldTransform = DisplacementFieldTransformType::New(); + auto fieldTransform = DisplacementFieldTransformType::New(); typename DisplacementFieldTransformType::ArrayType updateControlPoints; updateControlPoints.Fill(10); @@ -250,7 +250,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) displacementFieldSimple->InPlaceOn(); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -261,12 +261,12 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) // correlationMetric->SetFloatingPointCorrectionResolution(1e4); using ScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename ScalesEstimatorType::Pointer scalesEstimator = ScalesEstimatorType::New(); + auto scalesEstimator = ScalesEstimatorType::New(); scalesEstimator->SetMetric(correlationMetric); scalesEstimator->SetTransformForward(true); scalesEstimator->SetSmallParameterVariation(1.0); - typename GradientDescentOptimizerv4Type::Pointer optimizer = GradientDescentOptimizerv4Type::New(); + auto optimizer = GradientDescentOptimizerv4Type::New(); optimizer->SetLearningRate(1.0); #ifdef NDEBUG optimizer->SetNumberOfIterations(std::stoi(argv[6])); @@ -314,7 +314,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); @@ -348,7 +348,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) << " optimizer: " << displacementFieldSimple->GetOptimizer()->GetNumberOfWorkUnits() << std::endl; using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -359,7 +359,7 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) resampler->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[4]); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -367,18 +367,18 @@ PerformBSplineExpImageRegistration(int argc, char * argv[]) // Check identity of forward and inverse transforms using ComposerType = itk::ComposeDisplacementFieldsImageFilter; - typename ComposerType::Pointer composer = ComposerType::New(); + auto composer = ComposerType::New(); composer->SetDisplacementField(fieldTransform->GetDisplacementField()); composer->SetWarpingField(fieldTransform->GetInverseDisplacementField()); composer->Update(); using MagnituderType = itk::VectorMagnitudeImageFilter; - typename MagnituderType::Pointer magnituder = MagnituderType::New(); + auto magnituder = MagnituderType::New(); magnituder->SetInput(composer->GetOutput()); magnituder->Update(); using StatisticsImageFilterType = itk::StatisticsImageFilter; - typename StatisticsImageFilterType::Pointer stats = StatisticsImageFilterType::New(); + auto stats = StatisticsImageFilterType::New(); stats->SetInput(magnituder->GetOutput()); stats->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx index f207eb5b7d1..3358935b59f 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineImageRegistrationTest.cxx @@ -116,14 +116,14 @@ PerformBSplineImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -132,7 +132,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -161,7 +161,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) affineOptimizer->SetDoEstimateLearningRateAtEachIteration(true); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); { @@ -197,7 +197,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) // using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -205,12 +205,12 @@ PerformBSplineImageRegistration(int argc, char * argv[]) correlationMetric->SetUseFixedImageGradientFilter(false); using ScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename ScalesEstimatorType::Pointer scalesEstimator = ScalesEstimatorType::New(); + auto scalesEstimator = ScalesEstimatorType::New(); scalesEstimator->SetMetric(correlationMetric); scalesEstimator->SetTransformForward(true); scalesEstimator->SetSmallParameterVariation(1.0); - typename GradientDescentOptimizerv4Type::Pointer optimizer = GradientDescentOptimizerv4Type::New(); + auto optimizer = GradientDescentOptimizerv4Type::New(); optimizer->SetLearningRate(1.0); optimizer->SetNumberOfIterations(std::stoi(argv[6])); optimizer->SetScalesEstimator(scalesEstimator); @@ -220,7 +220,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); constexpr unsigned int numberOfLevels = 3; @@ -228,7 +228,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) using BSplineTransformType = itk::BSplineTransform; using BSplineRegistrationType = itk::ImageRegistrationMethodv4; - typename BSplineRegistrationType::Pointer bsplineRegistration = BSplineRegistrationType::New(); + auto bsplineRegistration = BSplineRegistrationType::New(); // Shrink the virtual domain by specified factors for each level. See documentation // for the itkShrinkImageFilter for more detailed behavior. @@ -246,7 +246,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) smoothingSigmasPerLevel[1] = 1; smoothingSigmasPerLevel[2] = 1; - typename BSplineTransformType::Pointer outputBSplineTransform = BSplineTransformType::New(); + auto outputBSplineTransform = BSplineTransformType::New(); typename BSplineTransformType::PhysicalDimensionsType physicalDimensions; typename BSplineTransformType::MeshSizeType meshSize; @@ -264,7 +264,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) for (unsigned int level = 0; level < numberOfLevels; ++level) { using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(fixedImage); shrinkFilter->Update(); @@ -278,7 +278,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) } using BSplineAdaptorType = itk::BSplineTransformParametersAdaptor; - typename BSplineAdaptorType::Pointer bsplineAdaptor = BSplineAdaptorType::New(); + auto bsplineAdaptor = BSplineAdaptorType::New(); bsplineAdaptor->SetTransform(outputBSplineTransform); bsplineAdaptor->SetRequiredTransformDomainMeshSize(requiredMeshSize); bsplineAdaptor->SetRequiredTransformDomainOrigin(shrinkFilter->GetOutput()->GetOrigin()); @@ -308,7 +308,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) bsplineRegistration->InPlaceOn(); using BSplineRegistrationCommandType = CommandIterationUpdate; - typename BSplineRegistrationCommandType::Pointer bsplineObserver = BSplineRegistrationCommandType::New(); + auto bsplineObserver = BSplineRegistrationCommandType::New(); bsplineRegistration->AddObserver(itk::IterationEvent(), bsplineObserver); ITK_TRY_EXPECT_NO_EXCEPTION(bsplineRegistration->Update()); @@ -324,7 +324,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) << " optimizer: " << bsplineRegistration->GetOptimizer()->GetNumberOfWorkUnits() << std::endl; using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -335,7 +335,7 @@ PerformBSplineImageRegistration(int argc, char * argv[]) resampler->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[4]); writer->SetInput(resampler->GetOutput()); writer->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx index f75d30e48cf..14a48ad7c79 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNImageRegistrationTest.cxx @@ -85,14 +85,14 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -101,7 +101,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -125,7 +125,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) #endif using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); ITK_TRY_EXPECT_NO_EXCEPTION(affineSimple->Update()); @@ -138,11 +138,11 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using AffineResampleFilterType = itk::ResampleImageFilter; - typename AffineResampleFilterType::Pointer affineResampler = AffineResampleFilterType::New(); + auto affineResampler = AffineResampleFilterType::New(); affineResampler->SetTransform(compositeTransform); affineResampler->SetInput(movingImage); affineResampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -155,7 +155,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) std::string affineMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterAffineTransform.nii.gz"); using AffineWriterType = itk::ImageFileWriter; - typename AffineWriterType::Pointer affineWriter = AffineWriterType::New(); + auto affineWriter = AffineWriterType::New(); affineWriter->SetFileName(affineMovingImageFileName.c_str()); affineWriter->SetInput(affineResampler->GetOutput()); affineWriter->Update(); @@ -166,13 +166,13 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) // Create the SyN deformable registration method using DisplacementFieldType = itk::Image; - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); displacementField->FillBuffer(zeroVector); - typename DisplacementFieldType::Pointer inverseDisplacementField = DisplacementFieldType::New(); + auto inverseDisplacementField = DisplacementFieldType::New(); inverseDisplacementField->CopyInformation(fixedImage); inverseDisplacementField->SetRegions(fixedImage->GetBufferedRegion()); inverseDisplacementField->Allocate(); @@ -189,7 +189,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) displacementFieldRegistration->SetOptimizerWeights(optimizerWeights); using OutputTransformType = typename DisplacementFieldRegistrationType::OutputTransformType; - typename OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); outputTransform->SetDisplacementField(displacementField); outputTransform->SetInverseDisplacementField(inverseDisplacementField); @@ -245,7 +245,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); @@ -273,7 +273,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) } using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -304,7 +304,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) compositeTransform->AddTransform(outputTransform); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -317,7 +317,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) std::string warpedMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterSyN.nii.gz"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(warpedMovingImageFileName.c_str()); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -336,7 +336,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) std::string inverseWarpedFixedImageFileName = std::string(argv[4]) + std::string("InverseWarpedFixedImage.nii.gz"); using InverseWriterType = itk::ImageFileWriter; - typename InverseWriterType::Pointer inverseWriter = InverseWriterType::New(); + auto inverseWriter = InverseWriterType::New(); inverseWriter->SetFileName(inverseWarpedFixedImageFileName.c_str()); inverseWriter->SetInput(inverseResampler->GetOutput()); inverseWriter->Update(); @@ -344,7 +344,7 @@ PerformBSplineSyNImageRegistration(int itkNotUsed(argc), char * argv[]) std::string displacementFieldFileName = std::string(argv[4]) + std::string("DisplacementField.nii.gz"); using DisplacementFieldWriterType = itk::ImageFileWriter; - typename DisplacementFieldWriterType::Pointer displacementFieldWriter = DisplacementFieldWriterType::New(); + auto displacementFieldWriter = DisplacementFieldWriterType::New(); displacementFieldWriter->SetFileName(displacementFieldFileName.c_str()); displacementFieldWriter->SetInput(outputTransform->GetDisplacementField()); displacementFieldWriter->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx index 95ebddac9e6..bee11b9920c 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkBSplineSyNPointSetRegistrationTest.cxx @@ -29,7 +29,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar using PointSetType = itk::PointSet; using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); using PointSetType = PointSetMetricType::FixedPointSetType; using PointType = PointSetType::PointType; @@ -39,10 +39,10 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar using MovingImageType = itk::Image; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // two circles with a small offset @@ -92,7 +92,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar fixedImageDirection.SetIdentity(); fixedImageSpacing.Fill(1); - FixedImageType::Pointer fixedImage = FixedImageType::New(); + auto fixedImage = FixedImageType::New(); fixedImage->SetRegions(fixedImageSize); fixedImage->SetOrigin(fixedImageOrigin); fixedImage->SetDirection(fixedImageDirection); @@ -100,7 +100,7 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar fixedImage->Allocate(); using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); metric->SetFixedPointSet(fixedPoints); @@ -115,23 +115,23 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); displacementField->FillBuffer(zeroVector); - DisplacementFieldType::Pointer inverseDisplacementField = DisplacementFieldType::New(); + auto inverseDisplacementField = DisplacementFieldType::New(); inverseDisplacementField->CopyInformation(fixedImage); inverseDisplacementField->SetRegions(fixedImage->GetBufferedRegion()); inverseDisplacementField->Allocate(); inverseDisplacementField->FillBuffer(zeroVector); using DisplacementFieldRegistrationType = itk::BSplineSyNImageRegistrationMethod; - DisplacementFieldRegistrationType::Pointer displacementFieldRegistration = DisplacementFieldRegistrationType::New(); + auto displacementFieldRegistration = DisplacementFieldRegistrationType::New(); using OutputTransformType = DisplacementFieldRegistrationType::OutputTransformType; - OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); outputTransform->SetDisplacementField(displacementField); outputTransform->SetInverseDisplacementField(inverseDisplacementField); @@ -179,12 +179,12 @@ itkBSplineSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(ar // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); - DisplacementFieldTransformAdaptorType::Pointer fieldTransformAdaptor = DisplacementFieldTransformAdaptorType::New(); + auto fieldTransformAdaptor = DisplacementFieldTransformAdaptorType::New(); fieldTransformAdaptor->SetRequiredSpacing(shrinkFilter->GetOutput()->GetSpacing()); fieldTransformAdaptor->SetRequiredSize(shrinkFilter->GetOutput()->GetBufferedRegion().GetSize()); fieldTransformAdaptor->SetRequiredDirection(shrinkFilter->GetOutput()->GetDirection()); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx index c8ca6aef17b..1a2a4f2aa04 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkExponentialImageRegistrationTest.cxx @@ -130,7 +130,7 @@ PerformExpImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); timer.Start("0 fixedImageReader"); fixedImageReader->Update(); @@ -141,7 +141,7 @@ PerformExpImageRegistration(int argc, char * argv[]) timer.Stop("1 fixedImage"); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); timer.Start("2 movingImageReader"); movingImageReader->Update(); @@ -155,7 +155,7 @@ PerformExpImageRegistration(int argc, char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; using GradientDescentOptimizerv4Type = itk::GradientDescentOptimizerv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -187,7 +187,7 @@ PerformExpImageRegistration(int argc, char * argv[]) affineOptimizer->SetDoEstimateLearningRateAtEachIteration(true); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); { @@ -228,14 +228,14 @@ PerformExpImageRegistration(int argc, char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using VectorType = itk::Vector; VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; using ConstantVelocityFieldType = itk::Image; - typename ConstantVelocityFieldType::Pointer displacementField = ConstantVelocityFieldType::New(); + auto displacementField = ConstantVelocityFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); @@ -248,14 +248,14 @@ PerformExpImageRegistration(int argc, char * argv[]) typename DisplacementFieldRegistrationType::Pointer displacementFieldSimple = DisplacementFieldRegistrationType::New(); - typename ConstantVelocityFieldTransformType::Pointer fieldTransform = ConstantVelocityFieldTransformType::New(); + auto fieldTransform = ConstantVelocityFieldTransformType::New(); fieldTransform->SetGaussianSmoothingVarianceForTheUpdateField(0.75); fieldTransform->SetGaussianSmoothingVarianceForTheConstantVelocityField(1.5); fieldTransform->SetConstantVelocityField(displacementField); fieldTransform->SetCalculateNumberOfIntegrationStepsAutomatically(true); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -266,12 +266,12 @@ PerformExpImageRegistration(int argc, char * argv[]) // correlationMetric->SetFloatingPointCorrectionResolution(1e4); using ScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename ScalesEstimatorType::Pointer scalesEstimator = ScalesEstimatorType::New(); + auto scalesEstimator = ScalesEstimatorType::New(); scalesEstimator->SetMetric(correlationMetric); scalesEstimator->SetTransformForward(true); scalesEstimator->SetSmallParameterVariation(1.0); - typename GradientDescentOptimizerv4Type::Pointer optimizer = GradientDescentOptimizerv4Type::New(); + auto optimizer = GradientDescentOptimizerv4Type::New(); optimizer->SetLearningRate(1.0); #ifdef NDEBUG optimizer->SetNumberOfIterations(std::stoi(argv[6])); @@ -319,7 +319,7 @@ PerformExpImageRegistration(int argc, char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(fieldTransform->GetConstantVelocityField()); timer.Start("5 shrink"); @@ -362,7 +362,7 @@ PerformExpImageRegistration(int argc, char * argv[]) << " optimizer: " << displacementFieldSimple->GetOptimizer()->GetNumberOfWorkUnits() << std::endl; using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -375,7 +375,7 @@ PerformExpImageRegistration(int argc, char * argv[]) timer.Stop("7 resampler"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[4]); writer->SetInput(resampler->GetOutput()); timer.Start("8 writer"); @@ -385,7 +385,7 @@ PerformExpImageRegistration(int argc, char * argv[]) // Check identity of forward and inverse transforms using ComposerType = itk::ComposeDisplacementFieldsImageFilter; - typename ComposerType::Pointer composer = ComposerType::New(); + auto composer = ComposerType::New(); composer->SetDisplacementField(fieldTransform->GetDisplacementField()); composer->SetWarpingField(fieldTransform->GetInverseDisplacementField()); timer.Start("8 composer"); @@ -393,14 +393,14 @@ PerformExpImageRegistration(int argc, char * argv[]) timer.Stop("8 composer"); using MagnituderType = itk::VectorMagnitudeImageFilter; - typename MagnituderType::Pointer magnituder = MagnituderType::New(); + auto magnituder = MagnituderType::New(); magnituder->SetInput(composer->GetOutput()); timer.Start("9 magnituder"); magnituder->Update(); timer.Stop("9 magnituder"); using StatisticsImageFilterType = itk::StatisticsImageFilter; - typename StatisticsImageFilterType::Pointer stats = StatisticsImageFilterType::New(); + auto stats = StatisticsImageFilterType::New(); stats->SetInput(magnituder->GetOutput()); timer.Start("10 stats"); stats->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx index d3aafdc69ac..e5b51e96576 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkImageRegistrationSamplingTest.cxx @@ -31,7 +31,7 @@ itkImageRegistrationSamplingTest(int, char *[]) using MovingImageType = itk::Image; using RegistrationType = itk::ImageRegistrationMethodv4; - RegistrationType::Pointer registrationMethod = RegistrationType::New(); + auto registrationMethod = RegistrationType::New(); try { diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx index 617e7a510bd..695d4e190b6 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkQuasiNewtonOptimizerv4RegistrationTest.cxx @@ -76,8 +76,8 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) using FixedImageReaderType = itk::ImageFileReader; using MovingImageReaderType = itk::ImageFileReader; - typename FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New(); - typename MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New(); + auto fixedImageReader = FixedImageReaderType::New(); + auto movingImageReader = MovingImageReaderType::New(); fixedImageReader->SetFileName(argv[3]); movingImageReader->SetFileName(argv[4]); @@ -90,24 +90,24 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) /** define a resample filter that will ultimately be used to deform the image */ using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resample = ResampleFilterType::New(); + auto resample = ResampleFilterType::New(); /** create a composite transform holder for other transforms */ using CompositeType = itk::CompositeTransform; - typename CompositeType::Pointer compositeTransform = CompositeType::New(); + auto compositeTransform = CompositeType::New(); // create an affine transform using AffineTransformType = TAffineTransform; - typename AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineTransform->SetIdentity(); std::cout << " affineTransform params " << affineTransform->GetParameters() << std::endl; using DisplacementTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - typename DisplacementTransformType::Pointer displacementTransform = DisplacementTransformType::New(); + auto displacementTransform = DisplacementTransformType::New(); using DisplacementFieldType = typename DisplacementTransformType::DisplacementFieldType; - typename DisplacementFieldType::Pointer field = DisplacementFieldType::New(); + auto field = DisplacementFieldType::New(); // set the field to be the same as the fixed image region, which will // act by default as the virtual domain in this example. @@ -128,7 +128,7 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) // identity transform for fixed image using IdentityTransformType = itk::IdentityTransform; - typename IdentityTransformType::Pointer identityTransform = IdentityTransformType::New(); + auto identityTransform = IdentityTransformType::New(); identityTransform->SetIdentity(); // The metric @@ -138,14 +138,14 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) if (metricString.compare("ms") == 0) { using MeanSquaresMetricType = itk::MeanSquaresImageToImageMetricv4; - typename MeanSquaresMetricType::Pointer meanSquaresMetric = MeanSquaresMetricType::New(); + auto meanSquaresMetric = MeanSquaresMetricType::New(); metric = meanSquaresMetric.GetPointer(); } else if (metricString.compare("mi") == 0) { using MIMetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; using PointSetType = typename MIMetricType::FixedSampledPointSetType; - typename MIMetricType::Pointer miMetric = MIMetricType::New(); + auto miMetric = MIMetricType::New(); metric = miMetric.GetPointer(); miMetric->SetNumberOfHistogramBins(20); @@ -175,7 +175,7 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) { // The metric using ANCMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename ANCMetricType::Pointer nbcMetric = ANCMetricType::New(); + auto nbcMetric = ANCMetricType::New(); metric = nbcMetric.GetPointer(); itk::Size radSize; @@ -212,7 +212,7 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) std::cout << "First do an affine registration " << std::endl; using OptimizerType = itk::QuasiNewtonOptimizerv4; - typename OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -276,11 +276,11 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) resample->Update(); // write out the displacement field using DisplacementWriterType = itk::ImageFileWriter; - typename DisplacementWriterType::Pointer displacementwriter = DisplacementWriterType::New(); - std::string outfilename(argv[5]); - std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); - std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); - std::string defout = name + std::string("_def") + ext; + auto displacementwriter = DisplacementWriterType::New(); + std::string outfilename(argv[5]); + std::string ext = itksys::SystemTools::GetFilenameExtension(outfilename); + std::string name = itksys::SystemTools::GetFilenameWithoutExtension(outfilename); + std::string defout = name + std::string("_def") + ext; displacementwriter->SetFileName(defout.c_str()); displacementwriter->SetInput(displacementTransform->GetDisplacementField()); displacementwriter->Update(); @@ -291,8 +291,8 @@ itkQuasiNewtonOptimizerv4RegistrationTestMain(int argc, char * argv[]) using OutputImageType = itk::Image; using CastFilterType = itk::CastImageFilter; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); - typename CastFilterType::Pointer caster = CastFilterType::New(); + auto writer = WriterType::New(); + auto caster = CastFilterType::New(); writer->SetFileName(argv[5]); caster->SetInput(resample->GetOutput()); writer->SetInput(caster->GetOutput()); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx index ebdd853dfe1..391811f4d83 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest.cxx @@ -132,14 +132,14 @@ PerformSimpleImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[3]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[4]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -147,10 +147,10 @@ PerformSimpleImageRegistration(int argc, char * argv[]) movingImage->DisconnectPipeline(); using AffineTransformType = itk::AffineTransform; - typename AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetObjectName("affineSimple"); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -168,7 +168,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) } using MIMetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - typename MIMetricType::Pointer mutualInformationMetric = MIMetricType::New(); + auto mutualInformationMetric = MIMetricType::New(); mutualInformationMetric->SetNumberOfHistogramBins(20); mutualInformationMetric->SetUseMovingImageGradientFilter(false); mutualInformationMetric->SetUseFixedImageGradientFilter(false); @@ -177,7 +177,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) affineSimple->SetMetric(mutualInformationMetric); using AffineScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename AffineScalesEstimatorType::Pointer scalesEstimator1 = AffineScalesEstimatorType::New(); + auto scalesEstimator1 = AffineScalesEstimatorType::New(); scalesEstimator1->SetMetric(mutualInformationMetric); scalesEstimator1->SetTransformForward(true); @@ -217,7 +217,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) affineOptimizer->SetScalesEstimator(scalesEstimator1); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::MultiResolutionIterationEvent(), affineObserver); { @@ -239,7 +239,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) using VectorType = itk::Vector; VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); @@ -248,7 +248,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) using DisplacementFieldTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - typename DisplacementFieldTransformType::Pointer fieldTransform = DisplacementFieldTransformType::New(); + auto fieldTransform = DisplacementFieldTransformType::New(); fieldTransform->SetGaussianSmoothingVarianceForTheUpdateField(0); fieldTransform->SetGaussianSmoothingVarianceForTheTotalField(1.5); fieldTransform->SetDisplacementField(displacementField); @@ -259,7 +259,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) displacementFieldSimple->SetObjectName("displacementFieldSimple"); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -270,11 +270,11 @@ PerformSimpleImageRegistration(int argc, char * argv[]) // correlationMetric->SetFloatingPointCorrectionResolution(1e4); using ScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename ScalesEstimatorType::Pointer scalesEstimator = ScalesEstimatorType::New(); + auto scalesEstimator = ScalesEstimatorType::New(); scalesEstimator->SetMetric(correlationMetric); scalesEstimator->SetTransformForward(true); - typename GradientDescentOptimizerv4Type::Pointer optimizer = GradientDescentOptimizerv4Type::New(); + auto optimizer = GradientDescentOptimizerv4Type::New(); optimizer->SetLearningRate(1.0); #ifdef NDEBUG optimizer->SetNumberOfIterations(std::stoi(argv[7])); @@ -331,7 +331,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); @@ -376,12 +376,12 @@ PerformSimpleImageRegistration(int argc, char * argv[]) << " optimizer: " << displacementFieldSimple->GetOptimizer()->GetNumberOfWorkUnits() << std::endl; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); compositeTransform->AddTransform(displacementFieldSimple->GetModifiableTransform()); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -392,7 +392,7 @@ PerformSimpleImageRegistration(int argc, char * argv[]) resampler->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(resampler->GetOutput()); writer->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx index a6a7a5ae73d..693b19782d8 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest2.cxx @@ -149,14 +149,14 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -165,7 +165,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) // Set up MI metric using MIMetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - typename MIMetricType::Pointer mutualInformationMetric = MIMetricType::New(); + auto mutualInformationMetric = MIMetricType::New(); mutualInformationMetric->SetNumberOfHistogramBins(20); mutualInformationMetric->SetUseMovingImageGradientFilter(false); mutualInformationMetric->SetUseFixedImageGradientFilter(false); @@ -173,18 +173,18 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) // Set up CC metric using GlobalCorrelationMetricType = itk::CorrelationImageToImageMetricv4; - typename GlobalCorrelationMetricType::Pointer gCorrelationMetric = GlobalCorrelationMetricType::New(); + auto gCorrelationMetric = GlobalCorrelationMetricType::New(); // Stage1: Rigid registration // using RegistrationType = itk::ImageRegistrationMethodv4; - typename RegistrationType::Pointer rigidRegistration = RegistrationType::New(); + auto rigidRegistration = RegistrationType::New(); rigidRegistration->SetObjectName("RigidSimple"); // Set up rigid multi metric: It only has one metric component using MultiMetricType = itk::ObjectToObjectMultiMetricv4; - typename MultiMetricType::Pointer rigidMultiMetric = MultiMetricType::New(); + auto rigidMultiMetric = MultiMetricType::New(); rigidMultiMetric->AddMetric(mutualInformationMetric); rigidRegistration->SetMetric(rigidMultiMetric); @@ -193,7 +193,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) // Rigid transform that is set to be optimized using RigidTransformType = typename RigidTransformTraits::TransformType; - typename RigidTransformType::Pointer rigidTransform = RigidTransformType::New(); + auto rigidTransform = RigidTransformType::New(); rigidRegistration->SetInitialTransform(rigidTransform); rigidRegistration->InPlaceOn(); @@ -211,7 +211,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) rigidRegistration->SetMetricSamplingPercentage(rigidSamplingPercentage); using RigidScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename RigidScalesEstimatorType::Pointer rigidScalesEstimator = RigidScalesEstimatorType::New(); + auto rigidScalesEstimator = RigidScalesEstimatorType::New(); rigidScalesEstimator->SetMetric(mutualInformationMetric); rigidScalesEstimator->SetTransformForward(true); @@ -232,13 +232,13 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) rigidOptimizer->SetScalesEstimator(rigidScalesEstimator); using CommandType = CommandIterationUpdate; - typename CommandType::Pointer rigidObserver = CommandType::New(); + auto rigidObserver = CommandType::New(); rigidRegistration->AddObserver(itk::MultiResolutionIterationEvent(), rigidObserver); // Stage2: Affine registration // - typename RegistrationType::Pointer affineSimple = RegistrationType::New(); + auto affineSimple = RegistrationType::New(); affineSimple->SetObjectName("affineSimple"); // Ensuring code coverage for boolean macros affineSimple->SmoothingSigmasAreSpecifiedInPhysicalUnitsOff(); @@ -250,7 +250,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) } // Set up affine multi metric: It has two metric components - typename MultiMetricType::Pointer affineMultiMetric = MultiMetricType::New(); + auto affineMultiMetric = MultiMetricType::New(); affineMultiMetric->AddMetric(mutualInformationMetric); affineMultiMetric->AddMetric(gCorrelationMetric); affineSimple->SetMetric(affineMultiMetric); @@ -261,14 +261,14 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) affineSimple->SetMovingImage(1, movingImage); using AffineTransformType = itk::AffineTransform; - typename AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); affineSimple->SetInitialTransform(affineTransform); affineSimple->InPlaceOn(); affineSimple->SetMovingInitialTransformInput(rigidRegistration->GetTransformOutput()); using AffineScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename AffineScalesEstimatorType::Pointer scalesEstimator1 = AffineScalesEstimatorType::New(); + auto scalesEstimator1 = AffineScalesEstimatorType::New(); scalesEstimator1->SetMetric(mutualInformationMetric); scalesEstimator1->SetTransformForward(true); @@ -307,7 +307,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) affineOptimizer->SetDoEstimateLearningRateAtEachIteration(true); affineOptimizer->SetScalesEstimator(scalesEstimator1); - typename CommandType::Pointer affineObserver = CommandType::New(); + auto affineObserver = CommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); ITK_TRY_EXPECT_NO_EXCEPTION(affineSimple->Update()); @@ -322,12 +322,12 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) } using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(rigidTransform); compositeTransform->AddTransform(affineTransform); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -338,7 +338,7 @@ PerformSimpleImageRegistration2(int argc, char * argv[]) resampler->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[4]); writer->SetInput(resampler->GetOutput()); writer->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest3.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest3.cxx index 6d003084057..9cb1324e306 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest3.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest3.cxx @@ -128,14 +128,14 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -151,11 +151,11 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) // Set up the centered transform initializer using AffineTransformType = itk::AffineTransform; - typename AffineTransformType::Pointer initialTransform = AffineTransformType::New(); + auto initialTransform = AffineTransformType::New(); using TransformInitializerType = itk::CenteredTransformInitializer; - typename TransformInitializerType::Pointer initializer = TransformInitializerType::New(); + auto initializer = TransformInitializerType::New(); initializer->SetTransform(initialTransform); initializer->SetFixedImage(fixedImage); @@ -164,13 +164,13 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) initializer->InitializeTransform(); using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(initialTransform); // Set up MI metric using MIMetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - typename MIMetricType::Pointer mutualInformationMetric = MIMetricType::New(); + auto mutualInformationMetric = MIMetricType::New(); mutualInformationMetric->SetNumberOfHistogramBins(20); mutualInformationMetric->SetUseMovingImageGradientFilter(false); mutualInformationMetric->SetUseFixedImageGradientFilter(false); @@ -182,7 +182,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) using RigidTransformType = typename RigidTransformTraits::TransformType; using RigidRegistrationType = itk::ImageRegistrationMethodv4; - typename RigidRegistrationType::Pointer rigidRegistration = RigidRegistrationType::New(); + auto rigidRegistration = RigidRegistrationType::New(); rigidRegistration->SetFixedImage(fixedImage); rigidRegistration->SetMovingImage(movingImage); @@ -200,7 +200,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) rigidRegistration->SetShrinkFactorsPerLevel(rigidShrinkFactorsPerLevel); using RigidScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename RigidScalesEstimatorType::Pointer rigidScalesEstimator = RigidScalesEstimatorType::New(); + auto rigidScalesEstimator = RigidScalesEstimatorType::New(); rigidScalesEstimator->SetMetric(mutualInformationMetric); rigidScalesEstimator->SetTransformForward(true); @@ -218,7 +218,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) rigidOptimizer->SetScalesEstimator(rigidScalesEstimator); using RigidCommandType = CommandIterationUpdate; - typename RigidCommandType::Pointer rigidObserver = RigidCommandType::New(); + auto rigidObserver = RigidCommandType::New(); rigidRegistration->AddObserver(itk::MultiResolutionIterationEvent(), rigidObserver); try @@ -236,7 +236,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) // Set up and optimize the affine registration using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineRegistration = AffineRegistrationType::New(); + auto affineRegistration = AffineRegistrationType::New(); affineRegistration->SetFixedImage(fixedImage); affineRegistration->SetMovingImage(movingImage); @@ -254,7 +254,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) affineRegistration->SetShrinkFactorsPerLevel(affineShrinkFactorsPerLevel); using AffineScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename AffineScalesEstimatorType::Pointer affineScalesEstimator = AffineScalesEstimatorType::New(); + auto affineScalesEstimator = AffineScalesEstimatorType::New(); affineScalesEstimator->SetMetric(mutualInformationMetric); affineScalesEstimator->SetTransformForward(true); @@ -272,7 +272,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) affineOptimizer->SetScalesEstimator(affineScalesEstimator); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineRegistration->AddObserver(itk::MultiResolutionIterationEvent(), affineObserver); try @@ -290,7 +290,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) // Write out resulting images using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -303,7 +303,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) std::string warpedMovingImageFileName = std::string(argv[4]) + std::string("WarpedMovingImage.nii.gz"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(warpedMovingImageFileName.c_str()); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -322,7 +322,7 @@ PerformCompositeImageRegistration(int itkNotUsed(argc), char * argv[]) std::string inverseWarpedFixedImageFileName = std::string(argv[4]) + std::string("InverseWarpedFixedImage.nii.gz"); using InverseWriterType = itk::ImageFileWriter; - typename InverseWriterType::Pointer inverseWriter = InverseWriterType::New(); + auto inverseWriter = InverseWriterType::New(); inverseWriter->SetFileName(inverseWarpedFixedImageFileName.c_str()); inverseWriter->SetInput(inverseResampler->GetOutput()); inverseWriter->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest4.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest4.cxx index f90dbda25ad..c97a69a95db 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest4.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTest4.cxx @@ -88,14 +88,14 @@ ImageRegistration(int itkNotUsed(argc), char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -104,14 +104,14 @@ ImageRegistration(int itkNotUsed(argc), char * argv[]) // Set up the centered transform initializer using TransformType = itk::Euler2DTransform; - typename TransformType::Pointer initialTransform = TransformType::New(); + auto initialTransform = TransformType::New(); using MetricType = itk::MeanSquaresImageToImageMetricv4; - typename MetricType::Pointer metric = MetricType::New(); + auto metric = MetricType::New(); using RegistrationType = itk::ImageRegistrationMethodv4; - typename RegistrationType::Pointer registration = RegistrationType::New(); + auto registration = RegistrationType::New(); registration->SetFixedImage(fixedImage); registration->SetMovingImage(movingImage); @@ -120,7 +120,7 @@ ImageRegistration(int itkNotUsed(argc), char * argv[]) registration->SetNumberOfLevels(1); using Optimizerv4Type = itk::ConjugateGradientLineSearchOptimizerv4; - typename Optimizerv4Type::Pointer optimizer = Optimizerv4Type::New(); + auto optimizer = Optimizerv4Type::New(); optimizer->SetLearningRate(1.0); optimizer->SetNumberOfIterations(100); @@ -134,7 +134,7 @@ ImageRegistration(int itkNotUsed(argc), char * argv[]) registration->SetOptimizer(optimizer); using CommandType = CommandIterationUpdate; - typename CommandType::Pointer observer = CommandType::New(); + auto observer = CommandType::New(); optimizer->AddObserver(itk::IterationEvent(), observer); try diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx index c9706e2c141..70c432f42b4 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimpleImageRegistrationTestWithMaskAndSampling.cxx @@ -132,7 +132,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[3]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); @@ -145,17 +145,17 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) using ImageMaskSpatialObjectType = itk::ImageMaskSpatialObject; using MaskImageType = typename ImageMaskSpatialObjectType::ImageType; - typename MaskImageType::Pointer maskImage = MaskImageType::New(); + auto maskImage = MaskImageType::New(); maskImage->CopyInformation(fixedImage); maskImage->SetRegions(fixedImage->GetRequestedRegion()); maskImage->Allocate(); maskImage->FillBuffer(itk::NumericTraits::OneValue()); - typename ImageMaskSpatialObjectType::Pointer maskSpatialObject = ImageMaskSpatialObjectType::New(); + auto maskSpatialObject = ImageMaskSpatialObjectType::New(); maskSpatialObject->SetImage(maskImage); maskSpatialObject->Update(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[4]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -163,10 +163,10 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) movingImage->DisconnectPipeline(); using AffineTransformType = itk::AffineTransform; - typename AffineTransformType::Pointer affineTransform = AffineTransformType::New(); + auto affineTransform = AffineTransformType::New(); using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetObjectName("affineSimple"); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -185,7 +185,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) } using MIMetricType = itk::JointHistogramMutualInformationImageToImageMetricv4; - typename MIMetricType::Pointer mutualInformationMetric = MIMetricType::New(); + auto mutualInformationMetric = MIMetricType::New(); mutualInformationMetric->SetNumberOfHistogramBins(20); mutualInformationMetric->SetUseMovingImageGradientFilter(false); mutualInformationMetric->SetUseFixedImageGradientFilter(false); @@ -195,7 +195,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) affineSimple->SetMetric(mutualInformationMetric); using AffineScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename AffineScalesEstimatorType::Pointer scalesEstimator1 = AffineScalesEstimatorType::New(); + auto scalesEstimator1 = AffineScalesEstimatorType::New(); scalesEstimator1->SetMetric(mutualInformationMetric); scalesEstimator1->SetTransformForward(true); @@ -235,7 +235,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) affineOptimizer->SetScalesEstimator(scalesEstimator1); using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::MultiResolutionIterationEvent(), affineObserver); { @@ -256,7 +256,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) using VectorType = itk::Vector; VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); @@ -265,7 +265,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) using DisplacementFieldTransformType = itk::GaussianSmoothingOnUpdateDisplacementFieldTransform; - typename DisplacementFieldTransformType::Pointer fieldTransform = DisplacementFieldTransformType::New(); + auto fieldTransform = DisplacementFieldTransformType::New(); fieldTransform->SetGaussianSmoothingVarianceForTheUpdateField(0); fieldTransform->SetGaussianSmoothingVarianceForTheTotalField(1.5); fieldTransform->SetDisplacementField(displacementField); @@ -276,7 +276,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) displacementFieldSimple->SetObjectName("displacementFieldSimple"); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -287,11 +287,11 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) // correlationMetric->SetFloatingPointCorrectionResolution(1e4); using ScalesEstimatorType = itk::RegistrationParameterScalesFromPhysicalShift; - typename ScalesEstimatorType::Pointer scalesEstimator = ScalesEstimatorType::New(); + auto scalesEstimator = ScalesEstimatorType::New(); scalesEstimator->SetMetric(correlationMetric); scalesEstimator->SetTransformForward(true); - typename GradientDescentOptimizerv4Type::Pointer optimizer = GradientDescentOptimizerv4Type::New(); + auto optimizer = GradientDescentOptimizerv4Type::New(); optimizer->SetLearningRate(1.0); #ifdef NDEBUG optimizer->SetNumberOfIterations(std::stoi(argv[7])); @@ -348,7 +348,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); @@ -393,12 +393,12 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) << " optimizer: " << displacementFieldSimple->GetOptimizer()->GetNumberOfWorkUnits() << std::endl; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); compositeTransform->AddTransform(displacementFieldSimple->GetModifiableTransform()); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetLargestPossibleRegion().GetSize()); @@ -409,7 +409,7 @@ PerformSimpleImageRegistrationWithMaskAndSampling(int argc, char * argv[]) resampler->Update(); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(resampler->GetOutput()); writer->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx index 9c9d534b6d7..f008aeffa20 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSimplePointSetRegistrationTest.cxx @@ -109,7 +109,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ using PointSetType = itk::PointSet; using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); using PointSetType = PointSetMetricType::FixedPointSetType; using PointType = PointSetType::PointType; @@ -119,10 +119,10 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ using MovingImageType = itk::Image; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // two circles with a small offset @@ -172,7 +172,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ fixedImageDirection.SetIdentity(); fixedImageSpacing.Fill(1); - FixedImageType::Pointer fixedImage = FixedImageType::New(); + auto fixedImage = FixedImageType::New(); fixedImage->SetRegions(fixedImageSize); fixedImage->SetOrigin(fixedImageOrigin); fixedImage->SetDirection(fixedImageDirection); @@ -180,7 +180,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ fixedImage->Allocate(); using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); metric->SetFixedPointSet(fixedPoints); @@ -201,7 +201,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ // optimizer using OptimizerType = itk::GradientDescentOptimizerv4; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetMetric(metric); optimizer->SetNumberOfIterations(numberOfIterations); optimizer->SetScalesEstimator(shiftScaleEstimator); @@ -210,7 +210,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ optimizer->SetConvergenceWindowSize(10); using AffineRegistrationType = itk::ImageRegistrationMethodv4; - AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetObjectName("affineSimple"); affineSimple->SetFixedPointSet(fixedPoints); affineSimple->SetMovingPointSet(movingPoints); @@ -219,7 +219,7 @@ itkSimplePointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ affineSimple->SetOptimizer(optimizer); using AffineCommandType = CommandIterationUpdate; - AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::MultiResolutionIterationEvent(), affineObserver); try diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx index e9550405e65..25262525826 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSyNImageRegistrationTest.cxx @@ -81,7 +81,7 @@ class CommandIterationUpdate : public itk::Command /* testing "itkGetConstObjectMacro" at each iteration */ - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactors); shrinkFilter->SetInput(filter->GetFixedImage()); shrinkFilter->Update(); @@ -119,14 +119,14 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -135,7 +135,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -171,11 +171,11 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using AffineResampleFilterType = itk::ResampleImageFilter; - typename AffineResampleFilterType::Pointer affineResampler = AffineResampleFilterType::New(); + auto affineResampler = AffineResampleFilterType::New(); affineResampler->SetTransform(compositeTransform); affineResampler->SetInput(movingImage); affineResampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -188,7 +188,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) std::string affineMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterAffineTransform.nii.gz"); using AffineWriterType = itk::ImageFileWriter; - typename AffineWriterType::Pointer affineWriter = AffineWriterType::New(); + auto affineWriter = AffineWriterType::New(); affineWriter->SetFileName(affineMovingImageFileName.c_str()); affineWriter->SetInput(affineResampler->GetOutput()); affineWriter->Update(); @@ -199,13 +199,13 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) // Create the SyN deformable registration method using DisplacementFieldType = itk::Image; - typename DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); displacementField->FillBuffer(zeroVector); - typename DisplacementFieldType::Pointer inverseDisplacementField = DisplacementFieldType::New(); + auto inverseDisplacementField = DisplacementFieldType::New(); inverseDisplacementField->CopyInformation(fixedImage); inverseDisplacementField->SetRegions(fixedImage->GetBufferedRegion()); inverseDisplacementField->Allocate(); @@ -216,7 +216,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) DisplacementFieldRegistrationType::New(); using OutputTransformType = typename DisplacementFieldRegistrationType::OutputTransformType; - typename OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); outputTransform->SetDisplacementField(displacementField); outputTransform->SetInverseDisplacementField(inverseDisplacementField); @@ -290,7 +290,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); @@ -307,7 +307,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) } using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -364,7 +364,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) } using DisplacementFieldCommandType = CommandIterationUpdate; - typename DisplacementFieldCommandType::Pointer DisplacementFieldObserver = DisplacementFieldCommandType::New(); + auto DisplacementFieldObserver = DisplacementFieldCommandType::New(); displacementFieldRegistration->AddObserver(itk::IterationEvent(), DisplacementFieldObserver); try @@ -381,7 +381,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) compositeTransform->AddTransform(outputTransform); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -394,7 +394,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) std::string warpedMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterSyN.nii.gz"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(warpedMovingImageFileName.c_str()); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -413,7 +413,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) std::string inverseWarpedFixedImageFileName = std::string(argv[4]) + std::string("InverseWarpedFixedImage.nii.gz"); using InverseWriterType = itk::ImageFileWriter; - typename InverseWriterType::Pointer inverseWriter = InverseWriterType::New(); + auto inverseWriter = InverseWriterType::New(); inverseWriter->SetFileName(inverseWarpedFixedImageFileName.c_str()); inverseWriter->SetInput(inverseResampler->GetOutput()); inverseWriter->Update(); @@ -421,7 +421,7 @@ PerformDisplacementFieldImageRegistration(int itkNotUsed(argc), char * argv[]) std::string displacementFieldFileName = std::string(argv[4]) + std::string("DisplacementField.nii.gz"); using DisplacementFieldWriterType = itk::ImageFileWriter; - typename DisplacementFieldWriterType::Pointer displacementFieldWriter = DisplacementFieldWriterType::New(); + auto displacementFieldWriter = DisplacementFieldWriterType::New(); displacementFieldWriter->SetFileName(displacementFieldFileName.c_str()); displacementFieldWriter->SetInput(outputTransform->GetDisplacementField()); displacementFieldWriter->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx index 991f88e6e74..8a57417d142 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkSyNPointSetRegistrationTest.cxx @@ -29,7 +29,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) using PointSetType = itk::PointSet; using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); using PointSetType = PointSetMetricType::FixedPointSetType; using PointType = PointSetType::PointType; @@ -39,10 +39,10 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) using MovingImageType = itk::Image; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // two circles with a small offset @@ -92,7 +92,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) fixedImageDirection.SetIdentity(); fixedImageSpacing.Fill(1); - FixedImageType::Pointer fixedImage = FixedImageType::New(); + auto fixedImage = FixedImageType::New(); fixedImage->SetRegions(fixedImageSize); fixedImage->SetOrigin(fixedImageOrigin); fixedImage->SetDirection(fixedImageDirection); @@ -100,7 +100,7 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) fixedImage->Allocate(); using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); metric->SetFixedPointSet(fixedPoints); @@ -115,23 +115,23 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) VectorType zeroVector(0.0); using DisplacementFieldType = itk::Image; - DisplacementFieldType::Pointer displacementField = DisplacementFieldType::New(); + auto displacementField = DisplacementFieldType::New(); displacementField->CopyInformation(fixedImage); displacementField->SetRegions(fixedImage->GetBufferedRegion()); displacementField->Allocate(); displacementField->FillBuffer(zeroVector); - DisplacementFieldType::Pointer inverseDisplacementField = DisplacementFieldType::New(); + auto inverseDisplacementField = DisplacementFieldType::New(); inverseDisplacementField->CopyInformation(fixedImage); inverseDisplacementField->SetRegions(fixedImage->GetBufferedRegion()); inverseDisplacementField->Allocate(); inverseDisplacementField->FillBuffer(zeroVector); using DisplacementFieldRegistrationType = itk::SyNImageRegistrationMethod; - DisplacementFieldRegistrationType::Pointer displacementFieldRegistration = DisplacementFieldRegistrationType::New(); + auto displacementFieldRegistration = DisplacementFieldRegistrationType::New(); using OutputTransformType = DisplacementFieldRegistrationType::OutputTransformType; - OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); outputTransform->SetDisplacementField(displacementField); outputTransform->SetInverseDisplacementField(inverseDisplacementField); @@ -176,12 +176,12 @@ itkSyNPointSetRegistrationTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) // usage, we could calculate these fixed parameters directly. using ShrinkFilterType = itk::ShrinkImageFilter; - ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(displacementField); shrinkFilter->Update(); - DisplacementFieldTransformAdaptorType::Pointer fieldTransformAdaptor = DisplacementFieldTransformAdaptorType::New(); + auto fieldTransformAdaptor = DisplacementFieldTransformAdaptorType::New(); fieldTransformAdaptor->SetRequiredSpacing(shrinkFilter->GetOutput()->GetSpacing()); fieldTransformAdaptor->SetRequiredSize(shrinkFilter->GetOutput()->GetBufferedRegion().GetSize()); fieldTransformAdaptor->SetRequiredDirection(shrinkFilter->GetOutput()->GetDirection()); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx index b2a50a08401..a22fe3b4fb2 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldImageRegistrationTest.cxx @@ -112,14 +112,14 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -128,7 +128,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -149,7 +149,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) std::cout << "number of affine iterations: " << numberOfAffineIterations << std::endl; using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); ITK_TRY_EXPECT_NO_EXCEPTION(affineSimple->Update()); @@ -163,11 +163,11 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using AffineResampleFilterType = itk::ResampleImageFilter; - typename AffineResampleFilterType::Pointer affineResampler = AffineResampleFilterType::New(); + auto affineResampler = AffineResampleFilterType::New(); affineResampler->SetTransform(compositeTransform); affineResampler->SetInput(movingImage); affineResampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -180,13 +180,13 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) std::string affineMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterAffineTransform.nii.gz"); using AffineWriterType = itk::ImageFileWriter; - typename AffineWriterType::Pointer affineWriter = AffineWriterType::New(); + auto affineWriter = AffineWriterType::New(); affineWriter->SetFileName(affineMovingImageFileName.c_str()); affineWriter->SetInput(affineResampler->GetOutput()); affineWriter->Update(); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -195,10 +195,10 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) using VelocityFieldRegistrationType = itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod; - typename VelocityFieldRegistrationType::Pointer velocityFieldRegistration = VelocityFieldRegistrationType::New(); + auto velocityFieldRegistration = VelocityFieldRegistrationType::New(); using OutputTransformType = typename VelocityFieldRegistrationType::OutputTransformType; - typename OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); velocityFieldRegistration->SetInitialTransform(outputTransform); velocityFieldRegistration->InPlaceOn(); @@ -327,7 +327,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) for (unsigned int level = 0; level < shrinkFactorsPerLevel.Size(); ++level) { using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(fixedImage); shrinkFilter->Update(); @@ -383,7 +383,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) compositeTransform->AddTransform(outputTransform); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -397,7 +397,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) std::string(argv[4]) + std::string("MovingImageAfterVelocityFieldTransform.nii.gz"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(warpedMovingImageFileName.c_str()); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -416,7 +416,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) std::string inverseWarpedFixedImageFileName = std::string(argv[4]) + std::string("InverseWarpedFixedImage.nii.gz"); using InverseWriterType = itk::ImageFileWriter; - typename InverseWriterType::Pointer inverseWriter = InverseWriterType::New(); + auto inverseWriter = InverseWriterType::New(); inverseWriter->SetFileName(inverseWarpedFixedImageFileName.c_str()); inverseWriter->SetInput(inverseResampler->GetOutput()); inverseWriter->Update(); @@ -425,7 +425,7 @@ PerformTimeVaryingBSplineVelocityFieldImageRegistration(int argc, char * argv[]) std::string(argv[4]) + std::string("VelocityFieldControlPointLattice.nii.gz"); using VelocityFieldWriterType = itk::ImageFileWriter; - typename VelocityFieldWriterType::Pointer velocityFieldLatticeWriter = VelocityFieldWriterType::New(); + auto velocityFieldLatticeWriter = VelocityFieldWriterType::New(); velocityFieldLatticeWriter->SetFileName(velocityFieldLatticeFileName.c_str()); velocityFieldLatticeWriter->SetInput(outputTransform->GetTimeVaryingVelocityFieldControlPointLattice()); velocityFieldLatticeWriter->Update(); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx index 0520271ac0b..91196396f0e 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest.cxx @@ -31,7 +31,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), using PointSetType = itk::PointSet; using PointSetMetricType = itk::EuclideanDistancePointSetToPointSetMetricv4; - PointSetMetricType::Pointer metric = PointSetMetricType::New(); + auto metric = PointSetMetricType::New(); using PointSetType = PointSetMetricType::FixedPointSetType; using PointType = PointSetType::PointType; @@ -41,10 +41,10 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), using MovingImageType = itk::Image; - PointSetType::Pointer fixedPoints = PointSetType::New(); + auto fixedPoints = PointSetType::New(); fixedPoints->Initialize(); - PointSetType::Pointer movingPoints = PointSetType::New(); + auto movingPoints = PointSetType::New(); movingPoints->Initialize(); // two circles with a small offset @@ -89,7 +89,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), fixedImageDirection.SetIdentity(); fixedImageSpacing.Fill(1); - FixedImageType::Pointer fixedImage = FixedImageType::New(); + auto fixedImage = FixedImageType::New(); fixedImage->SetRegions(fixedImageSize); fixedImage->SetOrigin(fixedImageOrigin); fixedImage->SetDirection(fixedImageDirection); @@ -97,7 +97,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), fixedImage->Allocate(); using AffineTransformType = itk::AffineTransform; - AffineTransformType::Pointer transform = AffineTransformType::New(); + auto transform = AffineTransformType::New(); transform->SetIdentity(); metric->SetFixedPointSet(fixedPoints); @@ -110,10 +110,10 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), using VelocityFieldRegistrationType = itk::TimeVaryingBSplineVelocityFieldImageRegistrationMethod; - VelocityFieldRegistrationType::Pointer velocityFieldRegistration = VelocityFieldRegistrationType::New(); + auto velocityFieldRegistration = VelocityFieldRegistrationType::New(); using OutputTransformType = VelocityFieldRegistrationType::OutputTransformType; - OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); velocityFieldRegistration->SetInitialTransform(outputTransform); velocityFieldRegistration->InPlaceOn(); @@ -180,7 +180,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), using VelocityFieldTransformAdaptorType = itk::TimeVaryingBSplineVelocityFieldTransformParametersAdaptor; - VelocityFieldTransformAdaptorType::Pointer initialFieldTransformAdaptor = VelocityFieldTransformAdaptorType::New(); + auto initialFieldTransformAdaptor = VelocityFieldTransformAdaptorType::New(); initialFieldTransformAdaptor->SetSplineOrder(outputTransform->GetSplineOrder()); initialFieldTransformAdaptor->SetRequiredTransformDomainOrigin(transformDomainOrigin); initialFieldTransformAdaptor->SetRequiredTransformDomainSpacing(transformDomainSpacing); @@ -230,7 +230,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), for (unsigned int level = 0; level < shrinkFactorsPerLevel.Size(); ++level) { using ShrinkFilterType = itk::ShrinkImageFilter; - ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(fixedImage); shrinkFilter->Update(); @@ -262,7 +262,7 @@ itkTimeVaryingBSplineVelocityFieldPointSetRegistrationTest(int itkNotUsed(argc), } } - VelocityFieldTransformAdaptorType::Pointer fieldTransformAdaptor = VelocityFieldTransformAdaptorType::New(); + auto fieldTransformAdaptor = VelocityFieldTransformAdaptorType::New(); fieldTransformAdaptor->SetSplineOrder(outputTransform->GetSplineOrder()); fieldTransformAdaptor->SetRequiredTransformDomainSpacing(velocityFieldSpacing); fieldTransformAdaptor->SetRequiredTransformDomainSize(velocityFieldSize); diff --git a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx index 61541caf498..fc507bce267 100644 --- a/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx +++ b/Modules/Registration/RegistrationMethodsv4/test/itkTimeVaryingVelocityFieldImageRegistrationTest.cxx @@ -112,14 +112,14 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) using ImageReaderType = itk::ImageFileReader; - typename ImageReaderType::Pointer fixedImageReader = ImageReaderType::New(); + auto fixedImageReader = ImageReaderType::New(); fixedImageReader->SetFileName(argv[2]); fixedImageReader->Update(); typename FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput(); fixedImage->Update(); fixedImage->DisconnectPipeline(); - typename ImageReaderType::Pointer movingImageReader = ImageReaderType::New(); + auto movingImageReader = ImageReaderType::New(); movingImageReader->SetFileName(argv[3]); movingImageReader->Update(); typename MovingImageType::Pointer movingImage = movingImageReader->GetOutput(); @@ -128,7 +128,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) using AffineTransformType = itk::AffineTransform; using AffineRegistrationType = itk::ImageRegistrationMethodv4; - typename AffineRegistrationType::Pointer affineSimple = AffineRegistrationType::New(); + auto affineSimple = AffineRegistrationType::New(); affineSimple->SetFixedImage(fixedImage); affineSimple->SetMovingImage(movingImage); @@ -149,7 +149,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) std::cout << "number of affine iterations: " << numberOfAffineIterations << std::endl; using AffineCommandType = CommandIterationUpdate; - typename AffineCommandType::Pointer affineObserver = AffineCommandType::New(); + auto affineObserver = AffineCommandType::New(); affineSimple->AddObserver(itk::IterationEvent(), affineObserver); ITK_TRY_EXPECT_NO_EXCEPTION(affineSimple->Update()); @@ -163,11 +163,11 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) using RealType = typename AffineRegistrationType::RealType; using CompositeTransformType = itk::CompositeTransform; - typename CompositeTransformType::Pointer compositeTransform = CompositeTransformType::New(); + auto compositeTransform = CompositeTransformType::New(); compositeTransform->AddTransform(affineSimple->GetModifiableTransform()); using AffineResampleFilterType = itk::ResampleImageFilter; - typename AffineResampleFilterType::Pointer affineResampler = AffineResampleFilterType::New(); + auto affineResampler = AffineResampleFilterType::New(); affineResampler->SetTransform(compositeTransform); affineResampler->SetInput(movingImage); affineResampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -180,7 +180,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) std::string affineMovingImageFileName = std::string(argv[4]) + std::string("MovingImageAfterAffineTransform.nii.gz"); using AffineWriterType = itk::ImageFileWriter; - typename AffineWriterType::Pointer affineWriter = AffineWriterType::New(); + auto affineWriter = AffineWriterType::New(); affineWriter->SetFileName(affineMovingImageFileName.c_str()); affineWriter->SetInput(affineResampler->GetOutput()); affineWriter->Update(); @@ -191,7 +191,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) // Determine the parameters (size, spacing, etc) for the time-varying velocity field // Here we use 10 time index points. using TimeVaryingVelocityFieldType = itk::Image; - typename TimeVaryingVelocityFieldType::Pointer velocityField = TimeVaryingVelocityFieldType::New(); + auto velocityField = TimeVaryingVelocityFieldType::New(); typename TimeVaryingVelocityFieldType::IndexType velocityFieldIndex; typename TimeVaryingVelocityFieldType::SizeType velocityFieldSize; @@ -235,7 +235,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) velocityField->FillBuffer(zeroVector); using CorrelationMetricType = itk::ANTSNeighborhoodCorrelationImageToImageMetricv4; - typename CorrelationMetricType::Pointer correlationMetric = CorrelationMetricType::New(); + auto correlationMetric = CorrelationMetricType::New(); typename CorrelationMetricType::RadiusType radius; radius.Fill(4); correlationMetric->SetRadius(radius); @@ -244,10 +244,10 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) using VelocityFieldRegistrationType = itk::TimeVaryingVelocityFieldImageRegistrationMethodv4; - typename VelocityFieldRegistrationType::Pointer velocityFieldRegistration = VelocityFieldRegistrationType::New(); + auto velocityFieldRegistration = VelocityFieldRegistrationType::New(); using OutputTransformType = typename VelocityFieldRegistrationType::OutputTransformType; - typename OutputTransformType::Pointer outputTransform = OutputTransformType::New(); + auto outputTransform = OutputTransformType::New(); velocityFieldRegistration->SetFixedImage(fixedImage); velocityFieldRegistration->SetMovingInitialTransform(compositeTransform); @@ -300,7 +300,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) for (unsigned int level = 0; level < shrinkFactorsPerLevel.Size(); ++level) { using ShrinkFilterType = itk::ShrinkImageFilter; - typename ShrinkFilterType::Pointer shrinkFilter = ShrinkFilterType::New(); + auto shrinkFilter = ShrinkFilterType::New(); shrinkFilter->SetShrinkFactors(shrinkFactorsPerLevel[level]); shrinkFilter->SetInput(fixedImage); shrinkFilter->Update(); @@ -351,7 +351,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) compositeTransform->AddTransform(outputTransform); using ResampleFilterType = itk::ResampleImageFilter; - typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); + auto resampler = ResampleFilterType::New(); resampler->SetTransform(compositeTransform); resampler->SetInput(movingImage); resampler->SetSize(fixedImage->GetBufferedRegion().GetSize()); @@ -365,7 +365,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) std::string(argv[4]) + std::string("MovingImageAfterVelocityFieldTransform.nii.gz"); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(warpedMovingImageFileName.c_str()); writer->SetInput(resampler->GetOutput()); writer->Update(); @@ -384,7 +384,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) std::string inverseWarpedFixedImageFileName = std::string(argv[4]) + std::string("InverseWarpedFixedImage.nii.gz"); using InverseWriterType = itk::ImageFileWriter; - typename InverseWriterType::Pointer inverseWriter = InverseWriterType::New(); + auto inverseWriter = InverseWriterType::New(); inverseWriter->SetFileName(inverseWarpedFixedImageFileName.c_str()); inverseWriter->SetInput(inverseResampler->GetOutput()); inverseWriter->Update(); @@ -392,7 +392,7 @@ PerformTimeVaryingVelocityFieldImageRegistration(int argc, char * argv[]) std::string velocityFieldFileName = std::string(argv[4]) + std::string("VelocityField.nii.gz"); using VelocityFieldWriterType = itk::ImageFileWriter; - typename VelocityFieldWriterType::Pointer velocityFieldWriter = VelocityFieldWriterType::New(); + auto velocityFieldWriter = VelocityFieldWriterType::New(); velocityFieldWriter->SetFileName(velocityFieldFileName.c_str()); velocityFieldWriter->SetInput(outputTransform->GetVelocityField()); velocityFieldWriter->Update(); diff --git a/Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.hxx b/Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.hxx index e7dc28e8002..94600740e6b 100644 --- a/Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.hxx +++ b/Modules/Segmentation/Classifiers/include/itkBayesianClassifierImageFilter.hxx @@ -279,7 +279,7 @@ BayesianClassifierImageFilterCopyInformation(this->GetPosteriorImage()); extractedComponentImage->SetBufferedRegion(this->GetPosteriorImage()->GetBufferedRegion()); extractedComponentImage->SetRequestedRegion(this->GetPosteriorImage()->GetRequestedRegion()); diff --git a/Modules/Segmentation/Classifiers/include/itkBayesianClassifierInitializationImageFilter.hxx b/Modules/Segmentation/Classifiers/include/itkBayesianClassifierInitializationImageFilter.hxx index c23653edc7b..a53f14f5863 100644 --- a/Modules/Segmentation/Classifiers/include/itkBayesianClassifierInitializationImageFilter.hxx +++ b/Modules/Segmentation/Classifiers/include/itkBayesianClassifierInitializationImageFilter.hxx @@ -89,7 +89,7 @@ BayesianClassifierInitializationImageFilter; // Run k means to get the means from the input image - typename KMeansFilterType::Pointer kmeansFilter = KMeansFilterType::New(); + auto kmeansFilter = KMeansFilterType::New(); kmeansFilter->SetInput(this->GetInput()); kmeansFilter->SetUseNonContiguousLabels(false); @@ -175,7 +175,7 @@ BayesianClassifierInitializationImageFilterReserve(m_NumberOfClasses); @@ -196,7 +196,7 @@ BayesianClassifierInitializationImageFilterFill(estimatedMeans[i]); covarianceEstimators->Fill(estimatedCovariances[i]); - typename GaussianMembershipFunctionType::Pointer gaussianDensityFunction = GaussianMembershipFunctionType::New(); + auto gaussianDensityFunction = GaussianMembershipFunctionType::New(); gaussianDensityFunction->SetMean(*(meanEstimatorsContainer->GetElement(i))); gaussianDensityFunction->SetCovariance(*(covarianceEstimatorsContainer->GetElement(i))); diff --git a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx index d7e09ddd2d8..fbd92fa5207 100644 --- a/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx +++ b/Modules/Segmentation/Classifiers/include/itkScalarImageKmeansImageFilter.hxx @@ -57,14 +57,14 @@ template void ScalarImageKmeansImageFilter::GenerateData() { - typename AdaptorType::Pointer adaptor = AdaptorType::New(); + auto adaptor = AdaptorType::New(); // Setup the regions here if a sub-region has been specified to restrict // classification on. Since this is not ThreadedGenenerateData, we are // safe... if (m_ImageRegionDefined) { - typename RegionOfInterestFilterType::Pointer regionOfInterestFilter = RegionOfInterestFilterType::New(); + auto regionOfInterestFilter = RegionOfInterestFilterType::New(); regionOfInterestFilter->SetRegionOfInterest(m_ImageRegion); regionOfInterestFilter->SetInput(this->GetInput()); regionOfInterestFilter->Update(); @@ -75,13 +75,13 @@ ScalarImageKmeansImageFilter::GenerateData() adaptor->SetImage(this->GetInput()); } - typename TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); treeGenerator->SetSample(adaptor); treeGenerator->SetBucketSize(16); treeGenerator->Update(); - typename EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); const size_t numberOfClasses = this->m_InitialMeans.size(); @@ -103,8 +103,8 @@ ScalarImageKmeansImageFilter::GenerateData() using RegionType = typename InputImageType::RegionType; // Now classify the samples - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); - typename ClassifierType::Pointer classifier = ClassifierType::New(); + auto decisionRule = DecisionRuleType::New(); + auto classifier = ClassifierType::New(); classifier->SetDecisionRule(decisionRule); classifier->SetInput(adaptor); @@ -143,7 +143,7 @@ ScalarImageKmeansImageFilter::GenerateData() classifier->SetMembershipFunctions(membershipFunctionsObject); using ClassLabelVectorObjectType = typename ClassifierType::ClassLabelVectorObjectType; - typename ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); classLabelsObject->Set(classLabels); classifier->SetClassLabels(classLabelsObject); diff --git a/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx index b71ed35f79f..56ea7e75a98 100644 --- a/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkBayesianClassifierImageFilterTest.cxx @@ -39,12 +39,12 @@ TestBayesianClassifierImageFilterWithNoPriors(typename TInputImage::Pointer imag using BayesianClassifierInitializerType = TBayesianClassifierInitializer; using BayesianClassifierFilterType = TBayesianClassifierFilter; - typename BayesianClassifierInitializerType::Pointer bayesianInitializer = BayesianClassifierInitializerType::New(); + auto bayesianInitializer = BayesianClassifierInitializerType::New(); bayesianInitializer->SetInput(image); bayesianInitializer->SetNumberOfClasses(numberOfClasses); - typename BayesianClassifierFilterType::Pointer bayesianClassifier = BayesianClassifierFilterType::New(); + auto bayesianClassifier = BayesianClassifierFilterType::New(); bayesianClassifier->SetInput(bayesianInitializer->GetOutput()); @@ -54,7 +54,7 @@ TestBayesianClassifierImageFilterWithNoPriors(typename TInputImage::Pointer imag using ExtractedComponentImageType = typename BayesianClassifierFilterType::ExtractedComponentImageType; using SmoothingFilterType = itk::GradientAnisotropicDiffusionImageFilter; - typename SmoothingFilterType::Pointer smoother = SmoothingFilterType::New(); + auto smoother = SmoothingFilterType::New(); smoother->SetNumberOfIterations(1); smoother->SetTimeStep(0.125); smoother->SetConductanceParameter(3); @@ -64,21 +64,21 @@ TestBayesianClassifierImageFilterWithNoPriors(typename TInputImage::Pointer imag using MonitorFilterType = itk::PipelineMonitorImageFilter; - typename MonitorFilterType::Pointer monitor = MonitorFilterType::New(); + auto monitor = MonitorFilterType::New(); monitor->SetInput(bayesianClassifier->GetOutput()); using ClassifierOutputImageType = typename BayesianClassifierFilterType::OutputImageType; using OutputImageType = itk::Image; using RescalerType = itk::RescaleIntensityImageFilter; - typename RescalerType::Pointer rescaler = RescalerType::New(); + auto rescaler = RescalerType::New(); rescaler->SetInput(monitor->GetOutput()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); writer->SetInput(rescaler->GetOutput()); @@ -106,13 +106,13 @@ TestBayesianClassifierImageFilterWithPriors(typename TInputImage::Pointer using BayesianClassifierInitializerType = TBayesianClassifierInitializer; using BayesianClassifierFilterType = TBayesianClassifierFilter; - typename BayesianClassifierInitializerType::Pointer bayesianInitializer = BayesianClassifierInitializerType::New(); + auto bayesianInitializer = BayesianClassifierInitializerType::New(); bayesianInitializer->SetInput(image); bayesianInitializer->SetNumberOfClasses(numberOfClasses); - typename BayesianClassifierFilterType::Pointer bayesianClassifier = BayesianClassifierFilterType::New(); + auto bayesianClassifier = BayesianClassifierFilterType::New(); bayesianClassifier->SetInput(bayesianInitializer->GetOutput()); bayesianClassifier->SetPriors(priorsImage); @@ -123,7 +123,7 @@ TestBayesianClassifierImageFilterWithPriors(typename TInputImage::Pointer using ExtractedComponentImageType = typename BayesianClassifierFilterType::ExtractedComponentImageType; using SmoothingFilterType = itk::GradientAnisotropicDiffusionImageFilter; - typename SmoothingFilterType::Pointer smoother = SmoothingFilterType::New(); + auto smoother = SmoothingFilterType::New(); smoother->SetNumberOfIterations(1); smoother->SetTimeStep(0.125); smoother->SetConductanceParameter(3); @@ -133,21 +133,21 @@ TestBayesianClassifierImageFilterWithPriors(typename TInputImage::Pointer using MonitorFilterType = itk::PipelineMonitorImageFilter; - typename MonitorFilterType::Pointer monitor = MonitorFilterType::New(); + auto monitor = MonitorFilterType::New(); monitor->SetInput(bayesianClassifier->GetOutput()); using ClassifierOutputImageType = typename BayesianClassifierFilterType::OutputImageType; using OutputImageType = itk::Image; using RescalerType = itk::RescaleIntensityImageFilter; - typename RescalerType::Pointer rescaler = RescalerType::New(); + auto rescaler = RescalerType::New(); rescaler->SetInput(monitor->GetOutput()); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outputFilename); writer->SetInput(rescaler->GetOutput()); @@ -185,13 +185,13 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) using BayesianInitializerType = itk::BayesianClassifierInitializationImageFilter; - BayesianInitializerType::Pointer bayesianInitializer = BayesianInitializerType::New(); + auto bayesianInitializer = BayesianInitializerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( bayesianInitializer, BayesianClassifierInitializationImageFilter, ImageToImageFilter); - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -213,7 +213,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) using BayesianClassifierFilterType = itk::BayesianClassifierImageFilter; - BayesianClassifierFilterType::Pointer bayesianClassifier = BayesianClassifierFilterType::New(); + auto bayesianClassifier = BayesianClassifierFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(bayesianClassifier, BayesianClassifierImageFilter, ImageToImageFilter); @@ -237,7 +237,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) const InputImageType * priorsInputImage = reader->GetOutput(); - PriorsImageType::Pointer priorsImage = PriorsImageType::New(); + auto priorsImage = PriorsImageType::New(); priorsImage->CopyInformation(priorsInputImage); priorsImage->SetRegions(inputImage->GetLargestPossibleRegion()); priorsImage->SetNumberOfComponentsPerPixel(5); @@ -262,7 +262,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) using ClassifierFilterType = itk::BayesianClassifierImageFilter; - ClassifierFilterType::Pointer filter = ClassifierFilterType::New(); + auto filter = ClassifierFilterType::New(); if (filter.IsNull()) { @@ -282,7 +282,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) using ClassifierFilterType = itk::BayesianClassifierImageFilter; - ClassifierFilterType::Pointer filter = ClassifierFilterType::New(); + auto filter = ClassifierFilterType::New(); if (filter.IsNull()) { return EXIT_FAILURE; @@ -302,7 +302,7 @@ itkBayesianClassifierImageFilterTest(int argc, char * argv[]) using ClassifierFilterType = itk::BayesianClassifierImageFilter; - ClassifierFilterType::Pointer filter = ClassifierFilterType::New(); + auto filter = ClassifierFilterType::New(); if (filter.IsNull()) { return EXIT_FAILURE; diff --git a/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx index 774766ab714..259095f924d 100644 --- a/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkImageClassifierFilterTest.cxx @@ -52,10 +52,10 @@ itkImageClassifierFilterTest(int argc, char * argv[]) // Generate an image with pixel intensities generated from two normal // distributions using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); - InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); InputImageType::IndexType start; InputImageType::SizeType size; @@ -109,7 +109,7 @@ itkImageClassifierFilterTest(int argc, char * argv[]) // to EM estimator using ImageToListSampleAdaptorType = itk::Statistics::ImageToListSampleAdaptor; - ImageToListSampleAdaptorType::Pointer sample = ImageToListSampleAdaptorType::New(); + auto sample = ImageToListSampleAdaptorType::New(); sample->SetImage(image); // Use EM estimator to estimate gaussian membership functions @@ -138,7 +138,7 @@ itkImageClassifierFilterTest(int argc, char * argv[]) } /* Estimating */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); estimator->SetSample(sample); int maximumIteration = 200; @@ -169,12 +169,12 @@ itkImageClassifierFilterTest(int argc, char * argv[]) using ImageClassifierFilterType = itk::Statistics::ImageClassifierFilter; - ImageClassifierFilterType::Pointer filter = ImageClassifierFilterType::New(); + auto filter = ImageClassifierFilterType::New(); using ClassLabelVectorObjectType = ImageClassifierFilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = ImageClassifierFilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); // Add class labels ClassLabelVectorType & classLabelVector = classLabelsObject->Get(); @@ -190,7 +190,7 @@ itkImageClassifierFilterTest(int argc, char * argv[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MaximumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const ImageClassifierFilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -282,7 +282,7 @@ itkImageClassifierFilterTest(int argc, char * argv[]) // Write out the classified image using OutputImageWriterType = itk::ImageFileWriter; - OutputImageWriterType::Pointer outputImageWriter = OutputImageWriterType::New(); + auto outputImageWriter = OutputImageWriterType::New(); outputImageWriter->SetFileName(argv[1]); outputImageWriter->SetInput(filter->GetOutput()); outputImageWriter->Update(); diff --git a/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx b/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx index 8f24c1572ef..0d3fd2a6eaf 100644 --- a/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkKmeansModelEstimatorTest.cxx @@ -62,7 +62,7 @@ itkKmeansModelEstimatorTest(int, char *[]) using VecImagePixelType = VecImageType::PixelType; - VecImageType::Pointer vecImage = VecImageType::New(); + auto vecImage = VecImageType::New(); VecImageType::SizeType vecImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; @@ -233,7 +233,7 @@ itkKmeansModelEstimatorTest(int, char *[]) //---------------------------------------------------------------------- using ImageKmeansModelEstimatorType = itk::ImageKmeansModelEstimator; - ImageKmeansModelEstimatorType::Pointer applyKmeansEstimator = ImageKmeansModelEstimatorType::New(); + auto applyKmeansEstimator = ImageKmeansModelEstimatorType::New(); //---------------------------------------------------------------------- // Set the parameters of the clusterer diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx index 8dd53f0f089..f90f3874a65 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest1.cxx @@ -42,9 +42,9 @@ itkSampleClassifierFilterTest1(int, char *[]) using FilterType = itk::Statistics::SampleClassifierFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(numberOfComponents); // Test GetInput() before setting the input @@ -106,10 +106,10 @@ itkSampleClassifierFilterTest1(int, char *[]) using MembershipFunctionPointer = MembershipFunctionType::Pointer; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); filter->SetClassLabels(classLabelsObject); - MembershipFunctionVectorObjectType::Pointer membershipFunctionsObject = MembershipFunctionVectorObjectType::New(); + auto membershipFunctionsObject = MembershipFunctionVectorObjectType::New(); filter->SetMembershipFunctions(membershipFunctionsObject); // Run the filter without specifying any membership functions. An exception @@ -199,7 +199,7 @@ itkSampleClassifierFilterTest1(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MaximumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); filter->SetDecisionRule(decisionRule); if (filter->GetDecisionRule() != decisionRule) diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx index 02b6570c920..81d0b5ad625 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest2.cxx @@ -37,9 +37,9 @@ itkSampleClassifierFilterTest2(int, char *[]) using SampleType = itk::Statistics::ListSample; using FilterType = itk::Statistics::SampleClassifierFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(numberOfComponents); filter->SetNumberOfClasses(numberOfClasses); @@ -61,10 +61,10 @@ itkSampleClassifierFilterTest2(int, char *[]) using MembershipFunctionPointer = MembershipFunctionType::Pointer; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); filter->SetClassLabels(classLabelsObject); - MembershipFunctionVectorObjectType::Pointer membershipFunctionsObject = MembershipFunctionVectorObjectType::New(); + auto membershipFunctionsObject = MembershipFunctionVectorObjectType::New(); filter->SetMembershipFunctions(membershipFunctionsObject); // Add three membership functions and rerun the filter MembershipFunctionVectorType & membershipFunctionsVector = membershipFunctionsObject->Get(); @@ -112,7 +112,7 @@ itkSampleClassifierFilterTest2(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MaximumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); filter->SetDecisionRule(decisionRule); // Generate samples from a Gaussian distribution with mean and @@ -121,7 +121,7 @@ itkSampleClassifierFilterTest2(int, char *[]) // the first class using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx index ac19d2eba6c..edb57c237a2 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest3.cxx @@ -43,11 +43,11 @@ itkSampleClassifierFilterTest3(int, char *[]) using EstimatorType = itk::Statistics::KdTreeBasedKmeansEstimator; // Generate a sample list - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(numberOfComponents); using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); // Populate the list with samples from two normal distributions @@ -89,17 +89,17 @@ itkSampleClassifierFilterTest3(int, char *[]) using ClassLabelVectorObjectType = FilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = FilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); /* Creating k-d tree */ - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); generator->SetSample(sample); unsigned int bucketSize = 1; generator->SetBucketSize(bucketSize); generator->GenerateData(); /* Searching kmeans */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); itk::Array initialMeans(2); initialMeans[0] = 5; @@ -126,7 +126,7 @@ itkSampleClassifierFilterTest3(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const FilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -167,7 +167,7 @@ itkSampleClassifierFilterTest3(int, char *[]) weightArrayObjects->Set(weightsArray); // Instantiate and pass all the required inputs to the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); filter->SetNumberOfClasses(numberOfClasses); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx index b62410a8253..940a62358e4 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest4.cxx @@ -43,10 +43,10 @@ itkSampleClassifierFilterTest4(int, char *[]) using EstimatorType = itk::Statistics::KdTreeBasedKmeansEstimator; // Generate a sample list - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); // Populate the list with samples from two normal distributions @@ -86,17 +86,17 @@ itkSampleClassifierFilterTest4(int, char *[]) using ClassLabelVectorObjectType = FilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = FilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); /* Creating k-d tree */ - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); generator->SetSample(sample); unsigned int bucketSize = 1; generator->SetBucketSize(bucketSize); generator->GenerateData(); /* Searching kmeans */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); itk::Array initialMeans(2); initialMeans[0] = 5; @@ -123,7 +123,7 @@ itkSampleClassifierFilterTest4(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const FilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -153,7 +153,7 @@ itkSampleClassifierFilterTest4(int, char *[]) } // Instantiate and pass all the required inputs to the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); filter->SetNumberOfClasses(numberOfClasses); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx index 57c35e326c7..d6b32a047ce 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest5.cxx @@ -43,11 +43,11 @@ itkSampleClassifierFilterTest5(int, char *[]) using EstimatorType = itk::Statistics::KdTreeBasedKmeansEstimator; // Generate a sample list - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(numberOfComponents); using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); // Populate the list with samples from two normal distributions @@ -89,17 +89,17 @@ itkSampleClassifierFilterTest5(int, char *[]) using ClassLabelVectorObjectType = FilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = FilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); /* Creating k-d tree */ - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); generator->SetSample(sample); unsigned int bucketSize = 1; generator->SetBucketSize(bucketSize); generator->GenerateData(); /* Searching kmeans */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); itk::Array initialMeans(2); initialMeans[0] = 5; @@ -126,7 +126,7 @@ itkSampleClassifierFilterTest5(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const FilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -156,7 +156,7 @@ itkSampleClassifierFilterTest5(int, char *[]) } // Instantiate and pass all the required inputs to the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); filter->SetNumberOfClasses(numberOfClasses); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx index 60a0a369621..d0a96fdce64 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest6.cxx @@ -43,11 +43,11 @@ itkSampleClassifierFilterTest6(int, char *[]) using EstimatorType = itk::Statistics::KdTreeBasedKmeansEstimator; // Generate a sample list - SampleType::Pointer sample = SampleType::New(); + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(numberOfComponents); using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); + auto normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize(101); // Populate the list with samples from two normal distributions @@ -88,17 +88,17 @@ itkSampleClassifierFilterTest6(int, char *[]) using ClassLabelVectorObjectType = FilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = FilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); /* Creating k-d tree */ - GeneratorType::Pointer generator = GeneratorType::New(); + auto generator = GeneratorType::New(); generator->SetSample(sample); unsigned int bucketSize = 1; generator->SetBucketSize(bucketSize); generator->GenerateData(); /* Searching kmeans */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); itk::Array initialMeans(2); initialMeans[0] = 5; @@ -125,7 +125,7 @@ itkSampleClassifierFilterTest6(int, char *[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const FilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -155,7 +155,7 @@ itkSampleClassifierFilterTest6(int, char *[]) } // Instantiate and pass all the required inputs to the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(sample); filter->SetNumberOfClasses(numberOfClasses); diff --git a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx index d34fdc06303..7cb647950ed 100644 --- a/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSampleClassifierFilterTest7.cxx @@ -92,7 +92,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) initialProportions[1] = 0.5; /* Loading point data */ - PointSetType::Pointer pointSet = PointSetType::New(); + auto pointSet = PointSetType::New(); PointSetType::PointsContainerPointer pointsContainer = PointSetType::PointsContainer::New(); constexpr int dataSizeBig = 2000; pointsContainer->Reserve(dataSizeBig); @@ -124,7 +124,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) dataStream.close(); /* Importing the point set to the sample */ - DataSampleType::Pointer sample = DataSampleType::New(); + auto sample = DataSampleType::New(); sample->SetPointSet(pointSet); @@ -139,7 +139,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) } /* Estimating */ - EstimatorType::Pointer estimator = EstimatorType::New(); + auto estimator = EstimatorType::New(); estimator->SetSample(sample); estimator->SetMaximumIteration(maximumIteration); estimator->SetInitialProportions(initialProportions); @@ -180,12 +180,12 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) // Set up a classifier using FilterType = itk::Statistics::SampleClassifierFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); using ClassLabelVectorObjectType = FilterType::ClassLabelVectorObjectType; using ClassLabelVectorType = FilterType::ClassLabelVectorType; - ClassLabelVectorObjectType::Pointer classLabelsObject = ClassLabelVectorObjectType::New(); + auto classLabelsObject = ClassLabelVectorObjectType::New(); // Add class labels ClassLabelVectorType & classLabelVector = classLabelsObject->Get(); @@ -201,7 +201,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) // Set a decision rule type using DecisionRuleType = itk::Statistics::MaximumDecisionRule; - DecisionRuleType::Pointer decisionRule = DecisionRuleType::New(); + auto decisionRule = DecisionRuleType::New(); const FilterType::MembershipFunctionVectorObjectType * membershipFunctionsObject = estimator->GetOutput(); @@ -250,7 +250,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) return EXIT_FAILURE; } - PointSetType::Pointer pointSet2 = PointSetType::New(); + auto pointSet2 = PointSetType::New(); PointSetType::PointsContainerPointer pointsContainer2 = PointSetType::PointsContainer::New(); constexpr int dataSizeSmall = 200; pointsContainer2->Reserve(dataSizeSmall); @@ -272,7 +272,7 @@ itkSampleClassifierFilterTest7(int argc, char * argv[]) dataTargetStream.close(); /* Importing the point set to the sample */ - DataSampleType::Pointer sampleTarget = DataSampleType::New(); + auto sampleTarget = DataSampleType::New(); sampleTarget->SetPointSet(pointSet2); diff --git a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx index 4863fa1f0cf..1274d9a57be 100644 --- a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilter3DTest.cxx @@ -81,10 +81,10 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer T1Reader = ReaderType::New(); + auto T1Reader = ReaderType::New(); T1Reader->SetFileName(inputVolume); - ReaderType::Pointer maskReader = ReaderType::New(); + auto maskReader = ReaderType::New(); maskReader->SetFileName(input3DSkullStripVolume); const PixelType imageExclusion = -32000; @@ -92,14 +92,14 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* The Threshold Image Filter is used to produce the brain clipping mask from a 3DSkullStrip result image. */ using ThresholdFilterType = itk::ThresholdImageFilter; - ThresholdFilterType::Pointer brainMaskFilter = ThresholdFilterType::New(); + auto brainMaskFilter = ThresholdFilterType::New(); brainMaskFilter->SetInput(maskReader->GetOutput()); brainMaskFilter->ThresholdBelow(maskThresholdBelow); brainMaskFilter->Update(); /* The Not Image Filter is used to produce the other clipping mask. */ using NotFilterType = itk::NotImageFilter; - NotFilterType::Pointer nonBrainMaskFilter = NotFilterType::New(); + auto nonBrainMaskFilter = NotFilterType::New(); nonBrainMaskFilter->SetInput(maskReader->GetOutput()); nonBrainMaskFilter->Update(); @@ -107,7 +107,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) Should this be limited to the excluded region of the clipped T1 image? */ using LabelStatisticsFilterType = itk::LabelStatisticsImageFilter; using StatisticRealType = LabelStatisticsFilterType::RealType; - LabelStatisticsFilterType::Pointer statisticsFilter = LabelStatisticsFilterType::New(); + auto statisticsFilter = LabelStatisticsFilterType::New(); statisticsFilter->SetInput(T1Reader->GetOutput()); statisticsFilter->SetLabelInput(maskReader->GetOutput()); statisticsFilter->Update(); @@ -125,7 +125,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* The Statistics Image Filter lets us find the initial cluster means. Should this be limited to the excluded region of the clipped T1 image? */ - LabelStatisticsFilterType::Pointer nonBrainStatisticsFilter = LabelStatisticsFilterType::New(); + auto nonBrainStatisticsFilter = LabelStatisticsFilterType::New(); nonBrainStatisticsFilter->SetInput(T1Reader->GetOutput()); nonBrainStatisticsFilter->SetLabelInput(nonBrainMaskFilter->GetOutput()); nonBrainStatisticsFilter->Update(); @@ -145,7 +145,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* The Mask Image Filter applies the clipping mask by stepping on the excluded region with the imageExclusion value. */ using MaskFilterType = itk::MaskImageFilter; - MaskFilterType::Pointer clippedBrainT1Filter = MaskFilterType::New(); + auto clippedBrainT1Filter = MaskFilterType::New(); clippedBrainT1Filter->SetInput1(T1Reader->GetOutput()); clippedBrainT1Filter->SetInput2(brainMaskFilter->GetOutput()); clippedBrainT1Filter->SetOutsideValue(imageExclusion); @@ -156,7 +156,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) if (numberOfStdDeviations > 0.0) { - ThresholdFilterType::Pointer clipArterialBloodFilter = ThresholdFilterType::New(); + auto clipArterialBloodFilter = ThresholdFilterType::New(); clipArterialBloodFilter->SetInput(clippedBrainT1Filter->GetOutput()); clipArterialBloodFilter->ThresholdAbove(static_cast(imageMean + numberOfStdDeviations * imageSigma)); clipArterialBloodFilter->SetOutsideValue(imageExclusion); @@ -171,7 +171,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* The Mask Image Filter applies the clipping mask by stepping on the excluded region with the imageExclusion value. */ - MaskFilterType::Pointer clippedNonBrainT1Filter = MaskFilterType::New(); + auto clippedNonBrainT1Filter = MaskFilterType::New(); clippedNonBrainT1Filter->SetInput1(T1Reader->GetOutput()); clippedNonBrainT1Filter->SetInput2(nonBrainMaskFilter->GetOutput()); clippedNonBrainT1Filter->SetOutsideValue(imageExclusion); @@ -182,7 +182,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) for the interior of the mask, plus a code for the exterior of the mask. */ using KMeansFilterType = itk::ScalarImageKmeansImageFilter; using RealPixelType = KMeansFilterType::RealPixelType; - KMeansFilterType::Pointer kmeansFilter = KMeansFilterType::New(); + auto kmeansFilter = KMeansFilterType::New(); kmeansFilter->SetInput(clippedBrainT1Pointer); constexpr unsigned int useNonContiguousLabels = 1; @@ -221,7 +221,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* The Scalar Image Kmeans Image Filter will find a code image in 3 classes for the interior of the mask, plus a code for the exterior of the mask. */ - KMeansFilterType::Pointer kmeansNonBrainFilter = KMeansFilterType::New(); + auto kmeansNonBrainFilter = KMeansFilterType::New(); kmeansNonBrainFilter->SetInput(clippedNonBrainT1Filter->GetOutput()); backgroundInitialMean = imageExclusion; @@ -253,7 +253,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) /* Now remap the labels - background first followed by brain */ using LabelImageType = KMeansFilterType::OutputImageType; - LabelImageType::Pointer kmeansLabelImage = LabelImageType::New(); + auto kmeansLabelImage = LabelImageType::New(); kmeansLabelImage->SetRegions(maskReader->GetOutput()->GetLargestPossibleRegion()); kmeansLabelImage->SetSpacing(maskReader->GetOutput()->GetSpacing()); kmeansLabelImage->SetDirection(maskReader->GetOutput()->GetDirection()); @@ -261,7 +261,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) kmeansLabelImage->Allocate(true); using LabelMapStatisticsFilterType = itk::LabelStatisticsImageFilter; - LabelMapStatisticsFilterType::Pointer statisticsNonBrainFilter = LabelMapStatisticsFilterType::New(); + auto statisticsNonBrainFilter = LabelMapStatisticsFilterType::New(); statisticsNonBrainFilter->SetInput(kmeansNonBrainFilter->GetOutput()); statisticsNonBrainFilter->SetLabelInput(kmeansNonBrainFilter->GetOutput()); std::cout << "statisticsNonBrainFilter->Update " << std::endl; @@ -291,7 +291,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) } /* Brain Tissues are Higher Label values */ - LabelMapStatisticsFilterType::Pointer statisticsBrainFilter = LabelMapStatisticsFilterType::New(); + auto statisticsBrainFilter = LabelMapStatisticsFilterType::New(); statisticsBrainFilter->SetInput(kmeansFilter->GetOutput()); statisticsBrainFilter->SetLabelInput(kmeansFilter->GetOutput()); std::cout << "statisticsBrainFilter->Update " << std::endl; @@ -320,7 +320,7 @@ itkScalarImageKmeansImageFilter3DTest(int argc, char * argv[]) // Write out the resulting Label Image using WriterType = itk::ImageFileWriter; - WriterType::Pointer labelWriter = WriterType::New(); + auto labelWriter = WriterType::New(); labelWriter->SetInput(kmeansLabelImage); labelWriter->SetFileName(outputLabelMapVolume); diff --git a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx index 5c9daee8a83..e59cca7dc8a 100644 --- a/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkScalarImageKmeansImageFilterTest.cxx @@ -43,7 +43,7 @@ itkScalarImageKmeansImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -51,7 +51,7 @@ itkScalarImageKmeansImageFilterTest(int argc, char * argv[]) using KMeansFilterType = itk::ScalarImageKmeansImageFilter; - KMeansFilterType::Pointer kmeansFilter = KMeansFilterType::New(); + auto kmeansFilter = KMeansFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(kmeansFilter, ScalarImageKmeansImageFilter, ImageToImageFilter); @@ -99,12 +99,12 @@ itkScalarImageKmeansImageFilterTest(int argc, char * argv[]) using RelabelFilterType = itk::RelabelComponentImageFilter; - RelabelFilterType::Pointer relabeler = RelabelFilterType::New(); + auto relabeler = RelabelFilterType::New(); relabeler->SetInput(kmeansFilter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(relabeler->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx index 962359591a0..4b9c4d6d636 100644 --- a/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx +++ b/Modules/Segmentation/Classifiers/test/itkSupervisedImageClassifierTest.cxx @@ -67,7 +67,7 @@ itkSupervisedImageClassifierTest(int, char *[]) //------------------------------------------------------ using VecImageType = itk::Image, NDIMENSION>; - VecImageType::Pointer vecImage = VecImageType::New(); + auto vecImage = VecImageType::New(); VecImageType::SizeType vecImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; @@ -173,7 +173,7 @@ itkSupervisedImageClassifierTest(int, char *[]) // Generate the training data //--------------------------------------------------------------- using ClassImageType = itk::Image; - ClassImageType::Pointer classImage = ClassImageType::New(); + auto classImage = ClassImageType::New(); ClassImageType::SizeType classImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; @@ -299,7 +299,7 @@ itkSupervisedImageClassifierTest(int, char *[]) using ImageGaussianModelEstimatorType = itk::ImageGaussianModelEstimator; - ImageGaussianModelEstimatorType::Pointer applyEstimateModel = ImageGaussianModelEstimatorType::New(); + auto applyEstimateModel = ImageGaussianModelEstimatorType::New(); applyEstimateModel->SetNumberOfModels(NUM_CLASSES); applyEstimateModel->SetInputImage(vecImage); @@ -317,7 +317,7 @@ itkSupervisedImageClassifierTest(int, char *[]) using DecisionRuleBasePointer = itk::Statistics::DecisionRule::Pointer; using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer myDecisionRule = DecisionRuleType::New(); + auto myDecisionRule = DecisionRuleType::New(); //---------------------------------------------------------------------- // Test code for the supervised classifier algorithm @@ -329,7 +329,7 @@ itkSupervisedImageClassifierTest(int, char *[]) using SupervisedClassifierType = itk::ImageClassifierBase; - SupervisedClassifierType::Pointer applyClassifier = SupervisedClassifierType::New(); + auto applyClassifier = SupervisedClassifierType::New(); using ProgressType = SupervisedImageClassifierTest::ShowProgressObject; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx index 435c7883122..eddb31b52ec 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentFunctorImageFilter.hxx @@ -32,7 +32,7 @@ void ConnectedComponentFunctorImageFilter::GenerateData() { // create an equivalency table - EquivalencyTable::Pointer eqTable = EquivalencyTable::New(); + auto eqTable = EquivalencyTable::New(); InputPixelType value, neighborValue; OutputPixelType label, originalLabel, neighborLabel; diff --git a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx index 30b16f92977..f7afcd2bb90 100644 --- a/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx +++ b/Modules/Segmentation/ConnectedComponents/include/itkConnectedComponentImageFilter.hxx @@ -79,7 +79,7 @@ ConnectedComponentImageFilter::GenerateDa typename TMaskImage::ConstPointer mask = this->GetMaskImage(); using MaskFilterType = MaskImageFilter; - typename MaskFilterType::Pointer maskFilter = MaskFilterType::New(); + auto maskFilter = MaskFilterType::New(); if (mask) { maskFilter->SetInput(input); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx index 0b5fcb2e928..f42a1846a5b 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterBackgroundTest.cxx @@ -39,7 +39,7 @@ itkConnectedComponentImageFilterBackgroundTest(int argc, char * argv[]) // Create an image with an arbitrary background value and a number // of islands with pixel values above and below the background value - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(512); image->SetRegions(size); @@ -59,7 +59,7 @@ itkConnectedComponentImageFilterBackgroundTest(int argc, char * argv[]) // Instantiate and run the filter using FilterType = itk::ConnectedComponentImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetBackgroundValue(background); filter->SetInput(image); itk::SimpleFilterWatcher watcher(filter); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx index bbd0356f52c..8ad21636796 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTest.cxx @@ -55,11 +55,11 @@ itkConnectedComponentImageFilterTest(int argc, char * argv[]) using RelabelType = itk::RelabelComponentImageFilter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - ThresholdFilterType::Pointer threshold = ThresholdFilterType::New(); - FilterType::Pointer filter = FilterType::New(); - RelabelType::Pointer relabel = RelabelType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto threshold = ThresholdFilterType::New(); + auto filter = FilterType::New(); + auto relabel = RelabelType::New(); itk::SimpleFilterWatcher watcher(filter); watcher.QuietOn(); @@ -102,7 +102,7 @@ itkConnectedComponentImageFilterTest(int argc, char * argv[]) } // Remap the labels to viewable colors - RGBImageType::Pointer colored = RGBImageType::New(); + auto colored = RGBImageType::New(); colored->SetRegions(filter->GetOutput()->GetBufferedRegion()); colored->Allocate(); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx index 6f2a5c94fcd..41d91c50f87 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTestRGB.cxx @@ -55,11 +55,11 @@ itkConnectedComponentImageFilterTestRGB(int argc, char * argv[]) using RelabelType = itk::RelabelComponentImageFilter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - ThresholdFilterType::Pointer threshold = ThresholdFilterType::New(); - FilterType::Pointer filter = FilterType::New(); - RelabelType::Pointer relabel = RelabelType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto threshold = ThresholdFilterType::New(); + auto filter = FilterType::New(); + auto relabel = RelabelType::New(); itk::SimpleFilterWatcher watcher(filter); watcher.QuietOn(); @@ -95,7 +95,7 @@ itkConnectedComponentImageFilterTestRGB(int argc, char * argv[]) // Remap the labels to viewable colors - RGBImageType::Pointer colored = RGBImageType::New(); + auto colored = RGBImageType::New(); colored->SetRegions(filter->GetOutput()->GetBufferedRegion()); colored->Allocate(); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx index ee5860127bd..35112b272b0 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkConnectedComponentImageFilterTooManyObjectsTest.cxx @@ -29,7 +29,7 @@ itkConnectedComponentImageFilterTooManyObjectsTest(int itkNotUsed(argc), char *[ // create a test input image with more objects in it than what the output type // can handle - 255 - ImageType::Pointer img = ImageType::New(); + auto img = ImageType::New(); ImageType::SizeType size; size.Fill(512); img->SetRegions(size); @@ -47,7 +47,7 @@ itkConnectedComponentImageFilterTooManyObjectsTest(int itkNotUsed(argc), char *[ } using FilterType = itk::ConnectedComponentImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(img); itk::SimpleFilterWatcher watcher(filter); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx index 009db76ce89..05db326894b 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkHardConnectedComponentImageFilterTest.cxx @@ -42,8 +42,8 @@ DoIt(int argc, char * argv[], const std::string pixelType) using OutputImageType = itk::Image; using IndexType = typename InputImageType::IndexType; - typename InputImageType::Pointer inputimg = InputImageType::New(); - IndexType index; + auto inputimg = InputImageType::New(); + IndexType index; index.Fill(0); typename InputImageType::RegionType region; @@ -100,7 +100,7 @@ DoIt(int argc, char * argv[], const std::string pixelType) // InputImageType::IndexType Seed = {10,2}; using FilterType = itk::HardConnectedComponentImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); @@ -142,7 +142,7 @@ DoIt(int argc, char * argv[], const std::string pixelType) std::cout << std::endl; using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(std::string(outputImageFileName) + pixelType + ".png"); writer->SetInput(filter->GetOutput()); try diff --git a/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx index 8b77e78dece..bcc605b1132 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkMaskConnectedComponentImageFilterTest.cxx @@ -57,11 +57,11 @@ itkMaskConnectedComponentImageFilterTest(int argc, char * argv[]) using RelabelType = itk::RelabelComponentImageFilter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - ThresholdFilterType::Pointer threshold = ThresholdFilterType::New(); - FilterType::Pointer filter = FilterType::New(); - RelabelType::Pointer relabel = RelabelType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto threshold = ThresholdFilterType::New(); + auto filter = FilterType::New(); + auto relabel = RelabelType::New(); itk::SimpleFilterWatcher watcher(filter); watcher.QuietOn(); @@ -81,7 +81,7 @@ itkMaskConnectedComponentImageFilterTest(int argc, char * argv[]) // create a mask containing the upper left hand corner and // a chunk out of the middle - MaskImageType::Pointer mask = MaskImageType::New(); + auto mask = MaskImageType::New(); mask->SetRegions(threshold->GetOutput()->GetLargestPossibleRegion()); mask->CopyInformation(threshold->GetOutput()); mask->Allocate(); @@ -153,7 +153,7 @@ itkMaskConnectedComponentImageFilterTest(int argc, char * argv[]) } // Remap the labels to viewable colors - RGBImageType::Pointer colored = RGBImageType::New(); + auto colored = RGBImageType::New(); colored->SetRegions(filter->GetOutput()->GetBufferedRegion()); colored->Allocate(); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx index e57c515c78f..9cd21ff5e51 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkRelabelComponentImageFilterTest.cxx @@ -67,14 +67,14 @@ itkRelabelComponentImageFilterTest(int argc, char * argv[]) RealType LowerBound = 51.0; RealType UpperBound = 252.0; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - ChangeFilterType::Pointer change = ChangeFilterType::New(); - ThresholdFilterType::Pointer threshold = ThresholdFilterType::New(); - ConnectedComponentType::Pointer connected = ConnectedComponentType::New(); - RelabelComponentType::Pointer relabel = RelabelComponentType::New(); - FinalThresholdFilterType::Pointer finalThreshold = FinalThresholdFilterType::New(); - StatisticsFilterType::Pointer statistics = StatisticsFilterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto change = ChangeFilterType::New(); + auto threshold = ThresholdFilterType::New(); + auto connected = ConnectedComponentType::New(); + auto relabel = RelabelComponentType::New(); + auto finalThreshold = FinalThresholdFilterType::New(); + auto statistics = StatisticsFilterType::New(); itk::SimpleFilterWatcher watcher(relabel); itk::SimpleFilterWatcher statswatcher(statistics); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx index 9b5d028ba2e..5f395e232b2 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkScalarConnectedComponentImageFilterTest.cxx @@ -53,11 +53,11 @@ itkScalarConnectedComponentImageFilterTest(int argc, char * argv[]) using FilterType = itk::ScalarConnectedComponentImageFilter; using RelabelType = itk::RelabelComponentImageFilter; - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); - FilterType::Pointer filter = FilterType::New(); - RelabelType::Pointer relabel = RelabelType::New(); + auto filter = FilterType::New(); + auto relabel = RelabelType::New(); itk::SimpleFilterWatcher watcher(filter); watcher.QuietOn(); @@ -67,7 +67,7 @@ itkScalarConnectedComponentImageFilterTest(int argc, char * argv[]) // create a mask containing the upper left hand corner and // a chunk out of the middle - MaskImageType::Pointer mask = MaskImageType::New(); + auto mask = MaskImageType::New(); mask->SetRegions(reader->GetOutput()->GetLargestPossibleRegion()); mask->CopyInformation(reader->GetOutput()); mask->Allocate(); @@ -141,7 +141,7 @@ itkScalarConnectedComponentImageFilterTest(int argc, char * argv[]) } // Remap the labels to viewable colors - RGBImageType::Pointer colored = RGBImageType::New(); + auto colored = RGBImageType::New(); colored->SetRegions(filter->GetOutput()->GetBufferedRegion()); colored->Allocate(); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx index 0dfa5ffe174..c5b2872fb81 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkThresholdMaximumConnectedComponentsImageFilterTest.cxx @@ -60,7 +60,7 @@ itkThresholdMaximumConnectedComponentsImageFilterTest(int argc, char * argv[]) const unsigned int minimumPixelArea = std::stoi(argv[3]); using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -77,7 +77,7 @@ itkThresholdMaximumConnectedComponentsImageFilterTest(int argc, char * argv[]) unsigned int thresholdValue; using ThresholdType = itk::ThresholdMaximumConnectedComponentsImageFilter; - ThresholdType::Pointer automaticThreshold = ThresholdType::New(); + auto automaticThreshold = ThresholdType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( automaticThreshold, ThresholdMaximumConnectedComponentsImageFilter, ImageToImageFilter); @@ -112,7 +112,7 @@ itkThresholdMaximumConnectedComponentsImageFilterTest(int argc, char * argv[]) using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(automaticThreshold->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx b/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx index 10adb32f1be..37ce14157f1 100644 --- a/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx +++ b/Modules/Segmentation/ConnectedComponents/test/itkVectorConnectedComponentImageFilterTest.cxx @@ -48,7 +48,7 @@ itkVectorConnectedComponentImageFilterTest(int argc, char * argv[]) using LabelImageType = itk::Image; // create an image of vectors - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::RegionType region; ImageType::SizeType size; size.Fill(100); @@ -166,15 +166,15 @@ itkVectorConnectedComponentImageFilterTest(int argc, char * argv[]) using VectorFilterType = itk::VectorConnectedComponentImageFilter; - VectorFilterType::Pointer filter = VectorFilterType::New(); + auto filter = VectorFilterType::New(); filter->SetInput(image); filter->SetDistanceThreshold(.01); using RelabelComponentType = itk::RelabelComponentImageFilter; - RelabelComponentType::Pointer relabel = RelabelComponentType::New(); + auto relabel = RelabelComponentType::New(); relabel->SetInput(filter->GetOutput()); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); try { @@ -195,7 +195,7 @@ itkVectorConnectedComponentImageFilterTest(int argc, char * argv[]) using VectorImageType = itk::VectorImage; using VectorImageFilterType = itk::VectorConnectedComponentImageFilter; - VectorImageFilterType::Pointer vfilter = VectorImageFilterType::New(); + auto vfilter = VectorImageFilterType::New(); return EXIT_SUCCESS; } diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx index a59da060a72..8df0b43aba7 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DBalloonForceFilterTest.cxx @@ -44,8 +44,8 @@ itkDeformableSimplexMesh3DBalloonForceFilterTest(int, char *[]) // declare the triangle to simplex mesh filter using SimplexFilterType = itk::TriangleMeshToSimplexMeshFilter; - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; @@ -56,7 +56,7 @@ itkDeformableSimplexMesh3DBalloonForceFilterTest(int, char *[]) std::cout << "Triangle mesh created. " << std::endl; - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); using DeformFilterType = itk::DeformableSimplexMesh3DBalloonForceFilter; @@ -67,7 +67,7 @@ itkDeformableSimplexMesh3DBalloonForceFilterTest(int, char *[]) using IndexType = OriginalImageType::IndexType; using ImageSizeType = OriginalImageType::SizeType; - OriginalImageType::Pointer originalImage = OriginalImageType::New(); + auto originalImage = OriginalImageType::New(); ImageSizeType imageSize; imageSize.Fill(20); @@ -101,21 +101,21 @@ itkDeformableSimplexMesh3DBalloonForceFilterTest(int, char *[]) using EdgeFilterType = itk::SobelEdgeDetectionImageFilter; - EdgeFilterType::Pointer edgeFilter = EdgeFilterType::New(); + auto edgeFilter = EdgeFilterType::New(); edgeFilter->SetInput(originalImage); edgeFilter->Update(); using GradientImageType = DeformFilterType::GradientImageType; using GradientFilterType = itk::GradientRecursiveGaussianImageFilter; - GradientFilterType::Pointer gradientFilter = GradientFilterType::New(); + auto gradientFilter = GradientFilterType::New(); gradientFilter->SetInput(edgeFilter->GetOutput()); gradientFilter->SetSigma(1.0); gradientFilter->Update(); std::cout << "done." << std::endl; - DeformFilterType::Pointer deformFilter = DeformFilterType::New(); + auto deformFilter = DeformFilterType::New(); deformFilter->SetInput(simplexFilter->GetOutput()); deformFilter->SetGradient(gradientFilter->GetOutput()); deformFilter->SetAlpha(0.2); diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx index 36bbbe7e26b..dfa028788cb 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DFilterTest.cxx @@ -69,8 +69,8 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) using SimplexVolumeType = itk::SimplexMeshVolumeCalculator; // create the actual mesh, sphere - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(10); PointType::ValueType scaleInit[3] = { 3, 3, 3 }; VectorType scale = scaleInit; @@ -83,7 +83,7 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) std::cout << "Triangle mesh created. " << std::endl; // send the sphere mesh ( triangle cells) to create a simplex mesh - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); simplexFilter->Update(); @@ -93,7 +93,7 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) std::cout << "Simplex Mesh: " << simplexMesh << std::endl; std::cout << "Creating dummy image..."; - OriginalImageType::Pointer originalImage = OriginalImageType::New(); + auto originalImage = OriginalImageType::New(); ImageSizeType imageSize; imageSize.Fill(20); @@ -126,7 +126,7 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) std::cout << "Creating dummy image done" << std::endl; std::cout << " starting to Filter Image" << std::endl; - GradientAnisotropicImageType::Pointer gradientanisotropicfilter = GradientAnisotropicImageType::New(); + auto gradientanisotropicfilter = GradientAnisotropicImageType::New(); gradientanisotropicfilter->SetInput(originalImage); gradientanisotropicfilter->SetNumberOfIterations(5); gradientanisotropicfilter->SetTimeStep(0.0625); @@ -134,13 +134,13 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) gradientanisotropicfilter->Update(); std::cout << "GradientAnisotropicDiffusion is DONE!" << std::endl; - GradientMagnitudeType::Pointer gradientmagnitudefilter = GradientMagnitudeType::New(); + auto gradientmagnitudefilter = GradientMagnitudeType::New(); gradientmagnitudefilter->SetInput(gradientanisotropicfilter->GetOutput()); gradientmagnitudefilter->SetSigma(1.0); gradientmagnitudefilter->Update(); std::cout << "GradientMagnitude is DONE!" << std::endl; - SigmoidImageType::Pointer sigmoidimagefilter = SigmoidImageType::New(); + auto sigmoidimagefilter = SigmoidImageType::New(); sigmoidimagefilter->SetInput(gradientmagnitudefilter->GetOutput()); sigmoidimagefilter->SetOutputMinimum(0); sigmoidimagefilter->SetOutputMaximum(1); @@ -149,13 +149,13 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) sigmoidimagefilter->Update(); std::cout << "Sigmoid is DONE!" << std::endl; - GradientFilterType::Pointer gradientFilter = GradientFilterType::New(); + auto gradientFilter = GradientFilterType::New(); gradientFilter->SetInput(sigmoidimagefilter->GetOutput()); gradientFilter->SetSigma(1.0); gradientFilter->Update(); std::cout << "GradientMagnitude is DONE!" << std::endl; - DeformFilterType::Pointer deformFilter = DeformFilterType::New(); + auto deformFilter = DeformFilterType::New(); constexpr unsigned int numberOfCycles = 100; @@ -174,7 +174,7 @@ itkDeformableSimplexMesh3DFilterTest(int, char *[]) SimplexMeshType::Pointer deformResult = deformFilter->GetOutput(); // calculate the volume of the mesh - SimplexVolumeType::Pointer volumecalculator = SimplexVolumeType::New(); + auto volumecalculator = SimplexVolumeType::New(); volumecalculator->SetSimplexMesh(deformFilter->GetOutput()); volumecalculator->Compute(); diff --git a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx index cef7da4ad40..a2ad7576c1e 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkDeformableSimplexMesh3DGradientConstraintForceFilterTest.cxx @@ -46,8 +46,8 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) // note : image is volume of 20x20x20 starting at 0,0,0 so make sure // the mesh sits on image in space - SphereMeshSourceType::Pointer mySphereMeshSource = SphereMeshSourceType::New(); - PointType center; + auto mySphereMeshSource = SphereMeshSourceType::New(); + PointType center; center.Fill(10); PointType::ValueType scaleInit[3] = { 5, 5, 5 }; VectorType scale = scaleInit; @@ -58,7 +58,7 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) std::cout << "Triangle mesh created. " << std::endl; - SimplexFilterType::Pointer simplexFilter = SimplexFilterType::New(); + auto simplexFilter = SimplexFilterType::New(); simplexFilter->SetInput(mySphereMeshSource->GetOutput()); using DeformFilterType = itk::DeformableSimplexMesh3DGradientConstraintForceFilter; @@ -69,7 +69,7 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) using IndexType = OriginalImageType::IndexType; using ImageSizeType = OriginalImageType::SizeType; - OriginalImageType::Pointer originalImage = OriginalImageType::New(); + auto originalImage = OriginalImageType::New(); ImageSizeType imageSize; imageSize.Fill(20); @@ -103,21 +103,21 @@ itkDeformableSimplexMesh3DGradientConstraintForceFilterTest(int, char *[]) using EdgeFilterType = itk::SobelEdgeDetectionImageFilter; - EdgeFilterType::Pointer edgeFilter = EdgeFilterType::New(); + auto edgeFilter = EdgeFilterType::New(); edgeFilter->SetInput(originalImage); edgeFilter->Update(); using GradientImageType = DeformFilterType::GradientImageType; using GradientFilterType = itk::GradientRecursiveGaussianImageFilter; - GradientFilterType::Pointer gradientFilter = GradientFilterType::New(); + auto gradientFilter = GradientFilterType::New(); gradientFilter->SetInput(edgeFilter->GetOutput()); gradientFilter->SetSigma(1.0); gradientFilter->Update(); std::cout << "done." << std::endl; - DeformFilterType::Pointer deformFilter = DeformFilterType::New(); + auto deformFilter = DeformFilterType::New(); deformFilter->SetInput(simplexFilter->GetOutput()); deformFilter->SetImage(originalImage); deformFilter->SetGradient(gradientFilter->GetOutput()); diff --git a/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx b/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx index 6408ed33aaa..86e7978abff 100644 --- a/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx +++ b/Modules/Segmentation/DeformableMesh/test/itkSimplexMeshWithFloatCoordRepTest.cxx @@ -29,7 +29,7 @@ itkSimplexMeshWithFloatCoordRepTest(int, char *[]) using MeshType = itk::SimplexMesh; using DeformType = itk::DeformableSimplexMesh3DFilter; - DeformType::Pointer deform = DeformType::New(); + auto deform = DeformType::New(); deform->Print(std::cout); return EXIT_SUCCESS; } diff --git a/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx b/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx index ec3b29ccc61..f34c4525681 100644 --- a/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx +++ b/Modules/Segmentation/KLMRegionGrowing/test/itkRegionGrow2DTest.cxx @@ -116,7 +116,7 @@ test_RegionGrowKLMExceptionHandling() int sizeLen = 3; using ImageType5D = itk::Image, NUMDIM5D>; - ImageType5D::Pointer image5D = ImageType5D::New(); + auto image5D = ImageType5D::New(); ImageType5D::SizeType imageSize5D; imageSize5D.Fill(sizeLen); @@ -139,7 +139,7 @@ test_RegionGrowKLMExceptionHandling() using KLMRegionGrowImageFilterType5D = itk::KLMRegionGrowImageFilter; - KLMRegionGrowImageFilterType5D::Pointer exceptionTestingFilter5D = KLMRegionGrowImageFilterType5D::New(); + auto exceptionTestingFilter5D = KLMRegionGrowImageFilterType5D::New(); KLMRegionGrowImageFilterType5D::GridSizeType gridSize5D; gridSize5D.Fill(1); @@ -227,7 +227,7 @@ test_regiongrowKLM1D() using ImageType = itk::Image, NUMDIM1D>; using OutputImageType = itk::Image, NUMDIM1D>; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); unsigned int numPixels = 100; unsigned int numPixelsHalf = 50; @@ -276,7 +276,7 @@ test_regiongrowKLM1D() using KLMRegionGrowImageFilterType = itk::KLMRegionGrowImageFilter; - KLMRegionGrowImageFilterType::Pointer KLMFilter = KLMRegionGrowImageFilterType::New(); + auto KLMFilter = KLMRegionGrowImageFilterType::New(); KLMRegionGrowImageFilterType::GridSizeType gridSize; gridSize.Fill(1); @@ -794,7 +794,7 @@ test_regiongrowKLM2D() using ImageType = itk::Image, NUMDIM2D>; using OutputImageType = itk::Image, NUMDIM2D>; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType imageSize; imageSize[0] = 10; @@ -848,7 +848,7 @@ test_regiongrowKLM2D() using KLMRegionGrowImageFilterType = itk::KLMRegionGrowImageFilter; - KLMRegionGrowImageFilterType::Pointer KLMFilter = KLMRegionGrowImageFilterType::New(); + auto KLMFilter = KLMRegionGrowImageFilterType::New(); KLMRegionGrowImageFilterType::GridSizeType gridSize; gridSize.Fill(1); @@ -1169,7 +1169,7 @@ test_regiongrowKLM2D() using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(KLMFilter->GetLabelledImage()); histogramGenerator->SetNumberOfBins(KLMFilter->GetNumberOfRegions()); @@ -1242,7 +1242,7 @@ test_regiongrowKLM3D() using ImageType = itk::Image, NUMDIM3D>; using OutputImageType = itk::Image, NUMDIM3D>; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType imageSize; imageSize[0] = 10; @@ -1312,7 +1312,7 @@ test_regiongrowKLM3D() using KLMRegionGrowImageFilterType = itk::KLMRegionGrowImageFilter; - KLMRegionGrowImageFilterType::Pointer KLMFilter = KLMRegionGrowImageFilterType::New(); + auto KLMFilter = KLMRegionGrowImageFilterType::New(); KLMRegionGrowImageFilterType::GridSizeType gridSize; gridSize.Fill(1); @@ -1671,7 +1671,7 @@ test_regiongrowKLM3D() using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(KLMFilter->GetLabelledImage()); histogramGenerator->SetNumberOfBins(KLMFilter->GetNumberOfRegions()); @@ -1744,7 +1744,7 @@ test_regiongrowKLM4D() using ImageType = itk::Image, NUMDIM4D>; using OutputImageType = itk::Image, NUMDIM4D>; - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType imageSize; int multVal = 2; @@ -1772,7 +1772,7 @@ test_regiongrowKLM4D() using KLMRegionGrowImageFilterType = itk::KLMRegionGrowImageFilter; - KLMRegionGrowImageFilterType::Pointer KLMFilter = KLMRegionGrowImageFilterType::New(); + auto KLMFilter = KLMRegionGrowImageFilterType::New(); KLMRegionGrowImageFilterType::GridSizeType gridSize; gridSize[0] = 1; @@ -2063,7 +2063,7 @@ test_regiongrowKLM4D() using HistogramGeneratorType = itk::Statistics::ScalarImageToHistogramGenerator; - HistogramGeneratorType::Pointer histogramGenerator = HistogramGeneratorType::New(); + auto histogramGenerator = HistogramGeneratorType::New(); histogramGenerator->SetInput(KLMFilter->GetLabelledImage()); histogramGenerator->SetNumberOfBins(KLMFilter->GetNumberOfRegions()); diff --git a/Modules/Segmentation/LabelVoting/include/itkVotingBinaryIterativeHoleFillingImageFilter.hxx b/Modules/Segmentation/LabelVoting/include/itkVotingBinaryIterativeHoleFillingImageFilter.hxx index b97b3975612..d397de517b5 100644 --- a/Modules/Segmentation/LabelVoting/include/itkVotingBinaryIterativeHoleFillingImageFilter.hxx +++ b/Modules/Segmentation/LabelVoting/include/itkVotingBinaryIterativeHoleFillingImageFilter.hxx @@ -51,7 +51,7 @@ VotingBinaryIterativeHoleFillingImageFilter::GenerateData() m_NumberOfPixelsChanged = 0; - typename VotingFilterType::Pointer filter = VotingFilterType::New(); + auto filter = VotingFilterType::New(); filter->SetRadius(this->GetRadius()); filter->SetBackgroundValue(this->GetBackgroundValue()); diff --git a/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx index eac73cb87fc..18a5e4dfd5c 100644 --- a/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkLabelVotingImageFilterTest.cxx @@ -59,9 +59,9 @@ itkLabelVotingImageFilterTest(int, char *[]) using LabelVotingImageFilterType = itk::LabelVotingImageFilter; // Create the input images - ImageType::Pointer inputImageA = ImageType::New(); - ImageType::Pointer inputImageB = ImageType::New(); - ImageType::Pointer inputImageC = ImageType::New(); + auto inputImageA = ImageType::New(); + auto inputImageB = ImageType::New(); + auto inputImageC = ImageType::New(); // Define their size, and start index SizeType size; @@ -116,7 +116,7 @@ itkLabelVotingImageFilterTest(int, char *[]) } // Create the LabelVoting Filter - LabelVotingImageFilterType::Pointer labelVotingFilter = LabelVotingImageFilterType::New(); + auto labelVotingFilter = LabelVotingImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(labelVotingFilter, LabelVotingImageFilter, ImageToImageFilter); diff --git a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx index 7c11095855b..aba2ebca08e 100644 --- a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryHoleFillingImageFilterTest.cxx @@ -47,7 +47,7 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) using ReaderType = itk::ImageFileReader; using WriterType = itk::ImageFileWriter; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); @@ -68,7 +68,7 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) using VotingBinaryHoleFillingImageFilterType = itk::VotingBinaryHoleFillingImageFilter; - VotingBinaryHoleFillingImageFilterType::Pointer voting = VotingBinaryHoleFillingImageFilterType::New(); + auto voting = VotingBinaryHoleFillingImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(voting, VotingBinaryHoleFillingImageFilter, VotingBinaryImageFilter); @@ -95,7 +95,7 @@ itkVotingBinaryHoleFillingImageFilterTest(int argc, char * argv[]) std::cout << "Number of pixels changed: " << voting->GetNumberOfPixelsChanged() << std::endl; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(voting->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryImageFilterTest.cxx b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryImageFilterTest.cxx index 8ae87df3539..a33e9fff8c9 100644 --- a/Modules/Segmentation/LabelVoting/test/itkVotingBinaryImageFilterTest.cxx +++ b/Modules/Segmentation/LabelVoting/test/itkVotingBinaryImageFilterTest.cxx @@ -45,10 +45,10 @@ itkVotingBinaryImageFilterTestImp(const std::string & infname, using FilterType = itk::VotingBinaryImageFilter; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(infname); - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); @@ -67,7 +67,7 @@ itkVotingBinaryImageFilterTestImp(const std::string & infname, ITK_TEST_SET_GET_VALUE(birthThreshold, filter->GetBirthThreshold()); ITK_TEST_SET_GET_VALUE(survivalThreshold, filter->GetSurvivalThreshold()); - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(outfname); writer->SetNumberOfStreamDivisions(5); @@ -116,7 +116,7 @@ itkVotingBinaryImageFilterTest(int argc, char * argv[]) using TestImageType = itk::Image; using FilterType = itk::VotingBinaryImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, VotingBinaryImageFilter, ImageToImageFilter); switch (componentType) diff --git a/Modules/Segmentation/LevelSets/include/itkCannySegmentationLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkCannySegmentationLevelSetFunction.hxx index 31f57a2a4c6..27eeeaa2e2b 100644 --- a/Modules/Segmentation/LevelSets/include/itkCannySegmentationLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkCannySegmentationLevelSetFunction.hxx @@ -74,7 +74,7 @@ template void CannySegmentationLevelSetFunction::CalculateDistanceImage() { - typename TFeatureImageType::Pointer tempFeature = TFeatureImageType::New(); + auto tempFeature = TFeatureImageType::New(); // The minipipeline might muck with its feature image requested // region. The rest of the class relies on the feature image requested diff --git a/Modules/Segmentation/LevelSets/include/itkCollidingFrontsImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkCollidingFrontsImageFilter.hxx index 5e6e04ef087..1d8817f03d1 100644 --- a/Modules/Segmentation/LevelSets/include/itkCollidingFrontsImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkCollidingFrontsImageFilter.hxx @@ -81,7 +81,7 @@ CollidingFrontsImageFilter::GenerateData() using MultiplyFilterType = itk::MultiplyImageFilter; - typename MultiplyFilterType::Pointer multiplyFilter = MultiplyFilterType::New(); + auto multiplyFilter = MultiplyFilterType::New(); multiplyFilter->SetInput1(fastMarchingFilter1->GetGradientImage()); multiplyFilter->SetInput2(fastMarchingFilter2->GetGradientImage()); multiplyFilter->Update(); @@ -113,7 +113,7 @@ CollidingFrontsImageFilter::GenerateData() using FunctionType = BinaryThresholdImageFunction; using IteratorType = FloodFilledImageFunctionConditionalConstIterator; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(multipliedImage); function->ThresholdBelow(m_NegativeEpsilon); diff --git a/Modules/Segmentation/LevelSets/include/itkCurvesLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkCurvesLevelSetFunction.hxx index 5900977b918..ffe819d704a 100644 --- a/Modules/Segmentation/LevelSets/include/itkCurvesLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkCurvesLevelSetFunction.hxx @@ -62,7 +62,7 @@ CurvesLevelSetFunction::CalculateAdvectionImage() { using DerivativeFilterType = GradientRecursiveGaussianImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->SetSigma(m_DerivativeSigma); derivative->Update(); @@ -73,7 +73,7 @@ CurvesLevelSetFunction::CalculateAdvectionImage() { using DerivativeFilterType = GradientImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->UseImageSpacingOn(); derivative->Update(); @@ -81,7 +81,7 @@ CurvesLevelSetFunction::CalculateAdvectionImage() using DerivativeOutputImageType = typename DerivativeFilterType::OutputImageType; using GradientCasterType = CastImageFilter; - typename GradientCasterType::Pointer caster = GradientCasterType::New(); + auto caster = GradientCasterType::New(); caster->SetInput(derivative->GetOutput()); caster->Update(); diff --git a/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourLevelSetFunction.hxx index 01d8b31d76c..81cbda37c96 100644 --- a/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourLevelSetFunction.hxx @@ -51,7 +51,7 @@ GeodesicActiveContourLevelSetFunction::CalculateA { using DerivativeFilterType = GradientRecursiveGaussianImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->SetSigma(m_DerivativeSigma); derivative->Update(); @@ -62,7 +62,7 @@ GeodesicActiveContourLevelSetFunction::CalculateA { using DerivativeFilterType = GradientImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->UseImageSpacingOn(); derivative->Update(); @@ -70,7 +70,7 @@ GeodesicActiveContourLevelSetFunction::CalculateA using DerivativeOutputImageType = typename DerivativeFilterType::OutputImageType; using GradientCasterType = CastImageFilter; - typename GradientCasterType::Pointer caster = GradientCasterType::New(); + auto caster = GradientCasterType::New(); caster->SetInput(derivative->GetOutput()); caster->Update(); diff --git a/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourShapePriorLevelSetFunction.hxx b/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourShapePriorLevelSetFunction.hxx index 26e69193e2c..ad3457a1c30 100644 --- a/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourShapePriorLevelSetFunction.hxx +++ b/Modules/Segmentation/LevelSets/include/itkGeodesicActiveContourShapePriorLevelSetFunction.hxx @@ -50,7 +50,7 @@ GeodesicActiveContourShapePriorLevelSetFunction:: // Compute the gradient of the feature image using DerivativeFilterType = GradientRecursiveGaussianImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->SetSigma(m_DerivativeSigma); derivative->Update(); @@ -61,7 +61,7 @@ GeodesicActiveContourShapePriorLevelSetFunction:: { using DerivativeFilterType = GradientImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->GetFeatureImage()); derivative->UseImageSpacingOn(); derivative->Update(); @@ -69,7 +69,7 @@ GeodesicActiveContourShapePriorLevelSetFunction:: using DerivativeOutputImageType = typename DerivativeFilterType::OutputImageType; using GradientCasterType = CastImageFilter; - typename GradientCasterType::Pointer caster = GradientCasterType::New(); + auto caster = GradientCasterType::New(); caster->SetInput(derivative->GetOutput()); caster->Update(); diff --git a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx index bcaa2c90df4..14a2bcd20e5 100644 --- a/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkParallelSparseFieldLevelSetImageFilter.hxx @@ -35,7 +35,7 @@ template ParallelSparseFieldCityBlockNeighborList::ParallelSparseFieldCityBlockNeighborList() { using ImageType = typename NeighborhoodType::ImageType; - typename ImageType::Pointer dummy_image = ImageType::New(); + auto dummy_image = ImageType::New(); unsigned int i, nCenter; int d; @@ -178,7 +178,7 @@ ParallelSparseFieldLevelSetImageFilter::CopyInputToOu // First need to subtract the iso-surface value from the input image. using ShiftScaleFilterType = ShiftScaleImageFilter; - typename ShiftScaleFilterType::Pointer shiftScaleFilter = ShiftScaleFilterType::New(); + auto shiftScaleFilter = ShiftScaleFilterType::New(); shiftScaleFilter->SetInput(this->GetInput()); shiftScaleFilter->SetShift(-m_IsoSurfaceValue); // keep a handle to the shifted output diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx index 9a34fd08392..a79fb58f66e 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldFourthOrderLevelSetImageFilter.hxx @@ -232,7 +232,7 @@ SparseFieldFourthOrderLevelSetImageFilter::ProcessNor // on into a temporary image to use as the input to the mini-pipeline. This // avoids a complete copy of the image. typename OutputImageType::Pointer phi = this->GetOutput(); - typename OutputImageType::Pointer tmp = OutputImageType::New(); + auto tmp = OutputImageType::New(); tmp->SetRequestedRegion(phi->GetRequestedRegion()); tmp->SetBufferedRegion(phi->GetBufferedRegion()); tmp->SetLargestPossibleRegion(phi->GetLargestPossibleRegion()); diff --git a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx index a1a2bd40eb4..08f01d20bcd 100644 --- a/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx +++ b/Modules/Segmentation/LevelSets/include/itkSparseFieldLevelSetImageFilter.hxx @@ -31,7 +31,7 @@ template SparseFieldCityBlockNeighborList::SparseFieldCityBlockNeighborList() { using ImageType = typename NeighborhoodType::ImageType; - typename ImageType::Pointer dummy_image = ImageType::New(); + auto dummy_image = ImageType::New(); unsigned int i, nCenter; int d; @@ -479,7 +479,7 @@ SparseFieldLevelSetImageFilter::CopyInputToOutput() // First need to subtract the iso-surface value from the input image. using ShiftScaleFilterType = ShiftScaleImageFilter; - typename ShiftScaleFilterType::Pointer shiftScaleFilter = ShiftScaleFilterType::New(); + auto shiftScaleFilter = ShiftScaleFilterType::New(); shiftScaleFilter->SetInput(this->GetInput()); shiftScaleFilter->SetShift(-m_IsoSurfaceValue); // keep a handle to the shifted output diff --git a/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx index 08ecbeaa1ff..02d7f74c78c 100644 --- a/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkAnisotropicFourthOrderLevelSetImageFilterTest.cxx @@ -25,7 +25,7 @@ itkAnisotropicFourthOrderLevelSetImageFilterTest(int, char *[]) using ImageType = itk::Image; using IndexType = ImageType::IndexType; - ImageType::Pointer im_init = ImageType::New(); + auto im_init = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { 128, 128 } }; @@ -54,7 +54,7 @@ itkAnisotropicFourthOrderLevelSetImageFilterTest(int, char *[]) } using FilterType = itk::AnisotropicFourthOrderLevelSetImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetMaxFilterIteration(2); filter->SetMaxNormalIteration(5); filter->SetNormalProcessConductance(0.5); diff --git a/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx index 8f36c2b01cf..734e472a41e 100644 --- a/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkBinaryMaskToNarrowBandPointSetFilterTest.cxx @@ -33,7 +33,7 @@ itkBinaryMaskToNarrowBandPointSetFilterTest(int, char *[]) // // Initialize an image with a white square in a black background // - BinaryMaskImageType::Pointer binaryMask = BinaryMaskImageType::New(); + auto binaryMask = BinaryMaskImageType::New(); BinaryMaskImageType::SizeType size; BinaryMaskImageType::IndexType index; @@ -76,7 +76,7 @@ itkBinaryMaskToNarrowBandPointSetFilterTest(int, char *[]) using GeneratorType = itk::BinaryMaskToNarrowBandPointSetFilter; - GeneratorType::Pointer narrowBandGenerator = GeneratorType::New(); + auto narrowBandGenerator = GeneratorType::New(); narrowBandGenerator->SetInput(binaryMask); diff --git a/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx index e59ee07eaf0..05e971aba84 100644 --- a/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCollidingFrontsImageFilterTest.cxx @@ -44,24 +44,24 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) PixelType background = 64; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using CollidingFrontsFilterType = itk::CollidingFrontsImageFilter; - CollidingFrontsFilterType::Pointer collidingFronts = CollidingFrontsFilterType::New(); + auto collidingFronts = CollidingFrontsFilterType::New(); using NodeContainer = CollidingFrontsFilterType::NodeContainer; using NodeType = CollidingFrontsFilterType::NodeType; // select seeds 20 pixels apart - NodeContainer::Pointer seeds1 = NodeContainer::New(); + auto seeds1 = NodeContainer::New(); InternalImageType::IndexType seedPosition1; seedPosition1[0] = 50; @@ -74,7 +74,7 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) seeds1->Initialize(); seeds1->InsertElement(0, node1); - NodeContainer::Pointer seeds2 = NodeContainer::New(); + auto seeds2 = NodeContainer::New(); InternalImageType::IndexType seedPosition2; seedPosition2[0] = 70; @@ -148,10 +148,10 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) if (argc > 2) { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName(argv[1]); writer->SetInput(inputImage); @@ -186,7 +186,7 @@ itkCollidingFrontsImageFilterTest(int argc, char * argv[]) using DoubleImageType = itk::Image; using CollidingFrontsFilterType2 = itk::CollidingFrontsImageFilter; - CollidingFrontsFilterType2::Pointer collidingFronts2 = CollidingFrontsFilterType2::New(); + auto collidingFronts2 = CollidingFrontsFilterType2::New(); return EXIT_SUCCESS; } diff --git a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx index 0eaae71cbfe..5614db03f51 100644 --- a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterTest.cxx @@ -56,7 +56,7 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -84,17 +84,17 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) * Then apply a sigmoid function to the gradient magnitude. */ using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -106,12 +106,12 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) * Use fast marching to create an signed distance from a seed point. */ using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that overlaps the square to be segmented. InternalImageType::IndexType seedPosition; @@ -134,7 +134,7 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) */ using CurvesFilterType = itk::CurvesLevelSetImageFilter; - CurvesFilterType::Pointer curvesFilter = CurvesFilterType::New(); + auto curvesFilter = CurvesFilterType::New(); // set the initial level set curvesFilter->SetInput(fastMarching->GetOutput()); @@ -155,7 +155,7 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) * Threshold the output level set to display the final contour. */ using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(curvesFilter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -167,7 +167,7 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) * Compute overlap between the true shape and the segmented shape */ using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -185,10 +185,10 @@ itkCurvesLevelSetImageFilterTest(int, char *[]) */ #ifdef WRITING_OUT_IMAGES using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName("inputImage.png"); writer->SetInput(inputImage); diff --git a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx index 684d6363db6..b0c565c3b62 100644 --- a/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkCurvesLevelSetImageFilterZeroSigmaTest.cxx @@ -54,7 +54,7 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -82,17 +82,17 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) * Then apply a sigmoid function to the gradient magnitude. */ using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -104,12 +104,12 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) * Use fast marching to create an signed distance from a seed point. */ using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that overlaps the square to be segmented. InternalImageType::IndexType seedPosition; @@ -132,7 +132,7 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) */ using CurvesFilterType = itk::CurvesLevelSetImageFilter; - CurvesFilterType::Pointer curvesFilter = CurvesFilterType::New(); + auto curvesFilter = CurvesFilterType::New(); // set the initial level set curvesFilter->SetInput(fastMarching->GetOutput()); @@ -156,7 +156,7 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) * Threshold the output level set to display the final contour. */ using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(curvesFilter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -168,7 +168,7 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) * Compute overlap between the true shape and the segmented shape */ using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -186,11 +186,11 @@ itkCurvesLevelSetImageFilterZeroSigmaTest(int, char *[]) */ /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx index c560c56eb5e..87ac324d7b0 100644 --- a/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkExtensionVelocitiesImageFilterTest.cxx @@ -125,7 +125,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) using PointType = itk::Point; // Fill an input image with simple signed distance function - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(128); ImageType::RegionType region(size); @@ -147,18 +147,18 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) // Squash up the level sets by mulitplying with a scalar using MultiplierType = itk::ShiftScaleImageFilter; - MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(image); multiplier->SetScale(0.5); // Set up auxiliary variables - ImageType::Pointer aux1 = ImageType::New(); + auto aux1 = ImageType::New(); aux1->SetRegions(region); aux1->Allocate(); aux1->FillBuffer(1.0); - ImageType::Pointer aux2 = ImageType::New(); + auto aux2 = ImageType::New(); aux2->SetRegions(region); aux2->Allocate(); @@ -176,7 +176,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) { // For debugging using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput( aux2 ); writer->SetFileName( "input.mhd" ); writer->Write(); @@ -186,7 +186,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) // Set up reinitialize level set image filter constexpr unsigned int AuxDimension = 2; using ReinitializerType = itk::ExtensionVelocitiesImageFilter; - ReinitializerType::Pointer reinitializer = ReinitializerType::New(); + auto reinitializer = ReinitializerType::New(); reinitializer->SetInput(multiplier->GetOutput()); reinitializer->SetInputVelocityImage(aux1, 0); reinitializer->SetInputVelocityImage(aux2, 1); @@ -201,7 +201,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) { // For debugging using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput( reinitializer->GetOutputVelocityImage( 1 ) ); writer->SetFileName( "output.mhd" ); writer->Write(); @@ -210,7 +210,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) // Check the output using DifferenceType = itk::Testing::ComparisonImageFilter; - DifferenceType::Pointer difference = DifferenceType::New(); + auto difference = DifferenceType::New(); difference->SetTestInput(aux2); difference->SetValidInput(reinitializer->GetOutputVelocityImage(1)); difference->Update(); @@ -234,7 +234,7 @@ itkExtensionVelocitiesImageFilterTest(int, char *[]) } using CalculatorType = itk::MinimumMaximumImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(difference->GetOutput()); calculator->Compute(); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx index 6617f63d772..0a6b2a55e24 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterTest.cxx @@ -49,7 +49,7 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -77,17 +77,17 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) // Then apply a sigmoid function to the gradient magnitude. // using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -99,12 +99,12 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) // Use fast marching to create an signed distance from a seed point. // using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that overlaps the square to be segmented. InternalImageType::IndexType seedPosition; @@ -128,7 +128,7 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) using GeodesicActiveContourFilterType = itk::GeodesicActiveContourLevelSetImageFilter; - GeodesicActiveContourFilterType::Pointer geodesicActiveContour = GeodesicActiveContourFilterType::New(); + auto geodesicActiveContour = GeodesicActiveContourFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( geodesicActiveContour, GeodesicActiveContourLevelSetImageFilter, SegmentationLevelSetImageFilter); @@ -152,7 +152,7 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) // Threshold the output level set to display the final contour. // using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(geodesicActiveContour->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -164,7 +164,7 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) // Compute overlap between the true shape and the segmented shape. // using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -181,11 +181,11 @@ itkGeodesicActiveContourLevelSetImageFilterTest(int, char *[]) // Uncomment to write out image files /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx index b15a9611a74..a7790f94998 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest.cxx @@ -51,7 +51,7 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -79,17 +79,17 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // Then apply a sigmoid function to the gradient magnitude. // using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -101,12 +101,12 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // Use fast marching to create an signed distance from a seed point. // using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that overlaps the square to be segmented. InternalImageType::IndexType seedPosition; @@ -129,7 +129,7 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // using ShapeDetectionFilterType = itk::GeodesicActiveContourLevelSetImageFilter; - ShapeDetectionFilterType::Pointer shapeDetection = ShapeDetectionFilterType::New(); + auto shapeDetection = ShapeDetectionFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( shapeDetection, GeodesicActiveContourLevelSetImageFilter, SegmentationLevelSetImageFilter); @@ -156,7 +156,7 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // Threshold the output level set to display the final contour. // using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(shapeDetection->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -168,7 +168,7 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // Compute overlap between the true shape and the segmented shape. // using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -185,11 +185,11 @@ itkGeodesicActiveContourLevelSetImageFilterZeroSigmaTest(int, char *[]) // Uncomment to write out image files /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx index 9e9e58c2dc7..c10a17635ab 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest.cxx @@ -73,10 +73,10 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) using OptimizerType = itk::AmoebaOptimizer; using ParametersType = FilterType::ParametersType; - FilterType::Pointer filter = FilterType::New(); - ShapeFunctionType::Pointer shape = ShapeFunctionType::New(); - CostFunctionType::Pointer costFunction = CostFunctionType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto filter = FilterType::New(); + auto shape = ShapeFunctionType::New(); + auto costFunction = CostFunctionType::New(); + auto optimizer = OptimizerType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( filter, GeodesicActiveContourShapePriorLevelSetImageFilter, ShapePriorSegmentationLevelSetImageFilter); @@ -100,12 +100,12 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) PixelType foreground = 190; // Fill in the background - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); - ImageType::Pointer trueShape = ImageType::New(); + auto trueShape = ImageType::New(); trueShape->SetRegions(imageRegion); trueShape->Allocate(); trueShape->FillBuffer(background); @@ -164,17 +164,17 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // Then apply a sigmoid function to the gradient magnitude. // using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -186,12 +186,12 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // Use fast marching to create an signed distance from a seed point. // using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that is within the shape to be segmented // The initial contour is a circle centered at {47,47} with radius 10.0 @@ -276,7 +276,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // Threshold the output level set to display the final contour. // using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(filter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -288,7 +288,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // Compute overlap between the true shape and the segmented shape. // using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(trueShape); overlap->SetInput2(thresholder->GetOutput()); @@ -317,11 +317,11 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest(int, char *[]) // Uncomment to write out images /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx index 52c168c79b0..bcc29c2ac10 100644 --- a/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx +++ b/Modules/Segmentation/LevelSets/test/itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2.cxx @@ -74,12 +74,12 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) using SphereFunctionType = itk::SphereSignedDistanceFunction; - FilterType::Pointer filter = FilterType::New(); - ShapeFunctionType::Pointer shape = ShapeFunctionType::New(); - CostFunctionType::Pointer costFunction = CostFunctionType::New(); - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto filter = FilterType::New(); + auto shape = ShapeFunctionType::New(); + auto costFunction = CostFunctionType::New(); + auto optimizer = OptimizerType::New(); - SphereFunctionType::Pointer sphere = SphereFunctionType::New(); + auto sphere = SphereFunctionType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( filter, GeodesicActiveContourShapePriorLevelSetImageFilter, ShapePriorSegmentationLevelSetImageFilter); @@ -104,12 +104,12 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) PixelType foreground = 190; // Fill in the background - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); - ImageType::Pointer trueShape = ImageType::New(); + auto trueShape = ImageType::New(); trueShape->SetRegions(imageRegion); trueShape->Allocate(); trueShape->FillBuffer(background); @@ -168,17 +168,17 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Then apply a sigmoid function to the gradient magnitude. // using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -190,12 +190,12 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Use fast marching to create an signed distance from a seed point. // using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that is within the shape to be segmented // The initial contour is a circle centered at {47,47} with radius 10.0 @@ -225,7 +225,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // at the center of the image and radius of 0. // using ComponentImageType = ShapeFunctionType::ImageType; - ComponentImageType::Pointer meanImage = ComponentImageType::New(); + auto meanImage = ComponentImageType::New(); meanImage->SetRegions(imageRegion); meanImage->Allocate(); @@ -271,7 +271,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Set up a translation transform // using TransformType = itk::TranslationTransform; - TransformType::Pointer transform = TransformType::New(); + auto transform = TransformType::New(); // // Set up the standard deviations @@ -346,7 +346,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Threshold the output level set to display the final contour. // using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(filter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -359,7 +359,7 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Compute overlap between the true shape and the segmented shape. // using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(trueShape); overlap->SetInput2(thresholder->GetOutput()); @@ -387,15 +387,15 @@ itkGeodesicActiveContourShapePriorLevelSetImageFilterTest_2(int, char *[]) // Uncomment to write out images /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); using ComponentCasterType = itk::CastImageFilter< ComponentImageType, InternalImageType >; - ComponentCasterType::Pointer ccaster = ComponentCasterType::New(); + auto ccaster = ComponentCasterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx index 3c86bce12f1..e99a3af4db8 100644 --- a/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkImplicitManifoldNormalVectorFilterTest.cxx @@ -30,7 +30,7 @@ itkImplicitManifoldNormalVectorFilterTest(int, char *[]) using FilterType = itk::ImplicitManifoldNormalVectorFilter; using FunctionType = itk::NormalVectorDiffusionFunction; - InputImageType::Pointer im_init = InputImageType::New(); + auto im_init = InputImageType::New(); InputImageType::RegionType r; InputImageType::SizeType sz = { { 50, 50 } }; InputImageType::IndexType idx = { { 0, 0 } }; @@ -48,8 +48,8 @@ itkImplicitManifoldNormalVectorFilterTest(int, char *[]) im_init->SetPixel(index, static_cast(index[0])); } - FilterType::Pointer filter = FilterType::New(); - FunctionType::Pointer function = FunctionType::New(); + auto filter = FilterType::New(); + auto function = FunctionType::New(); filter->SetInput(im_init); filter->SetNormalFunction(function); filter->SetIsoLevelLow(15.0); diff --git a/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx index 1c2bd7e7f0e..01b2d629c49 100644 --- a/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkIsotropicFourthOrderLevelSetImageFilterTest.cxx @@ -25,7 +25,7 @@ itkIsotropicFourthOrderLevelSetImageFilterTest(int, char *[]) using ImageType = itk::Image; using IndexType = ImageType::IndexType; - ImageType::Pointer im_init = ImageType::New(); + auto im_init = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { 128, 128 } }; @@ -54,7 +54,7 @@ itkIsotropicFourthOrderLevelSetImageFilterTest(int, char *[]) } using FilterType = itk::IsotropicFourthOrderLevelSetImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetMaxFilterIteration(250); filter->SetInput(im_init); diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx index 1f48cdccbae..c92da7858ea 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetFunctionTest.cxx @@ -182,7 +182,7 @@ class MorphFilter : public ::itk::DenseFiniteDifferenceImageFilter<::itk::Image< ~MorphFilter() override = default; MorphFilter() { - MorphFunction::Pointer p = MorphFunction::New(); + auto p = MorphFunction::New(); p->SetPropagationWeight(-1.0); p->SetAdvectionWeight(0.0); p->SetCurvatureWeight(1.0); @@ -212,8 +212,8 @@ itkLevelSetFunctionTest(int, char *[]) constexpr int n = 100; // Number of iterations - ImageType::Pointer im_init = ImageType::New(); - ImageType::Pointer im_target = ImageType::New(); + auto im_init = ImageType::New(); + auto im_target = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { LSFT::HEIGHT, LSFT::WIDTH } }; diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx index 5ff90d1a248..285b3835a1d 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetNeighborhoodExtractorTest.cxx @@ -28,7 +28,7 @@ itkLevelSetNeighborhoodExtractorTest(int, char *[]) // Create an input image using fastmarching using SourceType = itk::FastMarchingImageFilter; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ImageType::SizeType size; size.Fill(17); @@ -43,7 +43,7 @@ itkLevelSetNeighborhoodExtractorTest(int, char *[]) node.SetValue(-4.0); using NodeContainerType = SourceType::NodeContainer; - NodeContainerType::Pointer container = NodeContainerType::New(); + auto container = NodeContainerType::New(); container->InsertElement(0, node); @@ -52,7 +52,7 @@ itkLevelSetNeighborhoodExtractorTest(int, char *[]) source->Update(); using ExtractorType = itk::LevelSetNeighborhoodExtractor; - ExtractorType::Pointer extractor = ExtractorType::New(); + auto extractor = ExtractorType::New(); extractor->SetInputLevelSet(source->GetOutput()); extractor->SetLevelSetValue(0.0); diff --git a/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx b/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx index 7ca2fd4f87c..4bb283e4a2c 100644 --- a/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkLevelSetVelocityNeighborhoodExtractorTest.cxx @@ -29,7 +29,7 @@ itkLevelSetVelocityNeighborhoodExtractorTest(int, char *[]) // Create an input image using fastmarching using SourceType = itk::FastMarchingImageFilter; - SourceType::Pointer source = SourceType::New(); + auto source = SourceType::New(); ImageType::SizeType size; size.Fill(17); @@ -44,7 +44,7 @@ itkLevelSetVelocityNeighborhoodExtractorTest(int, char *[]) node.SetValue(-4.0); using NodeContainerType = SourceType::NodeContainer; - NodeContainerType::Pointer container = NodeContainerType::New(); + auto container = NodeContainerType::New(); container->InsertElement(0, node); @@ -53,7 +53,7 @@ itkLevelSetVelocityNeighborhoodExtractorTest(int, char *[]) source->Update(); using ExtractorType = itk::LevelSetVelocityNeighborhoodExtractor; - ExtractorType::Pointer extractor = ExtractorType::New(); + auto extractor = ExtractorType::New(); extractor->SetInputLevelSet(source->GetOutput()); extractor->SetLevelSetValue(0.0); @@ -62,14 +62,14 @@ itkLevelSetVelocityNeighborhoodExtractorTest(int, char *[]) // create some dummy auxiliary variable images using AuxImageType = ExtractorType::AuxImageType; - AuxImageType::Pointer aux0 = AuxImageType::New(); + auto aux0 = AuxImageType::New(); aux0->SetRegions(source->GetOutput()->GetBufferedRegion()); aux0->Allocate(); aux0->FillBuffer(1.0); extractor->SetAuxImage(aux0, 0); - AuxImageType::Pointer aux1 = AuxImageType::New(); + auto aux1 = AuxImageType::New(); aux1->SetRegions(source->GetOutput()->GetBufferedRegion()); aux1->Allocate(); aux1->FillBuffer(5.0); diff --git a/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx index 757b888cb08..88a4bb31aaa 100644 --- a/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkNarrowBandCurvesLevelSetImageFilterTest.cxx @@ -59,7 +59,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -86,17 +86,17 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Gaussian filter. Then apply a sigmoid function to the gradient // magnitude. using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -106,12 +106,12 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Create an initial level. // Use fast marching to create an signed distance from a seed point. using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that overlaps the square to be segmented. InternalImageType::IndexType seedPosition; @@ -132,7 +132,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Set up and run the shape detection filter using CurvesFilterType = itk::NarrowBandCurvesLevelSetImageFilter; - CurvesFilterType::Pointer curvesFilter = CurvesFilterType::New(); + auto curvesFilter = CurvesFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(curvesFilter, NarrowBandCurvesLevelSetImageFilter, NarrowBandLevelSetImageFilter); @@ -158,7 +158,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Threshold the output level set to display the final contour. using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(curvesFilter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -168,7 +168,7 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) // Compute overlap between the true shape and the segmented shape using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -180,10 +180,10 @@ itkNarrowBandCurvesLevelSetImageFilterTest(int argc, char * argv[]) std::cout << "Overlap: " << overlap->GetSimilarityIndex() << std::endl; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); rescaler->SetOutputMinimum(0); rescaler->SetOutputMaximum(255); diff --git a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx index e47ee061ced..ccdcdb2ea38 100644 --- a/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkNarrowBandThresholdSegmentationLevelSetImageFilterTest.cxx @@ -175,18 +175,18 @@ itkNarrowBandThresholdSegmentationLevelSetImageFilterTest(int, char *[]) // For Debugging // using WriterType = itk::ImageFileWriter< ::NBTS::ImageType>; - // WriterType::Pointer writer = WriterType::New(); + // auto writer = WriterType::New(); // writer->SetInput( filter->GetOutput() ); // writer->SetFileName( "outputThreshold.mhd" ); // writer->Write(); - // WriterType::Pointer writer3 = WriterType::New(); + // auto writer3 = WriterType::New(); // writer3->SetInput(inputImage); // writer3->SetFileName("inputThreshold.mhd"); // writer3->Write(); // using Writer2Type = itk::ImageFileWriter< ::NBTS::SeedImageType>; - // Writer2Type::Pointer writer2 = Writer2Type::New(); + // auto writer2 = Writer2Type::New(); // writer2->SetInput(seedImage); // writer2->SetFileName("seedThreshold.mhd"); // writer2->Write(); diff --git a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx index 04a68c09261..69eefe09167 100644 --- a/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkParallelSparseFieldLevelSetImageFilterTest.cxx @@ -192,7 +192,7 @@ class MorphFilter : public ::itk::ParallelSparseFieldLevelSetImageFilter<::itk:: ~MorphFilter() override = default; MorphFilter() { - MorphFunction::Pointer p = MorphFunction::New(); + auto p = MorphFunction::New(); p->SetPropagationWeight(-1.0); p->SetAdvectionWeight(0.0); p->SetCurvatureWeight(1.0); @@ -229,8 +229,8 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[]) constexpr int n = 100; // Number of iterations constexpr int numberOfWorkUnits = 11; // Number of work units to be used - ImageType::Pointer im_init = ImageType::New(); - ImageType::Pointer im_target = ImageType::New(); + auto im_init = ImageType::New(); + auto im_target = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { PSFLSIFT::HEIGHT, PSFLSIFT::WIDTH, PSFLSIFT::DEPTH } }; @@ -273,7 +273,7 @@ itkParallelSparseFieldLevelSetImageFilterTest(int argc, char * argv[]) PSFLSIFT::evaluate_function(im_target, PSFLSIFT::cube); using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); if (argc > 2) { writer->SetInput(im_init); diff --git a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx index d797fa5b73d..ad57203c7d1 100644 --- a/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkReinitializeLevelSetImageFilterTest.cxx @@ -76,7 +76,7 @@ itkReinitializeLevelSetImageFilterTest(int, char *[]) using PointType = itk::Point; // Fill an input image with simple signed distance function - ImageType::Pointer image = ImageType::New(); + auto image = ImageType::New(); ImageType::SizeType size; size.Fill(128); ImageType::RegionType region(size); @@ -98,14 +98,14 @@ itkReinitializeLevelSetImageFilterTest(int, char *[]) // Squash up the level sets by mulitplying with a scalar using MultiplierType = itk::ShiftScaleImageFilter; - MultiplierType::Pointer multiplier = MultiplierType::New(); + auto multiplier = MultiplierType::New(); multiplier->SetInput(image); multiplier->SetScale(0.5); // multiplier->SetShift( 0.0 ); // Set up reinitialize level set image filter using ReinitializerType = itk::ReinitializeLevelSetImageFilter; - ReinitializerType::Pointer reinitializer = ReinitializerType::New(); + auto reinitializer = ReinitializerType::New(); reinitializer->SetInput(multiplier->GetOutput()); ShowProgressObject progressWatch(reinitializer); @@ -118,14 +118,14 @@ itkReinitializeLevelSetImageFilterTest(int, char *[]) /* { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput( image ); writer->SetFileName( "input.mhd" ); writer->Write(); } { using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput( reinitializer->GetOutput() ); writer->SetFileName( "output.mhd" ); writer->Write(); @@ -134,13 +134,13 @@ itkReinitializeLevelSetImageFilterTest(int, char *[]) // Check the output signed distance map is within threshold using DifferenceType = itk::Testing::ComparisonImageFilter; - DifferenceType::Pointer difference = DifferenceType::New(); + auto difference = DifferenceType::New(); difference->SetTestInput(image); difference->SetValidInput(reinitializer->GetOutput()); difference->Update(); using CalculatorType = itk::MinimumMaximumImageCalculator; - CalculatorType::Pointer calculator = CalculatorType::New(); + auto calculator = CalculatorType::New(); calculator->SetImage(difference->GetOutput()); calculator->Compute(); @@ -159,7 +159,7 @@ itkReinitializeLevelSetImageFilterTest(int, char *[]) // Check if inside/outside points remain the same after reinitialization using CheckerType = itk::MultiplyImageFilter; - CheckerType::Pointer checker = CheckerType::New(); + auto checker = CheckerType::New(); checker->SetInput1(image); checker->SetInput2(reinitializer->GetOutput()); checker->Update(); diff --git a/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx index 5dc5ba0a797..c3fa329d0c6 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapeDetectionLevelSetImageFilterTest.cxx @@ -54,7 +54,7 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) PixelType background = 0; PixelType foreground = 190; - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); inputImage->SetRegions(imageRegion); inputImage->Allocate(); inputImage->FillBuffer(background); @@ -84,17 +84,17 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) * Then apply a sigmoid function to the gradient magnitude. */ using CastFilterType = itk::CastImageFilter; - CastFilterType::Pointer caster = CastFilterType::New(); + auto caster = CastFilterType::New(); caster->SetInput(inputImage); using GradientImageType = itk::GradientMagnitudeRecursiveGaussianImageFilter; - GradientImageType::Pointer gradMagnitude = GradientImageType::New(); + auto gradMagnitude = GradientImageType::New(); gradMagnitude->SetInput(caster->GetOutput()); gradMagnitude->SetSigma(1.0); using SigmoidFilterType = itk::SigmoidImageFilter; - SigmoidFilterType::Pointer sigmoid = SigmoidFilterType::New(); + auto sigmoid = SigmoidFilterType::New(); sigmoid->SetOutputMinimum(0.0); sigmoid->SetOutputMaximum(1.0); sigmoid->SetAlpha(-0.4); @@ -106,12 +106,12 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) * Use fast marching to create an signed distance from a seed point. */ using FastMarchingFilterType = itk::FastMarchingImageFilter; - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); using NodeContainer = FastMarchingFilterType::NodeContainer; using NodeType = FastMarchingFilterType::NodeType; - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); // Choose an initial contour that is wholly within the square to be segmented. InternalImageType::IndexType seedPosition; @@ -134,7 +134,7 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) */ using ShapeDetectionFilterType = itk::ShapeDetectionLevelSetImageFilter; - ShapeDetectionFilterType::Pointer shapeDetection = ShapeDetectionFilterType::New(); + auto shapeDetection = ShapeDetectionFilterType::New(); // set the initial level set shapeDetection->SetInput(fastMarching->GetOutput()); @@ -154,7 +154,7 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) * Threshold the output level set to display the final contour. */ using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(shapeDetection->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -166,7 +166,7 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) * Compute overlap between the true shape and the segmented shape */ using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(inputImage); overlap->SetInput2(thresholder->GetOutput()); @@ -185,11 +185,11 @@ itkShapeDetectionLevelSetImageFilterTest(int, char *[]) */ /* using WriterType = itk::ImageFileWriter< ImageType >; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); using RescaleFilterType = itk::RescaleIntensityImageFilter< InternalImageType, ImageType >; - RescaleFilterType::Pointer rescaler = RescaleFilterType::New(); + auto rescaler = RescaleFilterType::New(); writer->SetFileName( "inputImage.png" ); writer->SetInput( inputImage ); diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx index 7f2184d5ebe..c5112ff8b22 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorMAPCostFunctionTest.cxx @@ -48,7 +48,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) * Set up the shape signed distance function */ using ShapeFunctionType = itk::SphereSignedDistanceFunction; - ShapeFunctionType::Pointer shape = ShapeFunctionType::New(); + auto shape = ShapeFunctionType::New(); shape->Initialize(); /** @@ -87,11 +87,11 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) ImageType::RegionType region; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetRegions(region); input->Allocate(); - NodeContainerType::Pointer activeRegion = NodeContainerType::New(); + auto activeRegion = NodeContainerType::New(); using Iterator = itk::ImageRegionIteratorWithIndex; @@ -127,7 +127,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) /** * Create a dummy edge potential image. */ - ImageType::Pointer edgeMap = ImageType::New(); + auto edgeMap = ImageType::New(); edgeMap->SetRegions(region); edgeMap->Allocate(); edgeMap->FillBuffer(1.0); @@ -136,7 +136,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) /** * Set up the cost function */ - CostFunctionType::Pointer costFunction = CostFunctionType::New(); + auto costFunction = CostFunctionType::New(); costFunction->SetShapeFunction(shape); costFunction->SetActiveRegion(activeRegion); @@ -191,7 +191,7 @@ itkShapePriorMAPCostFunctionTest(int, char *[]) * Attempt to plug the cost function into an optimizer */ using OptimizerType = itk::AmoebaOptimizer; - OptimizerType::Pointer optimizer = OptimizerType::New(); + auto optimizer = OptimizerType::New(); optimizer->SetCostFunction(costFunction); optimizer->SetInitialPosition(mean); diff --git a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx index 6a0818ad1d8..9acb2d4effb 100644 --- a/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkShapePriorSegmentationLevelSetFunctionTest.cxx @@ -75,7 +75,7 @@ class SimpleTestFilter : public DenseFiniteDifferenceImageFilter protected: SimpleTestFilter() { - typename ShapePriorFunctionType::Pointer function = ShapePriorFunctionType::New(); + auto function = ShapePriorFunctionType::New(); function->SetPropagationWeight(0.0); function->SetAdvectionWeight(0.0); function->SetCurvatureWeight(0.0); @@ -122,12 +122,12 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) ImageType::RegionType region; region.SetSize(size); - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetRegions(region); input->Allocate(); using ShapeFunctionType = itk::SphereSignedDistanceFunction; - ShapeFunctionType::Pointer shape = ShapeFunctionType::New(); + auto shape = ShapeFunctionType::New(); shape->Initialize(); ShapeFunctionType::ParametersType parameters(shape->GetNumberOfParameters()); @@ -154,7 +154,7 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) * Set up the simple test filter using itk::ShapePriorSegmentationLevelSetFunction. */ using FilterType = itk::SPSLSF::SimpleTestFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); try { @@ -183,7 +183,7 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) */ using CharImageType = itk::Image; using ThresholdFilterType = itk::BinaryThresholdImageFilter; - ThresholdFilterType::Pointer thresholder = ThresholdFilterType::New(); + auto thresholder = ThresholdFilterType::New(); thresholder->SetInput(filter->GetOutput()); thresholder->SetLowerThreshold(-1e+10); @@ -191,7 +191,7 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) thresholder->SetOutsideValue(0); thresholder->SetInsideValue(255); - CharImageType::Pointer target = CharImageType::New(); + auto target = CharImageType::New(); target->SetRegions(region); target->Allocate(); @@ -222,7 +222,7 @@ itkShapePriorSegmentationLevelSetFunctionTest(int, char *[]) * Compute overlap between the true shape and the segmented shape */ using OverlapCalculatorType = itk::SimilarityIndexImageFilter; - OverlapCalculatorType::Pointer overlap = OverlapCalculatorType::New(); + auto overlap = OverlapCalculatorType::New(); overlap->SetInput1(target); overlap->SetInput2(thresholder->GetOutput()); diff --git a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx index 645aa796d53..1108bbcd1df 100644 --- a/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkSparseFieldFourthOrderLevelSetImageFilterTest.cxx @@ -140,7 +140,7 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) { using ImageType = itk::Image; - ImageType::Pointer im_init = ImageType::New(); + auto im_init = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { SFFOLSIFT::HEIGHT, SFFOLSIFT::WIDTH } }; @@ -155,7 +155,7 @@ itkSparseFieldFourthOrderLevelSetImageFilterTest(int, char *[]) SFFOLSIFT::evaluate_function(im_init, SFFOLSIFT::square); using FilterType = itk::IsotropicDiffusionLevelSetFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(im_init); std::cout << "MaxRefitIteration = " << (filter->GetMaxRefitIteration()) << "\n"; diff --git a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx index 03bccf03267..cdc5ffb88dd 100644 --- a/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkThresholdSegmentationLevelSetImageFilterTest.cxx @@ -183,7 +183,7 @@ itkThresholdSegmentationLevelSetImageFilterTest(int, char *[]) using FilterType = itk::ThresholdSegmentationLevelSetImageFilter<::TSIFTN::SeedImageType, ::TSIFTN::ImageType>; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(seedImage); filter->SetFeatureImage(inputImage); diff --git a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx index e434af9b440..48c57c8055a 100644 --- a/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkUnsharpMaskLevelSetImageFilterTest.cxx @@ -65,7 +65,7 @@ itkUnsharpMaskLevelSetImageFilterTest(int, char *[]) { using ImageType = itk::Image; - ImageType::Pointer im_init = ImageType::New(); + auto im_init = ImageType::New(); ImageType::RegionType r; ImageType::SizeType sz = { { HEIGHT, WIDTH } }; @@ -80,7 +80,7 @@ itkUnsharpMaskLevelSetImageFilterTest(int, char *[]) evaluate_function(im_init, square); using FilterType = itk::UnsharpMaskLevelSetImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetMaxFilterIteration(99); filter->SetNormalProcessUnsharpWeight(1); diff --git a/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx b/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx index ab71e7f94bc..aff6ca2cff4 100644 --- a/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSets/test/itkVectorThresholdSegmentationLevelSetImageFilterTest.cxx @@ -51,8 +51,8 @@ itkVectorThresholdSegmentationLevelSetImageFilterTest(int ac, char * av[]) using InputReaderType = itk::ImageFileReader; using RGBReaderType = itk::ImageFileReader; - RGBReaderType::Pointer rgbReader = RGBReaderType::New(); - InputReaderType::Pointer inputReader = InputReaderType::New(); + auto rgbReader = RGBReaderType::New(); + auto inputReader = InputReaderType::New(); inputReader->SetFileName(av[1]); rgbReader->SetFileName(av[2]); @@ -60,7 +60,7 @@ itkVectorThresholdSegmentationLevelSetImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::VectorThresholdSegmentationLevelSetImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputReader->GetOutput()); @@ -123,7 +123,7 @@ itkVectorThresholdSegmentationLevelSetImageFilterTest(int ac, char * av[]) using RescalerType = itk::RescaleIntensityImageFilter; - RescalerType::Pointer rescaler = RescalerType::New(); + auto rescaler = RescalerType::New(); rescaler->SetInput(filter->GetOutput()); @@ -132,7 +132,7 @@ itkVectorThresholdSegmentationLevelSetImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescaler->GetOutput()); writer->SetFileName(av[3]); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx index df1b4052450..a1c6a98956a 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToLevelSetImageAdaptor.hxx @@ -51,7 +51,7 @@ BinaryImageToLevelSetImageAdaptorSetInput(this->m_InputImage); m_SignedDistanceTransformFilter->Update(); - typename LevelSetImageType::Pointer tempImage = LevelSetImageType::New(); + auto tempImage = LevelSetImageType::New(); tempImage->Graft(m_SignedDistanceTransformFilter->GetOutput()); this->m_LevelSet = LevelSetType::New(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx index 771e633726e..d327b02b727 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationAdvectionTerm.hxx @@ -78,7 +78,7 @@ LevelSetEquationAdvectionTerm::GenerateAdvectionImag { using DerivativeFilterType = GradientRecursiveGaussianImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->m_Input); derivative->SetSigma(this->m_DerivativeSigma); derivative->Update(); @@ -89,7 +89,7 @@ LevelSetEquationAdvectionTerm::GenerateAdvectionImag { using DerivativeFilterType = GradientImageFilter; - typename DerivativeFilterType::Pointer derivative = DerivativeFilterType::New(); + auto derivative = DerivativeFilterType::New(); derivative->SetInput(this->m_Input); derivative->UseImageSpacingOn(); derivative->Update(); @@ -97,7 +97,7 @@ LevelSetEquationAdvectionTerm::GenerateAdvectionImag using DerivativeOutputImageType = typename DerivativeFilterType::OutputImageType; using GradientCasterType = CastImageFilter; - typename GradientCasterType::Pointer caster = GradientCasterType::New(); + auto caster = GradientCasterType::New(); caster->SetInput(derivative->GetOutput()); caster->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx index ee024a934c9..3be8dd58365 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetEquationPropagationTerm.hxx @@ -41,7 +41,7 @@ LevelSetEquationPropagationTerm:: if (this->m_PropagationImage.IsNull()) { using CastFilterType = CastImageFilter; - typename CastFilterType::Pointer castFilter = CastFilterType::New(); + auto castFilter = CastFilterType::New(); castFilter->SetInput(this->m_Input); castFilter->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetSparseImage.hxx b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetSparseImage.hxx index 77cc3b1ba99..b1c64d53d8e 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkLevelSetSparseImage.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkLevelSetSparseImage.hxx @@ -165,7 +165,7 @@ typename LabelObject::Pointer LevelSetSparseImage::GetAsLabelObject() { using OutputLabelObjectType = LabelObject; - typename OutputLabelObjectType::Pointer object = OutputLabelObjectType::New(); + auto object = OutputLabelObjectType::New(); if (this->m_InternalLabelList.empty()) { diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx index 99b353dfa27..cafae60028e 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateMalcolmSparseLevelSet.hxx @@ -54,7 +54,7 @@ UpdateMalcolmSparseLevelSet::Update() this->m_OutputLevelSet->SetDomainOffset(this->m_Offset); using LabelMapToLabelImageFilterType = LabelMapToLabelImageFilter; - typename LabelMapToLabelImageFilterType::Pointer labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); + auto labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); labelMapToLabelImageFilter->SetInput(this->m_InputLevelSet->GetLabelMap()); labelMapToLabelImageFilter->Update(); @@ -114,7 +114,7 @@ UpdateMalcolmSparseLevelSet::Update() } using LabelImageToLabelMapFilterType = LabelImageToLabelMapFilter; - typename LabelImageToLabelMapFilterType::Pointer labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); + auto labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); labelImageToLabelMapFilter->SetInput(this->m_InternalImage); labelImageToLabelMapFilter->SetBackgroundValue(LevelSetType::PlusOneLayer()); labelImageToLabelMapFilter->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx index 847a8d2f45a..1ad4a839209 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateShiSparseLevelSet.hxx @@ -56,7 +56,7 @@ UpdateShiSparseLevelSet::Update() this->m_OutputLevelSet->SetDomainOffset(this->m_Offset); using LabelMapToLabelImageFilterType = LabelMapToLabelImageFilter; - typename LabelMapToLabelImageFilterType::Pointer labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); + auto labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); labelMapToLabelImageFilter->SetInput(this->m_InputLevelSet->GetLabelMap()); labelMapToLabelImageFilter->Update(); @@ -166,7 +166,7 @@ UpdateShiSparseLevelSet::Update() } using LabelImageToLabelMapFilterType = LabelImageToLabelMapFilter; - typename LabelImageToLabelMapFilterType::Pointer labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); + auto labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); labelImageToLabelMapFilter->SetInput(this->m_InternalImage); labelImageToLabelMapFilter->SetBackgroundValue(LevelSetType::PlusThreeLayer()); labelImageToLabelMapFilter->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx b/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx index af8043f1182..a4fe88cc078 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx +++ b/Modules/Segmentation/LevelSetsv4/include/itkUpdateWhitakerSparseLevelSet.hxx @@ -78,7 +78,7 @@ UpdateWhitakerSparseLevelSet this->m_OutputLevelSet->SetLabelMap(this->m_InputLevelSet->GetModifiableLabelMap()); - typename LabelMapToLabelImageFilterType::Pointer labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); + auto labelMapToLabelImageFilter = LabelMapToLabelImageFilterType::New(); labelMapToLabelImageFilter->SetInput(this->m_InputLevelSet->GetLabelMap()); labelMapToLabelImageFilter->Update(); @@ -167,7 +167,7 @@ UpdateWhitakerSparseLevelSet this->MovePointFromMinus2(); this->MovePointFromPlus2(); - typename LabelImageToLabelMapFilterType::Pointer labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); + auto labelImageToLabelMapFilter = LabelImageToLabelMapFilterType::New(); labelImageToLabelMapFilter->SetInput(this->m_InternalImage); labelImageToLabelMapFilter->SetBackgroundValue(LevelSetType::PlusThreeLayer()); labelImageToLabelMapFilter->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/include/itkWhitakerSparseLevelSetImage.h b/Modules/Segmentation/LevelSetsv4/include/itkWhitakerSparseLevelSetImage.h index 7f955420bf2..309b737a484 100644 --- a/Modules/Segmentation/LevelSetsv4/include/itkWhitakerSparseLevelSetImage.h +++ b/Modules/Segmentation/LevelSetsv4/include/itkWhitakerSparseLevelSetImage.h @@ -137,7 +137,7 @@ class ITK_TEMPLATE_EXPORT WhitakerSparseLevelSetImage : public LevelSetSparseIma GetAsLabelObject() { using OutputLabelObjectType = LabelObject; - typename OutputLabelObjectType::Pointer object = OutputLabelObjectType::New(); + auto object = OutputLabelObjectType::New(); for (LayerIdType status = this->MinusThreeLayer(); status < this->PlusOneLayer(); ++status) { diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx index 2dd1144d0e8..c5d452555f9 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToMalcolmSparseLevelSetAdaptorTest.cxx @@ -41,7 +41,7 @@ itkBinaryImageToMalcolmSparseLevelSetAdaptorTest(int argc, char * argv[]) using InputImageType = itk::Image; using InputReaderType = itk::ImageFileReader; - InputReaderType::Pointer reader = InputReaderType::New(); + auto reader = InputReaderType::New(); reader->SetFileName(argv[1]); try { @@ -58,7 +58,7 @@ itkBinaryImageToMalcolmSparseLevelSetAdaptorTest(int argc, char * argv[]) using LevelSetType = itk::MalcolmSparseLevelSetImage; using BinaryToSparseAdaptorType = itk::BinaryImageToLevelSetImageAdaptor; - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(input); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -66,7 +66,7 @@ itkBinaryImageToMalcolmSparseLevelSetAdaptorTest(int argc, char * argv[]) LevelSetType::Pointer sparseLevelSet = adaptor->GetModifiableLevelSet(); using StatusImageType = itk::Image; - StatusImageType::Pointer statusImage = StatusImageType::New(); + auto statusImage = StatusImageType::New(); statusImage->SetRegions(input->GetLargestPossibleRegion()); statusImage->CopyInformation(input); statusImage->Allocate(); @@ -90,7 +90,7 @@ itkBinaryImageToMalcolmSparseLevelSetAdaptorTest(int argc, char * argv[]) } using StatusWriterType = itk::ImageFileWriter; - StatusWriterType::Pointer writer = StatusWriterType::New(); + auto writer = StatusWriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(statusImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx index 28f26c1785e..1c7943e0baf 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToShiSparseLevelSetAdaptorTest.cxx @@ -36,7 +36,7 @@ itkBinaryImageToShiSparseLevelSetAdaptorTest(int argc, char * argv[]) using InputImageType = itk::Image; using InputReaderType = itk::ImageFileReader; - InputReaderType::Pointer reader = InputReaderType::New(); + auto reader = InputReaderType::New(); reader->SetFileName(argv[1]); try { @@ -54,7 +54,7 @@ itkBinaryImageToShiSparseLevelSetAdaptorTest(int argc, char * argv[]) using BinaryToSparseAdaptorType = itk::BinaryImageToLevelSetImageAdaptor; - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(input); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -64,7 +64,7 @@ itkBinaryImageToShiSparseLevelSetAdaptorTest(int argc, char * argv[]) LevelSetType::Pointer sparseLevelSet = adaptor->GetModifiableLevelSet(); using StatusImageType = itk::Image; - StatusImageType::Pointer statusImage = StatusImageType::New(); + auto statusImage = StatusImageType::New(); statusImage->SetRegions(input->GetLargestPossibleRegion()); statusImage->CopyInformation(input); statusImage->Allocate(); @@ -84,7 +84,7 @@ itkBinaryImageToShiSparseLevelSetAdaptorTest(int argc, char * argv[]) } using StatusWriterType = itk::ImageFileWriter; - StatusWriterType::Pointer writer = StatusWriterType::New(); + auto writer = StatusWriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(statusImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx index 6fe074f6ccb..2628adf4352 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkBinaryImageToWhitakerSparseLevelSetAdaptorTest.cxx @@ -37,7 +37,7 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) using InputImageType = itk::Image; using InputReaderType = itk::ImageFileReader; - InputReaderType::Pointer reader = InputReaderType::New(); + auto reader = InputReaderType::New(); reader->SetFileName(argv[1]); try @@ -57,7 +57,7 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) using BinaryToSparseAdaptorType = itk::BinaryImageToLevelSetImageAdaptor; - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(input); adaptor->Initialize(); @@ -67,14 +67,14 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) LevelSetType::Pointer sparseLevelSet = adaptor->GetModifiableLevelSet(); using OutputImageType = itk::Image; - OutputImageType::Pointer output = OutputImageType::New(); + auto output = OutputImageType::New(); output->SetRegions(input->GetLargestPossibleRegion()); output->CopyInformation(input); output->Allocate(); output->FillBuffer(0.0); using StatusImageType = itk::Image; - StatusImageType::Pointer statusImage = StatusImageType::New(); + auto statusImage = StatusImageType::New(); statusImage->SetRegions(input->GetLargestPossibleRegion()); statusImage->CopyInformation(input); statusImage->Allocate(); @@ -100,7 +100,7 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer outputWriter = OutputWriterType::New(); + auto outputWriter = OutputWriterType::New(); outputWriter->SetFileName(argv[2]); outputWriter->SetInput(output); @@ -115,7 +115,7 @@ itkBinaryImageToWhitakerSparseLevelSetAdaptorTest(int argc, char * argv[]) } using StatusWriterType = itk::ImageFileWriter; - StatusWriterType::Pointer statusWriter = StatusWriterType::New(); + auto statusWriter = StatusWriterType::New(); statusWriter->SetFileName(argv[3]); statusWriter->SetInput(statusImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx index d792294f4c8..4257889c192 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkDenseLevelSetContainerTest.cxx @@ -30,7 +30,7 @@ itkDenseLevelSetContainerTest(int, char *[]) using NamedLevelSetContainerType = itk::LevelSetContainer; - NamedLevelSetContainerType::Pointer name_container = NamedLevelSetContainerType::New(); + auto name_container = NamedLevelSetContainerType::New(); name_container->AddLevelSet("Lung", LevelSetType::New()); name_container->AddLevelSet("Heart", LevelSetType::New()); @@ -51,7 +51,7 @@ itkDenseLevelSetContainerTest(int, char *[]) } using LevelSetContainerType = itk::LevelSetContainer; - LevelSetContainerType::Pointer container = LevelSetContainerType::New(); + auto container = LevelSetContainerType::New(); container->AddLevelSet(1, LevelSetType::New()); container->AddLevelSet(3, LevelSetType::New()); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx index b8ca31e4186..91c8c81359f 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDenseImageTest.cxx @@ -100,7 +100,7 @@ itkLevelSetDenseImageTest(int, char *[]) origin[0] = 3.99; origin[1] = 3.99; - ImageType::Pointer input = ImageType::New(); + auto input = ImageType::New(); input->SetRegions(region); input->SetSpacing(spacing); input->SetOrigin(origin); @@ -115,7 +115,7 @@ itkLevelSetDenseImageTest(int, char *[]) ImageType::PointType pt; using TestFunctionType = itk::LevelSetTestFunction; - TestFunctionType::Pointer testFunction = TestFunctionType::New(); + auto testFunction = TestFunctionType::New(); while (!it.IsAtEnd()) { @@ -129,7 +129,7 @@ itkLevelSetDenseImageTest(int, char *[]) ++it; } - LevelSetType::Pointer level_set = LevelSetType::New(); + auto level_set = LevelSetType::New(); level_set->SetImage(input); idx[0] = 9; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx index bec08e96fa5..d34398bf750 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainMapImageFilterTest.cxx @@ -45,7 +45,7 @@ itkLevelSetDomainMapImageFilterTest(int, char *[]) ListPixelType l; - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->Allocate(); input->FillBuffer(l); @@ -60,7 +60,7 @@ itkLevelSetDomainMapImageFilterTest(int, char *[]) input->SetPixel(index, ll); } - DomainMapImageFilterType::Pointer filter = DomainMapImageFilterType::New(); + auto filter = DomainMapImageFilterType::New(); filter->SetInput(input); filter->Update(); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx index 650ca947f2c..220a3e61caf 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionBaseTest.cxx @@ -60,7 +60,7 @@ itkLevelSetDomainPartitionBaseTest(int, char *[]) itk::IdentifierType count = 2; - DomainPartitionBaseHelperType::Pointer function = DomainPartitionBaseHelperType::New(); + auto function = DomainPartitionBaseHelperType::New(); function->SetNumberOfLevelSetFunctions(count); if (function->GetNumberOfLevelSetFunctions() != count) diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx index 73838e2bcc8..9f2d1f76f34 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageTest.cxx @@ -56,7 +56,7 @@ itkLevelSetDomainPartitionImageTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -70,7 +70,7 @@ itkLevelSetDomainPartitionImageTest(int, char *[]) regionVector[0] = region; regionVector[1] = region; - DomainPartitionSourceType::Pointer partitionSource = DomainPartitionSourceType::New(); + auto partitionSource = DomainPartitionSourceType::New(); partitionSource->SetNumberOfLevelSetFunctions(numberOfLevelSetFunctions); partitionSource->SetLevelSetDomainRegionVector(regionVector); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx index f238c64ea4f..67231c8f46a 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetDomainPartitionImageWithKdTreeTest.cxx @@ -61,7 +61,7 @@ itkLevelSetDomainPartitionImageWithKdTreeTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -73,8 +73,8 @@ itkLevelSetDomainPartitionImageWithKdTreeTest(int, char *[]) LevelSetDomainRegionVectorType regionVector; regionVector.resize(numberOfLevelSetFunctions); - CentroidVectorType mv; - SampleType::Pointer sample = SampleType::New(); + CentroidVectorType mv; + auto sample = SampleType::New(); sample->SetMeasurementVectorSize(Dimension); for (unsigned int i = 0; i < numberOfLevelSetFunctions; ++i) @@ -94,13 +94,13 @@ itkLevelSetDomainPartitionImageWithKdTreeTest(int, char *[]) sample->PushBack(mv); } - TreeGeneratorType::Pointer treeGenerator = TreeGeneratorType::New(); + auto treeGenerator = TreeGeneratorType::New(); treeGenerator->SetSample(sample); treeGenerator->SetBucketSize(2); treeGenerator->Update(); TreeType::Pointer kdtree = treeGenerator->GetOutput(); - DomainPartitionSourceType::Pointer partitionSource = DomainPartitionSourceType::New(); + auto partitionSource = DomainPartitionSourceType::New(); partitionSource->SetNumberOfLevelSetFunctions(numberOfLevelSetFunctions); partitionSource->SetImage(binary); partitionSource->SetLevelSetDomainRegionVector(regionVector); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx index 9ccc57b86df..cace320fe8b 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationBinaryMaskTermTest.cxx @@ -73,7 +73,7 @@ itkLevelSetEquationBinaryMaskTermTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -95,7 +95,7 @@ itkLevelSetEquationBinaryMaskTermTest(int, char *[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor1 = BinaryToSparseAdaptorType::New(); + auto adaptor1 = BinaryToSparseAdaptorType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); std::cout << "Finished converting levelset1 to sparse format" << std::endl; @@ -105,22 +105,22 @@ itkLevelSetEquationBinaryMaskTermTest(int, char *[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(2.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -131,7 +131,7 @@ itkLevelSetEquationBinaryMaskTermTest(int, char *[]) } // Create overlap penalty term - BinaryMaskTermType::Pointer maskTerm0 = BinaryMaskTermType::New(); + auto maskTerm0 = BinaryMaskTermType::New(); maskTerm0->SetInput(binary); maskTerm0->SetMask(binary); maskTerm0->SetCoefficient(1000.0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx index 3d568be6ff1..d62ddbc7948 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseExternalTermTest.cxx @@ -85,7 +85,7 @@ itkLevelSetEquationChanAndVeseExternalTermTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -107,7 +107,7 @@ itkLevelSetEquationChanAndVeseExternalTermTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -117,22 +117,22 @@ itkLevelSetEquationChanAndVeseExternalTermTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -143,7 +143,7 @@ itkLevelSetEquationChanAndVeseExternalTermTest(int argc, char * argv[]) } // Create ChanAndVese External term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(binary); cvExternalTerm0->SetCoefficient(1.0); cvExternalTerm0->SetCurrentLevelSetId(0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx index 46601427465..e9d35a5cf0e 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationChanAndVeseInternalTermTest.cxx @@ -85,7 +85,7 @@ itkLevelSetEquationChanAndVeseInternalTermTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -107,7 +107,7 @@ itkLevelSetEquationChanAndVeseInternalTermTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -117,22 +117,22 @@ itkLevelSetEquationChanAndVeseInternalTermTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -143,7 +143,7 @@ itkLevelSetEquationChanAndVeseInternalTermTest(int argc, char * argv[]) } // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(binary); cvInternalTerm0->SetCoefficient(1.0); cvInternalTerm0->SetCurrentLevelSetId(0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx index dc81f6e544d..36a49c94b37 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationCurvatureTermTest.cxx @@ -80,7 +80,7 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -102,7 +102,7 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -112,22 +112,22 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -138,7 +138,7 @@ itkLevelSetEquationCurvatureTermTest(int argc, char * argv[]) } // Create ChanAndVese External term for phi_{1} - CurvatureTermType::Pointer term = CurvatureTermType::New(); + auto term = CurvatureTermType::New(); term->SetInput(binary); term->SetCoefficient(1.0); term->SetCurrentLevelSetId(0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx index 6a7a54cf2cf..b34feffe3a4 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationLaplacianTermTest.cxx @@ -79,7 +79,7 @@ itkLevelSetEquationLaplacianTermTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -101,7 +101,7 @@ itkLevelSetEquationLaplacianTermTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -111,22 +111,22 @@ itkLevelSetEquationLaplacianTermTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -137,7 +137,7 @@ itkLevelSetEquationLaplacianTermTest(int argc, char * argv[]) } // Create ChanAndVese External term for phi_{1} - LaplacianTermType::Pointer term = LaplacianTermType::New(); + auto term = LaplacianTermType::New(); term->SetInput(binary); term->SetCoefficient(1.0); term->SetCurrentLevelSetId(0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx index e5f54680b8e..88743a7d20d 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationOverlapPenaltyTermTest.cxx @@ -73,7 +73,7 @@ itkLevelSetEquationOverlapPenaltyTermTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -95,13 +95,13 @@ itkLevelSetEquationOverlapPenaltyTermTest(int, char *[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor1 = BinaryToSparseAdaptorType::New(); + auto adaptor1 = BinaryToSparseAdaptorType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); std::cout << "Finished converting levelset1 to sparse format" << std::endl; // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor2 = BinaryToSparseAdaptorType::New(); + auto adaptor2 = BinaryToSparseAdaptorType::New(); adaptor2->SetInputImage(binary); adaptor2->Initialize(); std::cout << "Finished converting levelset2 to sparse format" << std::endl; @@ -113,22 +113,22 @@ itkLevelSetEquationOverlapPenaltyTermTest(int, char *[]) list_ids.push_back(1); list_ids.push_back(2); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(2.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -146,13 +146,13 @@ itkLevelSetEquationOverlapPenaltyTermTest(int, char *[]) // Create overlap penalty term - OverlapPenaltyTermType::Pointer penaltyTerm0 = OverlapPenaltyTermType::New(); + auto penaltyTerm0 = OverlapPenaltyTermType::New(); penaltyTerm0->SetInput(binary); penaltyTerm0->SetCoefficient(1000.0); penaltyTerm0->SetCurrentLevelSetId(0); penaltyTerm0->SetLevelSetContainer(lscontainer); - OverlapPenaltyTermType::Pointer penaltyTerm1 = OverlapPenaltyTermType::New(); + auto penaltyTerm1 = OverlapPenaltyTermType::New(); penaltyTerm1->SetInput(binary); penaltyTerm1->SetCoefficient(1000.0); penaltyTerm1->SetCurrentLevelSetId(1); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx index 157797f7ee9..cc14571ded4 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationPropagationTermTest.cxx @@ -79,7 +79,7 @@ itkLevelSetEquationPropagationTermTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -101,7 +101,7 @@ itkLevelSetEquationPropagationTermTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -111,22 +111,22 @@ itkLevelSetEquationPropagationTermTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -137,7 +137,7 @@ itkLevelSetEquationPropagationTermTest(int argc, char * argv[]) } // Create ChanAndVese External term for phi_{1} - PropagationTermType::Pointer term = PropagationTermType::New(); + auto term = PropagationTermType::New(); term->SetInput(binary); term->SetCoefficient(1.0); term->SetCurrentLevelSetId(0); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx index 9d907b66c78..44d17867931 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEquationTermContainerTest.cxx @@ -87,7 +87,7 @@ itkLevelSetEquationTermContainerTest(int argc, char * argv[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -109,7 +109,7 @@ itkLevelSetEquationTermContainerTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -119,22 +119,22 @@ itkLevelSetEquationTermContainerTest(int argc, char * argv[]) IdListType list_ids; list_ids.push_back(1); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(binary->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -145,17 +145,17 @@ itkLevelSetEquationTermContainerTest(int argc, char * argv[]) } // Create ChanAndVese External term for phi_{1} - LaplacianTermType::Pointer term0 = LaplacianTermType::New(); + auto term0 = LaplacianTermType::New(); term0->SetInput(binary); term0->SetCoefficient(1.0); std::cout << "Laplacian term created" << std::endl; - ChanAndVeseInternalTermType::Pointer term1 = ChanAndVeseInternalTermType::New(); + auto term1 = ChanAndVeseInternalTermType::New(); term1->SetInput(binary); term1->SetCoefficient(1.0); std::cout << "CV internal term created" << std::endl; - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(binary); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx index 82e0ea7e69a..e4cc63ccb3e 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest.cxx @@ -32,7 +32,7 @@ itkLevelSetEvolutionNumberOfIterationsStoppingCriterionTest(int, char *[]) using LevelSetContainerType = itk::LevelSetContainerBase; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(5); if (criterion->GetNumberOfIterations() != 5) diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx index ce1ee03d6d7..dc064a690c9 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMalcolmSparseLevelSetImageTest.cxx @@ -31,7 +31,7 @@ itkMalcolmSparseLevelSetImageTest(int, char *[]) IndexType index; index.Fill(3); - LabelMapType::Pointer labelMap = LabelMapType::New(); + auto labelMap = LabelMapType::New(); labelMap->SetBackgroundValue(1); for (int i = 0; i < 4; ++i) @@ -40,7 +40,7 @@ itkMalcolmSparseLevelSetImageTest(int, char *[]) labelMap->SetPixel(index, -1); } - SparseLevelSetType::Pointer phi = SparseLevelSetType::New(); + auto phi = SparseLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(phi, MalcolmSparseLevelSetImage, LevelSetSparseImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx index 90c12856253..e1b62fa8f48 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetChanAndVeseInternalTermTest.cxx @@ -63,7 +63,7 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) PixelType value = 0.; - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->Allocate(); input->FillBuffer(0); @@ -76,12 +76,12 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) ++it; } - ImageType::Pointer input1 = ImageType::New(); + auto input1 = ImageType::New(); input1->SetRegions(region); input1->Allocate(); input1->FillBuffer(value); - ImageType::Pointer input2 = ImageType::New(); + auto input2 = ImageType::New(); input2->SetRegions(region); input2->Allocate(); input2->FillBuffer(value); @@ -89,16 +89,16 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) ImageType::IndexType idx; IdListType list_ids; - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(region); id_image->Allocate(); id_image->FillBuffer(list_ids); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); CacheImageType::Pointer output = domainMapFilter->GetOutput(); @@ -142,8 +142,8 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) level_set[2]->SetImage(input2); // Insert the levelsets in a levelset container - bool levelSetNotYetAdded; - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + bool levelSetNotYetAdded; + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -160,7 +160,7 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) std::cout << "Level set container created" << std::endl; // Create ChanAndVeseTerm - ChanAndVeseTermType::Pointer cvTerm = ChanAndVeseTermType::New(); + auto cvTerm = ChanAndVeseTermType::New(); cvTerm->SetInput(input); cvTerm->SetCoefficient(1.0); cvTerm->SetCurrentLevelSetId(0); @@ -168,7 +168,7 @@ itkMultiLevelSetChanAndVeseInternalTermTest(int, char *[]) std::cout << "CV term created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer = TermContainerType::New(); + auto termContainer = TermContainerType::New(); termContainer->AddTerm(0, cvTerm); std::cout << "Term container created" << std::endl; diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx index 6f5d4f23d90..e0b50abcfd6 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageSubset2DTest.cxx @@ -86,7 +86,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) region.SetSize(size); // Input initialization - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->SetSpacing(spacing); input->SetOrigin(origin); @@ -114,7 +114,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -135,17 +135,17 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) } // Convert binary mask to dense level set - BinaryImageToLevelSetType::Pointer adaptor1 = BinaryImageToLevelSetType::New(); + auto adaptor1 = BinaryImageToLevelSetType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); LevelSetType::Pointer levelSet1 = adaptor1->GetModifiableLevelSet(); - BinaryImageToLevelSetType::Pointer adaptor2 = BinaryImageToLevelSetType::New(); + auto adaptor2 = BinaryImageToLevelSetType::New(); adaptor2->SetInputImage(binary); adaptor2->Initialize(); LevelSetType::Pointer levelSet2 = adaptor2->GetModifiableLevelSet(); - BinaryImageToLevelSetType::Pointer adaptor3 = BinaryImageToLevelSetType::New(); + auto adaptor3 = BinaryImageToLevelSetType::New(); adaptor3->SetInputImage(binary); adaptor3->Initialize(); LevelSetType::Pointer levelSet3 = adaptor3->GetModifiableLevelSet(); @@ -168,7 +168,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - IdListImageType::Pointer idImage = IdListImageType::New(); + auto idImage = IdListImageType::New(); idImage->SetRegions(input->GetLargestPossibleRegion()); idImage->Allocate(); idImage->FillBuffer(listIds); @@ -184,17 +184,17 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) ++it; } - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(idImage); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -216,46 +216,46 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) std::cout << "Level set container created" << std::endl; // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV external term created" << std::endl; // Create ChanAndVese internal term for phi_{2} - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{2} - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // Create ChanAndVese internal term for phi_{3} - ChanAndVeseInternalTermType::Pointer cvInternalTerm2 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm2 = ChanAndVeseInternalTermType::New(); cvInternalTerm2->SetInput(input); cvInternalTerm2->SetCoefficient(1.0); std::cout << "LevelSet 2: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{3} - ChanAndVeseExternalTermType::Pointer cvExternalTerm2 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm2 = ChanAndVeseExternalTermType::New(); cvExternalTerm2->SetInput(input); cvExternalTerm2->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -264,7 +264,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -273,7 +273,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) termContainer1->AddTerm(1, cvExternalTerm1); std::cout << "Term container 1 created" << std::endl; - TermContainerType::Pointer termContainer2 = TermContainerType::New(); + auto termContainer2 = TermContainerType::New(); termContainer2->SetInput(input); termContainer2->SetCurrentLevelSetId(2); termContainer2->SetLevelSetContainer(lscontainer); @@ -282,7 +282,7 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) termContainer2->AddTerm(1, cvExternalTerm2); std::cout << "Term container 2 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); @@ -290,11 +290,11 @@ itkMultiLevelSetDenseImageSubset2DTest(int, char *[]) std::cout << "Equation container created" << std::endl; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(10); std::cout << "Stopping criterion created" << std::endl; - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx index cd4d9fccb0d..8692da1bdda 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetDenseImageTest.cxx @@ -46,12 +46,12 @@ itkMultiLevelSetDenseImageTest(int, char *[]) PixelType value = 0.; - ImageType::Pointer input1 = ImageType::New(); + auto input1 = ImageType::New(); input1->SetRegions(region); input1->Allocate(); input1->FillBuffer(value); - ImageType::Pointer input2 = ImageType::New(); + auto input2 = ImageType::New(); input2->SetRegions(region); input2->Allocate(); input2->FillBuffer(value); @@ -59,7 +59,7 @@ itkMultiLevelSetDenseImageTest(int, char *[]) ImageType::IndexType idx; IdListType list_ids; - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(region); id_image->Allocate(); id_image->FillBuffer(list_ids); @@ -100,7 +100,7 @@ itkMultiLevelSetDenseImageTest(int, char *[]) level_set[2] = LevelSetType::New(); level_set[2]->SetImage(input2); - DomainMapImageFilterType::Pointer filter = DomainMapImageFilterType::New(); + auto filter = DomainMapImageFilterType::New(); filter->SetInput(id_image); filter->Update(); CacheImageType::Pointer output = filter->GetOutput(); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx index 5eab234bb9e..9829835bfba 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetEvolutionTest.cxx @@ -71,17 +71,17 @@ itkMultiLevelSetEvolutionTest(int, char *[]) PixelType value = 0.; - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->Allocate(); input->FillBuffer(1); - ImageType::Pointer input1 = ImageType::New(); + auto input1 = ImageType::New(); input1->SetRegions(region); input1->Allocate(); input1->FillBuffer(value); - ImageType::Pointer input2 = ImageType::New(); + auto input2 = ImageType::New(); input2->SetRegions(region); input2->Allocate(); input2->FillBuffer(value); @@ -89,7 +89,7 @@ itkMultiLevelSetEvolutionTest(int, char *[]) ImageType::IndexType idx; IdListType list_ids; - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(region); id_image->Allocate(); id_image->FillBuffer(list_ids); @@ -124,12 +124,12 @@ itkMultiLevelSetEvolutionTest(int, char *[]) ++it2; } - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Map of levelset bases @@ -141,7 +141,7 @@ itkMultiLevelSetEvolutionTest(int, char *[]) level_set[2]->SetImage(input2); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -164,13 +164,13 @@ itkMultiLevelSetEvolutionTest(int, char *[]) // *** 1st Level Set phi_{1} *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -179,13 +179,13 @@ itkMultiLevelSetEvolutionTest(int, char *[]) // *** 2nd Level Set phi_{2} *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{2} - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; @@ -193,7 +193,7 @@ itkMultiLevelSetEvolutionTest(int, char *[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -202,7 +202,7 @@ itkMultiLevelSetEvolutionTest(int, char *[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -212,15 +212,15 @@ itkMultiLevelSetEvolutionTest(int, char *[]) std::cout << "Term container 1 created" << std::endl; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(2); - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); equationContainer->SetLevelSetContainer(lscontainer); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx index aecdf6dedc9..fba465ed1fd 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetMalcolmImageSubset2DTest.cxx @@ -87,7 +87,7 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) region.SetSize(size); // Input initialization - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->SetSpacing(spacing); input->SetOrigin(origin); @@ -115,7 +115,7 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -136,7 +136,7 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) } // Convert binary mask to dense level set - BinaryImageToLevelSetType::Pointer adaptor1 = BinaryImageToLevelSetType::New(); + auto adaptor1 = BinaryImageToLevelSetType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); LevelSetType::Pointer levelSet1 = adaptor1->GetModifiableLevelSet(); @@ -157,7 +157,7 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - IdListImageType::Pointer idImage = IdListImageType::New(); + auto idImage = IdListImageType::New(); idImage->SetRegions(input->GetLargestPossibleRegion()); idImage->Allocate(); idImage->FillBuffer(listIds); @@ -171,17 +171,17 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) ++it; } - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(idImage); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -193,20 +193,20 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) std::cout << "Level set container created" << std::endl; // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV external term created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -216,17 +216,17 @@ itkMultiLevelSetMalcolmImageSubset2DTest(int, char *[]) std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); std::cout << "Equation container created" << std::endl; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(5000); std::cout << "Stopping criterion created" << std::endl; - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx index 933548385dd..36d0eb1a545 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetShiImageSubset2DTest.cxx @@ -87,7 +87,7 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) region.SetSize(size); // Input initialization - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->SetSpacing(spacing); input->SetOrigin(origin); @@ -115,7 +115,7 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -136,7 +136,7 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) } // Convert binary mask to dense level set - BinaryImageToLevelSetType::Pointer adaptor1 = BinaryImageToLevelSetType::New(); + auto adaptor1 = BinaryImageToLevelSetType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); LevelSetType::Pointer levelSet1 = adaptor1->GetModifiableLevelSet(); @@ -157,7 +157,7 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - IdListImageType::Pointer idImage = IdListImageType::New(); + auto idImage = IdListImageType::New(); idImage->SetRegions(input->GetLargestPossibleRegion()); idImage->Allocate(); idImage->FillBuffer(listIds); @@ -171,17 +171,17 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) ++it; } - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(idImage); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -193,20 +193,20 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) std::cout << "Level set container created" << std::endl; // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV external term created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -216,17 +216,17 @@ itkMultiLevelSetShiImageSubset2DTest(int, char *[]) std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); std::cout << "Equation container created" << std::endl; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(500); std::cout << "Stopping criterion created" << std::endl; - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx index 28aeea5f6ee..e0150bee999 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkMultiLevelSetWhitakerImageSubset2DTest.cxx @@ -87,7 +87,7 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) region.SetSize(size); // Input initialization - InputImageType::Pointer input = InputImageType::New(); + auto input = InputImageType::New(); input->SetRegions(region); input->SetSpacing(spacing); input->SetOrigin(origin); @@ -115,7 +115,7 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) region.SetSize(size); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(region); binary->SetSpacing(spacing); binary->SetOrigin(origin); @@ -136,7 +136,7 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) } // Convert binary mask to dense level set - BinaryImageToLevelSetType::Pointer adaptor1 = BinaryImageToLevelSetType::New(); + auto adaptor1 = BinaryImageToLevelSetType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); LevelSetType::Pointer levelSet1 = adaptor1->GetModifiableLevelSet(); @@ -157,7 +157,7 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) region.SetIndex(index); region.SetSize(size); - IdListImageType::Pointer idImage = IdListImageType::New(); + auto idImage = IdListImageType::New(); idImage->SetRegions(input->GetLargestPossibleRegion()); idImage->Allocate(); idImage->FillBuffer(listIds); @@ -171,17 +171,17 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) ++it; } - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(idImage); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -193,20 +193,20 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) std::cout << "Level set container created" << std::endl; // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 0: CV external term created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -216,17 +216,17 @@ itkMultiLevelSetWhitakerImageSubset2DTest(int, char *[]) std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); std::cout << "Equation container created" << std::endl; using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(500); std::cout << "Stopping criterion created" << std::endl; - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx index 273aef39c72..bbd0512c10c 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkShiSparseLevelSetImageTest.cxx @@ -31,7 +31,7 @@ itkShiSparseLevelSetImageTest(int, char *[]) IndexType index; index.Fill(3); - LabelMapType::Pointer labelMap = LabelMapType::New(); + auto labelMap = LabelMapType::New(); labelMap->SetBackgroundValue(3); for (int i = 0; i < 4; ++i) @@ -52,7 +52,7 @@ itkShiSparseLevelSetImageTest(int, char *[]) index[1] = 8; labelMap->SetPixel(index, 1); - SparseLevelSetType::Pointer phi = SparseLevelSetType::New(); + auto phi = SparseLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(phi, ShiSparseLevelSetImage, LevelSetSparseImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx index e0c59c9a7d0..b438a50785d 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseAdvectionImage2DTest.cxx @@ -66,14 +66,14 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) using NodeType = FastMarchingFilterType::NodeType; // Read the image to be segmented - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); ImageType::IndexType seedPosition; seedPosition[0] = std::stoi(argv[2]); @@ -116,15 +116,15 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) fastMarching->Update(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Map of levelset bases - LevelSetType::Pointer level_set = LevelSetType::New(); + auto level_set = LevelSetType::New(); level_set->SetImage(fastMarching->GetOutput()); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool levelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -140,7 +140,7 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create Advection term for phi_{1} - AdvectionTermType::Pointer advectionTerm = AdvectionTermType::New(); + auto advectionTerm = AdvectionTermType::New(); advectionTerm->SetInput(input); advectionTerm->SetCoefficient(1.0); advectionTerm->SetDerivativeSigma(std::stod(argv[6])); @@ -149,7 +149,7 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -157,15 +157,15 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) termContainer0->AddTerm(0, advectionTerm); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(5); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -183,7 +183,7 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) AdvectionTermType::AdvectionImageType * advectionImage = advectionTerm->GetModifiableAdvectionImage(); advectionTerm->SetAdvectionImage(advectionImage); - ImageType::Pointer outputImage = ImageType::New(); + auto outputImage = ImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -202,7 +202,7 @@ itkSingleLevelSetDenseAdvectionImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx index 03c463c1c59..e82d1a5b806 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetDenseImage2DTest.cxx @@ -68,14 +68,14 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) using NodeType = FastMarchingFilterType::NodeType; // Read the image to be segmented - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); ImageType::IndexType seedPosition; seedPosition[0] = std::stoi(argv[2]); @@ -118,15 +118,15 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) fastMarching->Update(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Map of levelset bases - LevelSetType::Pointer level_set = LevelSetType::New(); + auto level_set = LevelSetType::New(); level_set->SetImage(fastMarching->GetOutput()); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool levelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -142,13 +142,13 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -156,7 +156,7 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -165,15 +165,15 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(50); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -188,7 +188,7 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } - ImageType::Pointer outputImage = ImageType::New(); + auto outputImage = ImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -207,7 +207,7 @@ itkSingleLevelSetDenseImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[5]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx index 5af0ac80f6a..8de64c04ebb 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetMalcolmImage2DTest.cxx @@ -66,13 +66,13 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load input image - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -97,7 +97,7 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -105,11 +105,11 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) SparseLevelSetType::Pointer level_set = adaptor->GetModifiableLevelSet(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(2.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool levelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -125,13 +125,13 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -139,7 +139,7 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -148,15 +148,15 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); equationContainer->SetLevelSetContainer(lscontainer); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -172,7 +172,7 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -192,7 +192,7 @@ itkSingleLevelSetMalcolmImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx index cac86a904ea..1b25d3f3366 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetShiImage2DTest.cxx @@ -66,13 +66,13 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -97,7 +97,7 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -105,11 +105,11 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) SparseLevelSetType::Pointer level_set = adaptor->GetModifiableLevelSet(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(2.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool levelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -125,13 +125,13 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -139,7 +139,7 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -148,15 +148,15 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -172,7 +172,7 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -192,7 +192,7 @@ itkSingleLevelSetShiImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx index 768a177988a..ef7a76bfca2 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DTest.cxx @@ -68,13 +68,13 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -99,7 +99,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -107,11 +107,11 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) SparseLevelSetType::Pointer level_set = adaptor->GetModifiableLevelSet(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool LevelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -127,13 +127,13 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -141,7 +141,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -150,15 +150,15 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) termContainer0->AddTerm(1, cvExternalTerm0); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); equationContainer->SetLevelSetContainer(lscontainer); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -175,7 +175,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -195,7 +195,7 @@ itkSingleLevelSetWhitakerImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx index d474dbee985..8525b34fd97 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithCurvatureTest.cxx @@ -70,13 +70,13 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -101,7 +101,7 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -118,11 +118,11 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) level_set->SetDomainOffset(offset); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool LevelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -138,19 +138,19 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - CurvatureTermType::Pointer curvatureTerm0 = CurvatureTermType::New(); + auto curvatureTerm0 = CurvatureTermType::New(); curvatureTerm0->SetInput(input); curvatureTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Curvature term created" << std::endl; @@ -158,7 +158,7 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -168,15 +168,15 @@ itkSingleLevelSetWhitakerImage2DWithCurvatureTest(int argc, char * argv[]) termContainer0->AddTerm(2, curvatureTerm0); std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(5); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); if (evolution->GetEquationContainer() != equationContainer) diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx index d6335176800..4f1865abbaa 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithLaplacianTest.cxx @@ -73,13 +73,13 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -104,7 +104,7 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -112,11 +112,11 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) SparseLevelSetType::Pointer level_set = adaptor->GetModifiableLevelSet(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool LevelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -132,31 +132,31 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - CurvatureTermType::Pointer curvatureTerm0 = CurvatureTermType::New(); + auto curvatureTerm0 = CurvatureTermType::New(); curvatureTerm0->SetInput(input); curvatureTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Curvature term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - PropagationTermType::Pointer propagationTerm0 = PropagationTermType::New(); + auto propagationTerm0 = PropagationTermType::New(); propagationTerm0->SetInput(input); propagationTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Propagation term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - LaplacianTermType::Pointer laplacianTerm0 = LaplacianTermType::New(); + auto laplacianTerm0 = LaplacianTermType::New(); laplacianTerm0->SetInput(input); laplacianTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Laplacian term created" << std::endl; @@ -164,7 +164,7 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -177,14 +177,14 @@ itkSingleLevelSetWhitakerImage2DWithLaplacianTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(5); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx index 3b9cd5cc75a..4a888a8a8d5 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSingleLevelSetWhitakerImage2DWithPropagationTest.cxx @@ -71,13 +71,13 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -102,7 +102,7 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor = BinaryToSparseAdaptorType::New(); + auto adaptor = BinaryToSparseAdaptorType::New(); adaptor->SetInputImage(binary); adaptor->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -110,11 +110,11 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) SparseLevelSetType::Pointer level_set = adaptor->GetModifiableLevelSet(); // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); bool LevelSetNotYetAdded = lscontainer->AddLevelSet(0, level_set, false); @@ -130,25 +130,25 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - CurvatureTermType::Pointer curvatureTerm0 = CurvatureTermType::New(); + auto curvatureTerm0 = CurvatureTermType::New(); curvatureTerm0->SetInput(input); curvatureTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Curvature term created" << std::endl; // Create ChanAndVese curvature term for phi_{1} - PropagationTermType::Pointer propagationTerm0 = PropagationTermType::New(); + auto propagationTerm0 = PropagationTermType::New(); propagationTerm0->SetPropagationImage(input); propagationTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: Propagation term created" << std::endl; @@ -156,7 +156,7 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -168,14 +168,14 @@ itkSingleLevelSetWhitakerImage2DWithPropagationTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(50); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); // evolution->SetNumberOfIterations( 50 ); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx index edd17398d2a..c6bb0593746 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkSparseLevelSetContainerTest.cxx @@ -29,7 +29,7 @@ itkSparseLevelSetContainerTest(int, char *[]) using NameType = std::string; using NamedLevelSetContainerType = itk::LevelSetContainer; - NamedLevelSetContainerType::Pointer name_container = NamedLevelSetContainerType::New(); + auto name_container = NamedLevelSetContainerType::New(); name_container->AddLevelSet("Lung", LevelSetType::New()); name_container->AddLevelSet("Heart", LevelSetType::New()); @@ -50,7 +50,7 @@ itkSparseLevelSetContainerTest(int, char *[]) } using LevelSetContainerType = itk::LevelSetContainer; - LevelSetContainerType::Pointer container = LevelSetContainerType::New(); + auto container = LevelSetContainerType::New(); container->AddLevelSet(1, LevelSetType::New()); container->AddLevelSet(3, LevelSetType::New()); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx index 2f7d0c41fc6..f902d03cd5c 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetDenseImage2DTest.cxx @@ -71,14 +71,14 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) using NodeType = FastMarchingFilterType::NodeType; // Read the image to be segmented - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); - FastMarchingFilterType::Pointer fastMarching = FastMarchingFilterType::New(); + auto fastMarching = FastMarchingFilterType::New(); - NodeContainer::Pointer seeds = NodeContainer::New(); + auto seeds = NodeContainer::New(); ImageType::IndexType seedPosition; seedPosition[0] = std::stoi(argv[2]); @@ -127,29 +127,29 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) list_ids.push_back(1); list_ids.push_back(2); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(input->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Map of levelset bases - LevelSetType::Pointer level_set1 = LevelSetType::New(); + auto level_set1 = LevelSetType::New(); level_set1->SetImage(fastMarching->GetOutput()); - LevelSetType::Pointer level_set2 = LevelSetType::New(); + auto level_set2 = LevelSetType::New(); level_set2->SetImage(fastMarching->GetOutput()); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -172,13 +172,13 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -186,13 +186,13 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) // ----------------------------- // *** 2nd Level Set phi *** - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; @@ -200,7 +200,7 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -210,7 +210,7 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -219,16 +219,16 @@ itkTwoLevelSetDenseImage2DTest(int argc, char * argv[]) termContainer1->AddTerm(1, cvExternalTerm1); std::cout << "Term container 1 created" << std::endl; - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); equationContainer->SetLevelSetContainer(lscontainer); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(10); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx index 4c51ea51ba5..4e30a1c7e34 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetMalcolmImage2DTest.cxx @@ -71,13 +71,13 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary mask - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -102,14 +102,14 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor0 = BinaryToSparseAdaptorType::New(); + auto adaptor0 = BinaryToSparseAdaptorType::New(); adaptor0->SetInputImage(binary); adaptor0->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; SparseLevelSetType::Pointer level_set0 = adaptor0->GetModifiableLevelSet(); - BinaryToSparseAdaptorType::Pointer adaptor1 = BinaryToSparseAdaptorType::New(); + auto adaptor1 = BinaryToSparseAdaptorType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -121,22 +121,22 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) list_ids.push_back(1); list_ids.push_back(2); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(input->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(2.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -159,26 +159,26 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // ----------------------------- // *** 2nd Level Set phi *** - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; @@ -186,7 +186,7 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -196,7 +196,7 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -207,16 +207,16 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) std::cout << "Term container 1 created" << std::endl; // Create equation container - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -231,7 +231,7 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) return EXIT_FAILURE; } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -251,7 +251,7 @@ itkTwoLevelSetMalcolmImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx index 4fbe38f3c23..f8dc7f27210 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetShiImage2DTest.cxx @@ -71,13 +71,13 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary input for segmentation - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Create a binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -102,14 +102,14 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor0 = BinaryToSparseAdaptorType::New(); + auto adaptor0 = BinaryToSparseAdaptorType::New(); adaptor0->SetInputImage(binary); adaptor0->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; SparseLevelSetType::Pointer level_set0 = adaptor0->GetModifiableLevelSet(); - BinaryToSparseAdaptorType::Pointer adaptor1 = BinaryToSparseAdaptorType::New(); + auto adaptor1 = BinaryToSparseAdaptorType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -121,22 +121,22 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) list_ids.push_back(1); list_ids.push_back(2); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(input->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(5.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -159,25 +159,25 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; // ----------------------------- // *** 2nd Level Set phi *** - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; @@ -185,7 +185,7 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -195,7 +195,7 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -205,16 +205,16 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) std::cout << "Term container 1 created" << std::endl; // Create equation container - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -230,7 +230,7 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -250,7 +250,7 @@ itkTwoLevelSetShiImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx index 8422f79094b..eac7ac5f464 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkTwoLevelSetWhitakerImage2DTest.cxx @@ -73,13 +73,13 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) using InputIteratorType = itk::ImageRegionIteratorWithIndex; // load binary input for segmentation - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); reader->Update(); InputImageType::Pointer input = reader->GetOutput(); // Create a binary initialization - InputImageType::Pointer binary = InputImageType::New(); + auto binary = InputImageType::New(); binary->SetRegions(input->GetLargestPossibleRegion()); binary->CopyInformation(input); binary->Allocate(); @@ -104,14 +104,14 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) } // Convert binary mask to sparse level set - BinaryToSparseAdaptorType::Pointer adaptor0 = BinaryToSparseAdaptorType::New(); + auto adaptor0 = BinaryToSparseAdaptorType::New(); adaptor0->SetInputImage(binary); adaptor0->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; SparseLevelSetType::Pointer level_set0 = adaptor0->GetModifiableLevelSet(); - BinaryToSparseAdaptorType::Pointer adaptor1 = BinaryToSparseAdaptorType::New(); + auto adaptor1 = BinaryToSparseAdaptorType::New(); adaptor1->SetInputImage(binary); adaptor1->Initialize(); std::cout << "Finished converting to sparse format" << std::endl; @@ -123,22 +123,22 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) list_ids.push_back(1); list_ids.push_back(2); - IdListImageType::Pointer id_image = IdListImageType::New(); + auto id_image = IdListImageType::New(); id_image->SetRegions(input->GetLargestPossibleRegion()); id_image->Allocate(); id_image->FillBuffer(list_ids); - DomainMapImageFilterType::Pointer domainMapFilter = DomainMapImageFilterType::New(); + auto domainMapFilter = DomainMapImageFilterType::New(); domainMapFilter->SetInput(id_image); domainMapFilter->Update(); std::cout << "Domain map computed" << std::endl; // Define the Heaviside function - HeavisideFunctionBaseType::Pointer heaviside = HeavisideFunctionBaseType::New(); + auto heaviside = HeavisideFunctionBaseType::New(); heaviside->SetEpsilon(1.0); // Insert the levelsets in a levelset container - LevelSetContainerType::Pointer lscontainer = LevelSetContainerType::New(); + auto lscontainer = LevelSetContainerType::New(); lscontainer->SetHeaviside(heaviside); lscontainer->SetDomainMapFilter(domainMapFilter); @@ -161,13 +161,13 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) // *** 1st Level Set phi *** // Create ChanAndVese internal term for phi_{1} - ChanAndVeseInternalTermType::Pointer cvInternalTerm0 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm0 = ChanAndVeseInternalTermType::New(); cvInternalTerm0->SetInput(input); cvInternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm0 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm0 = ChanAndVeseExternalTermType::New(); cvExternalTerm0->SetInput(input); cvExternalTerm0->SetCoefficient(1.0); std::cout << "LevelSet 1: CV external term created" << std::endl; @@ -175,13 +175,13 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) // ----------------------------- // *** 2nd Level Set phi *** - ChanAndVeseInternalTermType::Pointer cvInternalTerm1 = ChanAndVeseInternalTermType::New(); + auto cvInternalTerm1 = ChanAndVeseInternalTermType::New(); cvInternalTerm1->SetInput(input); cvInternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV internal term created" << std::endl; // Create ChanAndVese external term for phi_{1} - ChanAndVeseExternalTermType::Pointer cvExternalTerm1 = ChanAndVeseExternalTermType::New(); + auto cvExternalTerm1 = ChanAndVeseExternalTermType::New(); cvExternalTerm1->SetInput(input); cvExternalTerm1->SetCoefficient(1.0); std::cout << "LevelSet 2: CV external term created" << std::endl; @@ -189,7 +189,7 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) // **************** CREATE ALL EQUATIONS **************** // Create Term Container - TermContainerType::Pointer termContainer0 = TermContainerType::New(); + auto termContainer0 = TermContainerType::New(); termContainer0->SetInput(input); termContainer0->SetCurrentLevelSetId(0); termContainer0->SetLevelSetContainer(lscontainer); @@ -199,7 +199,7 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) std::cout << "Term container 0 created" << std::endl; // Create Term Container - TermContainerType::Pointer termContainer1 = TermContainerType::New(); + auto termContainer1 = TermContainerType::New(); termContainer1->SetInput(input); termContainer1->SetCurrentLevelSetId(1); termContainer1->SetLevelSetContainer(lscontainer); @@ -209,16 +209,16 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) std::cout << "Term container 1 created" << std::endl; // Create equation container - EquationContainerType::Pointer equationContainer = EquationContainerType::New(); + auto equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(lscontainer); equationContainer->AddEquation(0, termContainer0); equationContainer->AddEquation(1, termContainer1); using StoppingCriterionType = itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion; - StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); + auto criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(std::stoi(argv[2])); - LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); + auto evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer(equationContainer); evolution->SetStoppingCriterion(criterion); evolution->SetLevelSetContainer(lscontainer); @@ -234,7 +234,7 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) } using OutputImageType = itk::Image; - OutputImageType::Pointer outputImage = OutputImageType::New(); + auto outputImage = OutputImageType::New(); outputImage->SetRegions(input->GetLargestPossibleRegion()); outputImage->CopyInformation(input); outputImage->Allocate(); @@ -254,7 +254,7 @@ itkTwoLevelSetWhitakerImage2DTest(int argc, char * argv[]) } using OutputWriterType = itk::ImageFileWriter; - OutputWriterType::Pointer writer = OutputWriterType::New(); + auto writer = OutputWriterType::New(); writer->SetFileName(argv[3]); writer->SetInput(outputImage); diff --git a/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx b/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx index 7bf1905e41c..7ca83b8a00a 100644 --- a/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx +++ b/Modules/Segmentation/LevelSetsv4/test/itkWhitakerSparseLevelSetImageTest.cxx @@ -33,7 +33,7 @@ itkWhitakerSparseLevelSetImageTest(int, char *[]) IndexType index; index.Fill(3); - LabelMapType::Pointer labelMap = LabelMapType::New(); + auto labelMap = LabelMapType::New(); labelMap->SetBackgroundValue(3); for (int i = 0; i < 4; ++i) @@ -42,7 +42,7 @@ itkWhitakerSparseLevelSetImageTest(int, char *[]) labelMap->SetPixel(index, -3); } - SparseLevelSetType::Pointer phi = SparseLevelSetType::New(); + auto phi = SparseLevelSetType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(phi, WhitakerSparseLevelSetImage, LevelSetSparseImage); diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkGibbsTest.cxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkGibbsTest.cxx index af9699bfb99..494326c12bf 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkGibbsTest.cxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkGibbsTest.cxx @@ -84,7 +84,7 @@ itkGibbsTest(int, char *[]) using PixelType = itk::Vector; using VecImageType = itk::Image; - VecImageType::Pointer vecImage = VecImageType::New(); + auto vecImage = VecImageType::New(); using VecImagePixelType = VecImageType::PixelType; @@ -135,7 +135,7 @@ itkGibbsTest(int, char *[]) // Generate the training data //--------------------------------------------------------------- using ClassImageType = itk::Image; - ClassImageType::Pointer classImage = ClassImageType::New(); + auto classImage = ClassImageType::New(); ClassImageType::SizeType classImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; @@ -210,7 +210,7 @@ itkGibbsTest(int, char *[]) using ImageGaussianModelEstimatorType = itk::ImageGaussianModelEstimator; - ImageGaussianModelEstimatorType::Pointer applyEstimateModel = ImageGaussianModelEstimatorType::New(); + auto applyEstimateModel = ImageGaussianModelEstimatorType::New(); applyEstimateModel->SetNumberOfModels(NUM_CLASSES); applyEstimateModel->SetInputImage(vecImage); @@ -228,7 +228,7 @@ itkGibbsTest(int, char *[]) using DecisionRuleBasePointer = itk::Statistics::DecisionRule::Pointer; using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer myDecisionRule = DecisionRuleType::New(); + auto myDecisionRule = DecisionRuleType::New(); //---------------------------------------------------------------------- // Set the classifier to be used and assigne the parameters for the @@ -254,7 +254,7 @@ itkGibbsTest(int, char *[]) // Set the Gibbs Prior labeller using GibbsPriorFilterType = itk::RGBGibbsPriorFilter; - GibbsPriorFilterType::Pointer applyGibbsImageFilter = GibbsPriorFilterType::New(); + auto applyGibbsImageFilter = GibbsPriorFilterType::New(); // Set the MRF labeller parameters applyGibbsImageFilter->SetNumberOfClasses(NUM_CLASSES); diff --git a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx index a3802ebc155..051f42a4c98 100644 --- a/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx +++ b/Modules/Segmentation/MarkovRandomFieldsClassifiers/test/itkMRFImageFilterTest.cxx @@ -46,7 +46,7 @@ itkMRFImageFilterTest(int, char *[]) //------------------------------------------------------ using VecImageType = itk::Image, NDIMENSION>; - VecImageType::Pointer vecImage = VecImageType::New(); + auto vecImage = VecImageType::New(); using VecImagePixelType = VecImageType::PixelType; @@ -191,7 +191,7 @@ itkMRFImageFilterTest(int, char *[]) // Generate the training data //--------------------------------------------------------------- using ClassImageType = itk::Image; - ClassImageType::Pointer classImage = ClassImageType::New(); + auto classImage = ClassImageType::New(); ClassImageType::SizeType classImgSize = { { IMGWIDTH, IMGHEIGHT, NFRAMES } }; @@ -286,7 +286,7 @@ itkMRFImageFilterTest(int, char *[]) using ImageGaussianModelEstimatorType = itk::ImageGaussianModelEstimator; - ImageGaussianModelEstimatorType::Pointer applyEstimateModel = ImageGaussianModelEstimatorType::New(); + auto applyEstimateModel = ImageGaussianModelEstimatorType::New(); applyEstimateModel->SetNumberOfModels(NUM_CLASSES); applyEstimateModel->SetInputImage(vecImage); @@ -302,7 +302,7 @@ itkMRFImageFilterTest(int, char *[]) // Set the decision rule //---------------------------------------------------------------------- using DecisionRuleType = itk::Statistics::MinimumDecisionRule; - DecisionRuleType::Pointer myDecisionRule = DecisionRuleType::New(); + auto myDecisionRule = DecisionRuleType::New(); //---------------------------------------------------------------------- // Set the classifier to be used and assigne the parameters for the @@ -332,7 +332,7 @@ itkMRFImageFilterTest(int, char *[]) // Set the MRF labeller using MRFImageFilterType = itk::MRFImageFilter; - MRFImageFilterType::Pointer applyMRFImageFilter = MRFImageFilterType::New(); + auto applyMRFImageFilter = MRFImageFilterType::New(); // Set the MRF labeller parameters applyMRFImageFilter->SetNumberOfClasses(NUM_CLASSES); diff --git a/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx index 9cf280bebc4..94c52eea901 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkConfidenceConnectedImageFilter.hxx @@ -143,7 +143,7 @@ ConfidenceConnectedImageFilter::GenerateData() // Compute the statistics of the seed point // Set up the image function used for connectivity - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); InputRealType lower; @@ -308,7 +308,7 @@ ConfidenceConnectedImageFilter::GenerateData() // Essentially, we flip the iterator around, so we walk the input // image (so Get() will get pixel values from the input) and constrain // iterator such it only visits pixels that were set in the output. - typename SecondFunctionType::Pointer secondFunction = SecondFunctionType::New(); + auto secondFunction = SecondFunctionType::New(); secondFunction->SetInputImage(outputImage); secondFunction->ThresholdBetween(m_ReplaceValue, m_ReplaceValue); diff --git a/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx index b37c954f5bd..1ecf3df23c7 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx @@ -33,11 +33,11 @@ template ConnectedThresholdImageFilter::ConnectedThresholdImageFilter() : m_ReplaceValue(NumericTraits::OneValue()) { - typename InputPixelObjectType::Pointer lower = InputPixelObjectType::New(); + auto lower = InputPixelObjectType::New(); lower->Set(NumericTraits::NonpositiveMin()); this->ProcessObject::SetNthInput(1, lower); - typename InputPixelObjectType::Pointer upper = InputPixelObjectType::New(); + auto upper = InputPixelObjectType::New(); upper->Set(NumericTraits::max()); this->ProcessObject::SetNthInput(2, upper); } @@ -237,7 +237,7 @@ ConnectedThresholdImageFilter::GenerateData() using FunctionType = BinaryThresholdImageFunction; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); function->ThresholdBetween(lower, upper); diff --git a/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx index 2d0ac79bda3..0067a97f3f0 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkIsolatedConnectedImageFilter.hxx @@ -200,7 +200,7 @@ IsolatedConnectedImageFilter::GenerateData() using FunctionType = BinaryThresholdImageFunction; using IteratorType = FloodFilledImageFunctionConditionalIterator; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); float progressWeight = 0.0f; diff --git a/Modules/Segmentation/RegionGrowing/include/itkNeighborhoodConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkNeighborhoodConnectedImageFilter.hxx index 9d3abcd4d8f..50fb8a799c0 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkNeighborhoodConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkNeighborhoodConnectedImageFilter.hxx @@ -117,7 +117,7 @@ NeighborhoodConnectedImageFilter::GenerateData() using FunctionType = NeighborhoodBinaryThresholdImageFunction; using IteratorType = FloodFilledImageFunctionConditionalIterator; - typename FunctionType::Pointer function = FunctionType::New(); + auto function = FunctionType::New(); function->SetInputImage(inputImage); function->ThresholdBetween(m_Lower, m_Upper); function->SetRadius(m_Radius); diff --git a/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx b/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx index 7a374713d28..0daf4a73568 100644 --- a/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx +++ b/Modules/Segmentation/RegionGrowing/include/itkVectorConfidenceConnectedImageFilter.hxx @@ -131,12 +131,12 @@ VectorConfidenceConnectedImageFilter::GenerateData() // Compute the statistics of the seed point using VectorMeanImageFunctionType = VectorMeanImageFunction; - typename VectorMeanImageFunctionType::Pointer meanFunction = VectorMeanImageFunctionType::New(); + auto meanFunction = VectorMeanImageFunctionType::New(); meanFunction->SetInputImage(inputImage); meanFunction->SetNeighborhoodRadius(m_InitialNeighborhoodRadius); using CovarianceImageFunctionType = CovarianceImageFunction; - typename CovarianceImageFunctionType::Pointer varianceFunction = CovarianceImageFunctionType::New(); + auto varianceFunction = CovarianceImageFunctionType::New(); varianceFunction->SetInputImage(inputImage); varianceFunction->SetNeighborhoodRadius(m_InitialNeighborhoodRadius); @@ -258,7 +258,7 @@ VectorConfidenceConnectedImageFilter::GenerateData() // Essentially, we flip the iterator around, so we walk the input // image (so Get() will get pixel values from the input) and constrain // iterator such it only visits pixels that were set in the output. - typename SecondFunctionType::Pointer secondFunction = SecondFunctionType::New(); + auto secondFunction = SecondFunctionType::New(); secondFunction->SetInputImage(outputImage); secondFunction->ThresholdBetween(m_ReplaceValue, m_ReplaceValue); diff --git a/Modules/Segmentation/RegionGrowing/test/itkConfidenceConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkConfidenceConnectedImageFilterTest.cxx index 56b6f23fc29..4ab4c592c5b 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkConfidenceConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkConfidenceConnectedImageFilterTest.cxx @@ -44,7 +44,7 @@ itkConfidenceConnectedImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::ConfidenceConnectedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); filter->SetInput(input->GetOutput()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx index bb356b9b91c..34f09d76a45 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkConnectedThresholdImageFilterTest.cxx @@ -56,7 +56,7 @@ itkConnectedThresholdImageFilterTest(int argc, char * argv[]) // Create the filter using ConnectedThresholdImageFilterType = itk::ConnectedThresholdImageFilter; - ConnectedThresholdImageFilterType::Pointer connectedThresholdFilter = ConnectedThresholdImageFilterType::New(); + auto connectedThresholdFilter = ConnectedThresholdImageFilterType::New(); itk::SimpleFilterWatcher watcher(connectedThresholdFilter); diff --git a/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx index 45ed7c13f12..434180196bf 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkIsolatedConnectedImageFilterTest.cxx @@ -41,7 +41,7 @@ itkIsolatedConnectedImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::IsolatedConnectedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); filter->SetInput(input->GetOutput()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkNeighborhoodConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkNeighborhoodConnectedImageFilterTest.cxx index e44a759970a..cd05e1a329e 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkNeighborhoodConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkNeighborhoodConnectedImageFilterTest.cxx @@ -39,7 +39,7 @@ itkNeighborhoodConnectedImageFilterTest(int ac, char * av[]) // Create a filter using FilterType = itk::NeighborhoodConnectedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher watcher(filter); filter->SetInput(input->GetOutput()); diff --git a/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx b/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx index d59ffe6a5c0..b5d03e62c0b 100644 --- a/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx +++ b/Modules/Segmentation/RegionGrowing/test/itkVectorConfidenceConnectedImageFilterTest.cxx @@ -47,13 +47,13 @@ itkVectorConfidenceConnectedImageFilterTest(int ac, char * av[]) using ReaderType = itk::ImageFileReader; - ReaderType::Pointer input = ReaderType::New(); + auto input = ReaderType::New(); input->SetFileName(av[1]); // Create a filter using FilterType = itk::VectorConfidenceConnectedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); itk::SimpleFilterWatcher filterWatch(filter); filter->SetInput(input->GetOutput()); @@ -102,7 +102,7 @@ itkVectorConfidenceConnectedImageFilterTest(int ac, char * av[]) // Generate test image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(av[2]); @@ -115,11 +115,11 @@ itkVectorConfidenceConnectedImageFilterTest(int ac, char * av[]) using VectorImageType = itk::VectorImage; using VectorReaderType = itk::ImageFileReader; - VectorReaderType::Pointer vinput = VectorReaderType::New(); + auto vinput = VectorReaderType::New(); vinput->SetFileName(av[1]); using VectorFilterType = itk::VectorConfidenceConnectedImageFilter; - VectorFilterType::Pointer vFilter = VectorFilterType::New(); + auto vFilter = VectorFilterType::New(); vFilter->SetInput(vinput->GetOutput()); vFilter->SetInitialNeighborhoodRadius(3); // measured in pixels diff --git a/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx b/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx index 8da6b63b5eb..bf2f8bf8ccc 100644 --- a/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx +++ b/Modules/Segmentation/SignedDistanceFunction/test/itkPCAShapeSignedDistanceFunctionTest.cxx @@ -46,14 +46,14 @@ itkPCAShapeSignedDistanceFunctionTest(int, char *[]) // define a pca shape function using ShapeFunction = itk::PCAShapeSignedDistanceFunction; - ShapeFunction::Pointer shape = ShapeFunction::New(); + auto shape = ShapeFunction::New(); // shape->DebugOn(); shape->SetNumberOfPrincipalComponents(NumberOfPCs); // set up the transform using transformType = itk::Euler2DTransform; - transformType::Pointer transform = transformType::New(); + auto transform = transformType::New(); shape->SetTransform(transform); @@ -76,7 +76,7 @@ itkPCAShapeSignedDistanceFunctionTest(int, char *[]) // set up the mean image - ImageType::Pointer meanImage = ImageType::New(); + auto meanImage = ImageType::New(); meanImage->SetRegions(region); meanImage->Allocate(); diff --git a/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx b/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx index c5d1321a9c2..0c2eaa7f0bc 100644 --- a/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx +++ b/Modules/Segmentation/SignedDistanceFunction/test/itkSphereSignedDistanceFunctionTest.cxx @@ -42,7 +42,7 @@ itkSphereSignedDistanceFunctionTest(int, char *[]) using PointType = FunctionType::PointType; using ParametersType = FunctionType::ParametersType; - SphereFunctionType::Pointer sphere = SphereFunctionType::New(); + auto sphere = SphereFunctionType::New(); // cast it to a generic function FunctionType::Pointer function = dynamic_cast(sphere.GetPointer()); diff --git a/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx b/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx index 87661a9998d..5d8e238740e 100644 --- a/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx +++ b/Modules/Segmentation/SuperPixel/include/itkSLICImageFilter.hxx @@ -112,7 +112,7 @@ SLICImageFilter::BeforeThreadedGenera { itkDebugMacro("Starting BeforeThreadedGenerateData"); - typename InputImageType::Pointer inputImage = InputImageType::New(); + auto inputImage = InputImageType::New(); inputImage->Graft(const_cast(this->GetInput())); @@ -122,7 +122,7 @@ SLICImageFilter::BeforeThreadedGenera typename InputImageType::Pointer shrunkImage; { using ShrinkImageFilterType = itk::ShrinkImageFilter; - typename ShrinkImageFilterType::Pointer shrinker = ShrinkImageFilterType::New(); + auto shrinker = ShrinkImageFilterType::New(); shrinker->SetInput(inputImage); shrinker->SetShrinkFactors(m_SuperGridSize); shrinker->UpdateLargestPossibleRegion(); diff --git a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterGTest.cxx b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterGTest.cxx index 455272a36f1..31b752147fb 100644 --- a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterGTest.cxx +++ b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterGTest.cxx @@ -49,7 +49,7 @@ class SLICFixture : public ::testing::Test { using HashFilter = itk::Testing::HashImageFilter; - typename HashFilter::Pointer hasher = HashFilter::New(); + auto hasher = HashFilter::New(); hasher->SetInput(image); hasher->Update(); return hasher->GetHash(); @@ -71,7 +71,7 @@ class SLICFixture : public ::testing::Test static typename InputImageType::Pointer CreateImage(unsigned int size = 100) { - typename InputImageType::Pointer image = InputImageType::New(); + auto image = InputImageType::New(); typename InputImageType::SizeType imageSize; imageSize.Fill(size); diff --git a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx index 658d4ab7dc2..28829920505 100644 --- a/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx +++ b/Modules/Segmentation/SuperPixel/test/itkSLICImageFilterTest.cxx @@ -57,11 +57,11 @@ itkSLICImageFilter(const std::string & inFileName, using InputImageType = TInputImageType; using ReaderType = itk::ImageFileReader; - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inFileName); using FilterType = itk::SLICImageFilter; - typename FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetSuperGridSize(gridSize); filter->SetEnforceConnectivity(enforceConnectivity); @@ -75,7 +75,7 @@ itkSLICImageFilter(const std::string & inFileName, using WriterType = itk::ImageFileWriter; - typename WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(outFileName); writer->SetInput(filter->GetOutput()); writer->Update(); @@ -101,7 +101,7 @@ itkSLICImageFilterTest(int argc, char * argv[]) using InputImageType = itk::VectorImage; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(inFileName); reader->UpdateOutputInformation(); diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx index 3a04b4dd9d3..fc5bac57d5a 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiDiagram2DTest.cxx @@ -46,9 +46,9 @@ itkVoronoiDiagram2DTest(int argc, char * argv[]) using PointIdIterator = CellType::PointIdIterator; using NeighborIdIterator = VoronoiDiagram::NeighborIdIterator; - VoronoiDiagram::Pointer voronoiDiagram = VoronoiDiagram::New(); + auto voronoiDiagram = VoronoiDiagram::New(); - VoronoiDiagramGenerator::Pointer voronoiDiagramGenerator = VoronoiDiagramGenerator::New(); + auto voronoiDiagramGenerator = VoronoiDiagramGenerator::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(voronoiDiagramGenerator, VoronoiDiagram2DGenerator, MeshSource); PointType insize; @@ -96,7 +96,7 @@ itkVoronoiDiagram2DTest(int argc, char * argv[]) } using WriterType = itk::MeshFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(voronoiDiagram); writer->SetFileName(argv[1]); diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx index fdda577134b..1bae145c6e0 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiPartitioningImageFilterTest.cxx @@ -55,7 +55,7 @@ itkVoronoiPartitioningImageFilterTest(int argc, char * argv[]) // using VoronoiSegmentationType = itk::VoronoiPartitioningImageFilter; - VoronoiSegmentationType::Pointer voronoi = VoronoiSegmentationType::New(); + auto voronoi = VoronoiSegmentationType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(voronoi, VoronoiPartitioningImageFilter, VoronoiSegmentationImageFilterBase); @@ -81,8 +81,8 @@ itkVoronoiPartitioningImageFilterTest(int argc, char * argv[]) using ColormapFilterType = itk::UnaryFunctorImageFilter; using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - ColormapFilterType::Pointer colormapper = ColormapFilterType::New(); + auto writer = WriterType::New(); + auto colormapper = ColormapFilterType::New(); colormapper->SetInput(voronoi->GetOutput()); writer->SetInput(colormapper->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx index d1a01d1c17b..9274db1cede 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationImageFilterTest.cxx @@ -30,12 +30,12 @@ itkVoronoiSegmentationImageFilterTest(int, char *[]) using PriorImage = itk::Image; using VoronoiSegmentationImageFilterType = itk::VoronoiSegmentationImageFilter; - VoronoiSegmentationImageFilterType::Pointer voronoiSegmenter = VoronoiSegmentationImageFilterType::New(); + auto voronoiSegmenter = VoronoiSegmentationImageFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS( voronoiSegmenter, VoronoiSegmentationImageFilter, VoronoiSegmentationImageFilterBase); - UShortImage::Pointer inputImage = UShortImage::New(); + auto inputImage = UShortImage::New(); UShortImage::SizeType size = { { width, height } }; UShortImage::IndexType index; index.Fill(0); diff --git a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx index ebf485d673d..7bf5573d2a1 100644 --- a/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx +++ b/Modules/Segmentation/Voronoi/test/itkVoronoiSegmentationRGBImageFilterTest.cxx @@ -60,7 +60,7 @@ ImageType::Pointer SetUpInputImage() { // initialize the test input image - ImageType::Pointer inputImage = ImageType::New(); + auto inputImage = ImageType::New(); ImageType::SizeType size = { { width, height } }; ImageType::RegionType region; region.SetSize(size); @@ -197,7 +197,7 @@ TestNoPrior(ImageType::Pointer inputImage) std::cout << "Beginning no-prior test" << std::endl; // set up the filter - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); std::cout << "Setting filter input" << std::endl; filter->SetInput(inputImage); @@ -257,12 +257,12 @@ TestWithPrior(ImageType::Pointer inputImage) { // set up the filter std::cout << "Setting up the filter and image" << std::endl; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetInput(inputImage); // set up the prior std::cout << "Setting up the prior image" << std::endl; - BinaryObjectImage::Pointer prior = BinaryObjectImage::New(); + auto prior = BinaryObjectImage::New(); BinaryObjectImage::SizeType size = { { width, height } }; BinaryObjectImage::RegionType region; region.SetSize(size); @@ -357,7 +357,7 @@ itkVoronoiSegmentationRGBImageFilterTest(int, char *[]) } // test set/get TestMean - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); filter->SetTestMean(VoronoiSegRGBTest::fgMean, VoronoiSegRGBTest::fgMean, VoronoiSegRGBTest::fgMean); unsigned int testMean[3]; filter->GetTestMean(testMean); diff --git a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx index 1df82ecee13..05f6c435055 100644 --- a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedFromMarkersImageFilter.hxx @@ -165,7 +165,7 @@ MorphologicalWatershedFromMarkersImageFilter::Generate // create a temporary image to store the state of each pixel (processed or // not) using StatusImageType = Image; - typename StatusImageType::Pointer statusImage = StatusImageType::New(); + auto statusImage = StatusImageType::New(); statusImage->SetRegions(markerImage->GetLargestPossibleRegion()); statusImage->Allocate(); diff --git a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedImageFilter.hxx index a16ec1d4b63..92bdcfea58e 100644 --- a/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkMorphologicalWatershedImageFilter.hxx @@ -65,7 +65,7 @@ void MorphologicalWatershedImageFilter::GenerateData() { // Create a process accumulator for tracking the progress of this minipipeline - ProgressAccumulator::Pointer progress = ProgressAccumulator::New(); + auto progress = ProgressAccumulator::New(); progress->SetMiniPipelineFilter(this); @@ -80,7 +80,7 @@ MorphologicalWatershedImageFilter::GenerateData() // Delegate to a R-Min filter to find the regional minima using RMinType = RegionalMinimaImageFilter; - typename RMinType::Pointer rmin = RMinType::New(); + auto rmin = RMinType::New(); rmin->SetInput(input); rmin->SetFullyConnected(m_FullyConnected); rmin->SetBackgroundValue(NumericTraits::ZeroValue()); @@ -88,13 +88,13 @@ MorphologicalWatershedImageFilter::GenerateData() // label the components using ConnectedCompType = ConnectedComponentImageFilter; - typename ConnectedCompType::Pointer label = ConnectedCompType::New(); + auto label = ConnectedCompType::New(); label->SetFullyConnected(m_FullyConnected); label->SetInput(rmin->GetOutput()); // the watershed using WatershedType = MorphologicalWatershedFromMarkersImageFilter; - typename WatershedType::Pointer wshed = WatershedType::New(); + auto wshed = WatershedType::New(); wshed->SetInput(input); wshed->SetMarkerImage(label->GetOutput()); wshed->SetFullyConnected(m_FullyConnected); diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedImageFilter.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedImageFilter.hxx index 635d3f7d384..f7e4bbf91a7 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedImageFilter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedImageFilter.hxx @@ -90,7 +90,7 @@ WatershedImageFilter::WatershedImageFilter() m_Relabeler->SetInputImage(m_Segmenter->GetOutputImage()); m_Relabeler->SetFloodLevel(this->GetLevel()); - WatershedMiniPipelineProgressCommand::Pointer c = WatershedMiniPipelineProgressCommand::New(); + auto c = WatershedMiniPipelineProgressCommand::New(); c->SetFilter(this); c->SetNumberOfFilters(3); diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedRelabeler.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedRelabeler.hxx index ab9d505b61a..16615c3ab62 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedRelabeler.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedRelabeler.hxx @@ -50,7 +50,7 @@ Relabeler::GenerateData() typename SegmentTreeType::Pointer tree = this->GetInputSegmentTree(); typename SegmentTreeType::Iterator it; - EquivalencyTable::Pointer eqT = EquivalencyTable::New(); + auto eqT = EquivalencyTable::New(); output->SetBufferedRegion(output->GetRequestedRegion()); output->Allocate(); diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTreeGenerator.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTreeGenerator.hxx index eba845e084e..52dabc0069b 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTreeGenerator.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmentTreeGenerator.hxx @@ -78,8 +78,8 @@ SegmentTreeGenerator::GenerateData() this->GetOutputSegmentTree()->Clear(); typename SegmentTableType::Pointer input = this->GetInputSegmentTable(); - typename SegmentTreeType::Pointer mergeList = SegmentTreeType::New(); - typename SegmentTableType::Pointer seg = SegmentTableType::New(); + auto mergeList = SegmentTreeType::New(); + auto seg = SegmentTableType::New(); if (m_ConsumeInput == true) // do not copy input { input->Modified(); diff --git a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx index 1921c274401..0a352d38a3c 100644 --- a/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx +++ b/Modules/Segmentation/Watersheds/include/itkWatershedSegmenter.hxx @@ -155,7 +155,7 @@ Segmenter::GenerateData() // Now create and allocate the threshold image. We need a single pixel // border around the NxM region we are segmenting. This means that for faces // that have no overlap into another chunk, we have to pad the image. - typename InputImageType::Pointer thresholdImage = InputImageType::New(); + auto thresholdImage = InputImageType::New(); thresholdImage->SetLargestPossibleRegion(thresholdLargestPossibleRegion); thresholdImage->SetBufferedRegion(thresholdImageRegion); @@ -463,7 +463,7 @@ Segmenter::AnalyzeBoundaryFlow(InputImageTypePointer thresholdImage } fps.label = NULL_LABEL; - EquivalencyTable::Pointer eqTable = EquivalencyTable::New(); + auto eqTable = EquivalencyTable::New(); // Process each boundary region. for (idx.first = 0; idx.first < ImageDimension; ++(idx.first)) @@ -693,7 +693,7 @@ Segmenter::LabelMinima(InputImageTypePointer img, typename flat_region_table_t::iterator flatPtr; InputPixelType currentValue; - EquivalencyTable::Pointer equivalentLabels = EquivalencyTable::New(); + auto equivalentLabels = EquivalencyTable::New(); typename OutputImageType::Pointer output = this->GetOutputImage(); @@ -907,7 +907,7 @@ Segmenter::DescendFlatRegions(flat_region_table_t & flatRegionTable // regions and equates each one with the label at its lowest boundary // point. Flat basins are preserved as their own regions. The output image is // relabeled to reflect these equivalencies. - EquivalencyTable::Pointer equivalentLabels = EquivalencyTable::New(); + auto equivalentLabels = EquivalencyTable::New(); for (typename flat_region_table_t::const_iterator region = flatRegionTable.begin(); region != flatRegionTable.end(); ++region) diff --git a/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx index 8a477a6a5ad..728d527773e 100644 --- a/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkIsolatedWatershedImageFilterTest.cxx @@ -57,7 +57,7 @@ itkIsolatedWatershedImageFilterTest(int argc, char * argv[]) // Create the IsolatedWatershedImageFilter object using FilterType = itk::IsolatedWatershedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, IsolatedWatershedImageFilter, ImageToImageFilter); @@ -128,7 +128,7 @@ itkIsolatedWatershedImageFilterTest(int argc, char * argv[]) // Write the filter output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx index 274faa7977e..e0a39fac674 100644 --- a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedFromMarkersImageFilterTest.cxx @@ -47,14 +47,14 @@ itkMorphologicalWatershedFromMarkersImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); - ReaderType::Pointer reader2 = ReaderType::New(); + auto reader2 = ReaderType::New(); reader2->SetFileName(argv[2]); using FilterType = itk::MorphologicalWatershedFromMarkersImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MorphologicalWatershedFromMarkersImageFilter, ImageToImageFilter); @@ -108,7 +108,7 @@ itkMorphologicalWatershedFromMarkersImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(filter->GetOutput()); writer->SetFileName(argv[3]); @@ -120,12 +120,12 @@ itkMorphologicalWatershedFromMarkersImageFilterTest(int argc, char * argv[]) using RGBImageType = itk::Image; using OverlayType = itk::LabelOverlayImageFilter; - OverlayType::Pointer overlay = OverlayType::New(); + auto overlay = OverlayType::New(); overlay->SetInput(reader->GetOutput()); overlay->SetLabelImage(filter->GetOutput()); using RGBWriterType = itk::ImageFileWriter; - RGBWriterType::Pointer rgbwriter = RGBWriterType::New(); + auto rgbwriter = RGBWriterType::New(); rgbwriter->SetInput(overlay->GetOutput()); rgbwriter->SetFileName(argv[6]); diff --git a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx index 73f1a98e7fe..737ff75b082 100644 --- a/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkMorphologicalWatershedImageFilterTest.cxx @@ -48,11 +48,11 @@ itkMorphologicalWatershedImageFilterTest(int argc, char * argv[]) using ImageType = itk::Image; using ReaderType = itk::ImageFileReader; - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv[1]); using FilterType = itk::MorphologicalWatershedImageFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, MorphologicalWatershedImageFilter, ImageToImageFilter); @@ -76,12 +76,12 @@ itkMorphologicalWatershedImageFilterTest(int argc, char * argv[]) // Rescale the output to have a better display using MaxCalculatorType = itk::MinimumMaximumImageCalculator; - MaxCalculatorType::Pointer minMaxCalculator = MaxCalculatorType::New(); + auto minMaxCalculator = MaxCalculatorType::New(); minMaxCalculator->SetImage(filter->GetOutput()); minMaxCalculator->Compute(); using RescaleType = itk::IntensityWindowingImageFilter; - RescaleType::Pointer rescaler = RescaleType::New(); + auto rescaler = RescaleType::New(); rescaler->SetInput(filter->GetOutput()); rescaler->SetWindowMinimum(itk::NumericTraits::ZeroValue()); rescaler->SetWindowMaximum(minMaxCalculator->GetMaximum()); @@ -90,7 +90,7 @@ itkMorphologicalWatershedImageFilterTest(int argc, char * argv[]) // Write output image using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(rescaler->GetOutput()); writer->SetFileName(argv[2]); @@ -103,12 +103,12 @@ itkMorphologicalWatershedImageFilterTest(int argc, char * argv[]) using OverlayType = itk::LabelOverlayImageFilter; - OverlayType::Pointer overlay = OverlayType::New(); + auto overlay = OverlayType::New(); overlay->SetInput(reader->GetOutput()); overlay->SetLabelImage(filter->GetOutput()); using RGBWriterType = itk::ImageFileWriter; - RGBWriterType::Pointer rgbwriter = RGBWriterType::New(); + auto rgbwriter = RGBWriterType::New(); rgbwriter->SetInput(overlay->GetOutput()); rgbwriter->SetFileName(argv[6]); diff --git a/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx index 0d64e15f562..c9c90d3087b 100644 --- a/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkTobogganImageFilterTest.cxx @@ -59,12 +59,12 @@ itkTobogganImageFilterTest(int argc, char * argv[]) ITK_TRY_EXPECT_NO_EXCEPTION(reader->Update()); - FilterType::Pointer toboggan = FilterType::New(); + auto toboggan = FilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(toboggan, TobogganImageFilter, ImageToImageFilter); - InputCastFilterType::Pointer inputCaster = InputCastFilterType::New(); - GMGaussianType::Pointer gmgaussian = GMGaussianType::New(); + auto inputCaster = InputCastFilterType::New(); + auto gmgaussian = GMGaussianType::New(); inputCaster->SetInput(reader->GetOutput()); gmgaussian->SetInput(inputCaster->GetOutput()); @@ -77,14 +77,14 @@ itkTobogganImageFilterTest(int argc, char * argv[]) // Cast the output of the Toboggan filter - OutputCastFilterType::Pointer outputCaster = OutputCastFilterType::New(); + auto outputCaster = OutputCastFilterType::New(); outputCaster->SetInput(toboggan->GetOutput()); ITK_TRY_EXPECT_NO_EXCEPTION(outputCaster->Update()); // Write the output using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetInput(outputCaster->GetOutput()); writer->SetFileName(argv[2]); diff --git a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx index c058d0a57ae..232959a232b 100644 --- a/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx +++ b/Modules/Segmentation/Watersheds/test/itkWatershedImageFilterTest.cxx @@ -47,13 +47,13 @@ itkWatershedImageFilterTest(int, char *[]) region.SetSize(size); region.SetIndex(origin); - ImageType2D::Pointer image2D = ImageType2D::New(); + auto image2D = ImageType2D::New(); image2D->SetLargestPossibleRegion(region); image2D->SetBufferedRegion(region); image2D->SetRequestedRegion(region); image2D->Allocate(); - LongImageType2D::Pointer longimage2D = LongImageType2D::New(); + auto longimage2D = LongImageType2D::New(); longimage2D->SetRegions(region); longimage2D->Allocate(true); // initialize buffer to zero diff --git a/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx b/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx index 7450d01f792..5104ca438b7 100644 --- a/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx +++ b/Modules/Video/BridgeOpenCV/include/itkOpenCVImageBridge.hxx @@ -48,7 +48,7 @@ OpenCVImageBridge::IplImageToITKImage(const IplImage * in) } // Do the conversion - typename ImageType::Pointer out = ImageType::New(); + auto out = ImageType::New(); #define CONVERSION_CASE(iplInputDepthID, itkOutputPixelType) \ case (iplInputDepthID): \ @@ -90,7 +90,7 @@ OpenCVImageBridge::CVMatToITKImage(const cv::Mat & in) using ImageType = TOutputImageType; using DepthIDType = int; - typename ImageType::Pointer out = ImageType::New(); + auto out = ImageType::New(); #define CONVERSION_CASE(inputDepthID, itkOutputPixelType) \ case (inputDepthID): \ diff --git a/Modules/Video/BridgeOpenCV/include/itkOpenCVVideoIOFactory.h b/Modules/Video/BridgeOpenCV/include/itkOpenCVVideoIOFactory.h index 6fb1f598beb..dcb97884651 100644 --- a/Modules/Video/BridgeOpenCV/include/itkOpenCVVideoIOFactory.h +++ b/Modules/Video/BridgeOpenCV/include/itkOpenCVVideoIOFactory.h @@ -58,7 +58,7 @@ class ITKVideoBridgeOpenCV_EXPORT OpenCVVideoIOFactory : public ObjectFactoryBas static void RegisterOneFactory() { - OpenCVVideoIOFactory::Pointer OpenCVFactory = OpenCVVideoIOFactory::New(); + auto OpenCVFactory = OpenCVVideoIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(OpenCVFactory); } diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx index 1b508d4473d..b1dd6a0e74c 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeGrayScaleTest.cxx @@ -101,7 +101,7 @@ itkOpenCVImageBridgeTestTemplatedScalar(char * argv) // // Read the image directly // - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv); reader->Update(); @@ -127,7 +127,7 @@ itkOpenCVImageBridgeTestTemplatedScalar(char * argv) } // Check results of IplImage -> itk::Image - typename DifferenceFilterType::Pointer differ = DifferenceFilterType::New(); + auto differ = DifferenceFilterType::New(); differ->SetValidInput(baselineImage); differ->SetTestInput(outIplITK); differ->Update(); diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx index bec7534876d..e1b03e6caf3 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVImageBridgeRGBTest.cxx @@ -158,7 +158,7 @@ itkOpenCVImageBridgeTestTemplatedRGB(char * argv0, char * argv1) // // Read the image directly // - typename ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); reader->SetFileName(argv1); try { diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoCaptureTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoCaptureTest.cxx index 5c444d43bd0..8d7c93b4daa 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoCaptureTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoCaptureTest.cxx @@ -63,7 +63,7 @@ itkOpenCVVideoCaptureTest(int argc, char * argv[]) // Set up an itk reader itk::ObjectFactoryBase::RegisterFactory(itk::OpenCVVideoIOFactory::New()); - scalarReaderType::Pointer scalarReader = scalarReaderType::New(); + auto scalarReader = scalarReaderType::New(); scalarReader->SetFileName(argv[1]); // Set up OpenCVVideoCapture @@ -121,7 +121,7 @@ itkOpenCVVideoCaptureTest(int argc, char * argv[]) // Set up an itk reader itk::ObjectFactoryBase::RegisterFactory(itk::OpenCVVideoIOFactory::New()); - rgbReaderType::Pointer rgbReader = rgbReaderType::New(); + auto rgbReader = rgbReaderType::New(); rgbReader->SetFileName(argv[1]); // Set up OpenCVVideoCapture diff --git a/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoIOTest.cxx b/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoIOTest.cxx index d82c7502413..10cba39b938 100644 --- a/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoIOTest.cxx +++ b/Modules/Video/BridgeOpenCV/test/itkOpenCVVideoIOTest.cxx @@ -53,7 +53,7 @@ itkImageFromBuffer(itk::OpenCVVideoIO::Pointer opencvIO, void * buffer, size_t b space.Fill(1.0); // May need fixing // Use itkImportImageFilter to create an ITK image - ImportFilterType::Pointer importFilter = ImportFilterType::New(); + auto importFilter = ImportFilterType::New(); importFilter->SetRegion(region); importFilter->SetOrigin(origin); importFilter->SetSpacing(space); @@ -416,7 +416,7 @@ test_OpenCVVideoIO(char * input, delete[] camBuffer; // Write out the ITK image -- DEBUG - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(cameraOutput); writer->SetInput(cameraFrame); writer->Update(); diff --git a/Modules/Video/BridgeVXL/include/itkVXLVideoIOFactory.h b/Modules/Video/BridgeVXL/include/itkVXLVideoIOFactory.h index b6db0661089..693ab0e44cf 100644 --- a/Modules/Video/BridgeVXL/include/itkVXLVideoIOFactory.h +++ b/Modules/Video/BridgeVXL/include/itkVXLVideoIOFactory.h @@ -57,7 +57,7 @@ class VXLVideoIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - VXLVideoIOFactory::Pointer VXLFactory = VXLVideoIOFactory::New(); + auto VXLFactory = VXLVideoIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(VXLFactory); } diff --git a/Modules/Video/BridgeVXL/test/itkVXLVideoIOTest.cxx b/Modules/Video/BridgeVXL/test/itkVXLVideoIOTest.cxx index 8679dccd296..b905f970344 100644 --- a/Modules/Video/BridgeVXL/test/itkVXLVideoIOTest.cxx +++ b/Modules/Video/BridgeVXL/test/itkVXLVideoIOTest.cxx @@ -50,7 +50,7 @@ itkImageFromBuffer(itk::VXLVideoIO::Pointer vxlIO, void * buffer, size_t bufferS space.Fill(1.0); // May need fixing // Use itkImportImageFilter to create an ITK image - ImportFilterType::Pointer importFilter = ImportFilterType::New(); + auto importFilter = ImportFilterType::New(); importFilter->SetRegion(region); importFilter->SetOrigin(origin); importFilter->SetSpacing(space); @@ -417,7 +417,7 @@ test_VXLVideoIO(char * input, ImageType::Pointer cameraFrame = itkImageFromBuffer(vxlIO, camBuffer, camBufferSize); // Write out the ITK image -- DEBUG - WriterType::Pointer writer = WriterType::New(); + auto writer = WriterType::New(); writer->SetFileName(cameraOutput); writer->SetInput(cameraFrame); writer->Update(); diff --git a/Modules/Video/Core/include/itkImageToVideoFilter.hxx b/Modules/Video/Core/include/itkImageToVideoFilter.hxx index b0fb1f1b816..5e5e8ca7b38 100644 --- a/Modules/Video/Core/include/itkImageToVideoFilter.hxx +++ b/Modules/Video/Core/include/itkImageToVideoFilter.hxx @@ -277,7 +277,7 @@ ImageToVideoFilter::GenerateData() inputSliceRegion.SetIndex(m_FrameAxis, idx); using ExtractFilterType = typename itk::ExtractImageFilter; - typename ExtractFilterType::Pointer extractFilter = ExtractFilterType::New(); + auto extractFilter = ExtractFilterType::New(); extractFilter->SetDirectionCollapseToSubmatrix(); extractFilter->SetInput(input); diff --git a/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx b/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx index 9f6c03d76d2..33e7e84a306 100644 --- a/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx +++ b/Modules/Video/Core/test/itkImageToVideoFilterTest.cxx @@ -60,7 +60,7 @@ itkImageToVideoFilterTest(int argc, char * argv[]) inputImage->SetDirection(inputDirection); using VideoFilterType = itk::ImageToVideoFilter; - VideoFilterType::Pointer videoFilter = VideoFilterType::New(); + auto videoFilter = VideoFilterType::New(); videoFilter->SetInput(inputImage); // Arbitrarily set 0th axis as temporal dimension to split frames itk::IndexValueType frameAxis = 0; diff --git a/Modules/Video/Core/test/itkRingBufferTest.cxx b/Modules/Video/Core/test/itkRingBufferTest.cxx index 78e370b069a..36dd4cd5cc1 100644 --- a/Modules/Video/Core/test/itkRingBufferTest.cxx +++ b/Modules/Video/Core/test/itkRingBufferTest.cxx @@ -31,7 +31,7 @@ itkRingBufferTest(int, char *[]) // Test instantiation ////// using RingBufferType = itk::RingBuffer; - RingBufferType::Pointer ringBuffer = RingBufferType::New(); + auto ringBuffer = RingBufferType::New(); // Check that the default number of buffers (3) was properly set if (ringBuffer->GetNumberOfBuffers() != 3) diff --git a/Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx b/Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx index ca5676f8d08..0559a371cd8 100644 --- a/Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx +++ b/Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx @@ -508,7 +508,7 @@ class DummyTemporalProcessObject : public TemporalProcessObject DummyTemporalProcessObject() { - DummyTemporalDataObject::Pointer po = DummyTemporalDataObject::New(); + auto po = DummyTemporalDataObject::New(); this->SetNthOutput(0, po.GetPointer()); } @@ -536,11 +536,11 @@ itkTemporalProcessObjectTest(int, char *[]) // Create 3 new DummyTemporalProcessObjects using TPOType = itk::TemporalProcessObjectTest::DummyTemporalProcessObject; - TPOType::Pointer tpo1 = TPOType::New(); + auto tpo1 = TPOType::New(); tpo1->SetIdNumber(1); - TPOType::Pointer tpo2 = TPOType::New(); + auto tpo2 = TPOType::New(); tpo2->SetIdNumber(2); - TPOType::Pointer tpo3 = TPOType::New(); + auto tpo3 = TPOType::New(); tpo3->SetIdNumber(3); // Set up the Process Objects in a pipeline @@ -567,7 +567,7 @@ itkTemporalProcessObjectTest(int, char *[]) // Create a new TemporalDataObject to pass through the pipeline using TDOType = itk::TemporalProcessObjectTest::DummyTemporalDataObject; - TDOType::Pointer tdo = TDOType::New(); + auto tdo = TDOType::New(); tpo1->SetInput(tdo); // Set up regions for TemporalDataObject diff --git a/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx b/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx index 2e8ff7a1092..73fa732aaa7 100644 --- a/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx +++ b/Modules/Video/Core/test/itkVectorImageToVideoTest.cxx @@ -51,7 +51,7 @@ itkVectorImageToVideoTest(int argc, char * argv[]) const auto inputImage = itk::ReadImage(argv[1]); using VideoFilterType = itk::ImageToVideoFilter; - VideoFilterType::Pointer videoFilter = VideoFilterType::New(); + auto videoFilter = VideoFilterType::New(); videoFilter->SetInput(inputImage); // Arbitrarily set last axis as temporal dimension to split frames itk::IndexValueType frameAxis = Dimension - 1; diff --git a/Modules/Video/Core/test/itkVideoSourceTest.cxx b/Modules/Video/Core/test/itkVideoSourceTest.cxx index 094219152e8..68a6133b91f 100644 --- a/Modules/Video/Core/test/itkVideoSourceTest.cxx +++ b/Modules/Video/Core/test/itkVideoSourceTest.cxx @@ -110,7 +110,7 @@ class DummyVideoSource : public VideoSource FrameType::Pointer CreateEmptyFrame() { - FrameType::Pointer out = FrameType::New(); + auto out = FrameType::New(); FrameType::RegionType largestRegion; FrameType::SizeType sizeLR; @@ -152,14 +152,14 @@ itkVideoSourceTest(int, char *[]) // Test Instantiation ////// using VideoSourceType = itk::VideoSourceTest::DummyVideoSource; - VideoSourceType::Pointer videoSource = VideoSourceType::New(); + auto videoSource = VideoSourceType::New(); ////// // Test Graft ////// // Create a VideoStream - VideoType::Pointer video = VideoType::New(); + auto video = VideoType::New(); itk::TemporalRegion largestRegion; itk::TemporalRegion requestedRegion; itk::TemporalRegion bufferedRegion; diff --git a/Modules/Video/Core/test/itkVideoStreamTest.cxx b/Modules/Video/Core/test/itkVideoStreamTest.cxx index dbcbb426ffb..dbe4e4985c2 100644 --- a/Modules/Video/Core/test/itkVideoStreamTest.cxx +++ b/Modules/Video/Core/test/itkVideoStreamTest.cxx @@ -52,7 +52,7 @@ itkVideoStreamTest(int, char *[]) ////// // Instantiate a new VideoStream - VideoType::Pointer video1 = VideoType::New(); + auto video1 = VideoType::New(); // Check dimension if (video1->GetFrameDimension() != Dimension) @@ -67,7 +67,7 @@ itkVideoStreamTest(int, char *[]) } // Create a second VideoStream - VideoType::Pointer video2 = VideoType::New(); + auto video2 = VideoType::New(); // Use GetFrameBuffer and SetFrameBuffer to make video1 point to the same // buffer as video2 @@ -108,9 +108,9 @@ itkVideoStreamTest(int, char *[]) } // Test appending frames to video2 - FrameType::Pointer frame1 = FrameType::New(); - FrameType::Pointer frame2 = FrameType::New(); - FrameType::Pointer frame3 = FrameType::New(); + auto frame1 = FrameType::New(); + auto frame2 = FrameType::New(); + auto frame3 = FrameType::New(); video2->SetFrame(0, frame1); video2->SetFrame(1, frame2); video2->SetFrame(2, frame3); diff --git a/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx b/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx index 91126ffe4c7..d0e56d45427 100644 --- a/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx +++ b/Modules/Video/Core/test/itkVideoToVideoFilterTest.cxx @@ -41,7 +41,7 @@ namespace VideoToVideoFilterTest InputFrameType::Pointer CreateInputFrame(InputPixelType val) { - InputFrameType::Pointer out = InputFrameType::New(); + auto out = InputFrameType::New(); InputFrameType::RegionType largestRegion; InputFrameType::SizeType sizeLR; @@ -173,15 +173,15 @@ itkVideoToVideoFilterTest(int, char *[]) // Instantiate a filter using VideoFilterType = itk::VideoToVideoFilterTest::DummyVideoToVideoFilter; - VideoFilterType::Pointer filter = VideoFilterType::New(); + auto filter = VideoFilterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, DummyVideoToVideoFilter, VideoToVideoFilter); // Set up an input video stream - InputVideoType::Pointer inputVideo = InputVideoType::New(); - itk::TemporalRegion inputLargestTemporalRegion; - SizeValueType inputStart = 0; - SizeValueType inputDuration = 10; + auto inputVideo = InputVideoType::New(); + itk::TemporalRegion inputLargestTemporalRegion; + SizeValueType inputStart = 0; + SizeValueType inputDuration = 10; inputLargestTemporalRegion.SetFrameStart(inputStart); inputLargestTemporalRegion.SetFrameDuration(inputDuration); inputVideo->SetLargestPossibleTemporalRegion(inputLargestTemporalRegion); diff --git a/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx index 68998aa4c6c..b2aced92922 100644 --- a/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkDecimateFramesVideoFilterTest.cxx @@ -89,9 +89,9 @@ itkDecimateFramesVideoFilterTest(int argc, char * argv[]) ////// // Instantiate reader, writer, and filter - ReaderType::Pointer reader = ReaderType::New(); - WriterType::Pointer writer = WriterType::New(); - FilterType::Pointer filter = FilterType::New(); + auto reader = ReaderType::New(); + auto writer = WriterType::New(); + auto filter = FilterType::New(); // Connect the pipeline filter->SetInput(reader->GetOutput()); @@ -130,8 +130,8 @@ itkDecimateFramesVideoFilterTest(int argc, char * argv[]) // Set up two readers to read in the frames that should have been written and // compare against those that actually were using FrameReaderType = itk::ImageFileReader; - FrameReaderType::Pointer inputFrameReader = FrameReaderType::New(); - FrameReaderType::Pointer outputFrameReader = FrameReaderType::New(); + auto inputFrameReader = FrameReaderType::New(); + auto outputFrameReader = FrameReaderType::New(); // Compare input frame 0 and output frame 0 inputFrameReader->SetFileName(inputFiles[0]); diff --git a/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx index fdeb102731e..6403d5aa126 100644 --- a/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkFrameAverageVideoFilterTest.cxx @@ -49,7 +49,7 @@ namespace FrameAverageVideoFilterTest InputFrameType::Pointer CreateInputFrame(InputPixelType val) { - InputFrameType::Pointer out = InputFrameType::New(); + auto out = InputFrameType::New(); InputFrameType::RegionType largestRegion; InputFrameType::SizeType sizeLR; @@ -97,11 +97,11 @@ itkFrameAverageVideoFilterTest(int argc, char * argv[]) // Instantiate the filter using FilterType = itk::FrameAverageVideoFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Set up an input VideoStream - InputVideoType::Pointer inputVideo = InputVideoType::New(); - SizeValueType numInputFrames = 50; + auto inputVideo = InputVideoType::New(); + SizeValueType numInputFrames = 50; inputVideo->SetNumberOfBuffers(numInputFrames); itk::TemporalRegion inputTempRegion; inputTempRegion.SetFrameStart(0); @@ -219,15 +219,15 @@ itkFrameAverageVideoFilterTest(int argc, char * argv[]) // Set up reader and writer using VideoReaderType = itk::VideoFileReader; using VideoWriterType = itk::VideoFileWriter; - VideoReaderType::Pointer reader = VideoReaderType::New(); - VideoWriterType::Pointer writer = VideoWriterType::New(); + auto reader = VideoReaderType::New(); + auto writer = VideoWriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); // Set up pipeline with 2 average filters each over 2 frames using FilterType2 = itk::FrameAverageVideoFilter; - FilterType2::Pointer avg1 = FilterType2::New(); - FilterType2::Pointer avg2 = FilterType2::New(); + auto avg1 = FilterType2::New(); + auto avg2 = FilterType2::New(); avg1->SetNumberOfFrames(2); avg2->SetNumberOfFrames(2); diff --git a/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx b/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx index f65932ad502..2df6f004dc9 100644 --- a/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx +++ b/Modules/Video/Filtering/test/itkFrameDifferenceVideoFilterTest.cxx @@ -48,7 +48,7 @@ namespace FrameDifferenceVideoFilterTest InputFrameType::Pointer CreateInputFrame(InputPixelType val) { - InputFrameType::Pointer out = InputFrameType::New(); + auto out = InputFrameType::New(); InputFrameType::RegionType largestRegion; InputFrameType::SizeType sizeLR; @@ -85,12 +85,12 @@ itkFrameDifferenceVideoFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[ { // Instantiate the filter using FilterType = itk::FrameDifferenceVideoFilter; - FilterType::Pointer filter = FilterType::New(); + auto filter = FilterType::New(); // Set up an input VideoStream - InputVideoType::Pointer inputVideo = InputVideoType::New(); - SizeValueType numInputFrames = 50; + auto inputVideo = InputVideoType::New(); + SizeValueType numInputFrames = 50; inputVideo->SetNumberOfBuffers(numInputFrames); itk::TemporalRegion inputTempRegion; inputTempRegion.SetFrameStart(0); diff --git a/Modules/Video/Filtering/test/itkImageFilterToVideoFilterWrapperTest.cxx b/Modules/Video/Filtering/test/itkImageFilterToVideoFilterWrapperTest.cxx index ad754d622df..809bf9b6957 100644 --- a/Modules/Video/Filtering/test/itkImageFilterToVideoFilterWrapperTest.cxx +++ b/Modules/Video/Filtering/test/itkImageFilterToVideoFilterWrapperTest.cxx @@ -63,14 +63,14 @@ itkImageFilterToVideoFilterWrapperTest(int argc, char * argv[]) itk::ObjectFactoryBase::RegisterFactory(itk::FileListVideoIOFactory::New()); // Set up reader and writer - VideoReaderType::Pointer reader = VideoReaderType::New(); - VideoWriterType::Pointer writer = VideoWriterType::New(); + auto reader = VideoReaderType::New(); + auto writer = VideoWriterType::New(); reader->SetFileName(argv[1]); writer->SetFileName(argv[2]); // Instantiate a new video filter and an image filter - GaussianImageFilterType::Pointer imgGauss = GaussianImageFilterType::New(); - GaussianVideoFilterType::Pointer vidGauss = GaussianVideoFilterType::New(); + auto imgGauss = GaussianImageFilterType::New(); + auto vidGauss = GaussianVideoFilterType::New(); // Set the parameters on the image filter and plug it into the video filter imgGauss->SetSigma(3); @@ -88,9 +88,9 @@ itkImageFilterToVideoFilterWrapperTest(int argc, char * argv[]) // using ImageReaderType = itk::ImageFileReader; using DifferenceFilterType = itk::Testing::ComparisonImageFilter; - ImageReaderType::Pointer imReader1 = ImageReaderType::New(); - ImageReaderType::Pointer imReader2 = ImageReaderType::New(); - DifferenceFilterType::Pointer differ = DifferenceFilterType::New(); + auto imReader1 = ImageReaderType::New(); + auto imReader2 = ImageReaderType::New(); + auto differ = DifferenceFilterType::New(); imgGauss->SetInput(imReader1->GetOutput()); differ->SetValidInput(imgGauss->GetOutput()); diff --git a/Modules/Video/IO/include/itkFileListVideoIOFactory.h b/Modules/Video/IO/include/itkFileListVideoIOFactory.h index 790d001ea25..d8b12f052d7 100644 --- a/Modules/Video/IO/include/itkFileListVideoIOFactory.h +++ b/Modules/Video/IO/include/itkFileListVideoIOFactory.h @@ -58,7 +58,7 @@ class ITKVideoIO_EXPORT FileListVideoIOFactory : public ObjectFactoryBase static void RegisterOneFactory() { - FileListVideoIOFactory::Pointer FileListFactory = FileListVideoIOFactory::New(); + auto FileListFactory = FileListVideoIOFactory::New(); ObjectFactoryBase::RegisterFactoryInternal(FileListFactory); } diff --git a/Modules/Video/IO/include/itkVideoFileWriter.hxx b/Modules/Video/IO/include/itkVideoFileWriter.hxx index 5553866cedf..ef5db52c690 100644 --- a/Modules/Video/IO/include/itkVideoFileWriter.hxx +++ b/Modules/Video/IO/include/itkVideoFileWriter.hxx @@ -158,7 +158,7 @@ VideoFileWriter::Write() // temporal streaming in TemporalProcessObject's GenerateData. We set the // buffered region to an empty region so that the entire requested region is // unbuffered and gets written. - TemporalDataObject::Pointer output = TemporalDataObject::New(); + auto output = TemporalDataObject::New(); output->SetLargestPossibleTemporalRegion(m_OutputTemporalRegion); output->SetRequestedTemporalRegion(m_OutputTemporalRegion); output->SetBufferedTemporalRegion(TemporalRegion()); diff --git a/Modules/Video/IO/test/itkFileListVideoIOTest.cxx b/Modules/Video/IO/test/itkFileListVideoIOTest.cxx index 0282e60c957..fab41ccebe7 100644 --- a/Modules/Video/IO/test/itkFileListVideoIOTest.cxx +++ b/Modules/Video/IO/test/itkFileListVideoIOTest.cxx @@ -127,7 +127,7 @@ test_FileListVideoIO(const char * input, std::cout << "Comparing all " << fileListIO->GetFrameTotal() << " frames" << std::endl; // Set up ImageFileReader - ReaderType::Pointer reader = ReaderType::New(); + auto reader = ReaderType::New(); // Loop through all frames std::vector filenames = fileListIO->SplitFileNames(input); diff --git a/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx b/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx index e8b7f79a5c2..b728305dafa 100644 --- a/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx +++ b/Modules/Video/IO/test/itkVideoFileReaderWriterTest.cxx @@ -52,7 +52,7 @@ itkVideoFileReaderWriterTest(int argc, char * argv[]) inFile = inFile + std::string(","); } } - VideoReaderType::Pointer reader = VideoReaderType::New(); + auto reader = VideoReaderType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(reader, VideoFileReader, VideoSource); @@ -63,7 +63,7 @@ itkVideoFileReaderWriterTest(int argc, char * argv[]) itk::ObjectFactoryBase::RegisterFactory(itk::FileListVideoIOFactory::New()); // Set up the writer - VideoWriterType::Pointer writer = VideoWriterType::New(); + auto writer = VideoWriterType::New(); ITK_EXERCISE_BASIC_OBJECT_METHODS(writer, VideoFileWriter, TemporalProcessObject);