// load a volume for computation
void emotionRoiProcessing::loadVolume(studyParams &vdb, volume<float> &v, int index)
{
	char processedFile[200], prefix[BUFF_SIZE], tempVolume[BUFF_SIZE];
	if (0)
	{
		// gets the motion corrected and gaussian file
		vdb.getMCGVolumeName(processedFile, index);
		read_volume(v, string(processedFile));
	}
	else
	{
		// making the activation volume for viewing
		vdb.getFinalVolumeFormat(prefix);
		vdb.setActivationFile(index);
		estimateActivation(index, index, vdb.slidingWindowSize, prefix, vdb.maskFile, vdb.activationFile);

		// gets the motion corrected and gaussian file and calculates the mean with the last n volumes (n = sliding window size)
		sprintf(tempVolume, "%s%s", vdb.outputDir, "temp.nii");
		vdb.getMCGVolumeFormat(prefix);
		estimateActivation(index, index, vdb.slidingWindowSize, prefix, tempVolume);
		read_volume(v, string(tempVolume));
		if (fileExists(tempVolume))
			remove(tempVolume);
	}

}
Example #2
0
// plug in test function
DLLExport testSVM(studyParams &vdb, int index, float &classnum, float &projection, void * &userData)
{
   char prefix[BUFF_SIZE];
   SVMProcessing *svmProcessingVar = (SVMProcessing *) userData;

   vdb.getFinalVolumeFormat(prefix);

   fprintf(stderr, "Generating activation file.\n");
   vdb.setActivationFile(index);

   estimateActivation(index, index, vdb.slidingWindowSize, prefix, vdb.maskFile, vdb.activationFile);
   
   fprintf(stderr, "Classifying.\n");
   svmProcessingVar->test(index, vdb.activationFile, classnum, projection);
   
   return 1;
}