X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxContourMainFrame.cxx;h=bb5f01f8eab6ec0cf64e949ffde4294ad90b3064;hb=cbe3176d12a4163a8ec9bfe62cd62ceba115090e;hp=34182bdfeca0d59f525d589d6bfb145e2f30dcd4;hpb=6c03e0da23ae573ca08a0cf362219e944cf7d50a;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 34182bd..bb5f01f 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -2093,7 +2093,10 @@ void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int sel void wxContourMainFrame::onSaveResults(std::string directory,std::string namefile, std::string filename, int typeContourGroup){ SaveValuesXYZ( directory , namefile, typeContourGroup ); - SaveImageResult( directory , namefile, typeContourGroup); + + vtkImageData* mask, *value; + this->getMaskValue(mask, value, typeContourGroup); + this->SaveImageResult( directory , namefile, mask, value); FILE *pFile=fopen(filename.c_str(),"w+"); @@ -2253,8 +2256,7 @@ void wxContourMainFrame::SaveValuesXYZ(std::string directory,std::string namefil delete contourextractdata; } -void wxContourMainFrame::SaveImageResult(std::string directory,std::string namefile, int typeContourGroup) -{ +void wxContourMainFrame::getMaskValue(vtkImageData* mask,vtkImageData* value,int typeContourGroup){ wxBusyCursor wait; ContourExtractData *contourextractdata = new ContourExtractData( true ); //int typeContourGroup = this->_radiolstboxContourGroup->GetSelection(); @@ -2333,20 +2335,19 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef } contourextractdata->SetLstManualContourModel( lstManConModTmp ); - - -// for (ii=0 ; iigetModel() ); -// } -// contourextractdata->SetLstManualContourModel( lstManConMod ); - contourextractdata->CalculateImageResult(); // with actual Z } // for iContourGroup } // for z + value = contourextractdata->GetVtkImageValueResult(); + mask = contourextractdata->GetVtkImageMaskResult(); + delete contourextractdata; +} + +void wxContourMainFrame::SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value) +{ + std::string temp = directory + "/" + namefile + "-Value.mhd"; wxString filename = crea::std2wx(temp); @@ -2360,7 +2361,7 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef // Image Value vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( ); - writerValueImage->SetInput( contourextractdata->GetVtkImageValueResult() ); + writerValueImage->SetInput( value ); writerValueImage->SetFileName( (const char *)filename.mb_str() ); writerValueImage->SetFileDimensionality( 3 ); writerValueImage->Write( ); @@ -2379,15 +2380,17 @@ void wxContourMainFrame::SaveImageResult(std::string directory,std::string namef filename.append(_T("-Mask.mhd"));*/ vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( ); - writerMaskImage->SetInput( contourextractdata->GetVtkImageMaskResult() ); + writerMaskImage->SetInput( mask ); writerMaskImage->SetFileName( (const char *)filename.mb_str() ); writerMaskImage->SetFileDimensionality( 3 ); writerMaskImage->Write( ); interfMainPanel::getInstance()->setStringInfoPanel( _T("") ); - delete contourextractdata; + } + + void wxContourMainFrame::onChangeInstantInstantPanel(std::string name,int value, int minshow, int maxshow){ if( name.compare( _theViewPanel->getVerticalConceptName() ) == 0){ _theViewPanel->setActualVertical( value);