_viewColorLayerImagePanel = NULL;
}
- wxContourMainFrame :: wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
+ wxContourMainFrame::wxContourMainFrame(wxWindow* parent, wxWindowID id,const wxString& title,const wxPoint& pos,const wxSize& size,std::vector<vtkImageData*> images, long style,std::string datadir)
: wxPanel(parent, id, pos, size, style)
{
m_mgr.SetManagedWindow(this);
notebook->AddPage( _theViewPanel, wxT(" View ") );
m_mgr.Update();
}
-
-
if( configured )
{
notebook->AddPage( _instantPanel, wxT("Instant Page") );
m_mgr.Update();
}
-
m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
m_mgr.Update();
-
SetMinSize(wxSize(300,300));
m_mgr.Update();
return configured;
return manModelContour;
}
-void wxContourMainFrame :: saveState(){
+void wxContourMainFrame :: saveState()
+{
std::string temp = kernelManager->saveState();
saveFileWithContours(temp);
}
-void wxContourMainFrame::onDeleteContour(){
+void wxContourMainFrame::onDeleteContour()
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
}
}
-void wxContourMainFrame :: deleteContour( std::string theKeyName ){
+void wxContourMainFrame :: deleteContour( std::string theKeyName )
+{
/*
manualContourModel * cModel;
manualViewBaseContour * cViewer;
JCP --08-09-2008 */
}
-void wxContourMainFrame::setConceptValue( std::string name, int value ){
+void wxContourMainFrame::setConceptValue( std::string name, int value )
+{
_instantPanel->setConceptValue(name, value);
}
-ConceptDataWrap* wxContourMainFrame::getLastConceptData(){
+ConceptDataWrap* wxContourMainFrame::getLastConceptData()
+{
return _instantPanel->getLastConceptData();
}
-bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos ){
+bool wxContourMainFrame::getIfConceptCheckedAt( std::string name, int pos )
+{
return _instantPanel->getIfConceptCheckedAt( name, pos );
}
std::vector<int> instantVect;
_instantPanel->getInstant( instantVect );
int actualSlice = instantVect[1];
-
kernelManager->setInstant(instantVect);
-
// Refresh Mask image
- if(_viewMaskImage!=NULL){
+ if(_viewMaskImage!=NULL)
+ {
_viewMaskImage->SetZ(actualSlice);
if (_viewMaskImagePanel->IsVisible()==true)
{
getMaskValue(&mask,&value, _contourGroup , 0, -1, -1);
_viewMaskImage->onThreshold();
}
- }
-
+ } // if _viewMaskImage
// Refresh Threshold image
- if(_viewThresholdImage!=NULL){
+ if(_viewThresholdImage!=NULL)
+ {
_viewThresholdImage->SetZ(actualSlice);
- if (_viewThresholdImagePanel->IsVisible()==true){
+ if (_viewThresholdImagePanel->IsVisible()==true)
+ {
_viewThresholdImage->onThreshold();
}
- }
-
-
+ } // if _viewThresholdImage
updateInstantOutlines();
updateInstantImageData();
updateInstantAxes();
-void wxContourMainFrame :: updateInstantOutlines()
+void wxContourMainFrame::updateInstantOutlines()
{
_theViewPanel->removeSceneContours();
_theViewPanel->addNameWrapperToScene();
//}
}
-int wxContourMainFrame::getNamesWrappingSize(){
+int wxContourMainFrame::getNamesWrappingSize()
+{
return kernelManager->getNamesWrappingSize();
}
-std::string wxContourMainFrame::getNameWrapping(int i){
+
+std::string wxContourMainFrame::getNameWrapping(int i)
+{
return kernelManager->getNameWrapping(i);
}
void wxContourMainFrame::onCopy(){
std::vector<std::string> currentSelection = _theViewPanel->getSelectedObjects();
-
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
_performingOperation->reset();
_performingOperation->setKeyNamesOperationElems( currentSelection );
}
-void wxContourMainFrame::onPaste(){
-
-
+void wxContourMainFrame::onPaste()
+{
char theStartCommand = _performingOperation->getStartCommand();
if ( theStartCommand == COPY )
{
}
}
}
-void wxContourMainFrame::onUndo(){
+
+void wxContourMainFrame::onUndo()
+{
std::string filename;
if(kernelManager->onUndoSaveFile(filename)){
saveFileWithContours(filename);
_theViewPanel->getSceneManager()->createCopyContourOf( anExistingKName, cloneName, manualModel , append );
}
-//EED04
-void wxContourMainFrame ::loadState(std::string filename){
-
+void wxContourMainFrame ::loadState(std::string filename)
+{
deleteAllContours();
onLoadContours(filename,false);
-
- /* EED Borrame
- char tmp[255];
- FILE *pFile=fopen(filename.c_str(),"r+");
-
- fscanf(pFile,"%s",tmp); // --CreaContour--
-
- fscanf(pFile,"%s",tmp); // Version
- fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
-
- deleteAllContours();
-
- loadContours(pFile, false);
- loadContours(pFile, true);
-
- fclose(pFile);
- */
-}
-
-
-//EED03
-/*EED Borrame
-void wxContourMainFrame::loadContours( FILE *pFile, bool staticContour )
-{
- char tmp[255];
-
- if (staticContour==false)
- {
- fscanf(pFile,"%s",tmp); // ImageDimensions
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
-
- fscanf(pFile,"%s",tmp); // ImageSpacing
- fscanf(pFile,"%s",tmp); // X
- fscanf(pFile,"%s",tmp); // Y
- fscanf(pFile,"%s",tmp); // Z
- }
-
- fscanf(pFile,"%s",tmp); // NumberOfContours
- fscanf(pFile,"%s",tmp); // ##
- int numberOfContours = atoi(tmp);
-
- std::vector<int> instantVector;
- int typeContourModel;
- manualBaseModel *manModelContour;
- int typeView;
-
- int i;
- for (i=0;i<numberOfContours;i++)
- {
- instantVector.clear();
- fscanf(pFile,"%s",tmp); // Instant
- fscanf(pFile,"%s",tmp); // 1
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 2
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 3
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 4
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 5
- instantVector.push_back( atoi(tmp) );
- fscanf(pFile,"%s",tmp); // 6
- instantVector.push_back( atoi(tmp) );
-
- fscanf(pFile,"%s",tmp); // TypeContourModel
- fscanf(pFile,"%s",tmp); // ##
- typeContourModel = atoi(tmp);
-
- manModelContour = kernelManager->factoryManualContourModel(typeContourModel);
- manModelContour->Open(pFile);
-
- fscanf(pFile,"%s",tmp); // TypeView
- fscanf(pFile,"%s",tmp); // ##
- typeView = atoi(tmp);
-
- std::string theName;
- theName = kernelManager->createOutline( manModelContour, instantVector );
- bool addedModel = theName.compare("") != 0;
- if( addedModel )
- {
- double spc[3];//Si no hay imagen pero hay contornos que spacing se pone por default
- _theViewPanel->getSpacing(spc);
- //Adding the manualContourControler to interface objects structure
- //Adding the manualViewContour to interface objects structure
- //_theViewPanel->getSceneManager()->setControlActiveStateOfALL( false );//This call is being done here because if the ROI is created underneath the previously created ROIS will still be active.
- _theViewPanel->getSceneManager()->configureViewControlTo( theName, manModelContour,spc , typeView) ;
- }
-
- if (staticContour==true)
- {
- Instant instant(&instantVector);
- kernelManager->changeContourOfManager( theName , &instant );
- }
- }// for numberOfContours
}
-*/
void wxContourMainFrame::onLoad()
void wxContourMainFrame::SetZForAllContours(int pz)
{
- printf("EED wxContourMainFrame::SetZForAllContours\n");
-
//-- Normal Contours
-
std::vector< std::string > lstNameThings;
int i,sizeLstNameThings;
int ii,sizeLstPoints;
fscanf(pFileData,"%s",tmpD); // NumberOfContours
fscanf(pFileData,"%s",tmpD); // #
}
-
fscanf(pFile,"%s",tmp); // --CreaContour--
-
fscanf(pFile,"%s",tmp); // Version
fscanf(pFile,"%s",tmp); // 1.0.3 || 1.0.2 || 1.0.1 || 1.0.0
std::string version(tmp);
-
-
-printf("EED wxContourMainFrame::onLoadContours version%s \n", version.c_str() );
-
-
//AD:02-06-09
_tmpReadFileTypeOfTransformation=-1;
if (version=="1.0.3")
openContours(pFile,pFileData,false);
openContours(pFile,pFileData,true); //Load StaticContours
}
-
if (version=="1.0.2")
{
//EED001
openContours(pFile,pFileData,true); // Load StaticContours
SetZForAllContours(-900);
}
-
//AD:02-06-09
else if (version=="1.0.1")
{
}
-void wxContourMainFrame::RefreshInterface(){
+void wxContourMainFrame::RefreshInterface()
+{
changeInstant();
_theViewPanel->RefreshInterface();
//wxVtk2DBaseView *wxvtk2dbaseview = (wxVtk2DBaseView*)this->_theViewPanel->getWxVtkBaseView();
//wxvtk2dbaseview->Refresh();
}
-vtkImageData* wxContourMainFrame::getImageData(){
+vtkImageData* wxContourMainFrame::getImageData()
+{
return _theViewPanel->getImageData();
}
return _theViewPanel->getWindowLevel();
}
-void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel){
+void wxContourMainFrame::onBrigthnessColorWindowLevel(int colorwindow,int windowlevel)
+{
_theViewPanel->onBrigthnessColorWindowLevel(colorwindow, windowlevel);
RefreshInterface();
}
-void wxContourMainFrame::onInterpolation(bool interpolate){
+void wxContourMainFrame::onInterpolation(bool interpolate)
+{
_theViewPanel->onInterpolation(interpolate);
RefreshInterface();
}
-void wxContourMainFrame::onChangeInstant(std::string name,int actual){
+void wxContourMainFrame::onChangeInstant(std::string name,int actual)
+{
_instantPanel->setConceptValue( name, actual );
}
-void wxContourMainFrame::resetAppend(){
+void wxContourMainFrame::resetAppend()
+{
kernelManager->resetAppend();
-
}
-void wxContourMainFrame::onSpreadAdd(){
+void wxContourMainFrame::onSpreadAdd()
+{
std::vector<double> vecX;
std::vector<double> vecY;
std::vector<double> vecZ;
}
-void wxContourMainFrame::onSpreadAddAll(){
+void wxContourMainFrame::onSpreadAddAll()
+{
//EED02
std::vector<int> tempVector;
_instantPanel->getInstant( tempVector );
}
-void wxContourMainFrame::onSpreadGo(int type){
+void wxContourMainFrame::onSpreadGo(int type)
+{
//JCP 20-10-08 Undo redo implementation
saveState();
//JCP 20-10-08 Undo redo implementation
//RefreshInterface();
}
-void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector){
-
+void wxContourMainFrame::getInstantVector(std::vector<int>& tempVector)
+{
}
-std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide){
+std::vector<std::string> wxContourMainFrame::getOutlinesName(int slide)
+{
std::vector<int> tempVector;
_instantPanel->getInstant(tempVector);
//Asignation of slide number should be different ex by name