ITK  4.13.0
Insight Segmentation and Registration Toolkit
WikiExamples/Math/Trig/SinImageFilter.cxx
#include "itkImage.h"
typedef itk::Image<float, 2> FloatImageType;
static void CreateImage(FloatImageType::Pointer image);
int main(int, char *[])
{
FloatImageType::Pointer image = FloatImageType::New();
CreateImage(image);
// Compute the sine of each pixel
SinImageFilterType;
SinImageFilterType::Pointer sinImageFilter = SinImageFilterType::New ();
sinImageFilter->SetInput(image);
sinImageFilter->Update();
return EXIT_SUCCESS;
}
void CreateImage(FloatImageType::Pointer image)
{
start.Fill(0);
size.Fill(10);
FloatImageType::RegionType region(start,size);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
}