Reputation:
I'm trying to work with filters "unsharp-mask" for DICOM files and or .mhd (goal). In C ++ recommended the use of ITK, within it there is UnsharpMaskLevelSetImageFilter class, it does exactly what I want, for 2D images. When I use a imageType volume to .dcm files or .mhd the filter does not work. Can anyone tell me if it is compatible with volume? Or if there is any way to create unsharp-mask in C ++?
this is my code:
itk::GDCMImageIOFactory::RegisterOneFactory();
itk::MetaImageIOFactory::RegisterOneFactory();
typedef float InputPixelType;
const int ImageDimension = 3;
typedef itk::Image< InputPixelType, ImageDimension > InputImageType;
typedef itk::ImageFileReader< InputImageType > ReaderType;
typedef itk::UnsharpMaskLevelSetImageFilter <InputImageType, InputImageType> FilterType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName("D:\\31panoramica.mhd");
FilterType::Pointer filter = FilterType::New();
FilterWatcher watcher(filter);
filter->SetNumberOfThreads(100);
filter->SetMaxFilterIteration(10);
filter->SetNormalProcessUnsharpWeight(0.2);
filter->SetInput(reader->GetOutput());
filter->Update();
typedef itk::ImageFileWriter< InputImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName("D:\\31panoramica22.mhd");
writer->SetInput(filter->GetOutput());
writer->Update();
Upvotes: 0
Views: 309