return wxContourMainFrame::getInstance()->getOutlinesName(slide);
}
-void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ){
- wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ);
+void interfMainPanel::onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax){
+ wxContourMainFrame::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);
}
void interfMainPanel::setStringInfoPanel(wxString tmpString){
}
void interfMainPanel::onSaveResults(std::string directory,std::string namefile, std::string filename,
- int typeContourGroup, bool XYZValues, bool contourImage, bool statistics)
+ int typeContourGroup, int selection, int minZ, int maxZ ,bool XYZValues, bool contourImage, bool statistics)
{
wxContourMainFrame::getInstance()->onSaveResults(directory, namefile, filename,
- typeContourGroup, XYZValues, contourImage, statistics);
+ typeContourGroup, selection, minZ,maxZ, XYZValues, contourImage, statistics);
}
wxString interfMainPanel::getCellValue(int j,int i){
showPanel(thresholdPanel);
}
-void interfMainPanel::ShowResultImages(int typeContourGroup)
+void interfMainPanel::ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ)
{
- wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup);
+ wxContourMainFrame::getInstance()->ShowResultImages(typeContourGroup, selection, minZ, maxZ);
}
std::vector<std::string> getOutlinesName(int slide);
- void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ);
+ void onInformationContourLabels(int typeContourGroup,int selection,int minZ,int maxZ,int grayRangeMin,int grayRangeMax);
void setStringInfoPanel(wxString tmpString);
void setColLableInfoPanel(int tmpIntB ,wxString tmpTitleString);
void onSaveResults(std::string directory,std::string namefile, std::string filename,
- int typeContourGroup, bool XYZValues, bool contourImage, bool statistics);
+ int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
wxString getCellValue(int j,int i);
virtual bool Show(bool show);
- void ShowResultImages(int typeContourGroup);
+ void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ);
private:
wxString lstOptions[4];
lstOptions[0]=_T("Current Slice");
lstOptions[1]=_T("Range Slices");
- lstOptions[2]=_T("All Slices");
- _informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS);
+// lstOptions[2]=_T("All Slices");
+ _informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS);
wxString lstOptContOperation[5];
lstOptContOperation[0]=_T("AND");
wxPoint( 0, 0 ),
wxSize( 200, 500 ) );
- int i,gridCol=10,gridRow=sizeZ;
+ int i,gridCol=10,gridRow=sizeZ+2;
_grid->CreateGrid( 0, 0 );
_grid->AppendRows(gridRow);
_grid->AppendCols(gridCol);
void interfInformationPanel::onShowResultImages(wxCommandEvent& event)
{
// onExtractInformation( event );
+ int selection = _informationRadiobox->GetSelection();
+ int minZ = _mbarrangeSliceInformation->GetStart();
+ int maxZ = _mbarrangeSliceInformation->GetEnd();
int typeContourGroup = _radiolstboxContourGroup->GetSelection();
- interfMainPanel::getInstance()->ShowResultImages( typeContourGroup );
+ interfMainPanel::getInstance()->ShowResultImages( typeContourGroup , selection, minZ, maxZ);
}
_grid->ClearGrid();
int typeContourGroup = this->_radiolstboxContourGroup->GetSelection();
- int selection = _informationRadiobox->GetSelection();
- int minZ = _mbarrangeSliceInformation->GetStart();
- int maxZ = _mbarrangeSliceInformation->GetEnd();
-
- interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ);
+ int selection = _informationRadiobox->GetSelection();
+ int minZ = _mbarrangeSliceInformation->GetStart();
+ int maxZ = _mbarrangeSliceInformation->GetEnd();
+ int grayRangeMin = _mbarrangeRangeInformation->GetStart();
+ int grayRangeMax = _mbarrangeRangeInformation->GetEnd();
+
+ interfMainPanel::getInstance()->onInformationContourLabels(typeContourGroup, selection, minZ, maxZ,grayRangeMin,grayRangeMax);
}
void interfInformationPanel::onSaveResults(wxCommandEvent& event)
if (dialog.ShowModal() == wxID_OK)
{
onExtractInformation( event );
+ int selection = _informationRadiobox->GetSelection();
+ int minZ = _mbarrangeSliceInformation->GetStart();
+ int maxZ = _mbarrangeSliceInformation->GetEnd();
std::string directory=(const char *)(dialog.GetDirectory().mb_str());
std::string namefile=(const char *)(dialog.GetFilename().mb_str());
std::string filename = (const char *)(dialog.GetPath().mb_str() );
int typeContourGroup = _radiolstboxContourGroup->GetSelection();
interfMainPanel::getInstance()->onSaveResults(directory, namefile, filename,
- typeContourGroup, _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
+ typeContourGroup,
+ selection,minZ,maxZ,
+ _XYZValues->GetValue(), _contourImage->GetValue(), _statistics->GetValue());
}
}
//tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ;
tempString = wxString(lstContourThings[ii].c_str(),wxConvUTF8) ;
_grid->SetCellValue( z, ii, tempString );
- }
- }
+ } // for ii
+ }// for z
+
+ // Last line
+ _grid->SetRowLabelValue(sizeZ, _T(" ") );
+ for (ii=0 ; ii<sizeLstContourThings ; ii++)
+ {
+ _grid->SetCellValue( sizeZ, ii, _T(" ") );
+ } // for ii
+
}
void interfInformationPanel::setStringInfoPanel(wxString tmpString){
-void wxContourMainFrame::ShowResultImages(int typeContourGroup)
+void wxContourMainFrame::ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ)
{
vtkImageData * mask;
vtkImageData * value;
- this->getMaskValue(&mask, &value, typeContourGroup);
+ this->getMaskValue(&mask, &value, typeContourGroup, selection, minZ, maxZ);
std::vector<int> nTypeView;
nTypeView.push_back(5);
}
-void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ)
+void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax)
{
GenerateContourExtractData();
+ wxString tempString;
int maxContourGroup = 0;
-
_contourextractdata ->SetTypeOperation( typeContourGroup % 3 );
_instantPanel->getInstant( tempVector );
vtkImageData *imagedata = _theViewPanel->getImageData();
- int sizeZ = _theViewPanel->GetImageDataSizeZ();
+// int sizeZ = _theViewPanel->GetImageDataSizeZ();
int z;
int ii,sizeLstContourThings;
double porcent;
wxString tmpString;
-
+//?????
if (selection==0 ) // actual slice
{
- std::vector<int> tempVector;
- _instantPanel->getInstant( tempVector );
int actualSlice = tempVector[1];
minZ = actualSlice;
maxZ = actualSlice;
- }
- else if (selection==2 ) // All slices
- {
- minZ = 0;
- maxZ = sizeZ-1;
- }
- else if (selection==1 ) // slice range
- {
+ } else { // slice range
minZ = minimumZ;
maxZ = maximumZ;
}
totalZ = maxZ-minZ+1;
_contourextractdata->SetImage( imagedata);
+ _contourextractdata->InitVolumeStatistics();
+
// For each slice..
for ( z=minZ ; z<=maxZ ; z++ )
{
lstManConModExp = kernelManager->ExploseEachModel( lstManConMod );
- wxString tempString;
tempString.Printf(_T("%d - %d"),z, sizeLstContourThings);
interfMainPanel::getInstance()->setRowLabelInfoPanel(z, tempString);
//_grid->SetRowLabelValue(z, tempString );
&pLstValuePosZ);
// Statistics of each slice.
_contourextractdata->Statistics( &pLstValue,
- minimumZ,
- maximumZ,
+ grayRangeMin,
+ grayRangeMax,
&resultGrayRangeCount,
&resultSize,
&resultMin,
} // for iContourGroup
} // for z
+ // Print Volume Statistics
+
+
+ int vol_rCountRange;
+ int vol_rsize;
+ double vol_minValue;
+ double vol_maxValue;
+ double vol_average;
+ double vol_standardeviation;
+
+ if (selection!=0 ) // actual slice
+ {
+
+ _contourextractdata->GetVolumeStatistics(&vol_rCountRange, &vol_rsize,
+ &vol_minValue, &vol_maxValue,
+ &vol_average, &vol_standardeviation);
+
+ interfMainPanel::getInstance()->setRowLabelInfoPanel(maxZ+2, _T("Total:"));
+
+ tempString.Printf(_T("%d"),vol_rsize);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 0, tempString);
+
+ tempString.Printf(_T("%d"),vol_rCountRange);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 1, tempString);
+
+ tempString.Printf(_T("%f"),vol_minValue);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 2, tempString);
+
+ tempString.Printf(_T("%f"),vol_maxValue);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 3, tempString);
+
+ tempString.Printf(_T("%f"),vol_average);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 4, tempString);
+
+ tempString.Printf(_T("%f"),vol_standardeviation);
+ interfMainPanel::getInstance()->setCellValueInfoPanel(maxZ+2, 5, tempString);
+ }
+ //-----------------------------------------
+
int iTitleGroup;
wxString tmpTitleString;
int tmpIntB;
interfMainPanel::getInstance()->setColLableInfoPanel( tmpIntB + 4, _T("Average") );
interfMainPanel::getInstance()->setColLableInfoPanel( tmpIntB + 5, _T("St.Dev.") );
interfMainPanel::getInstance()->setColLableInfoPanel( tmpIntB + 6, _T(" ") );
- }
-
+ }// for title
interfMainPanel::getInstance()->setStringInfoPanel( _T("") );
}
//AD: 29-05-09
void wxContourMainFrame::onSaveResults(std::string directory,std::string namefile, std::string filename,
- int typeContourGroup, bool XYZValues, bool contourImage, bool statistics)
+ int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics)
{
if (XYZValues)
{
{
vtkImageData * mask;
vtkImageData * value;
- this->getMaskValue(&mask, &value, typeContourGroup);
+ this->getMaskValue(&mask, &value, typeContourGroup,selection,minZ,maxZ);
this->SaveImageResult( directory , namefile, mask, value);
}
FILE *pFile=fopen(name.str().c_str(),"w+");
- int sizeZ = _theViewPanel->GetImageDataSizeZ();
wxString tmpString;
- int i,j,maxX,maxY=sizeZ;
+ int i,j,maxX;
+
+// int sizeZ = _theViewPanel->GetImageDataSizeZ();
+// int maxY=sizeZ+2;
+
maxX= interfMainPanel::getInstance()->getNumberColsInformationPanel();//this->_grid->GetNumberCols();
+ // -- Title --
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,"slice\t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle );
}
- fprintf(pFile,"\n" );
-
-
+ fprintf(pFile,"\n\n" );
- for ( j=0; j<maxY ; j++)
+
+// ??????
+
+ if (selection==0 ) // actual slice
+ {
+ std::vector<int> tempVector;
+ _instantPanel->getInstant( tempVector );
+ int actualSlice = tempVector[1];
+ minZ = actualSlice;
+ maxZ = actualSlice;
+ }
+
+ // Stadistics...
+ for ( j=minZ; j<=maxZ ; j++)
{
fprintf(pFile,"%d\t" , j );
for (i=0 ; i<maxX ; i++){
fprintf(pFile,"\n" );
} // for j
+
+ // Total of stadistics.....
+ if (selection!=0)
+ {
+ fprintf(pFile,"\n Total:\t" );
+ for (i=0 ; i<maxX ; i++){
+ tmpString = interfMainPanel::getInstance()->getCellValue(maxZ+2, i);//_grid->GetCellValue( maxZ+2 , i );
+ fprintf(pFile,"%s\t" , (const char *)(tmpString.mb_str()) );
+ } // for i
+ fprintf(pFile,"\n" );
+ }
+
fclose(pFile);
}
}
}
-void wxContourMainFrame::getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup){
+void wxContourMainFrame::getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup, int selection, int minZ, int maxZ){
wxBusyCursor wait;
GenerateContourExtractData();
_instantPanel->getInstant( tempVector );
vtkImageData *imagedata = _theViewPanel->getImageData();
- int sizeZ = _theViewPanel->GetImageDataSizeZ();
int z;
int ii,sizeLstContourThings;
- int minZ,maxZ;
double totalZ;
double porcent;
wxString tmpString;
-
- minZ = 0;// _mbarrange->GetStart();
- maxZ = sizeZ;//_mbarrange->GetEnd();
- totalZ = maxZ-minZ+1;
+
+
+ if (selection==0 ) // actual slice
+ {
+ int actualSlice = tempVector[1];
+ minZ = actualSlice;
+ maxZ = actualSlice;
+ }
+
+ totalZ = maxZ-minZ;
_contourextractdata->SetImage( imagedata);
// For each slice..
- for ( z=0 ; z<sizeZ ; z++)
+ for ( z=minZ ; z<=maxZ ; z++)
{
porcent = 100.0* (z-minZ)/totalZ;
void setInstantChooserPanel( wxInstantChooserPanel * theInstantChooserPanel );
-
- void getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup);
+ void getMaskValue(vtkImageData ** mask,vtkImageData ** value,int typeContourGroup, int selection, int minZ, int maxZ);
void SaveImageResult(std::string directory,std::string namefile, vtkImageData* mask,vtkImageData* value);
std::vector<std::string> getOutlinesName(int slide);
- void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ);
+ void onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax);
void onSaveResults(std::string directory,std::string namefile, std::string filename,
- int typeContourGroup, bool XYZValues, bool contourImage, bool statistics);
+ int typeContourGroup, int selection, int minZ, int maxZ, bool XYZValues, bool contourImage, bool statistics);
void SaveValuesXYZ(std::string directory,std::string namefile, int typeContourGroup);
void saveFileWithContoursAutomatique();
- void ShowResultImages(int typeContourGroup);
+ void ShowResultImages(int typeContourGroup, int selection, int minZ, int maxZ );
private:
format 66
"GeneralArchitecture" // GeneralArchitecture
- revision 4
+ revision 6
modified_by 2 "davila"
// class settings
//class diagram settings
end
end
- sequencediagram 129154 "Sequence diagram btnLabels"
+ sequencediagram 129154 "Sequence diagram btnStatistics"
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default show_stereotype_properties default
overlapping_bars size A4
end
-window_sizes 1005 825 189 810 698 70
+window_sizes 1070 859 329 735 732 70
diagrams
active classdiagram_ref 128002 // GeneralArchitecture
- 806 678 100 4 556 0
- sequencediagram_ref 129154 // Sequence diagram btnLabels
- 531 558 100 4 0 161
+ 731 712 100 4 420 11
+ sequencediagram_ref 129154 // Sequence diagram btnStatistics
+ 664 712 100 4 0 7
sequencediagram_ref 129282 // Sequnce diagram btnSave
- 560 558 100 4 0 161
+ 560 558 100 4 0 0
sequencediagram_ref 129410 // Sequence diagram btnShowImageResult
- 560 558 100 4 0 51
+ 990 709 100 4 0 0
end
show_stereotypes
selected classdiagram_ref 128002 // GeneralArchitecture