#include <cstdio>
#include <iomanip>
int
main(int argc, char * argv[])
{
if (argc < 4)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0]
<< " inputImageFile outputImageFileBase numberOfSlices"
<< std::endl;
return EXIT_FAILURE;
}
using InputPixelType = float;
using OutputPixelType = float;
using FilterType =
OutputImageType>;
reader->SetFileName(argv[1]);
laplacian->SetNormalizeAcrossScale(true);
laplacian->SetInput(reader->GetOutput());
writer->SetInput(laplacian->GetOutput());
const int numberOfSlices = std::stoi(argv[3]);
for (int slice = 0; slice < numberOfSlices; ++slice)
{
std::ostringstream filename;
filename << argv[2] << std::setfill('0') << std::setw(3) << slice
<< ".mhd";
writer->SetFileName(filename.str());
const float sigma = static_cast<float>(slice) / 10.0 + 1.0;
laplacian->SetSigma(sigma);
writer->Update();
}
return EXIT_SUCCESS;
}