return kernelManager->getOutlinesNameAtInstant(tempVector);
}
-void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ){
+void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ)
+{
int maxContourGroup = 0;
ContourExtractData *contourextractdata = new ContourExtractData();
//_staticTextInformation->SetLabel(tmpString);
//Extraction data from contours of each slice
- contourextractdata->SetZtoBeAnalys( z);
+ contourextractdata->SetZtoBeAnalys(z);
tempVector[1]=z;
Instant instant(&tempVector);
delete contourextractdata;
}
-void wxContourMainFrame::onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup){
- SaveValuesXYZ( directory , namefile, typeContourGroup );
-
- vtkImageData* mask, *value;
- this->getMaskValue(mask, value, typeContourGroup);
- this->SaveImageResult( directory , namefile, mask, value);
+void wxContourMainFrame::onSaveResults(std::string directory,std::string namefile, std::string filename,
+ int typeContourGroup, bool XYZValues, bool contourImage, bool statistics)
+{
+ if (XYZValues)
+ {
+ SaveValuesXYZ( directory , namefile, typeContourGroup );
+ }
+ if (contourImage)
+ {
+ vtkImageData * mask;
+ vtkImageData * value;
+ this->getMaskValue(&mask, &value, typeContourGroup);
+ this->SaveImageResult( directory , namefile, mask, value);
+ }
- FILE *pFile=fopen(filename.c_str(),"w+");
+ if (statistics)
+ {
+ FILE *pFile=fopen(filename.c_str(),"w+");
- int sizeZ = _theViewPanel->GetImageDataSizeZ();
+ int sizeZ = _theViewPanel->GetImageDataSizeZ();
- wxString tmpString;
- int i,j,maxX,maxY=sizeZ;
- maxX= interfMainPanel::getInstance()->getNumberColsInformationPanel();//this->_grid->GetNumberCols();
+ wxString tmpString;
+ int i,j,maxX,maxY=sizeZ;
+ maxX= interfMainPanel::getInstance()->getNumberColsInformationPanel();//this->_grid->GetNumberCols();
- int iTitle,sizeTitle = (maxX / _numberOfVariablesStatistics);
- for ( iTitle=0; iTitle<sizeTitle ; iTitle++)
- {
- // fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle,tmpString.c_str() );
- fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle );
- }
- fprintf(pFile,"\n" );
+ int iTitle,sizeTitle = (maxX / _numberOfVariablesStatistics);
+ for ( iTitle=0; iTitle<sizeTitle ; iTitle++)
+ {
+ // fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle,tmpString.c_str() );
+ fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle );
+ }
+ fprintf(pFile,"\n" );
- for ( j=0; j<maxY ; j++)
- {
- fprintf(pFile,"%d\t" , j );
- for (i=0 ; i<maxX ; i++){
- tmpString = interfMainPanel::getInstance()->getCellValue(j, i);//_grid->GetCellValue( j , i );
- fprintf(pFile,"%s\t" , (const char *)(tmpString.mb_str()) );
- } // for i
- fprintf(pFile,"\n" );
- } // for j
+ for ( j=0; j<maxY ; j++)
+ {
+ fprintf(pFile,"%d\t" , j );
+ for (i=0 ; i<maxX ; i++){
+ tmpString = interfMainPanel::getInstance()->getCellValue(j, i);//_grid->GetCellValue( j , i );
+ fprintf(pFile,"%s\t" , (const char *)(tmpString.mb_str()) );
+ } // for i
+ fprintf(pFile,"\n" );
+ } // for j
- fclose(pFile);
+ fclose(pFile);
+ }
}
void wxContourMainFrame::SaveValuesXYZ(std::string directory,std::string namefile,int typeContourGroup)
delete contourextractdata;
}
-void wxContourMainFrame::getMaskValue(vtkImageData* mask,vtkImageData* value,int typeContourGroup){
+void wxContourMainFrame::getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup){
wxBusyCursor wait;
ContourExtractData *contourextractdata = new ContourExtractData( true );
//int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
} // for iContourGroup
} // for z
- value = contourextractdata->GetVtkImageValueResult();
- mask = contourextractdata->GetVtkImageMaskResult();
+ (*value) = contourextractdata->GetVtkImageValueResult();
+ (*mask) = contourextractdata->GetVtkImageMaskResult();
delete contourextractdata;
}