本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}