_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 );
VisiblePlaneWidget( false );
//-------------------------------------------------------------------
wxVtkMPR3DView::~wxVtkMPR3DView()
{
VisiblePointWidget( false );
VisiblePlaneWidget( 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);
_myCallback->SetVtkPointWidget(_pointWidget);
_pointWidget->SetInteractor( GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor() );
_pointWidget->AllOff();
_pointWidget->PlaceWidget();
_myCallback->SetVtkPointWidget(_pointWidget);
_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 );
+#else
+ _myCallback->SetVtkPolyData(_vtkplane);
+ _myCallback->SetVtkProbeFilter(_probe);
+ _planeWidget->GetPolyData(_vtkplane);
+ _probe->SetInputData(_vtkplane);
+ _probe->SetSourceData(imageData);
+// _probe->Update();
+ _contourMapper->SetInputData( _probe->GetPolyDataOutput() );
+#endif
_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());
_planeWidgetX->SetInput( imageData );
_planeWidgetY->SetInput( imageData );
_planeWidgetZ->SetInput( imageData );
// -- Plane widget
_probe->SetSource( imageData );
_planeWidgetX->SetInput( imageData );
_planeWidgetY->SetInput( imageData );
_planeWidgetZ->SetInput( imageData );
// -- Plane widget
_probe->SetSource( imageData );
image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
image->GetSpacing(xSpacing, ySpacing, zSpacing);
}
image->GetExtent(xMin, xMax, yMin, yMax, zMin, zMax);
image->GetSpacing(xSpacing, ySpacing, zSpacing);
}
if ((plane==1) && (ok==false)) _planeWidgetX->EnabledOff();
if ((plane==2) && (ok==false)) _planeWidgetY->EnabledOff();
if ((plane==3) && (ok==false)) _planeWidgetZ->EnabledOff();
if ((plane==1) && (ok==false)) _planeWidgetX->EnabledOff();
if ((plane==2) && (ok==false)) _planeWidgetY->EnabledOff();
if ((plane==3) && (ok==false)) _planeWidgetZ->EnabledOff();
SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
SetColorWindow( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() );
SetColorLevel( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
+ if(_pointWidget)
+ {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ _pointWidget->SetInput( image );
+#else
+ _pointWidget->SetInputData( image );
+#endif
+ _pointWidget->PlaceWidget();
+
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
_planeWidget->SetCenter( x,y,z );
_planeWidget->UpdatePlacement();
_planeWidget->GetPolyData(_vtkplane);
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
vtkStructuredPoints *stPoints = vtkStructuredPoints::New();
stPoints -> GetPointData( )->SetScalars( slices->GetOutput()->GetPointData()->GetScalars() );
stPoints -> SetDimensions( sizeIma, sizeIma, 1 );
vtkStructuredPoints *stPoints = vtkStructuredPoints::New();
stPoints -> GetPointData( )->SetScalars( slices->GetOutput()->GetPointData()->GetScalars() );
stPoints -> SetDimensions( sizeIma, sizeIma, 1 );
_3DSliceMapper->SetLookupTable( _bwlookup );
_3DSliceMapper->SetScalarRange( _range );
_3DSliceMapper->ImmediateModeRenderingOn( );
_3DSliceMapper->SetLookupTable( _bwlookup );
_3DSliceMapper->SetScalarRange( _range );
_3DSliceMapper->ImmediateModeRenderingOn( );
vtkCutter* sliceCutter = vtkCutter::New();
vtkImageData *vtkimagedata = this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
vtkCutter* sliceCutter = vtkCutter::New();
vtkImageData *vtkimagedata = this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
sliceCutter->SetCutFunction( slicePlane );
//EED
// vtkLookupTable *lut = BuildHueWeightBaseMap();
vtkPolyDataMapper *slice = vtkPolyDataMapper::New();
sliceCutter->SetCutFunction( slicePlane );
//EED
// vtkLookupTable *lut = BuildHueWeightBaseMap();
vtkPolyDataMapper *slice = vtkPolyDataMapper::New();
- slice->SetInput( sliceCutter->GetOutput() );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ slice->SetInput( sliceCutter->GetOutput() );
+#else
+ slice->SetInputData( sliceCutter->GetOutput() );
+#endif