ITK  5.4.0
Insight Toolkit
SphinxExamples/src/Filtering/ImageGradient/GradientOfVectorImage/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(int argc, char * argv[])
{
// Setup types
using VectorImageType = itk::Image<VectorType, 2>;
auto image = VectorImageType::New();
size[0] = 5;
size[1] = 5;
index[0] = 0;
index[1] = 0;
region.SetSize(size);
region.SetIndex(index);
image->SetRegions(region);
image->Allocate();
while (!iterator.IsAtEnd())
{
}
// Create and setup a gradient filter
auto gradientFilter = GradientFilterType::New();
gradientFilter->SetInput(image);
gradientFilter->Update();
return EXIT_SUCCESS;
}
itk::Index
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:70
itkCovariantVector.h
itk::Size< 2 >
itk::GTest::TypedefsAndConstructors::Dimension2::VectorType
ImageBaseType::SpacingType VectorType
Definition: itkGTestTypedefsAndConstructors.h:53
itkImage.h
itkImageRegionIterator.h
itk::ImageConstIterator::IsAtEnd
bool IsAtEnd() const
Definition: itkImageConstIterator.h:377
itk::ImageRegionIterator
A multi-dimensional iterator templated over image type that walks a region of pixels.
Definition: itkImageRegionIterator.h:80
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::GradientImageFilter
Computes the gradient of an image using directional derivatives.
Definition: itkGradientImageFilter.h:68
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itkGradientImageFilter.h
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
New
static Pointer New()
itk::ImageRegion::SetSize
void SetSize(const SizeType &size)
Definition: itkImageRegion.h:202