Logo Search packages:      
Sourcecode: caret version File versions  Download package

GuiMapFmriMetricInfo::GuiMapFmriMetricInfo ( const GuiMapFmriMappingSet surfaceInfo,
const GuiMapFmriVolume volumeInfo,
const int  volumeIndexIn,
const int  subVolumeIndexIn 
)

Constructor.

Constructor.

Definition at line 37 of file GuiMapFmriMetricInfo.cxx.

References FileUtilities::basename(), GuiMapFmriMappingSet::getDoAverageFiducialFileFlag(), GuiMapFmriVolume::getFileComment(), GuiMapFmriMappingSet::getMappingCaretSurfaces(), GuiMapFmriMappingSet::getMappingCoordFileNames(), GuiMapFmriMappingSet::getMappingType(), GuiMapFmriMappingSet::getStructureForColumnNaming(), GuiMapFmriVolume::getSubVolumeName(), GuiMapFmriVolume::getThresholds(), StringUtilities::makeLowerCase(), metricAverageFiducialCoordColumnName, metricAverageFiducialCoordColumnNameRowNumber, metricAverageFiducialCoordColumnNegativeThreshold, metricAverageFiducialCoordColumnPositiveThreshold, metricAverageFiducialCoordComment, metricAverageOfAllColumnName, metricAverageOfAllColumnNameRowNumber, metricAverageOfAllColumnNegativeThreshold, metricAverageOfAllColumnPositiveThreshold, metricAverageOfAllComment, metricColumnComments, metricColumnNames, metricColumnNamesRowNumber, metricColumnNegativeThreshold, metricColumnPositiveThreshold, metricMaxValueColumnName, metricMaxValueColumnNameRowNumber, metricMaxValueColumnNegativeThreshold, metricMaxValueColumnPositiveThreshold, metricMaxValueComment, metricMinValueColumnName, metricMinValueColumnNameRowNumber, metricMinValueColumnNegativeThreshold, metricMinValueColumnPositiveThreshold, metricMinValueComment, metricMostCommonExcludeUnidentifiedValueColumnName, metricMostCommonExcludeUnidentifiedValueColumnNameRowNumber, metricMostCommonExcludeUnidentifiedValueColumnNegativeThreshold, metricMostCommonExcludeUnidentifiedValueColumnPositiveThreshold, metricMostCommonExcludeUnidentifiedValueComment, metricMostCommonValueColumnName, metricMostCommonValueColumnNameRowNumber, metricMostCommonValueColumnNegativeThreshold, metricMostCommonValueColumnPositiveThreshold, metricMostCommonValueComment, metricStdDevColumnName, metricStdDevColumnNameRowNumber, metricStdDevColumnNegativeThreshold, metricStdDevColumnPositiveThreshold, metricStdDevComment, metricStdErrorColumnName, metricStdErrorColumnNameRowNumber, metricStdErrorColumnNegativeThreshold, metricStdErrorColumnPositiveThreshold, metricStdErrorComment, subVolumeIndex, surfaceNameForMetricColumn, and volumeIndex.

