Beispiel #1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    grades = new QList<studentGrade>;
    ui->setupUi(this);
    setupGradeMinimums();
    calculateAverages();
}
void thresholdCalculator::update(ofxCvGrayscaleAdvanced & smallCurrentImg, ofxCvGrayscaleAdvanced & smallMaskImg, ofxCvGrayscaleAdvanced & currentImg,
								 ofRectangle & targetRect, bool isBrightEye) {

	// glint threshold is still rough..
		calculateAverages(smallCurrentImg, smallMaskImg, targetRect);
		calculateMinMaxBrightness(currentImg, targetRect);

	if (isBrightEye){
		glintThresholdForBrightEye = (maxBrightness * 9 + MAX(whiteAvg, pupilAvg)) / 10;
	} else {
		pupilThreshold = ofClamp((pupilAvg + whiteMin * 3) / 4, pupilAvg + 5, 255);
		glintThresholdForDarkEye = (maxBrightness * 3 + whiteAvg) / 4;
	}
}
Beispiel #3
0
void affyPslAndAtlasToBedOld(char *pslFile, char *atlasFile, char *bedOut, char *expRecOut)
/** Main function that does all the work for old-style*/
{
struct hash *bedHash = NULL;
struct affyAtlas *aaList=NULL, *aa=NULL;
struct expRecord *erList=NULL, *er=NULL;
struct bed *bedList=NULL, *bed=NULL;
int expCount = 0;
FILE *erOut = NULL, *bOut=NULL;
warn("loading atlas file");
aaList = affyAtlasLoadAll(atlasFile);
expCount = countExperiments(aaList);
warn("creating list of beds from alignments");
bedList = createBedsFromPsls(pslFile, expCount);
warn("creating hash from list of beds");
bedHash = createBedHash(bedList);
warn("appending experiments to beds in hash");
appendExperiments(bedHash, aaList, &erList);
warn("Running sanity Checks");
checkAllBeds(&bedList, expCount);
warn("%d beds were missing experiments." , missingExpsCount);
warn("%d beds had no experiments.", noExpCount);
warn("Calculating average intensities");
convertIntensitiesToRatios(bedList);
calculateAverages(bedList);

warn("writing expRecords out");
erOut = mustOpen(expRecOut, "w");
for(er = erList; er != NULL; er = er->next)
    expRecordTabOut(er, erOut);
carefulClose(&erOut);

warn("writing beds out");
bOut = mustOpen(bedOut, "w");
for(bed = bedList; bed != NULL; bed = bed->next)
    bedTabOutN(bed, 15, bOut);
carefulClose(&bOut);

warn("cleaning up..");
freeHash(&bedHash);
bedFreeList(&bedList);

warn("Done.");
}
Beispiel #4
0
/*this is the code to analyse the locations of the cetacean mammals*/
void featureTwo() {
    calculateAverages(sightingsHead);

    //print out the sightings
    printf("\n===============================================================");
    printf("\nType   Average Location         All Sightings\n");
    printf("       Lat        Long          Lat        Long\n");
    struct sighting *i = sightingsHead;
    while (i != NULL) {
        if (i->display == 0) {
            printf("%s      %0.6f  %0.6f     ", i->type, i->avgLoc.lat, i->avgLoc.lng);
            int counter = 0;
            while (counter != i->numOfDup) {
                if (counter != 0) {
                    printf("                                ");
                }
                printf("%0.6f  %0.6f\n", i->dupLocs[counter].lat, i->dupLocs[counter].lng);
                counter++;
            }
        }
        i = i->next;
    }
    continueProgram("\nShall we analyse the data to find any PODs? Y/N\n");
}
Beispiel #5
0
void ScoreHelper::doCalculations()
{
    calculateAverages();
    calculateStandardDeviations();
}
Beispiel #6
0
void MainWindow::on_GradeListButton_clicked()
{
    GradeListWindow gradeList(grades);
    gradeList.exec();
    calculateAverages();
}
Beispiel #7
0
void MainWindow::on_SetGradeCurveButton_clicked() {
    SetCurveWindow setCurve(gradeMinimums);
    setCurve.exec();
    calculateAverages();
}
Beispiel #8
0
void MainWindow::on_AddGradeButton_clicked() {
    AddGradeWindow addGrade(grades);
    addGrade.exec();
    calculateAverages();
}