X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxContourMainFrame.cxx;h=4261ef1ee6b6c15d9e272d986921fa462ecf9ae8;hb=ae4e82199b7c2de2c149f84be5a10edcce7596e0;hp=80caa583baf24919e62ffee61709d9b9a1f01d11;hpb=60b52441cfaace2c530f9d46ce959b84162e674e;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 80caa58..4261ef1 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -2054,7 +2054,8 @@ std::vector wxContourMainFrame::getOutlinesName(int slide){ 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(); @@ -2126,7 +2127,7 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel //_staticTextInformation->SetLabel(tmpString); //Extraction data from contours of each slice - contourextractdata->SetZtoBeAnalys( z); + contourextractdata->SetZtoBeAnalys(z); tempVector[1]=z; Instant instant(&tempVector); @@ -2245,43 +2246,54 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel 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; iTitlegetCellValue(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; jgetCellValue(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) @@ -2410,7 +2422,7 @@ void wxContourMainFrame::SaveValuesXYZ(std::string directory,std::string namefil 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(); @@ -2494,8 +2506,8 @@ void wxContourMainFrame::getMaskValue(vtkImageData* mask,vtkImageData* value,int } // for iContourGroup } // for z - value = contourextractdata->GetVtkImageValueResult(); - mask = contourextractdata->GetVtkImageMaskResult(); + (*value) = contourextractdata->GetVtkImageValueResult(); + (*mask) = contourextractdata->GetVtkImageMaskResult(); delete contourextractdata; }