SimpleITK  2.0.0rc2.post17
SimpleGaussianFunctional.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.
*
*=========================================================================*/
// This one header will include all SimpleITK filters and external
// objects.
#include <SimpleITK.h>
#include <stdlib.h>
#include <iostream>
// create convenient namespace alias
namespace sitk = itk::simple;
int main ( int argc, char* argv[] ) {
if ( argc < 4 ) {
std::cerr << "Usage: " << argv[0] << " <input> <sigma> <output>\n";
return 1;
}
sitk::Image image = sitk::ReadImage ( std::string ( argv[1] ) );
sitk::PixelIDValueEnum inputPixelID = image.GetPixelID();
image = sitk::SmoothingRecursiveGaussian ( image, atof ( argv[2] ) );
image = sitk::Cast( image, inputPixelID );
sitk::WriteImage ( image, std::string ( argv[3] ) );
return 0;
}
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:75
SimpleITK.h
itk::simple::PixelIDValueEnum
PixelIDValueEnum
Enumerated values of pixelIDs.
Definition: sitkPixelIDValues.h:90
itk::simple::Cast
Image Cast(const Image &image, PixelIDValueEnum pixelID)
itk::simple::Image::GetPixelID
PixelIDValueEnum GetPixelID() const
itk::simple::SmoothingRecursiveGaussian
Image SmoothingRecursiveGaussian(const Image &image1, double sigma, bool normalizeAcrossScale=false)
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
itk::simple::WriteImage
SITKIO_EXPORT void WriteImage(const Image &image, const std::string &fileName, bool useCompression=false, int compressionLevel=-1)
itk::simple::ReadImage
SITKIO_EXPORT Image ReadImage(const std::string &filename, PixelIDValueEnum outputPixelType=sitkUnknown, const std::string &imageIO="")
ReadImage is a procedural interface to the ImageFileReader class which is convenient for most image r...
itk::simple
Definition: sitkAdditionalProcedures.h:29