Example #1
0
// assuming that two mask files are the same, which is the full brain mask
void Scheduler(int me, int nprocs, int step, RawMatrix** r_matrices, int taskType, Trial* trials, int nTrials, int nHolds, int nSubs, int nFolds, const char* output_file, const char* mask_file1, const char* mask_file2)
{
    RawMatrix** masked_matrices1=NULL;
    RawMatrix** masked_matrices2=NULL;
    if (mask_file1!=NULL)
    {
        masked_matrices1 = GetMaskedMatrices(r_matrices, nSubs, mask_file1);
        //MatrixPermutation(masked_matrices1, nSubs);
    }
    else
        masked_matrices1 = r_matrices;
    if (mask_file2!=NULL)
    {
        masked_matrices2 = GetMaskedMatrices(r_matrices, nSubs, mask_file2);
        //MatrixPermutation(masked_matrices2, nSubs);
    }
    else
        masked_matrices2 = r_matrices;
    if (me == 0)
    {
        int row1 = masked_matrices1[0]->row;
        int row2 = masked_matrices2[0]->row;
        cout<<"#voxels for mask 1: "<<row1<<endl;
        cout<<"#voxels for mask 2: "<<row2<<endl;
        DoMaster(nprocs, step, row1, output_file, mask_file1);
    }
    else
    {
        DoSlave(me, 0, masked_matrices1, masked_matrices2, taskType, trials, nTrials, nHolds, nSubs, nFolds);  // 0 for master id
    }
}
Example #2
0
void DoTap(double Dist, double Rate, double TPI)
{
	// Tap down
	MoveRelAtVel(SPINDLE_AXIS, Dist*TPI*CNTS_PER_REV, Rate*TPI*CNTS_PER_REV);
	
	while(!CheckDone(SPINDLE_AXIS))
		DoSlave();
}