亮度投射 放大灰度区间
//亮度投射 放大灰度区间
typedef itk::RescaleIntensityImageFilter<ImageType, ImageType> RescaleIntensityImageFilter_ext_3d;
RescaleIntensityImageFilter_ext_3d::Pointer rescaleFliter_ext_3d
= RescaleIntensityImageFilter_ext_3d::New();
rescaleFliter_ext_3d->SetInput(heartLogic3->GetOutput());
rescaleFliter_ext_3d->SetOutputMinimum(0);
rescaleFliter_ext_3d->SetOutputMaximum(1);
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);
//亮度投射
typedef itk::RescaleIntensityImageFilter<ImageType, ImageType> RescaleIntensityImageFilter_ext_3d;
RescaleIntensityImageFilter_ext_3d::Pointer rescaleFliter_ext_3d
= RescaleIntensityImageFilter_ext_3d::New();
rescaleFliter_ext_3d->SetInput(regionFliter->GetOutput());
rescaleFliter_ext_3d->SetOutputMinimum(-32768);
rescaleFliter_ext_3d->SetOutputMaximum(32767);
//占内存长度不同和取值范围不同
int 32位 -2^32---2^32-1
short 16位 -32768~32767
32位系统:long是4字节32位,int是4字节32位
64位系统:long是8字节64位,int是4字节32位
//获得灰度区间
//cout<<"获得灰度区间"<<endl;
typedef itk::StatisticsImageFilter<ImageType> StatisticsImageFilterType;
StatisticsImageFilterType::Pointer statisticsImageFilter = StatisticsImageFilterType::New ();
statisticsImageFilter->SetInput(shrinkFilter->GetOutput());
statisticsImageFilter->Update();
signed int pRange[2]; //这里会有负值
pRange[0] = statisticsImageFilter->GetMinimum();
pRange[1] = statisticsImageFilter->GetMaximum();