_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xyzv[1]);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xyzv[2]);
} else {
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xyzv[1]);
_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xyzv[2]);
} else {
if (needRefresh)
{
vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
isbv->SetParent_refresh_waiting();
isbv->EvaluateToRefresh();
}
if (needRefresh)
{
vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetInteractorStyleBaseView();
isbv->SetParent_refresh_waiting();
isbv->EvaluateToRefresh();
}
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview )
{
_wxvtk3Dbaseview = wxvtk3Dbaseview;
wxVtkMPR3DView::wxVtkMPR3DView( wxVtk3DBaseView *wxvtk3Dbaseview )
{
_wxvtk3Dbaseview = wxvtk3Dbaseview;
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
VisiblePointWidget( false );
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
VisiblePointWidget( false );
//-------------------------------------------------------------------
void wxVtkMPR3DView::Configure()
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
//-------------------------------------------------------------------
void wxVtkMPR3DView::Configure()
{
vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0) ); // _saggital
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1) ); // _axial
-// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal
-
-
-
- // vtkPointWidget
- //if(_myCallback!=NULL){
- //_myCallback->Delete();
-
- //}
vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
_myCallback->SetWxVtkMPR3DView(this);
vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
_myCallback->SetWxVtkMPR3DView(this);
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
_pointWidget->PlaceWidget();
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
_pointWidget->PlaceWidget();
_planeWidget->NormalToXAxisOn();
_planeWidget->SetResolution(50);
_planeWidget->SetRepresentationToOutline();
_planeWidget->NormalToXAxisOn();
_planeWidget->SetResolution(50);
_planeWidget->SetRepresentationToOutline();
imageData->GetDimensions(dim);
int px=(dim[0]/2);
int py=(dim[1]/2);
int pz=(dim[2]/2);
int dd=20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
imageData->GetDimensions(dim);
int px=(dim[0]/2);
int py=(dim[1]/2);
int pz=(dim[2]/2);
int dd=20;
_planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
-
- if(_vtkplane==NULL){
- _vtkplane = vtkPolyData::New();
-
- _probe = vtkProbeFilter::New();
- _contourMapper = vtkPolyDataMapper::New();
-
+ if(_vtkplane==NULL)
+ {
+ _vtkplane = vtkPolyData::New();
+ _probe = vtkProbeFilter::New();
+ _contourMapper = vtkPolyDataMapper::New();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_probe->SetInput(_vtkplane);
_contourMapper->SetInput( _probe->GetPolyDataOutput() );
#else
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
_probe->SetInput(_vtkplane);
_contourMapper->SetInput( _probe->GetPolyDataOutput() );
#else
_contourMapper->SetInputData( _probe->GetPolyDataOutput() );
#endif
_contourPlaneActor = vtkActor::New();
_contourPlaneActor->SetMapper(_contourMapper);
_contourMapper->SetInputData( _probe->GetPolyDataOutput() );
#endif
_contourPlaneActor = vtkActor::New();
_contourPlaneActor->SetMapper(_contourMapper);
_planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
_planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_planeWidget->AddObserver(vtkCommand::InteractionEvent,_myCallback);
// render window (expressed in pixels).
_wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
// render window (expressed in pixels).
_wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 );
//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400);
}
//-------------------------------------------------------------------
void wxVtkMPR3DView::ConfigureFreePlanes()
{
}
//-------------------------------------------------------------------
void wxVtkMPR3DView::ConfigureFreePlanes()
{
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
vtkCellPicker* picker = vtkCellPicker::New();
picker->SetTolerance(0.005);
// The shared picker enables us to use 3 planes at one time
// and gets the picking order right
vtkCellPicker* picker = vtkCellPicker::New();
picker->SetTolerance(0.005);
// The 3 image plane widgets
_planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
_planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
_planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
// The 3 image plane widgets
_planeWidgetX = GetPlaneWidget('x', 1, 0, 0, picker);
_planeWidgetY = GetPlaneWidget('y', 1, 1, 0, picker);
_planeWidgetZ = GetPlaneWidget('z', 0, 0, 1, picker);
_planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetY->SetLookupTable(_planeWidgetX->GetLookupTable());
_planeWidgetZ->SetLookupTable(_planeWidgetX->GetLookupTable());
+
+
+ double colorWindow = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow();
+ double colorLevel = _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel();
+
+ double spc[3];
+ vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+ if(image)
+ {
+ image->GetSpacing(spc);
+ }else{
+ spc[0] = 0;
+ spc[1] = 0;
+ spc[2] = 0;
+ }
+ double x = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
+ double y = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
+ double z = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
+
_vtkmpr3Ddataviewer->SetImage();
}
//-------------------------------------------------------------------
vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
{
_vtkmpr3Ddataviewer->SetImage();
}
//-------------------------------------------------------------------
vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
{
- vtkProperty* prop1 = 0;
- vtkImagePlaneWidget* planeWidget = 0;
- planeWidget = vtkImagePlaneWidget::New();
+ vtkProperty* prop1 = NULL;
+ vtkImagePlaneWidget* planeWidget = vtkImagePlaneWidget::New();
planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
planeWidget->EnabledOff();
vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
planeWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
planeWidget->EnabledOff();
vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
- double x=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
- double y=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
- double z=GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
-
- SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
- SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
+ double x = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetX();
+ double y = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetY();
+ double z = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetZ();
_planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
_planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
}
_planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
_planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
}
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
//-------------------------------------------------------------------
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
-//-------------------------------------------------------------------
-void wxVtkMPR3DView::SetColorLevel(double colorLevel)
-{
- double colorWindow = _planeWidgetX->GetWindow();
- _planeWidgetX->SetWindowLevel(colorWindow,colorLevel);
-}
//-------------------------------------------------------------------
// EED 25 Janvier 2007 testLoic
//-------------------------------------------------------------------
// EED 25 Janvier 2007 testLoic