Exemplo n.º 1
0
void MainWindow::sum()
{
	QString path = QFileDialog::getOpenFileName(this,"Image to make the operation ..","",tr("Images (*.dcm *.pgm)"));

    if(path==""){
		QMessageBox::information(this,"Information","You haven't selected any file image.");
	}
	else{
	
		if(path.contains(".dcm")){
		
			MedicalImages mi(path.toStdString().c_str());
		
			path = path.replace(".dcm",".pgm");
		
			mi.writeToPPM(path.toStdString().c_str());
		}
		
		P2 res;
		res.load(path.toStdString().c_str());
		
		image = applyAdd(image,res);
		
		setImages();
	}
}
Exemplo n.º 2
0
//This override is needed because nodes try to add their inputs, but we override where input connections come from.
//In addition, we have no input buffers.
void SubgraphNode::tick() {
	last_processed = simulation->getTickCount();
	//Zeroing the output buffers will silence our output.
	if(getState() == Lav_NODESTATE_PAUSED) {
		zeroOutputBuffers();
		return;
	}
	tickProperties();
	zeroInputBuffers();
	is_processing = true;
	num_input_buffers = input_buffers.size();
	num_output_buffers = output_buffers.size();
	//No process call, subgraphs  don't support it.
	applyMul();
	applyAdd();
	is_processing = false;
}
Exemplo n.º 3
0
// apply but do not close
void MConfig::on_buttonApply_clicked() {
  if (!buttonApply->isEnabled()) {
    return;
  }

  int i = tabWidget->currentIndex();
  switch (i) {

    case 1:
      setCursor(QCursor(Qt::WaitCursor));
      applyRestore();
      setCursor(QCursor(Qt::ArrowCursor));
      buttonApply->setEnabled(false);
      break;

    case 2:
      applyDesktop();
      buttonApply->setEnabled(false);
      break;

    case 3:
      setCursor(QCursor(Qt::WaitCursor));
      applyGroup();
      setCursor(QCursor(Qt::ArrowCursor));
      buttonApply->setEnabled(false);
      break;

    case 4:
      setCursor(QCursor(Qt::WaitCursor));
      applyMembership();
      setCursor(QCursor(Qt::ArrowCursor));
      break;

    default:
      setCursor(QCursor(Qt::WaitCursor));
      if (addUserBox->isEnabled()) {
        applyAdd();
      } else {
        applyDelete();
        buttonApply->setEnabled(false);
      }
      setCursor(QCursor(Qt::ArrowCursor));
      break;
  }
}
Exemplo n.º 4
0
void Node::tick() {
	last_processed = simulation->getTickCount();
	zeroOutputBuffers(); //we always do this because sometimes we're not going to actually do anything else.
	if(getState() == Lav_NODESTATE_PAUSED) return; //nothing to do, for we are paused.
	tickProperties();
	//willProcessParents is handled by the planner.
	zeroInputBuffers();
	//Collect parent outputs onto ours.
	//by using the getInputConnection and getInputConnectionCount functions, we allow subgraphs to override effectively.
	bool needsMixing = getProperty(Lav_NODE_CHANNEL_INTERPRETATION).getIntValue()==Lav_CHANNEL_INTERPRETATION_SPEAKERS;
	for(int i = 0; i < getInputConnectionCount(); i++) {
		getInputConnection(i)->add(needsMixing);
	}
	is_processing = true;
	num_input_buffers = input_buffers.size();
	num_output_buffers = output_buffers.size();
	process();
	applyMul();
	applyAdd();
	is_processing = false;
}