// ------------------------------------------------------------------------
void MainWindow::setUpSignals()
{
	// image control slots
	connect(this->imageList->getImageList(), SIGNAL(itemSelectionChanged()),
		this, SLOT(imageSelectionChanged()));
	connect(this->zSlider, SIGNAL(valueChanged(int)),
		this, SLOT(sliderSelectionChanged()));
	connect(this->tSlider, SIGNAL(valueChanged(int)),
		this, SLOT(sliderSelectionChanged()));

	// button slots 
	connect(this->addLineButton, SIGNAL(pressed()), this, SLOT(addLinePressed()));
	connect(this->removeLineButton, SIGNAL(pressed()), this, SLOT(removeLinePressed()));
	connect(this->propagateLineButton, SIGNAL(pressed()), this, SLOT(propagateLinePressed()));
	connect(this->lockLineButton, SIGNAL(pressed()), this, SLOT(lockLine()));
	connect(this->lineList->getWidget(), SIGNAL(itemSelectionChanged()), 
			this, SLOT(lineChanged()));
	connect(this->controls, SIGNAL(rightPressed()), this, SLOT(tSliderRight()));
	connect(this->controls, SIGNAL(leftPressed()), this, SLOT(tSliderLeft()));
	connect(this->controls, SIGNAL(lockPressed()), this, SLOT(lockLine()));
	connect(this->controls, SIGNAL(propagatePressed()), this, SLOT(propagateLinePressed()));
	connect(this->imageTypeButton, SIGNAL(pressed()), this, SLOT(imageTypePressed()));

	// connect the load and save 
	connect(this->saveAction, SIGNAL(triggered()), this, SLOT(saveActionPressed()));
	connect(this->newAction, SIGNAL(triggered()), this, SLOT(newActionPressed()));
	connect(this->loadAction, SIGNAL(triggered()), this, SLOT(loadActionPressed()));
	connect(this->saveAsAction, SIGNAL(triggered()), this, SLOT(saveAsActionPressed()));
	connect(this->processDicomAction, SIGNAL(triggered()), this, SLOT(processDicomPressed()));
	connect(this->exportVideos, SIGNAL(triggered()), this, SLOT(exportVideosPressed()));
}
/* Function that iterates through the matrix
 * Each thread locks the lines it's going to process
 * Calls the processCell funtion on each cell
 * board, the current board
 */
void iterateBoard(board_t* board){
	int heightLength = board->height + 1;
	int widthLength = board->width + 1;
	size_t i, j;
#pragma omp parallel private(i,j) shared(board)
	{
#pragma omp for schedule(static, 1)

	for (i = 0; i < heightLength; ++i) {
		lockLine(i, board);
	}
#pragma omp barrier

#pragma omp for schedule(static, 1)
	for (i = 0; i < heightLength; ++i) {
		for (j = 0; j < widthLength; ++j) {
			processCell(i, j, board);
		}
	}
	}
}