creaMaracasVisu:ShowNPoints:Box31
ISEXEC:FALSE
-19.500275:46.578993:-900.000000
-28.819725:36.578993:-900.000000
+41.139725:36.578993:-900.000000
FIN_BOX
BOX
wx:LayoutSplit:Box32
-43.295549:-113.442289:-900.000000
PORT
Proportion:"10"
+PORT
+WinTitle:"Measure"
FIN_BOX
BOX
wx:LayoutTab:Box33
new wx:LayoutSplit Box32
set Box32.Proportion "10"
+ set Box32.WinTitle "Measure"
new wx:LayoutTab Box33
void ViewerNV::Process()
{
vtkImageData* img = bbGetInputIn();
-
-
std::vector<int> type = bbGetInputnTypeView();
-
-
- if(img != NULL && _mwxwidget != NULL){
- if(!compareVectors(type, _currenttype)){
+ if(img != NULL && _mwxwidget != NULL)
+ {
+ if(!compareVectors(type, _currenttype))
+ {
_mwxwidget->SetType(&type);
_mwxwidget->UpdateLayout(img);
}else if (img != _currentimg){
_mwxwidget->SetImage(img);
}
_mwxwidget->RefreshView();
-
_currenttype = type;
_currentimg = img;
-
_point.clear();
_point.push_back((int)_mwxwidget->GetX());
_point.push_back((int)_mwxwidget->GetY());
_point.push_back((int)_mwxwidget->GetZ());
bbSetOutputPoint(_point);
-
// WxBlackBox::Process();
// mwxwidget->SetImage(img );
wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView(1);
wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView(2);
wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView(3);
wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView(4);
-
//wxwidget->RefreshView();
-
bbSetOutputwxVtkBaseView1( wvbv1 );
bbSetOutputwxVtkBaseView2( wvbv2 );
bbSetOutputwxVtkBaseView3( wvbv3 );
if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
-
if (wvbv1!=NULL)
{
bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
updateObservers();
}
-
if(bbGetInputColorFunction()!=NULL)
{
_mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
}
-
-
if( (bbGetInputColorLevel()!=-1) && (bbGetInputWindowLevel()!=-1))
{
if(bbGetInputColorLevel() == 0)
_mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , bbGetInputColorLevel() );
}
}
+ _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
}// mwxwidget != NULL
}
bbSetInputObs3(NULL);
bbSetInputObs4(NULL);
bbSetInputObs5(NULL);
+ bbSetInputInterpolate(true);
std::vector<int> vecNTypeViwer;
vecNTypeViwer.push_back(5);
BBTK_DECLARE_INPUT(Obs3, vtkInteractorObserver *);
BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *);
BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *);
+ BBTK_DECLARE_INPUT(Interpolate, bool);
+
BBTK_DECLARE_OUTPUT(wxVtkBaseView1,wxVtkBaseView*);
BBTK_DECLARE_OUTPUT(wxVtkBaseView2,wxVtkBaseView*);
BBTK_INPUT(ViewerNV,Obs3,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
BBTK_INPUT(ViewerNV,Obs4,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
BBTK_INPUT(ViewerNV,Obs5,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,"");
+ BBTK_INPUT(ViewerNV,Interpolate,"Interpolate true/false (default true)",bool,"");
BBTK_OUTPUT(ViewerNV,wxVtkBaseView1,"wxVtkBaseView 1",wxVtkBaseView *,"");
BBTK_OUTPUT(ViewerNV,wxVtkBaseView2,"wxVtkBaseView 2",wxVtkBaseView *,"");
RefreshView();
}
+//-----------------------------------------------------------------------------------
+void wxMaracas_N_ViewersWidget::SetInterpolate(bool interpolate)
+{
+ mvtkmprbasedata->SetInterpolate(interpolate);
+ RefreshView();
+}
+
+
+
void setColorTransferFunction(vtkColorTransferFunction* colortable);
void SetColorWindowLevel(double colorWindow, double colorLevel);
+ void SetInterpolate(bool interpolate);
+
+
//------------------------------------------------------------------------------------------------------------
// Attributes
//------------------------------------------------------------------------------------------------------------
wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata)
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
- wxPanel *panel = this;
- wxWindow *wxwindow = NULL, *window3D = 0;
- wxSplitterWindow *panelClipping3D= 0;
-// wxPanel *panelControl = 0;
-// wxFlexGridSizer *sizerCtrol = 0;
- wxPanel *controlPanelMPR3D = 0;
- wxPanel *controlPanelClippingSurf3D = 0;
+ wxPanel *panel = this;
+ wxWindow *wxwindow = NULL;
+ wxWindow *window3D = NULL;
+ wxSplitterWindow *panelClipping3D = NULL;
+// wxPanel *panelControl = NULL;
+// wxFlexGridSizer *sizerCtrol = NULL;
+ wxPanel *controlPanelMPR3D = NULL;
+ wxPanel *controlPanelClippingSurf3D = NULL;
//RaC 03-2010 Adding a tab
- wxPanel *controlPanelClippingVol3D = 0;
+ wxPanel *controlPanelClippingVol3D = NULL;
wxBoxSizer *sizer = 0;
mvtkmprbasedata = vtkmprbasedata;
}
- mvtk2Dbaseview = NULL;
- mvtkmpr2Dview_X = NULL;
- mvtkmpr2Dview_Y = NULL;
- mvtkmpr2Dview_Z = NULL;
- mvtkplane2Dview = NULL;
- mwidgetMesure = NULL;
- mwxsphereview = NULL;
- mwxvtkclipping3Dview = NULL;
- mwxvtk3Dbaseview_Clipping3D = NULL;
- mwxvtkmpr3Dview = NULL;
- vtkmpr3Ddataviewer = NULL;
+ mvtk2Dbaseview = NULL;
+ mvtkmpr2Dview_X = NULL;
+ mvtkmpr2Dview_Y = NULL;
+ mvtkmpr2Dview_Z = NULL;
+ mvtkplane2Dview = NULL;
+ mwidgetMesure = NULL;
+ mwxsphereview = NULL;
+ mwxvtkclipping3Dview = NULL;
+ mwxvtk3Dbaseview_Clipping3D = NULL;
+ mwxvtkmpr3Dview = NULL;
+ vtkmpr3Ddataviewer = NULL;
if (type==-1)
{
//-------------------------------------------------------------------
wxVtkClipping3DView::~wxVtkClipping3DView()
{
- if (_boxWidgetVolume!=NULL) { _boxWidgetVolume -> Delete(); }
- if (_boxWidgetS1!=NULL) { _boxWidgetS1 -> Delete(); }
+ if (_boxWidgetVolume!=NULL) { _boxWidgetVolume -> Delete(); }
+ if (_boxWidgetS1!=NULL) { _boxWidgetS1 -> Delete(); }
if (_vtkclipping3Ddataviewer!=NULL) { delete _vtkclipping3Ddataviewer; }
if (_wxvtkclipping3DviewCntrlPanel!=NULL){ delete _wxvtkclipping3DviewCntrlPanel; }
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::SetVisibleBoxSurface(bool visible)
{
- if (visible==true){
+ if (visible==true)
+ {
_boxWidgetS1->On();
} else {
_boxWidgetS1->Off();
}
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::VisibleVolumeBoxActor(bool visible)
{
- if (visible!=_vtkclipping3Ddataviewer->GetVisibleVolumeBox() ){
+ if (visible!=_vtkclipping3Ddataviewer->GetVisibleVolumeBox() )
+ {
VisibleVolumeActor(!visible);
_vtkclipping3Ddataviewer->BoxActorChanged(visible);
_vtkclipping3Ddataviewer->SetVisibleVolumeBox(visible);
_vtkclipping3Ddataviewer->SetVisibleVolume(!visible);
}
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::Refresh()
{
_wxvtkclipping3DviewCntrlPanel->Refresh();
}
}
+
//-------------------------------------------------------------------
wxPanel* wxVtkClipping3DView::CreateSurfControlPanel(wxWindow *parent)
{
return _wxvtkclipping3DviewVolCntrlPanel;
}
-
//-------------------------------------------------------------------
vtkClipping3DDataViewer* wxVtkClipping3DView::GetVtkClipping3DDataViewer()
{
return _vtkclipping3Ddataviewer;
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::VisibleActor(int idTissue, bool visTissue){
if (visTissue!=_vtkclipping3Ddataviewer->GetVisibleTissue(idTissue)){
_vtkclipping3Ddataviewer->SetVisibleTissue(idTissue,visTissue);
}
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::SetRepSurfaceWireFrame(int idTissue , bool representationType )
{
}
}
+
//-------------------------------------------------------------------
wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview()throw(char*)
{
}
return _wxvtk3Dbaseview;
}
+
//-------------------------------------------------------------------
void wxVtkClipping3DView::Configure()
{
_boxWidgetS1->SetInput( polydata );
- _boxWidgetS1->PlaceWidget();
+
+//EED 2016-08-19
+ //_boxWidgetS1->PlaceWidget();
+ int ext[6];
+ this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData()->GetExtent(ext);
+ _boxWidgetS1->PlaceWidget(ext[0],ext[1],ext[2],ext[3],ext[4],ext[5]);
int i;
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
_boxWidgetS1->AddObserver( vtkCommand::InteractionEvent, _vtkclipping3Ddataviewer->GetObserverS(i) );
}
-
-
-
// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetTissueActor(0) );
// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetTissueActor(3));
//EED 29Mars2009
// _boxWidgetS1->On();
-
_boxWidgetS1->Off();
_boxWidgetS1->GetPlanes( this->GetVtkClipping3DDataViewer()->GetTissuePlanes(0) );
_boxWidgetVolume = vtkBoxWidget::New();
_boxWidgetVolume->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
_boxWidgetVolume->SetPlaceFactor(1.25);
-
_boxWidgetVolume->SetInput( this->GetVtkClipping3DDataViewer()->GetVtkMPRBaseData()->GetImageData() );
_boxWidgetVolume->PlaceWidget();
-
- _boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent , _vtkclipping3Ddataviewer->GetObserverV() );
-
+ _boxWidgetVolume->AddObserver( vtkCommand::InteractionEvent, _vtkclipping3Ddataviewer->GetObserverV() );
_boxWidgetVolume->HandlesOn ();
//EED 29Mars2009
// _boxWidgetVolume->On();
-
_boxWidgetVolume->Off();
-
// vtkPlanes *vtkplanes=this->GetVtkClipping3DDataViewer()->GetVolumePlanes();
// _boxWidgetVolume->GetPlanes( vtkplanes );
-
//EED 27/05/2013
// _wxvtk3Dbaseview->GetRenderer()->ResetCamera ();
// _wxvtk3Dbaseview->GetCamera()->Dolly(1.2);
_vtkclipping3Ddataviewer->SetRenderer(this->GetWxvtk3Dbaseview()->GetRenderer());
_vtkclipping3Ddataviewer->SetInteractor(this->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor());
-
-
}
//-------------------------------------------------------------------
void wxVtkClipping3DView::SetVtkClipping3DDataViewer(vtkClipping3DDataViewer *vtkclipping3Ddataviewer)
virtual ~wxVtkClipping3DView();
virtual void Refresh();
virtual void Configure();
- void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
+ void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
- wxPanel* CreateSurfControlPanel(wxWindow *parent);
- wxPanel* CreateVolControlPanel(wxWindow *parent);
+ wxPanel* CreateSurfControlPanel(wxWindow *parent);
+ wxPanel* CreateVolControlPanel(wxWindow *parent);
vtkClipping3DDataViewer* GetVtkClipping3DDataViewer();
- void VisibleActor(int idTissue, bool visTissue);
- void VisibleVolumeActor( bool visVolume );
+ void VisibleActor(int idTissue, bool visTissue);
+ void VisibleVolumeActor( bool visVolume );
- void VisibleVolumeBoxActor(bool visible);
+ void VisibleVolumeBoxActor(bool visible);
- void SetVisibleBoxSurface(bool visible);
- void SetVisibleBoxVolume(bool visible);
- void SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
+ void SetVisibleBoxSurface(bool visible);
+ void SetVisibleBoxVolume(bool visible);
+ void SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
wxVtk3DBaseView* GetWxvtk3Dbaseview()throw(char*);
- void SetRayCasting(bool active);
- void SetMIPActive(bool active);
- void SetInterpolation(bool active);
- void SetShade(bool active);
+ void SetRayCasting(bool active);
+ void SetMIPActive(bool active);
+ void SetInterpolation(bool active);
+ void SetShade(bool active);
- void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+ void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
private:
wxVtk3DBaseView *_wxvtk3Dbaseview;
vtkClipping3DDataViewer *_vtkclipping3Ddataviewer;
- vtkBoxWidget *_boxWidgetS1;
- vtkBoxWidget *_boxWidgetVolume;
- wxPanel *_wxvtkclipping3DviewCntrlPanel;
- wxPanel *_wxvtkclipping3DviewVolCntrlPanel;
+ vtkBoxWidget *_boxWidgetS1;
+ vtkBoxWidget *_boxWidgetVolume;
+ wxPanel *_wxvtkclipping3DviewCntrlPanel;
+ wxPanel *_wxvtkclipping3DviewVolCntrlPanel;
protected:
};