#include <iostream>
#include <stdlib.h>
int main ( int argc, char* argv[] ) {
if ( argc < 2 ) {
std::cerr << "Usage: N4BiasFieldCorrection inputImage outputImage";
std::cerr << " [shrinkFactor] [maskImage] [numberOfIterations]";
std::cerr << " [numberOfFittingLevels]\n";
return 1;
}
if ( argc > 4 ) {
} else {
}
unsigned int shrinkFactor = 1;
if ( argc > 3 ) {
shrinkFactor = atoi( argv[3] );
std::vector<unsigned int> shrink( inputImage.
GetDimension(), shrinkFactor );
}
unsigned int numFittingLevels = 4;
if ( argc > 6) {
numFittingLevels = atoi(argv[6]);
}
if ( argc > 5 ) {
unsigned int it = atoi( argv[5] );
std::vector<unsigned int> iterations( numFittingLevels, it );
}
if (shrinkFactor > 1) {
sitk::WriteImage( corrected_image,
"CXX-Example-N4BiasFieldCorrection-shrunk.nrrd" );
}
if (getenv("SITK_NOSHOW") == NULL)
return 0;
}
Image Shrink(const Image &image1, std::vector< unsigned int > shrinkFactors=std::vector< unsigned int >(3, 1))
Reduce the size of an image by an integer factor in each dimension.
Image OtsuThreshold(const Image &image, const Image &maskImage, uint8_t insideValue=1u, uint8_t outsideValue=0u, uint32_t numberOfHistogramBins=128u, bool maskOutput=true, uint8_t maskValue=255u, bool returnBinMidpoint=false)
Threshold an image using the Otsu Threshold.
SITKIO_EXPORT void WriteImage(const Image &image, const std::string &fileName, bool useCompression=false, int compressionLevel=-1)
WriteImage is a procedural interface to the ImageFileWriter. class which is convenient for many image...
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...