ITK  5.2.0
Insight Toolkit
SphinxExamples/src/Core/Transform/TranslateAVectorImage/Code.cxx
/*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#include "itkImage.h"
int
main(int, char *[])
{
using VectorImageType = itk::Image<VectorType, 2>;
VectorImageType::Pointer image = VectorImageType::New();
start.Fill(0);
size.Fill(10);
itk::ImageRegion<2> region(start, size);
image->SetRegions(region);
image->Allocate();
translation[0] = 10;
translation[1] = 20;
transform->Translate(translation);
ResampleFilterType::Pointer vectorResampleFilter = ResampleFilterType::New();
vectorResampleFilter->SetInput(image);
vectorResampleFilter->SetSize(image->GetLargestPossibleRegion().GetSize());
vectorResampleFilter->SetTransform(transform);
vectorResampleFilter->Update();
return EXIT_SUCCESS;
}
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
itkCovariantVector.h
itk::Size< 2 >
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:69
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::Vector< TParametersValueType, NDimensions >
itkImageFileReader.h
itkImage.h
itk::SmartPointer< Self >
itk::Index::Fill
void Fill(IndexValueType value)
Definition: itkIndex.h:270
itk::Size::Fill
void Fill(SizeValueType value)
Definition: itkSize.h:211
itkTranslationTransform.h
itk::TranslationTransform::New
static Pointer New()
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itk::CovariantVector< double, 3 >
itk::ResampleImageFilter
Resample an image via a coordinate transform.
Definition: itkResampleImageFilter.h:90
itkNumericTraits.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itkResampleImageFilter.h