《itk实用demo》-非线性映射,线性映射

本文介绍使用ITK库进行图像处理的方法,包括非线性映射(S型映射)、线性映射(如强度缩放、归一化、阈值处理等)。通过不同类型的滤波器实现图像增强,例如SigmoidImageFilter、ClampImageFilter、CastImageFilter、RescaleIntensityImageFilter等。
摘要由CSDN通过智能技术生成

非线性映射

 typedef itk::SigmoidImageFilter <ImageType, ImageType> SigmoidImageFilterType;
 SigmoidImageFilterType::Pointer sigmoidFilter = SigmoidImageFilterType::New();
 sigmoidFilter->SetInput(imagedata);
 sigmoidFilter->SetOutputMinimum(-1024);
 sigmoidFilter->SetOutputMaximum(800);
 sigmoidFilter->SetAlpha(100.0);
 sigmoidFilter->SetBeta(150.0);

线性映射

#include "itkClampImageFilter.h"
  typedef itk::ClampImageFilter< FloatImageType, UnsignedCharImageType > ClampFilterType;
  ClampFilterType::Pointer clampFilter = ClampFilterType::New();
  clampFilter->SetInput(image);
  clampFilter->Update();
--------------------------------------------------------------------------------
#include "itkCastImageFilter.h"
  typedef itk::CastImageFilter< FloatImageType, UnsignedCharImageType > CastFilterType;
  CastFilterType::Pointer castFilter = CastFilterType::New();
  castFilter->SetInput(reader->GetOutput());
--------------------------------------------------------------------------------
#include "itkRescaleIntensityImageFilter.h"
  typedef itk::RescaleIntensityImageFilter< ImageType, ImageType > RescaleFilterType;
  RescaleFilterType::Pointer rescaleFilter = RescaleFilterType::New();
  rescaleFilter->SetInput(reader->GetOutput());
  rescaleFilter->SetOutputMinimum(0);
  rescaleFilter->SetOutputMaximum(255);
--------------------------------------------------------------------------------
itkShiftScaleImageFilter.h
typedef itk::ShiftScaleImageFilter< ImageType, ImageType > ScaleFilterType;
ScaleFilterType::Pointer shiftFliter= ScaleFilterType::New();  
shiftFliter->SetInput(reader->GetOutput());
shiftFliter->SetScale(1.2);
shiftFliter->SetShift(25);
--------------------------------------------------------------------------------
#include "itkNormalizeImageFilter.h"
  typedef itk::NormalizeImageFilter< FloatImageType, FloatImageType >
    NormalizeFilterType;
  NormalizeFilterType::Pointer normalizeFilter = NormalizeFilterType::New();
  normalizeFilter->SetInput(reader->GetOutput());
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值