{
   volumeIndex = volumeIndexIn;
   subVolumeIndex = subVolumeIndexIn;

   QString volumeComment;
   if (volumeInfo != NULL) {
      volumeComment = volumeInfo->getFileComment();
      if (volumeComment.isEmpty() == false) {
         QString s("Volume Comment: ");
         s.append(volumeComment);
         s.append("; ");
         volumeComment = s;
      }
   }
   
   switch (surfaceInfo->getMappingType()) {
      case GuiMapFmriMappingSet::MAPPING_TYPE_NONE:
         return;
         break;
      case GuiMapFmriMappingSet::MAPPING_TYPE_WITH_CARET_SURFACES:
         {
            std::vector<BrainModelSurface*> surfaces;
            surfaceInfo->getMappingCaretSurfaces(surfaces);
            for (unsigned int i = 0; i < surfaces.size(); i++) {
               surfaceNameForMetricColumn.push_back(surfaces[i]->getDescriptiveName());
            }
         }
         break;
      case GuiMapFmriMappingSet::MAPPING_TYPE_WITH_SPEC_FILES:
         {
            std::vector<QString> names;
            surfaceInfo->getMappingCoordFileNames(names);
            for (unsigned int i = 0; i < names.size(); i++) {
               surfaceNameForMetricColumn.push_back(FileUtilities::basename(names[i]));
            }
            
            if (surfaceInfo->getDoAverageFiducialFileFlag()) {
               const QString structName = surfaceInfo->getStructureForColumnNaming();
               
               metricAverageFiducialCoordColumnName = "AFM ";
               if (structName.isEmpty() == false) {
                  metricAverageFiducialCoordColumnName.append(structName);
               }
               metricAverageFiducialCoordColumnName.append(" - ");
               //metricAverageFiducialCoordColumnName.append(surfaceInfo->getAverageFiducialCoordFileName());
               metricAverageFiducialCoordColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
               metricAverageFiducialCoordColumnNameRowNumber = -1;
               metricAverageFiducialCoordComment = "Average Fiducial Mapping (AFM); ";
               metricAverageFiducialCoordComment.append(volumeComment);
               metricAverageFiducialCoordColumnNegativeThreshold = 0.0;
               metricAverageFiducialCoordColumnPositiveThreshold = 0.0;
               float negThresh = 0.0, posThresh = 0.0;
               volumeInfo->getThresholds(negThresh, posThresh);
               metricAverageFiducialCoordColumnNegativeThreshold = negThresh;
               metricAverageFiducialCoordColumnPositiveThreshold = posThresh;
            }
         }
         break;
   }
   
   float negThresh, posThresh;
   volumeInfo->getThresholds(negThresh, posThresh);

   for (unsigned int i = 0; i < surfaceNameForMetricColumn.size(); i++) {
      QString prefix;
      if (surfaceNameForMetricColumn.size() > 1) {
         QString s(StringUtilities::makeLowerCase(surfaceNameForMetricColumn[i]));
         const int caseNameIndex = s.indexOf("case");
         if (caseNameIndex != -1) {
            int periodCount = 0;
            for (int j = caseNameIndex; j < s.length(); j++) {
               if (s[j] == '.') {
                  periodCount++;
                  if (periodCount == 2) {
                     prefix = surfaceNameForMetricColumn[i].mid(caseNameIndex,
                                                        (j - caseNameIndex));
                     break;
                  }
               }
            }
         }
      }
      QString columnName;
      if (prefix.isEmpty() == false) {
         columnName.append("Map to ");
         columnName.append(prefix);
         columnName.append(" - ");
      }
      columnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
      metricColumnNames.push_back(columnName);
      metricColumnNegativeThreshold.push_back(negThresh);
      metricColumnPositiveThreshold.push_back(posThresh);
      metricColumnComments.push_back("");
      metricColumnNamesRowNumber.push_back(-1);
   }
   
   QString allSurfaceNames;
   for (unsigned int i = 0; i < surfaceNameForMetricColumn.size(); i++) {
      allSurfaceNames.append(surfaceNameForMetricColumn[i]);
      allSurfaceNames.append("  ");
   }

   const QString structName = surfaceInfo->getStructureForColumnNaming();

   metricAverageOfAllColumnName = "MFM ";
   if (structName.isEmpty() == false) {
      metricAverageOfAllColumnName.append(structName);
   }
   metricAverageOfAllColumnName.append(" - ");
   metricAverageOfAllColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricAverageOfAllComment.append("Multi-Fiducial Mapping (MFM); ");
   metricAverageOfAllComment.append(volumeComment);
   metricAverageOfAllComment.append("MFM using surface files: ");
   metricAverageOfAllComment.append(allSurfaceNames);
   metricAverageOfAllColumnNameRowNumber = -1;
   metricAverageOfAllColumnNegativeThreshold = negThresh;
   metricAverageOfAllColumnPositiveThreshold = posThresh;
   
   metricStdDevColumnName = "STANDARD DEVIATION (MFM) - ";
   metricStdDevColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricStdDevComment.append("Using surface files: ");
   metricStdDevComment.append(allSurfaceNames);
   metricStdDevColumnNameRowNumber = -1;
   metricStdDevColumnNegativeThreshold = 0.0; //negThresh;
   metricStdDevColumnPositiveThreshold = 0.0; //posThresh;
   
   metricStdErrorColumnName = "STANDARD ERROR (MFM) - ";
   metricStdErrorColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricStdErrorComment.append("Using surface files: ");
   metricStdErrorComment.append(allSurfaceNames);
   metricStdErrorColumnNameRowNumber = -1;
   metricStdErrorColumnNegativeThreshold = 0.0; //negThresh;
   metricStdErrorColumnPositiveThreshold = 0.0; //posThresh;

   metricMinValueColumnName = "MINIMUM (MFM) - ";
   metricMinValueColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricMinValueComment.append("Using surface files: ");
   metricMinValueComment.append(allSurfaceNames);
   metricMinValueColumnNameRowNumber = -1;
   metricMinValueColumnNegativeThreshold = 0.0; //negThresh;
   metricMinValueColumnPositiveThreshold = 0.0; //posThresh;

   metricMaxValueColumnName = "MAXIMUM (MFM) - ";
   metricMaxValueColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricMaxValueComment.append("Using surface files: ");
   metricMaxValueComment.append(allSurfaceNames);
   metricMaxValueColumnNameRowNumber = -1;
   metricMaxValueColumnNegativeThreshold = 0.0; //negThresh;
   metricMaxValueColumnPositiveThreshold = 0.0; //posThresh;

   metricMostCommonValueColumnName = "MFM (Most Common) ";
   if (structName.isEmpty() == false) {
      metricMostCommonValueColumnName.append(structName);
   }
   metricMostCommonValueColumnName.append(" - ");
   metricMostCommonValueColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricMostCommonValueComment.append("Multi-Fiducial Most Common Mapping (MFM); ");
   metricMostCommonValueComment.append(volumeComment);
   metricMostCommonValueComment.append("MFM using surface files: ");
   metricMostCommonValueComment.append(allSurfaceNames);
   metricMostCommonValueColumnNameRowNumber = -1;
   metricMostCommonValueColumnNegativeThreshold = 0.0; //negThresh;
   metricMostCommonValueColumnPositiveThreshold = 0.0; //posThresh;   

   metricMostCommonExcludeUnidentifiedValueColumnName = "MFM (Most Common Exclude No ID) ";
   if (structName.isEmpty() == false) {
      metricMostCommonExcludeUnidentifiedValueColumnName.append(structName);
   }
   metricMostCommonExcludeUnidentifiedValueColumnName.append(" - ");
   metricMostCommonExcludeUnidentifiedValueColumnName.append(volumeInfo->getSubVolumeName(subVolumeIndex));
   metricMostCommonExcludeUnidentifiedValueComment.append("Multi-Fiducial Most Common Exclude No ID Mapping (MFM); ");
   metricMostCommonExcludeUnidentifiedValueComment.append(volumeComment);
   metricMostCommonExcludeUnidentifiedValueComment.append("MFM using surface files: ");
   metricMostCommonExcludeUnidentifiedValueComment.append(allSurfaceNames);
   metricMostCommonExcludeUnidentifiedValueColumnNameRowNumber = -1;
   metricMostCommonExcludeUnidentifiedValueColumnNegativeThreshold = 0.0; //negThresh;
   metricMostCommonExcludeUnidentifiedValueColumnPositiveThreshold = 0.0; //posThresh;   
}      


Generated by  Doxygen 1.6.0   Back to index