// Constructors & Destructors
//------------------------------------------------------------------------------------------------------------
-wxContourMainFrame* wxContourMainFrame:: instance = NULL;
+wxContourMainFrame* wxContourMainFrame::instance=NULL;
char wxContourMainFrame::COPY = 'C';
wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,long style)
_viewThresholdImage = NULL;
_viewThresholdImagePanel = NULL;
_viewColorLayerImagePanel = NULL;
-
_frameShowResultImages = NULL;
}
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);
+ if(instance == NULL)
+ {
+ instance=new wxContourMainFrame(parent, id, title, pos, size, images, style,datadir);
}
return instance;
}
- std::vector<vtkImageData*> wxContourMainFrame ::getVectImages()
+ std::vector<vtkImageData*> wxContourMainFrame::getVectImages()
{
return kernelManager->getVectImages();
}
- wxContourMainFrame* wxContourMainFrame :: getInstance()
+ wxContourMainFrame* wxContourMainFrame::getInstance()
{
return instance;
}
- void wxContourMainFrame :: resetInstance()
+ void wxContourMainFrame::resetInstance()
{
instance->Destroy();
}
- wxContourMainFrame :: ~wxContourMainFrame()
+ wxContourMainFrame::~wxContourMainFrame()
{
delete _contourextractdata;
deleteAllContours();
// Creational and initialization methods using WxAui
//------------------------------------------------------------------------------------------------------------
//
- wxAuiNotebook * wxContourMainFrame :: createNotebook()
+ wxAuiNotebook * wxContourMainFrame::createNotebook()
{
wxSize client_size = GetClientSize();
wxAuiNotebook* noteBook = new wxAuiNotebook(this, -1, wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style);
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
- bool wxContourMainFrame :: configurePanels( )
+ bool wxContourMainFrame::configurePanels( )
{
bool configured = _theViewPanel!=NULL;
mp->SetPointX( vecOut[0] );
mp->SetPointY( vecOut[1] );
mp->SetPointZ( vecOut[2] );
- }
+ } // for i
_theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
}
onLoadContours(filename,false);
}
-
void wxContourMainFrame::onLoad()
{
std::string fileNameContourROI = GetFileLocation();
if (dialog.ShowModal() == wxID_OK)
{
fileNameContourROI = (const char *)(dialog.GetPath().mb_str());
- }
- }
-
+ } // if dialog
+ } // if FileLocation
onLoadContours(fileNameContourROI,true);
}
-
void wxContourMainFrame::SetZForAllContours(int pz)
{
//-- Normal Contours
std::vector< std::string > lstNameThings;
int i,sizeLstNameThings;
- int ii,sizeLstPoints;
-
+ int ii,sizeLstPoints;
lstNameThings = kernelManager->GetLstNameThings();
sizeLstNameThings = lstNameThings.size();
for (i=0 ; i<sizeLstNameThings ; i++)
readDimSpc(pFile,false); // DimSpc interactive OFF
openContours(pFile,pFileData,true); // Load StaticContours
SetZForAllContours(-900);
- }
- //AD:02-06-09
- else if (version=="1.0.1")
- {
+ } else if (version=="1.0.1") { //AD:02-06-09
openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
openContours(pFile,pFileData,true); //Load StaticContours, skips ImageDimensions and ImageSpacing
- }
-
- //AD:02-06-09
- else if (version=="1.0.0")
- {
+ } else if (version=="1.0.0") { //AD:02-06-09
openContours(pFile,pFileData,false); //Skips ImageDimensions and ImageSpacing
}
-
fclose(pFile);
-
if(pFileData != NULL)
{
fclose(pFileData);
} // if
- }
+ } // pFile
_theViewPanel->getSceneManager()->removeSceneContours();
changeInstant();
}
filename = dialog.GetPath().mb_str();
filenamecontours = kernelManager->parseOsirixFile(filename);
- if(filenamecontours.compare("") != 0){
+ if(filenamecontours.compare("") != 0)
+ {
onLoadContours(filenamecontours,true);
} // if
} // if
#else
wxFileDialog dialog(NULL, _T("Choose a File"), _T(""), _T(""), _T("*.*"), wxFD_OPEN );
#endif
-
if (dialog.ShowModal() == wxID_OK)
{
filename = dialog.GetPath().mb_str();
} // if
}
-
//AD: 29-05-09
-void wxContourMainFrame::onSave(){
+void wxContourMainFrame::onSave()
+{
//CMRU 03-09-09-----------------------------------------------------------------------------------------------
if(GetFileLocation().empty())
{
kernelManager->setCurrentFileName(fileNameContourROI);
saveFileWithContours( fileNameContourROI );
}
- }
-//CMRU 03-09-09-----------------------------------------------------------------------------------------------
- else
- {
+ } else {//CMRU 03-09-09-----------------------------------------------------------------------------------------------
std::cout<<"Nombre del archivo: "<<GetFileLocation()<<std::endl;
std::string fileNameContourROI = GetFileLocation();
std::cout<<"Nombre del archivo: "<<fileNameContourROI<<std::endl;
{
wxDialog* dial = new wxDialog (this,-1,_T("Tools"),wxDefaultPosition, wxSize(460,360));
wxSizer* buttonsSizer = dial->CreateSeparatedButtonSizer(wxOK|wxCANCEL);
- wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
+// wxBoxSizer *dialSizer = new wxBoxSizer(wxVERTICAL);
+ wxFlexGridSizer *dialSizer = new wxFlexGridSizer(1);
wxString lstOptOperation[2];
lstOptOperation[0]=_T("By Dimension");
lstOptOperation[1]=_T("By Spacing");
- wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,45), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS);
+ wxRadioBox * radioOpts = new wxRadioBox(dial, -1, _T("Type of Transformation"), wxDefaultPosition, wxSize(270,90), 2 , lstOptOperation, 2, wxRA_SPECIFY_COLS);
dialSizer->Add( new wxStaticText(dial,-1,_T("The image resolution is not compatible with the ")) , 0, wxGROW );
dialSizer->Add( new wxStaticText(dial,-1,_T("selected Roi file. Do you want to tranform it?")) , 0, wxGROW );
void wxContourMainFrame::SegmentationOneSlice( int x, int y, int z, int isovalue, int sampling, int method )
{
+
+printf("EED wxContourMainFrame::SegmentationOneSlice Start=%d %d\n",sampling,method );
+printf("EED wxContourMainFrame::SegmentationOneSlice %d %d %d \n",x,y,z );
+
int typeofcontour = 1;
//--Extracting Contour
vtkImageData *imagedata = getImageData();
int ii,size=vtkcell->GetNumberOfPoints();
printf("EED wxContourMainFrame::SegmentationOneSlice C \n");
int id;
- for (ii=1;ii<=size;ii++)
+ for (ii=0;ii<size;ii++)
{
// id = polyDataResult->GetLines()->GetData()->GetValue(ii);
// p = polyDataResult->GetPoint(id);
}
-void wxContourMainFrame::saveFileWithContoursAutomatique(){
+void wxContourMainFrame::saveFileWithContoursAutomatique()
+{
+printf("EED wxContourMainFrame::saveFileWithContoursAutomatique \n");
std::string filename = kernelManager->getCurrentFileName();
if(filename.compare("")!=0){
saveFileWithContours(filename);
onSave();
}
}
-void wxContourMainFrame::ShowToolsPanel(bool show){
+void wxContourMainFrame::ShowToolsPanel(bool show)
+{
_pannew->Show(show);
}
{
_fileLocation = newFileLocation;
std::cout<<"GETFILELOCATION:"<<_fileLocation<<std::endl;
+
+//EED 2019-12-17
+ kernelManager->setCurrentFileName(_fileLocation);
}
//------------------------------------------------------------------------------------------------------------