{
if(thresholdShown)
{
- wxContourMainFrame::getInstance()->refLineHide();
thresholdShown=false;
panelThreshold->onThresholdStop();
else if (!thresholdShown)
{
- wxContourMainFrame::getInstance()->refLineShow();
thresholdShown=true;
-
showPanel(thresholdPanel);
}
}
nom.push_back("Create a Line");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
hand.push_back(this);
-
+/*
path.push_back(datadir + "/Line.png");
nom.push_back("Create Points");
funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
hand.push_back(this);
-
+*/
this->addButtons(path, nom);
this->setVectorFunction(funct);
void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
interfMainPanel::getInstance()->onCreateContourLine();
}
-
+/*
void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
interfMainPanel::getInstance()->onCreateContourLine();
}
+*/
\ No newline at end of file
**/
void onCreateContourLine( wxCommandEvent& event );
- void onCreateContourPoints( wxCommandEvent& event );
+ //void onCreateContourPoints( wxCommandEvent& event );
};
std::vector<std::string> conceptNameVect;
std::vector<int> conceptSizeVect;
- wxAuiNotebook * notebook = this->createNotebook();
+ notebook = this->createNotebook();
kernelManager = new KernelManagerContour( images , _datadir+"/data/" , strCreaContourDataTmp );
//*******************changeInstant();
_theViewPanel->setVerticalConcept( "Axe Depth", data->getMinValue(), data->getMaxValue(), data->getMinShowedValue(), data->getMaxShowedValue(), data->getActualValue() );
- this->configurePanels( notebook );
+ this->configurePanels( );
}
//------------------------------------------------------------------------------------------------------------
// Creational and initialization methods
//------------------------------------------------------------------------------------------------------------
- bool wxContourMainFrame :: configurePanels(wxAuiNotebook* theNoteBook)
+ bool wxContourMainFrame :: configurePanels( )
{
bool configured = _theViewPanel!=NULL;
configured &= _theViewPanel!=NULL;
if( _theViewPanel!=NULL )
{
- theNoteBook->AddPage( _theViewPanel, wxT(" View ") );
+ notebook->AddPage( _theViewPanel, wxT(" View ") );
m_mgr.Update();
}
if( configured )
{
- theNoteBook->AddPage( _instantPanel, wxT("Instant Page") );
+ notebook->AddPage( _instantPanel, wxT("Instant Page") );
m_mgr.Update();
}
- m_mgr.AddPane(theNoteBook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
+ m_mgr.AddPane(notebook, wxAuiPaneInfo().Name(wxT("notebook_content")).CenterPane().PaneBorder(false));
m_mgr.Update();
-/* configured &= _buttonsBar!=NULL;
- if( _buttonsBar!=NULL )
- {
- m_mgr.AddPane(_buttonsBar, wxAuiPaneInfo().
- Name(wxT("TB")).Caption(wxT("Buttons Bar")).
- ToolbarPane().Top().
- LeftDockable( ).RightDockable( false ).CloseButton(false));
- m_mgr.Update();
- }*/
- //CreateStatusBar();
-
+
SetMinSize(wxSize(300,300));
m_mgr.Update();
return configured;
}
- void wxContourMainFrame :: setNotebook( wxAuiNotebook * noteBook )
- {
-
- }
-
//------------------------------------------------------------------------------------------------------------
// Attributes getters and setters
//------------------------------------------------------------------------------------------------------------
//Lookup Table
vtkLookupTable *lookup = vtkLookupTable::New();
- lookup->SetNumberOfTableValues(range[1]);
+ lookup->SetNumberOfTableValues(range[1]+1);
lookup->SetTableRange(range);
lookup->SetAlphaRange(0, 1);
lookup->SetValueRange(0, 1);
lookup->SetRampToLinear( );
+
//Assign a fake color for the upper image, and set the white as transparent
for(int i = range[0]; i < range[1]; i++)
{
+ //std::cout<<"Int equal: " << i << std::endl;
+
if( i >= minVal && i <= maxVal )
{
lookup->SetTableValue(i, 1.0, 0.0, 0.0, 1);
lookup->Build( );
vtkImageMapToColors *mapperImage = vtkImageMapToColors::New( );
- mapperImage->SetInput( img );
mapperImage->SetLookupTable( lookup );
+ mapperImage->SetInput( img );
+ //mapperImage->SetOutputFormatToRGBA( );
vtkImageActor * upperImageActor = vtkImageActor::New( );
upperImageActor->SetInput( mapperImage->GetOutput() );
upperImageActor->SetOpacity( 1 );
- //viewer->SetInput( myImage ); viewer->GetRenderer()->AddActor( myActor );ACTOR!!!
+ vtkImageViewer2* viewer = vtkImageViewer2::New();
+ viewer->SetInput( upperImageActor->GetInput() );
+ viewer->SetColorLevel((range[1]-range[0])/2);
+ viewer->SetColorWindow(range[1]);
+ viewer->GetRenderer()->AddActor( upperImageActor );
+ viewer->Render();
+
+ //wxThresholdPanel * panel = new wxThresholdPanel( viewer, notebook );
+
+ //onThresholdPanel(panel);
+
+ RefreshInterface();
//baseImageActor = vtkImageActor::New( );
//baseImageActor->SetInput( mBox->bbGetInputImage1() );
+}
- RefreshInterface();
+
+bool wxContourMainFrame::onThresholdPanel(wxPanel* panel)
+ {
+ bool configured = panel!=NULL;
+ configured &= panel!=NULL;
+
+ if( configured )
+ {
+ notebook->AddPage( panel, wxT(" Threshold "), true );
+ m_mgr.Update();
+ }
+ return configured;
}
void wxContourMainFrame::showAxis(bool show)
//#include "wxVtkBaseView_SceneManager.h"
#include "wxInstantChooserPanel.h"
#include "wxContourViewPanel.h"
+#include "wxThresholdPanel.h"
void setVectImages( std::vector<vtkImageData*> images );
- bool configurePanels(wxAuiNotebook * theNoteBook );
-
- void setNotebook( wxAuiNotebook * theNoteBook );
+ bool configurePanels( );
wxAuiNotebook * createNotebook();
void onThreshold(int minVal, int maxVal);
+ bool onThresholdPanel(wxPanel* panel);
+
+//====================================================================================================
+
void showAxis(bool show);
void onRigidPressed();
wxArrayString m_perspectives;
wxMenu* m_perspectives_menu;
*/
+
+ wxAuiNotebook * notebook;
long m_notebook_style;
long m_notebook_theme;
int _numberOfVariablesStatistics;
--- /dev/null
+//----------------------------------------------------------------------------------------------------------------
+// Class definition include
+//----------------------------------------------------------------------------------------------------------------
+#include "wxThresholdPanel.h"
+
+
+//----------------------------------------------------------------------------------------------------------------
+// Other includes
+//----------------------------------------------------------------------------------------------------------------
+
+ //------------------------------------------------------------------------------------------------------------
+ // Constructors & Destructors
+ //------------------------------------------------------------------------------------------------------------
+
+ wxThresholdPanel :: wxThresholdPanel ( vtkImageViewer2 * theViewer, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
+ :wxPanel(parent, -1, pos, size, style)
+ {
+ //wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
+
+ vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+ theViewer->SetupInteractor(iren);
+
+ //crea::creawxVTKRenderWindowInteractor * mInteractor = new crea::creawxVTKRenderWindowInteractor(this,-1);
+ //mInteractor->UseCaptureMouseOn();
+ //theViewer->SetupInteractor ( mInteractor );
+
+ //theViewer->Render();
+ //theViewer->GetRenderer()->ResetCamera();
+
+ //topsizer-> Add( iren ,1,wxGROW ,0);
+ SetAutoLayout( true );
+ //SetSizer( topsizer );
+ Layout();
+ }
+
+
+ wxThresholdPanel :: ~wxThresholdPanel()
+ {
+
+ }
\ No newline at end of file
--- /dev/null
+#ifndef __wxThresholdPanel_INCLUDED_H__
+#define __wxThresholdPanel_INCLUDED_H__
+
+
+// -----------------------------------------------------------------------------------------------------------
+// WX headers inclusion.
+// For compilers that support precompilation, includes <wx/wx.h>.
+// -----------------------------------------------------------------------------------------------------------
+
+#include <wx/wxprec.h>
+#ifdef __BORLANDC__
+#pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include <wx/wx.h>
+#endif
+
+
+//------------------------------------------------------------------------------------------------------------
+// Includes
+//------------------------------------------------------------------------------------------------------------
+
+#include "creawxVTKRenderWindowInteractor.h"
+#include "vtkImageViewer2.h"
+#include "vtkRenderWindowInteractor.h"
+
+//------------------------------------------------------------------------------------------------------------
+// Class definition
+//------------------------------------------------------------------------------------------------------------
+
+class wxThresholdPanel : public wxPanel
+{
+public:
+
+ //------------------------------------------------------------------------------------------------------------
+ // Constructors & Destructors
+ //------------------------------------------------------------------------------------------------------------
+
+ wxThresholdPanel( vtkImageViewer2 * theViewer, wxWindow *parent, const wxPoint& pos=wxDefaultPosition, const wxSize& size = wxDefaultSize,long style= wxDEFAULT_FRAME_STYLE | wxSUNKEN_BORDER, int vertStart=1, int vertEnd=1, int horzStart=1, int horzEnd=1 );
+
+ ~wxThresholdPanel();
+
+ //------------------------------------------------------------------------------------------------------------
+ // Creational and initialization methods
+ //------------------------------------------------------------------------------------------------------------
+
+
+ //------------------------------------------------------------------------------------------------------------
+ // Methods for capturing events from the horizontal bar
+ //------------------------------------------------------------------------------------------------------------
+
+
+
+ //------------------------------------------------------------------------------------------------------------
+ // Other functional methods
+ //------------------------------------------------------------------------------------------------------------
+
+
+
+ //------------------------------------------------------------------------------------------------------------
+ // Attributtes
+ //------------------------------------------------------------------------------------------------------------
+private:
+
+ //------------------------------------------------------------------------------------------------------------
+ // Private methods
+ //------------------------------------------------------------------------------------------------------------
+
+};
+#endif