当前位置: 首页>>代码示例>>C++>>正文


C++ ImageLayer::setGrayImage方法代码示例

本文整理汇总了C++中ImageLayer::setGrayImage方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageLayer::setGrayImage方法的具体用法?C++ ImageLayer::setGrayImage怎么用?C++ ImageLayer::setGrayImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ImageLayer的用法示例。


在下文中一共展示了ImageLayer::setGrayImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: on_pushButtonApply_clicked

void RescaleIntensityFilterDialog::on_pushButtonApply_clicked()
{
    ImageLayer *imageLayer = ImageLayer::instance();
    int minimum = ui->spinBoxMinimum->value();
    int maximum = ui->spinBoxMaximum->value();

    rescaleFilter->SetInput(imageLayer->grayImagePointer(0));
    rescaleFilter->SetOutputMinimum(minimum);
    rescaleFilter->SetOutputMaximum(maximum);
    rescaleFilter->Update();

    imageLayer->resizeImageVector(2);
    imageLayer->setGrayImage(1, rescaleFilter->GetOutput());
}
开发者ID:amsantosr,项目名称:QtITKConnection,代码行数:14,代码来源:rescaleintensityfilterdialog.cpp

示例2: on_pushButtonApply_clicked

void SigmoidFilterDialog::on_pushButtonApply_clicked()
{
    ImageLayer *imageLayer = ImageLayer::instance();
    int outputMinimum = ui->spinBoxMinimum->value();
    int outputMaximum = ui->spinBoxMaximum->value();
    double alpha = ui->spinBoxAlpha->value();
    double beta = ui->spinBoxBeta->value();

    sigmoidFilter->SetInput(imageLayer->grayImagePointer(0));
    sigmoidFilter->SetOutputMinimum(outputMinimum);
    sigmoidFilter->SetOutputMaximum(outputMaximum);
    sigmoidFilter->SetAlpha(alpha);
    sigmoidFilter->SetBeta(beta);
    sigmoidFilter->Update();

    imageLayer->resizeImageVector(2);
    imageLayer->setGrayImage(1, sigmoidFilter->GetOutput());
}
开发者ID:amsantosr,项目名称:QtITKConnection,代码行数:18,代码来源:sigmoidfilterdialog.cpp

示例3: on_pushButtonApply_clicked

void BinaryThresholdFilterDialog::on_pushButtonApply_clicked()
{
    ImageLayer *imageLayer = ImageLayer::instance();
    int insideValue = ui->spinBoxInsideValue->value();
    int outsideValue = ui->spinBoxOutsideValue->value();
    int lowerThreshold = ui->spinBoxLowerThreshold->value();
    int upperThreshold = ui->spinBoxUpperThreshold->value();
    imageLayer->resizeImageVector(2);

    typedef itk::BinaryThresholdImageFilter<ImageLayer::GrayImageType, ImageLayer::GrayImageType> BinaryThresholdFilterType;

    BinaryThresholdFilterType::Pointer binaryThresholdFilter = BinaryThresholdFilterType::New();
    binaryThresholdFilter->SetInsideValue(insideValue);
    binaryThresholdFilter->SetOutsideValue(outsideValue);
    binaryThresholdFilter->SetLowerThreshold(lowerThreshold);
    binaryThresholdFilter->SetUpperThreshold(upperThreshold);
    binaryThresholdFilter->SetInput(imageLayer->grayImagePointer(0));
    binaryThresholdFilter->Update();

    imageLayer->setGrayImage(1, binaryThresholdFilter->GetOutput());
}
开发者ID:amsantosr,项目名称:QtITKConnection,代码行数:21,代码来源:binarythresholdfilterdialog.cpp

示例4: on_pushButtonApply_clicked

void ThresholdFilterDialog::on_pushButtonApply_clicked()
{
    ImageLayer *imageLayer = ImageLayer::instance();
    int outsideValue = ui->spinBoxOutsideValue->value();
    int threshold = ui->spinBoxThreshold->value();
    int lowerThreshold = ui->spinBoxLowerThreshold->value();
    int upperThreshold = ui->spinBoxUpperThreshold->value();
    thresholdFilter->SetInput(imageLayer->grayImagePointer(0));

    if (ui->radioButtonThresholdBelow->isChecked()) {
        thresholdFilter->SetOutsideValue(outsideValue);
        thresholdFilter->ThresholdBelow(threshold);
    } else if (ui->radioButtonThresholdAbove->isChecked()){
        thresholdFilter->SetOutsideValue(outsideValue);
        thresholdFilter->ThresholdAbove(threshold);
    } else {
        thresholdFilter->SetOutsideValue(outsideValue);
        thresholdFilter->ThresholdOutside(lowerThreshold, upperThreshold);
    }
    thresholdFilter->Update();
    imageLayer->resizeImageVector(2);
    imageLayer->setGrayImage(1, thresholdFilter->GetOutput());
}
开发者ID:amsantosr,项目名称:QtITKConnection,代码行数:23,代码来源:thresholdfilterdialog.cpp


注:本文中的ImageLayer::setGrayImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。