}
- wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir ){
+ wxContourMainFrame* wxContourMainFrame :: getInstance(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir )
+ {
if(instance == NULL){
instance = new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
}
}
void wxContourMainFrame::onLoad()
-{
- char tmp[255];
- char tmpD[255];
+{
std::string fileNameContourROI = GetFileLocation();
-
//CMRU 03-09-09-----------------------------------------------------------------------------------------------
if(GetFileLocation().empty())
{
}
}
+ onLoadContours(fileNameContourROI);
+}
+
+void wxContourMainFrame::onLoadContours(std::string fileNameContourROI){
+ char tmp[255];
+ char tmpD[255];
+
FILE *pFile =fopen(fileNameContourROI.c_str(),"r+");
}
_theViewPanel->getSceneManager()->removeSceneContours();
changeInstant();
+
+}
+
+void wxContourMainFrame::onImport(){
+ std::string filename, filenamecontours;
+ wxFileDialog dialog(NULL, _T("Choose a XML Osirix File"), _T(""), _T(""), _T("*.xml"), wxOPEN );
+
+ if (dialog.ShowModal() == wxID_OK)
+ {
+ filename = dialog.GetPath().mb_str();
+ filenamecontours = kernelManager->parseOsirixFile(filename);
+
+ if(filenamecontours.compare("") != 0){
+ onLoadContours(filenamecontours);
+ }
+
+ }
}
+void wxContourMainFrame::onTest(){
+ std::string filename, filenamecontours;
+ wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxOPEN );
+
+ if (dialog.ShowModal() == wxID_OK)
+ {
+ filename = dialog.GetPath().mb_str();
+ std::cout << "This is the filename: " << filename << std::endl;
+ }
+}
+
//AD: 29-05-09
void wxContourMainFrame::onSave(){
}
+void wxContourMainFrame::SetScalarRange(int grayRangeMin, int grayRangeMax)
+{
+ _contourextractdata->SetScalarRange(grayRangeMin,grayRangeMax);
+}
+
void wxContourMainFrame::onInformationContourLabels(int typeContourGroup,int selection,int minimumZ,int maximumZ,int grayRangeMin, int grayRangeMax)
{
}
_contourextractdata->SetLstManualContourModel( lstManConModTmp );
+ _contourextractdata->SetScalarRange(grayRangeMin,grayRangeMax);
pLstValue.clear();
pLstValuePosX.clear();
pLstValuePosY.clear();
pLstValuePosZ.clear();
- _contourextractdata->GetValuesInsideCrown( &pLstValue,
+
+
+ int numberOfPixels;
+ _contourextractdata->GetValuesInsideCrown( &numberOfPixels,
+ &pLstValue,
&pLstValuePosX,
&pLstValuePosY,
&pLstValuePosZ);
+ resultSize=numberOfPixels;
// Statistics of each slice.
_contourextractdata->Statistics( &pLstValue,
grayRangeMin,
&resultMax,
&resultAverage,
&resultStandardeviation);
-
+
if (interfMainPanel::getInstance()->getNumberColsInformationPanel()<_numberOfVariablesStatistics*(iContourGroup+1) )
{
interfMainPanel::getInstance()->appendColsInformationPanel(_numberOfVariablesStatistics);
tmpIntA=_numberOfVariablesStatistics*iContourGroup ;
- tempString.Printf(_T("%d"),resultSize);
+ tempString.Printf(_T("%d"),numberOfPixels);
+
interfMainPanel::getInstance()->setCellValueInfoPanel(z, tmpIntA, tempString);
tempString.Printf(_T("%d"),resultGrayRangeCount);
pLstValuePosX.clear();
pLstValuePosY.clear();
pLstValuePosZ.clear();
- _contourextractdata->GetValuesInsideCrown( &pLstValue,
+ int numberOfPixels;
+ _contourextractdata->GetValuesInsideCrown( &numberOfPixels,
+ &pLstValue,
&pLstValuePosX,
&pLstValuePosY,
&pLstValuePosZ);
// Image Value
vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( );
writerValueImage->SetInput( value );
+ writerValueImage->SetInput( value );
writerValueImage->SetFileName( (const char *)filename.mb_str() );
writerValueImage->SetFileDimensionality( 3 );
+ writerValueImage->SetCompression(false);
writerValueImage->Write( );
// Image Mask
writerMaskImage->SetInput( mask );
writerMaskImage->SetFileName( (const char *)filename.mb_str() );
writerMaskImage->SetFileDimensionality( 3 );
+ writerValueImage->SetCompression(false);
writerMaskImage->Write( );
interfMainPanel::getInstance()->setStringInfoPanel( _T("") );
return _viewMaskImagePanel;
}
+
+wxPanel *wxContourMainFrame::getColorLayerImageViewPanel(wxWindow *parent)
+{
+ if (_viewColorLayerImagePanel==NULL)
+ {
+ _viewColorLayerImagePanel = new wxPanel(parent, -1);
+/*EED Borrame
+ double range[2];
+ _theViewPanel->getImageData()->GetScalarRange(range);
+ int min = (int)floor (range[0]);
+ int max = (int)ceil (range[1]);
+ _viewColorLayerImagePanel = new ThresholdImageViewPanel( parent, min, max , 1);
+ _viewThresholdImage = new ThresholdImageView();
+ _viewThresholdImage->SetImage( _theViewPanel->getImageData() );
+ _viewThresholdImage->SetminMaxValue( min, max);
+ _viewThresholdImage->SetBaseColor( 1,0,0 );
+ _viewThresholdImagePanel->SetThresholdImageView( _viewThresholdImage );
+ _viewThresholdImage->SetwxVtkBaseView( _theViewPanel->getWxVtkBaseView() );
+*/
+ }
+ return _viewColorLayerImagePanel;
+}
+
+
wxPanel *wxContourMainFrame::getThresholdImageViewPanel(wxWindow *parent)
{
if (_viewThresholdImagePanel==NULL)
_fileLocation = newFileLocation;
std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
}
-//------------------------------------------------------------------------------------------------------------
\ No newline at end of file
+//------------------------------------------------------------------------------------------------------------