ITK/Release 4/Why Switch to ITKv4/SimplifiedITK/DiscreteGaussianFilter: Difference between revisions
From KitwarePublic
< ITK | Release 4 | Why Switch to ITKv4 | SimplifiedITK
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 26: | Line 26: | ||
import SimpleITK | import SimpleITK | ||
input = SimpleITK.ReadImage ( filename ) | input = SimpleITK.ReadImage ( filename ) | ||
output = SimpleITK.DiscreteGaussianFilter( input, 1.0, 5 ) | |||
</source> | </source> | ||
Revision as of 22:55, 30 August 2011
C++
<source lang="cpp">
// Setup image types. typedef float InputPixelType; typedef float OutputPixelType; typedef itk::Image<InputPixelType, 2> InputImageType; typedef itk::Image<OutputPixelType,2> OutputImageType; // Filter type typedef itk::DiscreteGaussianImageFilter< InputImageType, OutputImageType > FilterType; // Create a filter FilterType::Pointer filter = FilterType::New(); // Create the pipeline filter->SetInput( reader->GetOutput() ); filter->SetVariance( 1.0 ); filter->SetMaximumKernelWidth( 5 ); filter->Update(); OutputImageType::Pointer blurred = filter->GetOutput();
</source>
WrapITK
SimpleITK
<source lang="python"> import SimpleITK input = SimpleITK.ReadImage ( filename ) output = SimpleITK.DiscreteGaussianFilter( input, 1.0, 5 ) </source>