void ColorDeconvolutionFilterPlugin::updateSettingsPanelFromFilter() {
  ColorDeconvolutionFilter<double>* filter = dynamic_cast<ColorDeconvolutionFilter<double>* >(_filter.get());
  if (_settingsPanel && filter) {
    _mutex.lock();
    QDoubleSpinBox* stain1R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1RSpinBox");
    QDoubleSpinBox* stain1G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1GSpinBox");
    QDoubleSpinBox* stain1B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain1BSpinBox");
    QDoubleSpinBox* stain2R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2RSpinBox");
    QDoubleSpinBox* stain2G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2GSpinBox");
    QDoubleSpinBox* stain2B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain2BSpinBox");
    QDoubleSpinBox* stain3R = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3RSpinBox");
    QDoubleSpinBox* stain3G = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3GSpinBox");
    QDoubleSpinBox* stain3B = _settingsPanel->findChild<QDoubleSpinBox*>("Stain3BSpinBox");
    QDoubleSpinBox* rThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("RThreshold");
    QDoubleSpinBox* gThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("GThreshold");
    QDoubleSpinBox* bThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("BThreshold");
    QDoubleSpinBox* globalThreshold = _settingsPanel->findChild<QDoubleSpinBox*>("GlobalThreshold");
    QComboBox* outputStain = _settingsPanel->findChild<QComboBox*>("OutputStainComboBox");
    std::vector<std::vector<double> > stains = filter->getStain();
    std::vector<double> rgbThresholds = filter->getRGBDensityThresholds();
    double gbThreshold = filter->getGlobalDensityThreshold();
    unsigned int outStain = filter->getOutputStain();
    QList<QWidget*> boxes = _settingsPanel->findChildren<QWidget*>();
    foreach(QWidget* sb, boxes) {
      sb->blockSignals(true);
    }