Exemplo n.º 1
0
MRFRegistrationDisplay::MRFRegistrationDisplay(QWidget *parent)
: QDialog(parent)
{
	// set some defualt values
	this->gridSpacing = 6.0;
	this->xGridOrigin = 110;
	this->yGridOrigin = 70;

	this->xGridSize = 75;
	this->yGridSize = 75;

	this->resolutionLevels = 3;

	this->labelSteps = 5;
	this->labelInc = 0.33;

	this->maxDisplacement = this->gridSpacing * 0.4;
	this->useSparseSampling = true;
	this->optimiserIterations = 5;
	this->regularisationAmount = 0.1;
	this->metricType = NCC;

	this->mitkImageSeries = NULL;



	this->setupUi(this);

	QFont courier("Courier", 12, QFont::Normal);
	this->registrationTextOutput->setFont(courier);

	connect(this->startRegistrationButton, SIGNAL(pressed()), this, SLOT(startRegistration()));
}
Exemplo n.º 2
0
QEquipmentDialog:: QEquipmentDialog() {
    setCursor(Qt::PointingHandCursor);
    QVBoxLayout* layout = new QVBoxLayout(this);
    listWidget = new QListWidget(this);
    QFont courier("Courier", 12);
    listWidget->setFont(courier);
    layout->addWidget(listWidget);
    for (int i=0; i<equipmentTypesCount; i++) {
        listWidget->addItem("");
    }
    connect(listWidget, SIGNAL(clicked(const QModelIndex&)), this, SLOT(onListClick(const QModelIndex&)));
}
Exemplo n.º 3
0
Console::Console(QWidget *parent)
    : QPlainTextEdit(parent)
{
    setWindowTitle("Console");
    resize(800, 600);

    setUndoRedoEnabled(false);
    appendPlainText(QString(""));

    QFont courier("Courier");
    setFont(courier);
}
Exemplo n.º 4
0
void compressFile(string & file_name, string const & ref_file_name, const int num_workers, 
	bool seq_only, bool discard_secondary_alignments) {
	int dictionary_size = 1<<23;
	int match_len_limit = 36; // equivalent to -6 option

	// const int num_workers = num_threads - 1;//max(2, num_threads - 1); // one for parsing
	const int slots_per_worker = 20;
	const int num_slots =
		( ( num_workers > 1 ) ? num_workers * slots_per_worker : 1 );

	Packet_courier courier(num_workers, num_slots);

	// open output streams
	Output_args output_args = initializeOutputStreams(file_name, seq_only, discard_secondary_alignments, &courier);

	// cerr << "Initialized output streams" << endl;

	// from plzip library implementation
	// initialize parsing thread -- pass courier, FDs for output
	Parser_args parser_args;
	parser_args.output = output_args;
	parser_args.file_name = file_name;
	parser_args.ref_file_name = ref_file_name;
	parser_args.courier = &courier;
	parser_args.seq_only = seq_only;
	parser_args.discard_secondary_alignments = discard_secondary_alignments;

	pthread_t * parser_thread = new pthread_t();
	int errcode = pthread_create( parser_thread, 0, parseSAM, &parser_args );
	if ( errcode ) { 
		show_error( "Can't create parser thread", errcode ); cleanup_and_fail(); 
	}

	// initialize worker threads
	Worker_arg worker_arg;
	worker_arg.courier = &courier;
	worker_arg.dictionary_size = dictionary_size;
	worker_arg.match_len_limit = match_len_limit;

	pthread_t * worker_threads = new( std::nothrow ) pthread_t[num_workers];
	if( !worker_threads ) { 
		cleanup_and_fail(); 
	}
	for( int i = 0; i < num_workers; ++i ) {
		errcode = pthread_create( worker_threads + i, 0, cworker, &worker_arg );
		if( errcode ) { 
			show_error( "Can't create worker threads", errcode ); cleanup_and_fail(); 
		}
	}

	// cerr << "launched threads" << endl;

	// concurrently wait for threads to return compressed packets; write them to disk
	muxer(courier);

	// join worker threads
	for( int i = num_workers - 1; i >= 0; --i ) {
		errcode = pthread_join( worker_threads[i], 0 );
		if( errcode ) { 
			show_error( "Can't join worker threads", errcode ); cleanup_and_fail(); 
		}
		else {
			// cerr << "thread " << i << " joined" << endl;
		}
	}
	delete[] worker_threads;

	// join the parser thread
	errcode = pthread_join( *parser_thread, 0 );
	if( errcode ) {
		show_error( "Can't join parser thread", errcode ); cleanup_and_fail(); 
	}

	// destructor in OutputBuffer will close file output streams
};