+++ /dev/null
-#include "itkBinaryThinningImageFilter.h"
-#include "itkImage.h"
-#include "itkImageFileReader.h"
-#include "itkImageFileWriter.h"
-#include "itkRescaleIntensityImageFilter.h"
-
-typedef itk::Image<short, 3> ImageType;
-
-int main(int argc, char *argv[])
-{
-
- typedef itk::ImageFileReader<ImageType> ImageReader;
- ImageReader::Pointer reader = ImageReader::New();
- std::string fileName = argv[1];
- reader->SetFileName(fileName);
- reader->Update();
- ImageType::Pointer image = reader->GetOutput();
-
- typedef itk::BinaryThinningImageFilter <ImageType, ImageType> BinaryThinningImageFilterType;
- BinaryThinningImageFilterType::Pointer binaryThinningImageFilter = BinaryThinningImageFilterType::New();
- binaryThinningImageFilter->SetInput(image);
- binaryThinningImageFilter->Update();
-
- // Rescale the image so that it can be seen (the output is 0 and 1, we want 0 and 255)
- typedef itk::RescaleIntensityImageFilter< ImageType, ImageType > RescaleType;
- RescaleType::Pointer rescaler = RescaleType::New();
- rescaler->SetInput( binaryThinningImageFilter->GetOutput() );
- rescaler->SetOutputMinimum(0);
- rescaler->SetOutputMaximum(255);
- rescaler->Update();
-
- typedef itk::ImageFileWriter< ImageType > WriterType;
- WriterType::Pointer writer = WriterType::New();
- writer->SetFileName(argv[2]);
- writer->SetInput(rescaler->GetOutput());
- writer->Update();
-
- return EXIT_SUCCESS;
-}
-