コード例 #1
0
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
0
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
0
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
0
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());
}