本文整理汇总了C++中writertype::Pointer::UseInputMetaDataDictionaryOff方法的典型用法代码示例。如果您正苦于以下问题:C++ Pointer::UseInputMetaDataDictionaryOff方法的具体用法?C++ Pointer::UseInputMetaDataDictionaryOff怎么用?C++ Pointer::UseInputMetaDataDictionaryOff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类writertype::Pointer
的用法示例。
在下文中一共展示了Pointer::UseInputMetaDataDictionaryOff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
if(argc != 3){
std::cout << "Usage: Test2DImage inputFilename outputFilename";
return 1;
}
typedef signed int InputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image<InputPixelType, Dimension> InputImageType;
typedef itk::RGBPixel<unsigned char> RGBPixelType;
typedef itk::Image<RGBPixelType, 2> RGBImageType;
typedef itk::ImageFileReader<InputImageType> ReaderType;
typedef itk::ImageFileWriter<RGBImageType> WriterType;
typedef itk::GDCMImageIO ImageIOType;
typedef itk::GradientAnisotropicDiffusionImageFilter<InputImageType,
InputImageType> DiffusionFilterType;
typedef itk::GradientMagnitudeImageFilter<InputImageType, InputImageType>
GradientMagnitudeFilterType;
typedef itk::Functor::ScalarToRGBPixelFunctor<int> ColorMapFunctorType;
typedef itk::UnaryFunctorImageFilter<InputImageType,
RGBImageType, ColorMapFunctorType> ColorMapFilterType;
typedef itk::JPEGImageIO JImageIOType;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
ImageIOType::Pointer GDCMImageIO = ImageIOType::New();
JImageIOType::Pointer JPEGImageIO = JImageIOType::New();
ColorMapFilterType::Pointer colormapper = ColorMapFilterType::New();
reader->SetFileName(argv[1]);
reader->SetImageIO(GDCMImageIO);
try {
reader->Update();
}
catch (itk::ExceptionObject & e) {
std::cerr << "exception in file reader " << std::endl;
std::cerr << e << std::endl;
return 1;
}
DiffusionFilterType::Pointer diffusion = DiffusionFilterType::New();
diffusion->SetNumberOfIterations(1);
diffusion->SetConductanceParameter(4);
diffusion->SetTimeStep(0.125);
GradientMagnitudeFilterType::Pointer gradient = GradientMagnitudeFilterType::New();
diffusion->SetInput(reader->GetOutput());
gradient->SetInput(diffusion->GetOutput());
gradient->Update();
MyWatershedSegmenter<InputImageType> watershed(gradient->GetOutput());
watershed.buildLowerCompleteImage();
watershed.buildLabeledImage();
colormapper->SetInput(watershed.returnFinalImage());
writer->SetInput(colormapper->GetOutput());
writer->UseInputMetaDataDictionaryOff();
writer->SetImageIO(JPEGImageIO);
writer->SetFileName(argv[2]);
writer->Update();
}