ITK  5.4.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
*
* https://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()
{
using VectorImageType = itk::Image<VectorType, 2>;
auto 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);
auto vectorResampleFilter = ResampleFilterType::New();
vectorResampleFilter->SetInput(image);
vectorResampleFilter->SetSize(image->GetLargestPossibleRegion().GetSize());
vectorResampleFilter->SetTransform(transform);
vectorResampleFilter->Update();
return EXIT_SUCCESS;
}
itk::TranslationTransform::New
static Pointer New()
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:70
itkCovariantVector.h
itk::Size< 2 >
itk::ImageRegion
An image region represents a structured region of data.
Definition: itkImageRegion.h:80
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itk::Vector< TParametersValueType, VDimension >
itkImageFileReader.h
itkImage.h
itk::SmartPointer< Self >
itk::Index::Fill
void Fill(IndexValueType value)
Definition: itkIndex.h:274
itk::Size::Fill
void Fill(SizeValueType value)
Definition: itkSize.h:213
itkTranslationTransform.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
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:88
New
static Pointer New()
itkResampleImageFilter.h