}
// ----------------------------------------------------------------------------
-InteractorStyleMaracas * InteractorStyleMaracas :: Clone() // virtual
+InteractorStyleMaracas * InteractorStyleMaracas::Clone() // virtual
{
InteractorStyleMaracas * clone = new InteractorStyleMaracas();
CopyAttributesTo(clone);
return true;
}
-
-
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnMouseWheelForward() //virtual
{
return true;
}
-
//---------------------------------------------------------------------------
bool InteractorStyleMaracas::OnMouseWheelBackward() //virtual
{
return true;
}
-
//---------------------------------------------------------------------------
-
- void InteractorStyleMaracas::SetVtkInteractorStyleBaseView(vtkInteractorStyleBaseView* vtkInteractorStyleBaseView)
+void InteractorStyleMaracas::SetVtkInteractorStyleBaseView(vtkInteractorStyleBaseView* vtkInteractorStyleBaseView)
{
_vtkInteractorStyleBaseView = vtkInteractorStyleBaseView;
}
-
-
//---------------------------------------------------------------------------
void InteractorStyleMaracas::RemoveVtkInteractorStyleBaseView()
{
// vtkimageviewer2->Render();
}
+
+
return true;
}
_visibleVolumeBox = visibleBox;
}
+
//-------------------------------------------------------------------
-void vtkClipping3DDataViewer::Configure_Tissue()
+void vtkClipping3DDataViewer::SetImage()
{
+ int i;
+ vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+ for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+ {
+ _mCubes[i]->SetInput( imagedata );
+ } // for
+ _volumeMapper->SetInput( imagedata );
+ _volumerendererdata->SetImageData( imagedata );
+}
- double range[2];
+//-------------------------------------------------------------------
+void vtkClipping3DDataViewer::Configure_Tissue()
+{
int i;
- for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
+ double range[2];
+ vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
+ imagedata->GetScalarRange( range );
+ for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
+ {
// Visualisation - original volume
- vtkImageData *imagedata=_vtkmprbasedata->GetImageData();
- imagedata->GetScalarRange( range );
_mCubes[i] = vtkMarchingCubes::New( );
_mCubes[i]->SetInput( imagedata );
-
_mCubes[i]->SetValue( 0, range[1]*(4+i) / 8 );
// _mCubes[i]->SetValue( 0, 1500 );
-
_tissueStripper[i] = vtkStripper::New();
_tissueStripper[i]->SetInput( _mCubes[i]->GetOutput( ) );
-
-
-
_tissuePlanes[i] = vtkPlanes::New();
-
int x1,x2,y1,y2,z1,z2;
imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
_tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2);
-
_tissueClipper[i] = vtkClipPolyData::New();
_tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
_tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
_tissueClipper[i]->InsideOutOn( );
-
_tissueMapper[i] = vtkPolyDataMapper::New( );
_tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
_tissueMapper[i]->ScalarVisibilityOff( );
// _tissueMapper[i]->Update();
-
- }
-
-
+ } // for i
// vtkActor tissue
for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++){
_observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::Configure_VolumeBox()
{
//_volumerendererdata->BoundingBoxChanged(event.IsChecked() );
}
+//-----------------------------------------------------------------------------
+
void vtkClipping3DDataViewer::SetRenderer(vtkRenderer* renderer)
{
_volumerendererdata->SetRenderer(renderer);
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::SetInteractor(vtkRenderWindowInteractor* interactor)
{
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::BoxActorChanged(bool changed)
{
vector<double> *gv = this->GetGreyValuesTransferenceFVector();
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun)
{
_volumerendererdata->SetLookUpTable((vtkLookupTable*)(ctfun));
}
+//-----------------------------------------------------------------------------
void vtkClipping3DDataViewer::updateVolume()
{
//EED 4 nov 2015 Estelle
// _mapOutline->SetInput(_outlineData->GetOutput());
- _outline = vtkActor::New();
+ _outline = vtkActor::New();
_outline->SetMapper(_mapOutline);
_outline->GetProperty()->SetColor(0,0,0);
}
virtual void Configure();
void Configure_Tissue();
void Configure_Volume();
-
+ void SetImage();
+
void SetIsovalue(int idTissue, int isoValue);
double GetIsovalue(int idTissue);
{
vtkInteractorStyleBaseView::OnRightButtonDown();
- if ((GetInteractor()->GetControlKey()==1) && (GetInteractor()->GetShiftKey()==0) ){
+ if ((GetInteractor()->GetControlKey()==1) && (GetInteractor()->GetShiftKey()==0) )
+ {
this->vtkInteractorStyleImage::OnRightButtonDown();
}
}
vtkInteractorStyleBaseView::OnRightButtonUp();
this->vtkInteractorStyleImage::OnRightButtonUp();
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView2D::OnMouseMove () // virtual
{
vtkInteractorStyleBaseView::OnMouseMove();
this->vtkInteractorStyleImage::OnMouseMove();
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView2D::OnLeftButtonDown() // virtual
{
this->vtkInteractorStyleImage::OnLeftButtonDown();
}
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView2D::OnLeftButtonUp () // virtual
{
this->vtkInteractorStyleImage::OnLeftButtonUp();
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView2D::OnMiddleButtonDown () // virtual
{
this->vtkInteractorStyleImage::OnLeftButtonDown();
}
}
+
//---------------------------------------------------------------------------
void vtkInteractorStyleBaseView2D::OnMiddleButtonUp () // virtual
{
_fordwareY = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
vtkPlane2DView *vtkplane2Dview = (vtkPlane2DView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
vtkplane2Dview->RotationStart();
-
return true;
}
vtkplane2Dview->ResetBack();
// this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
}
-
return true;
}
}
//---------------------------------------------------------------------------
-
vtkInteractorStyleSphere::~vtkInteractorStyleSphere()
{
}
-
-//---------------------------------------------------------------------------
-
+//--------------------------------------------------------------------------
bool vtkInteractorStyleSphere::OnRightButtonDown()
{
if ((_vtkInteractorStyleBaseView->GetInteractor()->GetControlKey()==0) && (_vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey()==0) )
_stateRadio = true;
//_fordwareX = this->Interactor->GetEventPosition()[0];
_fordwareY = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
-
wxSphereView *wxsphereview = (wxSphereView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
-
_radio = wxsphereview->GetRadio();
}
-
return true;
}
//---------------------------------------------------------------------------
-
bool vtkInteractorStyleSphere::OnRightButtonUp()
{
if (_stateRadio==true)
wxsphereview->GetIdOfImage(radio+0.2);
wxsphereview->GetIdOfImage(radio-0.1);
wxsphereview->GetIdOfImage(radio-0.2);
-
wxsphereview->RefreshView();
_stateRadio = false;
}
-
return true;
}
-//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
bool vtkInteractorStyleSphere::OnLeftButtonDown()
{
_stateRotate = true;
return true;
}
-
//---------------------------------------------------------------------------
-
bool vtkInteractorStyleSphere::OnLeftButtonUp()
{
wxSphereView *wxsphereview = (wxSphereView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
wxsphereview->RefreshView();
_stateRotate = false;
}
-
return true;
}
//---------------------------------------------------------------------------
-
bool vtkInteractorStyleSphere::OnMouseMove ()
{
wxSphereView *wxsphereview = (wxSphereView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView());
+
if (_stateRotate==true)
{
bool ok_v, ok_ang;
}
if (_stateRadio==true)
{
+
//int fx = this->Interactor->GetEventPosition()[0];
int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
double dif=(fy-_fordwareY) / 10.0;
wxsphereview->SetRadio( _radio + dif );
wxsphereview->SetDeltaVoxel(3);
+
wxsphereview->RefreshView();
}
-
return true;
}
+
+
+
+
+
+
+
+
+
return &_ctFunVectorBlue;
}
+//-------------------------------------------------------------------
+void vtkMPR3DDataViewer::SetImage()
+{
+ _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() );
+ _axialColors->SetInput( _vtkmprbasedata->GetImageData() );
+ _coronalColors->SetInput( _vtkmprbasedata->GetImageData() );
+}
+
//-------------------------------------------------------------------
void vtkMPR3DDataViewer::Configure()
{
{
_vtkmprbasedata->GetImageData()->GetScalarRange(range);
delta = range[1]-range[0];
-
-
+
_ctFunVectorPoint.clear();
_ctFunVectorPoint.push_back( range[0] + delta*0/4 );
_ctFunVectorPoint.push_back( range[0] + delta*1/4 );
_ctFunVectorBlue.push_back(0.0);
_ctFunVectorBlue.push_back(0.0);
-
if(_ctfun==NULL)
{
_ctfun = vtkColorTransferFunction::New();
vtkActor* GetOutlineActor();
virtual void Refresh();
virtual void Configure();
+ void SetImage();
void SetVisiblePosition(int idPosition, bool visible);
bool GetVisiblePosition(int idPosition);
vtkImageActor* GetvtkActor_saggital();
_imageResult = NULL;
// line horizontal
- _pts = NULL;
- _lineActor = NULL;
- _lineMapper = NULL;
- _pd = NULL;
+ _pts = NULL;
+ _lineActor = NULL;
+ _lineMapper = NULL;
+ _pd = NULL;
_interactorstyleplane2D = false;
}
vtkPlane2DView::~vtkPlane2DView()
{
ResetPlane();
-
// Horizontal Line
if (_pts != NULL) { _pts -> Delete(); }
if (_lineActor != NULL) { _lineActor -> Delete(); }
if (_lineMapper != NULL) { _lineMapper -> Delete(); }
if (_pd != NULL) { _pd -> Delete(); }
-
_transform1 -> Delete();
_transform2 -> Delete();
}
}
//-------------------------------------------------------------------
-void vtkPlane2DView::ResetPlane(){
+void vtkPlane2DView::ResetPlane()
+{
if (_pSource !=NULL) { _pSource -> Delete(); }
if (_3Dslices !=NULL) { _3Dslices -> Delete(); }
if (_stPoints !=NULL) { _stPoints -> Delete(); }
if (_change !=NULL) { _change -> Delete(); }
}
+
//-------------------------------------------------------------------
vtkMPRBaseData *vtkPlane2DView::GetVtkmprbasedata()
{
//-------------------------------------------------------------------
void vtkPlane2DView::ExtractPlane()
{
-
double x = GetVtkmprbasedata()->GetX();
double y = GetVtkmprbasedata()->GetY();
double z = GetVtkmprbasedata()->GetZ();
}
//-------------------------------------------------------------------
-
void vtkPlane2DView::Extract_One_PlaneVTK()
{
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
}
//-------------------------------------------------------------------
-
void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ )
{
-
int mipWidth;
double sp;
int sizeWidth = (_mip_width*2)+1 ;
int deltaPixel;
int iWidth,itmp,tmpSizeWith;
-
double spc[3];
vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
SetPSource(_sizeIma);
imagedata->GetSpacing(spc);
-
bool heightDefinition=false;
if (_mip_width<3)
{
heightDefinition=true;
}
-
if (heightDefinition==true)
{
mipWidth = _mip_width;
sizeWidth = tmpSizeWith;
deltaPixel = 4;
}
-
-
-
std::vector< vtkProbeFilter* > slicesLST;
-
_pSource->Push( -mipWidth * sp );
_pSource->Update();
-
for ( iWidth=0 ; iWidth<sizeWidth ; iWidth++ )
{
vtkProbeFilter *slice = vtkProbeFilter::New();
slicesLST.push_back( slice );
_pSource->Push( sp );
}
-
if (_imageResult ==NULL)
{
_imageResult = vtkImageData::New();
_imageResult -> AllocateScalars();
_imageResult -> Update();
}
-
unsigned short *pTemp;
unsigned short *pResult;
pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
-
int iPixels , sizePixels = _sizeIma*_sizeIma;
for(iPixels=0 ; iPixels<sizePixels ; iPixels=iPixels+deltaPixel)
{
-
pTemp = (unsigned short*)slicesLST[0]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
-
pResult = (unsigned short*)_imageResult->GetScalarPointer( 0 , 0 , 0 );
pResult[iPixels] = pTemp[iPixels];
-
for (iWidth=1;iWidth<sizeWidth;iWidth++)
{
pTemp = (unsigned short*)slicesLST[iWidth]->GetOutput()->GetPointData()->GetScalars()->GetVoidPointer(0);
pResult[iPixels] = pTemp[iPixels];
}
}
-
if (deltaPixel!=1)
{
for (itmp=1;itmp<deltaPixel;itmp++)
pResult[iPixels+itmp] = pResult[iPixels];
}
}
-
}
-
for (iWidth=0;iWidth<sizeWidth;iWidth++)
{
slicesLST[iWidth]->Delete();
}
-
_imageResult->Modified();
_imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageResult );
-
}
//-------------------------------------------------------------------
//
// Actual version
vtkInteractorStyleBaseView2D *style2D = vtkInteractorStyleBaseView2D::New();
-
manualInteractorWindowLevel *_manualinteractorwindowlevel= new manualInteractorWindowLevel();
style2D->SetInteractorWindowLevel( _manualinteractorwindowlevel );
-
vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
-
SetInteractorStyleImage( style2D );
// RaC
vtkTransform *transform = mprbasedata->GetTransformOrientation();
_transform1->SetMatrix( transform->GetMatrix() );
}
+
//-------------------------------------------------------------------
void vtkPlane2DView::RotationDrag(double vx, double vy, bool ok_v, bool ok_ang)
{
void vtkPlane2DView::Refresh( )
{
ExtractPlane();
+ UpdateColorWindowLevel();
wxVtkBaseView::Refresh();
}
//-------------------------------------------------------------------
}
_lineActor->GetProperty()->SetOpacity(opacity);
}
+
// ----------------------------------------------------------------------------
void vtkPlane2DView::TransfromCoordViewWorld2(double &X, double &Y, double &Z)
{
double spc[3];
GetVtkmprbasedata()->GetImageData()->GetSpacing(spc);
-
double xx = X;
double yy = Y;
double zz = 0;
-
TransFromCoordScreenToWorld(xx,yy,zz);
-
-
vtkTransform *transf1 = vtkTransform::New();
transf1->Identity();
vtkTransform *transf2 = GetVtkmprbasedata()->GetTransformOrientation();
in[1] = xx - center;
in[2] = yy - center;
in[3] = 0;
-
transf1->MultiplyPoint(in,out);
transf1->Delete();
-
X = out[0] + GetVtkmprbasedata()->GetX() ;
Y = out[1] + GetVtkmprbasedata()->GetY() ;
Z = out[2] + GetVtkmprbasedata()->GetZ() ;
class creaMaracasVisu_EXPORT vtkMPRBaseData: public vtkBaseData{
public:
vtkMPRBaseData();
- virtual ~vtkMPRBaseData();
+ virtual ~vtkMPRBaseData();
virtual void Configure();
int GetMaxPositionX( );
int GetMaxPositionY( );
int GetMaxPositionZ( );
double GetX();
double GetY();
- void SetX(double x);
- void SetY(double y);
- void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
+ void SetX(double x);
+ void SetY(double y);
+ void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
vtkTransform* GetTransformOrientation();
- void SetNormal(double nx, double ny, double nz);
- void InitTransformOrientation(vtkTransform *trans);
+ void SetNormal(double nx, double ny, double nz);
+ void InitTransformOrientation(vtkTransform *trans);
protected:
int _x1,_x2,_y1,_y2,_z1,_z2;
_refreshBPage=0;
}
-void wxMPRWidget::setImageData(vtkImageData * img, double voxelsize){
+
+//----------------------------------------------------------------------------
+void wxMPRWidget::setImageData(vtkImageData * img, double voxelsize)
+{
if(_marImageData!=NULL){
_marImageData->removeImageData(0);
_marImageData->AddImageData(img);
}else{
- _marImageData = new marImageData(img);
+ _marImageData = new marImageData(img);
}
- _voxelSize = voxelsize;
+ _voxelSize = voxelsize;
if(_vtkmprbasedata==NULL){
_vtkmprbasedata = new vtkMPRBaseData();
_vtkmprbasedata->SetMarImageData(_marImageData);
- wxSplitterWindow *pnlSplitter = new wxSplitterWindow( this , -1);
+ wxSplitterWindow *pnlSplitter= new wxSplitterWindow( this , -1);
pnlSplitter -> SetMinimumPaneSize( 2 );
//RaC Nov2012 Correctly resize internal panels with the window resize event
pnlSplitter->SetSashGravity(0.5);
- wxPanel *MPRPanel = CreateMPRPanel(pnlSplitter,_vtkmprbasedata);
+ wxPanel *MPRPanel = CreateMPRPanel(pnlSplitter,_vtkmprbasedata);
wxPanel *controlPanel = CreateControlPanel(pnlSplitter);
pnlSplitter -> SplitVertically( MPRPanel, controlPanel, 550 );
this->GetSizer() -> Add( pnlSplitter ,1,wxGROW ,0);
}
-
-
-
}
-//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
wxMPRWidget::~wxMPRWidget( )
{
//EEDxx2.4 DELETE
}
if (type==4)
{
- _wxsphereview_B = new wxSphereView( panel , vtkmprbasedata, vtkmprbasedata->GetImageData() );
+//EED
+// _wxsphereview_B = new wxSphereView( panel , vtkmprbasedata, vtkmprbasedata->GetImageData() );
+ _wxsphereview_B = new wxSphereView( panel , vtkmprbasedata );
wxwindow=_wxsphereview_B->GetWxVTKRenderWindowInteractor();
}
notebook->AddPage( _widgetMesure, _T("Plane") );
// view 3.1
- _wxsphereview = new wxSphereView( notebook , vtkmprbasedata, vtkmprbasedata->GetImageData());
+// EED
+// _wxsphereview = new wxSphereView( notebook , vtkmprbasedata, vtkmprbasedata->GetImageData());
+ _wxsphereview = new wxSphereView( notebook , vtkmprbasedata );
wxVTKRenderWindowInteractor *iren3B = _wxsphereview->GetWxVTKRenderWindowInteractor();
notebook->AddPage( iren3B, _T("Sphere") );
if (vtkmprbasedata==NULL)
{
- minternalVtkmprbasedata = true;
- mvtkmprbasedata = new vtkMPRBaseData();
- marImageData *marimagedata = new marImageData( imagedata );
+ minternalVtkmprbasedata = true;
+ mvtkmprbasedata = new vtkMPRBaseData();
+ marImageData *marimagedata = new marImageData( imagedata );
mvtkmprbasedata->SetMarImageData(marimagedata);
} else {
minternalVtkmprbasedata = false;
wxwindow = mwidgetMesure;
}else if (type==4)
{
- mwxsphereview = new wxSphereView( panel , mvtkmprbasedata, mvtkmprbasedata->GetImageData() );
+//EED
+// mwxsphereview = new wxSphereView( panel , mvtkmprbasedata , mvtkmprbasedata->GetImageData() );
+ mwxsphereview = new wxSphereView( panel , mvtkmprbasedata );
wxwindow=mwxsphereview->GetWxVTKRenderWindowInteractor();
}else if (type==5)
{
panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
-
- mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
- vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
+ mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
+ vtkClipping3DDataViewer *vtkclipping3Ddataviewer= new vtkClipping3DDataViewer();
vtkclipping3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata);
vtkclipping3Ddataviewer->Configure();
mwxvtkclipping3Dview->SetVtkClipping3DDataViewer(vtkclipping3Ddataviewer);
- mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
+ mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
vtkmpr3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata);
vtkmpr3Ddataviewer->Configure();
window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
//--
- wxNotebook *notebook = new wxNotebook(panelClipping3D, -1);
+ wxNotebook *notebook = new wxNotebook(panelClipping3D, -1);
// First tab
- controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(notebook, true);
+ controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(notebook, true);
notebook->AddPage(controlPanelMPR3D, _T("Planes") );
// Second Tab
} else if (type==6) {
panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
+ wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
+ wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
panelControl->SetAutoLayout(true);
if (mvtkmpr2Dview_Y !=NULL ){ mvtkmpr2Dview_Y->Refresh(); }
if (mvtkmpr2Dview_Z !=NULL ){ mvtkmpr2Dview_Z->Refresh(); }
if (mvtkplane2Dview !=NULL ){ mvtkplane2Dview->Refresh(); }
- if (mwxsphereview !=NULL ){ mwxsphereview ->Refresh(); }
+ if (mwxsphereview !=NULL ){ mwxsphereview ->RefreshView(); }
if (mwxvtkmpr3Dview !=NULL ){ mwxvtkmpr3Dview->RefreshView(); }
if (mwxvtkclipping3Dview !=NULL ){ mwxvtkclipping3Dview->Refresh(); }
if (mwxvtk3Dbaseview_Clipping3D !=NULL ){ mwxvtk3Dbaseview_Clipping3D->Refresh(); }
return wxvtkbaseview ;
}
+
+
+//-------------------------------------------------------------------------
void wxMaracas_ViewerWidget::SetImage( vtkImageData *image )
{
if(mvtkmprbasedata !=NULL)
mar->removeImageData(0);
mar->AddImageData(image);
}
-
if (mvtk2Dbaseview!=NULL)
{
mvtk2Dbaseview->SetImageToVtkViewer(image);
}
- if (mvtkmpr2Dview_X!=NULL){
+ if (mvtkmpr2Dview_X!=NULL)
+ {
mvtkmpr2Dview_X->SetImageToVtkViewer(image);
}
- if (mvtkmpr2Dview_Y!=NULL){
+ if (mvtkmpr2Dview_Y!=NULL)
+ {
mvtkmpr2Dview_Y->SetImageToVtkViewer(image);
}
- if (mvtkmpr2Dview_Z!=NULL){
+ if (mvtkmpr2Dview_Z!=NULL)
+ {
mvtkmpr2Dview_Z->SetImageToVtkViewer(image);
}
- if (mvtkplane2Dview!=NULL){
+ if (mvtkplane2Dview!=NULL)
+ {
// ??? EED 10 oct 2012
}
- if (mwxsphereview!=NULL){
- // ??? EED 10 oct 2012
+ if (mwxsphereview!=NULL)
+ {
+ mwxsphereview->SetImage();
}
- if (mwxvtk3Dbaseview_Clipping3D!=NULL){
- // ??? EED 10 oct 2012
+ if (mwxvtkclipping3Dview!=NULL)
+ {
+ mwxvtkclipping3Dview->GetVtkClipping3DDataViewer()->SetImage();
}
-
+ if (mwxvtkmpr3Dview!=NULL)
+ {
+ mwxvtkmpr3Dview->SetImage();
+ }
//EED 26/11/2009
// ConfigureVTK();
// RefreshView();
+
}
+ //-------------------------------------------------------------------------
+
double wxMaracas_ViewerWidget :: GetX()
{
double value = -1;
return value;
}
+ //-------------------------------------------------------------------------
+
double wxMaracas_ViewerWidget::GetY()
{
double value = -1;
return value;
}
+ //-------------------------------------------------------------------------
+
double wxMaracas_ViewerWidget::GetZ()
{
double value = -1;
#include "wxSphereView.h"
-
-wxSphereView::wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata, vtkImageData *imageData )
+wxSphereView::wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata/*, vtkImageData *imageData */)
: wxVtk2DBaseView(parent)
{
_delta = 1;
_vtkmprbasedata = vtkmprbasedata;
- _imageDataOriginal = imageData;
+//EED 2016-08-31
+// _imageDataOriginal = imageData;
+
+ SetImage();
_imageSphere = vtkImageData::New();
_imageSphere->SetDimensions (150,150,500);
- _imageSphere->SetScalarTypeToUnsignedShort();
+
+//EED
+// _imageSphere->SetScalarTypeToUnsignedShort();
+ _imageSphere->SetScalarType( _imageDataOriginal->GetScalarType() );
+
_imageSphere->AllocateScalars();
_imageSphere->Update();
-
- vtkBaseData *vtkbasedata = new vtkBaseData();
- vtkbasedata->SetMarImageData( new marImageData(_imageSphere) );
- this->SetVtkBaseData(vtkbasedata);
+//EED ???? vtkBaseData no esta compartido con los otros objetos .. PLOP
+// vtkBaseData *vtkbasedata = new vtkBaseData();
+// vtkbasedata->SetMarImageData( new marImageData(_imageSphere) );
+// this->SetVtkBaseData(vtkbasedata);
+ this->SetVtkBaseData(_vtkmprbasedata);
_transform = vtkTransform::New();
_transform1 = vtkTransform::New();
_transform ->Identity();
_transform1->Identity();
_transform2->Identity();
-
_radio=25;
}
//-------------------------------------------------------------------
-
wxSphereView::~wxSphereView()
{
_transform -> Delete();
}
//----------------------------------------------------------------------------
+void wxSphereView::SetImage()
+{
+ ResetlstId();
+ _imageDataOriginal=_vtkmprbasedata->GetImageData();
+}
+//----------------------------------------------------------------------------
double wxSphereView::GetRadio()
{
return _radio;
}
//----------------------------------------------------------------------------
-
void wxSphereView::SetRadio(double radio)
{
if (radio<0)
{
radio=0;
- }
+ } // if
_radio=radio;
}
//----------------------------------------------------------------------------
-
void wxSphereView::Configure()
{
wxVtk2DBaseView::Configure();
+
+ vtkInteractorStyleBaseView2D *style2D = vtkInteractorStyleBaseView2D::New();
+ manualInteractorWindowLevel *_manualinteractorwindowlevel= new manualInteractorWindowLevel();
+ style2D->SetInteractorWindowLevel( _manualinteractorwindowlevel );
+// vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
+// style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
+ SetInteractorStyleImage( style2D );
+
+
+
_vtkinteractorstylesphere = new vtkInteractorStyleSphere();
((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _vtkinteractorstylesphere );
double points[4][3];
-
// EED purify 12/sep/2006
int i,j;
for (i=0;i<4;i++)
for (j=0;j<3;j++)
{
points[i][j]=0;
- }
- }
-
+ } // for
+ } // for
InitSphere(points);
+
+
DefineImageSphere();
}
//----------------------------------------------------------------------------
-
void wxSphereView::RefreshPoint()
{
double x = _vtkmprbasedata->GetX() - _centerX;
double z = _vtkmprbasedata->GetZ() - _centerZ;
double alpha= atan2(x,z);
double beta = atan2( y , sqrt(z*z+x*x) );
-
alpha = alpha*180/3.1416;
beta = beta*180/3.1416;
-
_transform1->Identity();
_transform1->RotateY(alpha);
_transform1->RotateX(-beta);
-
_radio= sqrt(x*x + y*y +z*z);
-
RefreshView();
}
-//----------------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void wxSphereView::Refresh( )
+{
+// ExtractPlane();
+ UpdateColorWindowLevel();
+ wxVtkBaseView::Refresh();
+}
+
+
+
+//----------------------------------------------------------------------------
void wxSphereView::RefreshView()
{
+//EED
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageSphere );
DefineImageSphere();
- wxVtk2DBaseView::Refresh();
+// UpdateColorWindowLevel();
+// wxVtk2DBaseView::Refresh();
+ Refresh();
}
//----------------------------------------------------------------------------
-
void wxSphereView::RotationEnd()
{
_transform1->RotateWXYZ(_ang,_vxb,_vyb,0);
}
//----------------------------------------------------------------------------
-
void wxSphereView::RotationStart(double vx, double vy, bool ok_v, bool ok_ang)
{
if (ok_ang==false)
{
_ang = -sqrt( vx*vx + vy*vy ) / 1.0;
- }
-
+ } // if ok_ang
if (ok_v==false){
_vxb=-vy;
_vyb=vx;
- }
-
+ } // if ok_v
_transform2->Identity();
_transform2->RotateWXYZ(_ang,_vxb,_vyb,0);
SetDeltaVoxel(3);
}
//----------------------------------------------------------------------------
-
void wxSphereView::GetPointSphere(double p[3],double r1,double angA,double angB)
{
double in[3],out[3];
}
//----------------------------------------------------------------------------
-
void wxSphereView::RotatePointOverTheSphere( double pp[3], double p[3],double cc[3])
{
-
double out[3];
_transform->TransformPoint(p,out);
pp[0] = out[0] + cc[0];
pp[1] = out[1] + cc[1];
pp[2] = out[2] + cc[2];
-
}
//----------------------------------------------------------------------------
-
-void wxSphereView::TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image)
-{
- double t;
- double difX = pp2[0]-pp1[0];
- double difY = pp2[1]-pp1[1];
- double difZ = pp2[2]-pp1[2];
-
- double max = 200;
-
- int dimOrg[3];
- int dimRes[3];
- int z;
- _imageDataOriginal->GetDimensions(dimOrg);
- image->GetDimensions(dimRes);
-
- int i;
- double x1=pp1[0];
- double y1=pp1[1];
- double z1=pp1[2];
- int xx=-1,yy=-1,zz=-1;
-
- for (i=0;i<max;i++)
- {
- t = i/max;
- xx = (int) (x1+t*difX);
- yy = (int) (y1+t*difY);
- zz = (int) (z1+t*difZ);
-
- z=i;
- if ((xx>=0) && (xx<dimOrg[0]) && (yy>=0) && (yy<dimOrg[1]) && (zz>=0) && (zz<dimOrg[2]) &&
- (AngX>=0) && (AngX<dimRes[0]) && (AngY>=0) && (AngY<dimRes[1]) && (z>=0) && (z<dimRes[2]) )
- {
- unsigned short *pOrg=(unsigned short*)_imageDataOriginal->GetScalarPointer (xx,yy,zz);
- unsigned short *pRes=(unsigned short*)image->GetScalarPointer( (int)AngX , (int)AngY , z );
- *pRes=*pOrg;
- }
- }
-}
-
-//----------------------------------------------------------------------------
-
void wxSphereView::ResetlstId()
{
int i,size=_lstId.size();
}
//----------------------------------------------------------------------------
-
int wxSphereView::GetIdOfImage(double radio)
{
int id=0;
} else {
id = 0;
}
-
FiltreImage(id,radio);
_lstId.insert(_lstId.begin(),1,new idAlBeRa(id,radio,_delta) );
-
return id;
}
//----------------------------------------------------------------------------
-
void wxSphereView::DefineImageSphere()
{
int id;
id=GetIdOfImage( _radio );
- GetVtkBaseData()->SetZ( id );
-}
+//EED
+// GetVtkBaseData()->SetZ( id );
+ _imageViewer2XYZ->GetVtkImageViewer2()->SetSlice ( id );
+}
//----------------------------------------------------------------------------
void wxSphereView::SetDeltaVoxel(int delta)
}
//----------------------------------------------------------------------------
-void wxSphereView::SetVoxel(double i, double j, int delta,double id, unsigned short gris)
+void wxSphereView::SetVoxel(double i, double j, int delta,double id, double gris)
{
int ii,jj,delta2;
unsigned short *pRes;
if ( (ii>=0)&&(ii<dimRes[0]) &&
(jj>=0)&&(jj<dimRes[1]) )
{
- pRes = (unsigned short*)_imageSphere->GetScalarPointer( ii , jj , (int)id );
- *pRes=gris;
+//EED
+// pRes = (unsigned short*)_imageSphere->GetScalarPointer( ii , jj , (int)id );
+// *pRes=gris;
+ _imageSphere->SetScalarComponentFromDouble( ii , jj , (int)id , 0, gris );
}
- }
- }
-
+ } // for jj
+ } // for ii
}
//----------------------------------------------------------------------------
-
void wxSphereView::SetXYZtoParent(double i, double j)
{
d2x=dimRes[0]/2;
d2y=dimRes[1]/2;
_imageDataOriginal->GetDimensions(dimOrig);
-
p[0] = (i - d2x)*factor;
pxx=p[0]*p[0];
p[1] = (j - d2y)*factor;
_vtkmprbasedata->SetY(pp[1]);
_vtkmprbasedata->SetZ(pp[2]);
}
- }
- }
+ } // if pp
+ } // if radio
}
-
//----------------------------------------------------------------------------
-
void wxSphereView::FiltreImageB(int id, double radio, bool ok,int deltaTMP)
{
+ double value;
double factor = 0.75;
double radioB = radio/3;
double radio2 = radio*radio;
//JCP 24 - 04 -09
d2x=dimRes[0]/2;
d2y=dimRes[1]/2;
-// double deltaTMP=_delta;
_imageDataOriginal->GetDimensions(dimOrig);
-
int start,end;
int limitA,limitB;
limitA = (int) ( (-radioB/factor)+d2x );
(pp[1]>=0) && (pp[1]<dimOrig[1]) &&
(pp[2]>=0) && (pp[2]<dimOrig[2]) )
{
- pOrig=(unsigned short*)_imageDataOriginal->GetScalarPointer( (int)(pp[0]) , (int)(pp[1]) , (int)(pp[2]) );
- SetVoxel(i,j,deltaTMP,id,*pOrig);
+//EED
+// pOrig=(unsigned short*)_imageDataOriginal->GetScalarPointer( (int)(pp[0]) , (int)(pp[1]) , (int)(pp[2]) );
+// SetVoxel(i,j,deltaTMP,id,*pOrig);
+ value=_imageDataOriginal->GetScalarComponentAsDouble( (int)(pp[0]) , (int)(pp[1]) , (int)(pp[2]), 0);
+ SetVoxel(i,j,deltaTMP,id,value);
} else {
SetVoxel(i,j,deltaTMP,id,2000);
}
}
}
}
-
_imageSphere->Modified();
_imageSphere->Update();
}
-
-
-
//----------------------------------------------------------------------------
-
void wxSphereView::FiltreImage(int id, double radio)
{
-
_transform -> Identity();
_transform -> Concatenate(_transform1);
_transform -> Concatenate(_transform2);
-
FiltreImageB(id,radio,false, _delta);
FiltreImageB(id,radio,true, 1);
}
-
//----------------------------------------------------------------------------
/*
}
}
}
+
+
+//----------------------------------------------------------------------------
+
+void wxSphereView::TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image)
+{
+ double t;
+ double difX = pp2[0]-pp1[0];
+ double difY = pp2[1]-pp1[1];
+ double difZ = pp2[2]-pp1[2];
+ double max = 200;
+ int dimOrg[3];
+ int dimRes[3];
+ int z;
+ _imageDataOriginal->GetDimensions(dimOrg);
+ image->GetDimensions(dimRes);
+ int i;
+ double x1=pp1[0];
+ double y1=pp1[1];
+ double z1=pp1[2];
+ int xx=-1,yy=-1,zz=-1;
+ for (i=0;i<max;i++)
+ {
+ t = i/max;
+ xx = (int) (x1+t*difX);
+ yy = (int) (y1+t*difY);
+ zz = (int) (z1+t*difZ);
+
+ z=i;
+ if ((xx>=0) && (xx<dimOrg[0]) && (yy>=0) && (yy<dimOrg[1]) && (zz>=0) && (zz<dimOrg[2]) &&
+ (AngX>=0) && (AngX<dimRes[0]) && (AngY>=0) && (AngY<dimRes[1]) && (z>=0) && (z<dimRes[2]) )
+ {
+ unsigned short *pOrg=(unsigned short*)_imageDataOriginal->GetScalarPointer (xx,yy,zz);
+ unsigned short *pRes=(unsigned short*)image->GetScalarPointer( (int)AngX , (int)AngY , z );
+ *pRes=*pOrg;
+ }
+ }
+}
+
+
+
+
*/
class wxSphereView : public wxVtk2DBaseView
{
public:
- wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata, vtkImageData *imageData);
+ wxSphereView( wxWindow *parent, vtkMPRBaseData *vtkmprbasedata /*, vtkImageData *imageData*/);
~wxSphereView();
virtual void Configure();
+ void SetImage();
+
void RotationEnd();
void RotationStart(double vx, double vy, bool ok_v, bool ok_ang);
virtual void RefreshView();
- virtual void SetVoxel(double i, double j, int delta, double id, unsigned short gris);
+ virtual void Refresh();
+
+ virtual void SetVoxel(double i, double j, int delta, double id, double gris);
void SetDeltaVoxel(int delta);
double GetRadio();
void SetRadio(double radio);
void RefreshPoint();
private:
- std::vector<idAlBeRa*> _lstId;
-
+ std::vector<idAlBeRa*> _lstId;
int _centerX;
int _centerY;
int _centerZ;
double _radio;
-
double _ang;
double _vxb;
double _vyb;
-
int _delta;
-
vtkImageData *_imageDataOriginal;
vtkImageData *_imageSphere;
-
vtkMPRBaseData *_vtkmprbasedata;
vtkInteractorStyleSphere *_vtkinteractorstylesphere;
-
vtkTransform *_transform;
vtkTransform *_transform1;
vtkTransform *_transform2;
void FiltreImageB(int id, double radio, bool ok,int deltaTMP);
void DefineImageSphere();
void ResetlstId();
-
void InitSphere(double points[4][3]);
double SphereFindCenter(double P[4][3], double cc[3]);
double determinant(double a[4][4], int n);
-
void GetPointSphere(double p[3],double r1,double angA,double angB);
void RotatePointOverTheSphere( double pp[3], double p[3],double cc[3]);
- void TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image);
+// void TransferePoints(double pp1[3],double pp2[3],double AngX,double AngY,vtkImageData *image);
};
#endif /*WXSPHEREVIEW_H_*/
X=X*spc[0];
Y=Y*spc[1];
Z=Z*spc[2];
-
}
//-------------------------------------------------------------------
imageData->GetExtent (x1,x2,y1,y2,z1,z2);
}
-
_imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2);
_imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
}
-
-
//-------------------------------------------------------------------
void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData)
{
} // if _imageViewer2XYZ
}
-
//-------------------------------------------------------------------
void wxVtk2DBaseView::Configure(bool okimage)
{
//////////////
}
-
vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData();
if (imageData!=NULL)
{
//_collookup->SetTableValue(255 , 0 , 1 , 0 , 1 );
//_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel ()->SetLookupTable(_collookup );
-
// EED 17 Oct 2007
// SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
-
vtkImageViewer2 *IV2 = _imageViewer2XYZ->GetVtkImageViewer2();
vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
//-------------------------------------------------------------------
-int wxVtk2DBaseView::GetActualSlice() // virtual
+int wxVtk2DBaseView::GetActualSlice() // virtual
{
return (int)(GetVtkBaseData()->GetZ());
}
GetVtkBaseData()->SetZ(slice);
}
-
//-------------------------------------------------------------------
void wxVtk2DBaseView::UpdateColorWindowLevel()
{
// vtkImageViewer2 *vtkimageviewer2 = _imageViewer2XYZ->GetVtkImageViewer2();
-
vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
imagemaptowindowlevel->SetWindow( GetVtkBaseData()->GetColorWindow() );
imagemaptowindowlevel->SetLevel( GetVtkBaseData()->GetColorLevel() );
{
int z = (int)(GetVtkBaseData()->GetZ());
_imageViewer2XYZ->SetZSlice( z );
-
//EED 2016/02/19
vtkImageActor *imageactor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
imageactor->SetInterpolate( GetVtkBaseData()->GetInterpolate() );
-
//EED 01nov2012
UpdateColorWindowLevel();
wxVtkBaseView::Refresh();
void wxVtk2DBaseView::SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview)
{
SetInteractorStyleBaseView(interactorstylebaseview);
-
wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor();
interactorstylebaseview->SetInteractor ( iren );
iren->SetInteractorStyle(interactorstylebaseview);
interactorstylebaseview->SetwxVtkBaseView(this);
-
vtkMaracasImageViewer2Callback * cbk = vtkMaracasImageViewer2Callback::New();
cbk->IV = _imageViewer2XYZ->GetVtkImageViewer2();
interactorstylebaseview->AddObserver( vtkCommand::WindowLevelEvent, cbk );
class vtkInfoTextImage;
class vtkInfoTextImageInteractor;
-
-
//------------------------------------------------------------------
class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{
virtual void Configure(bool okimage=true);
vtkImageViewer2_XYZ* _imageViewer2XYZ;
-
virtual void Refresh();
virtual void ResetView();
virtual int GetActualSlice();
//EED 01nov2012
void UpdateColorWindowLevel();
-
private:
vtkInfoTextImage *_vtkIinfoTextImage;
vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
_configure = false;
_aRenderer = NULL;
_renWin = NULL;
- _aCamera = NULL;
+ _aCamera = NULL;
}
//-------------------------------------------------------------------
wxVtk3DBaseView::~wxVtk3DBaseView()
if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
- if (_renWin!=NULL) {
+ if (_renWin!=NULL)
+ {
if(_renWin->GetReferenceCount()==0)
{
- _renWin -> Delete(); _renWin=NULL;
+ _renWin->Delete();
+ _renWin=NULL;
}
}
}
GetCamera()->Roll(180);
GetCamera()->Yaw(180+30);
GetCamera()->Pitch(-22);
-
-
}
}
+
//-------------------------------------------------------------------
//EED 27 sep 2006
void wxVtk3DBaseView::GetSpacing(double spc[3])
public:
wxVtk3DBaseView( wxWindow *parent, vtkBaseData* vtkbasedata );
virtual ~wxVtk3DBaseView();
- vtkCamera* GetCamera();
- virtual vtkRenderer* GetRenderer();
+ vtkCamera* GetCamera();
+ virtual vtkRenderer* GetRenderer();
virtual vtkRenderWindow* GetRenWin();
- void Refresh();
- void Configure();
- virtual void GetSpacing(double spc[3]);
- void SetStereo(int type);
- void ResetCamera(int *ext=NULL,double* spc=NULL);
+ void Refresh();
+ void Configure();
+ virtual void GetSpacing(double spc[3]);
+ void SetStereo(int type);
+ void ResetCamera(int *ext=NULL,double* spc=NULL);
private:
- bool _configure;
- vtkRenderer *_aRenderer;
+ bool _configure;
+ vtkRenderer *_aRenderer;
vtkRenderWindow *_renWin;
- vtkCamera *_aCamera;
+ vtkCamera *_aCamera;
protected:
};
vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
vri->vtkRenderWindowInteractor::Render();
-
//_iren->Refresh();
#endif
#else
//GetRenWin()->Render();
#endif
-
}
//---------------------------------------------------------------------------
vtkRenderer* wxVtkBaseView::GetRenderer() // virtual
vtkInteractorStyleImage* GetInteractorStyleBaseView();
virtual void GetSpacing(double spc[3]);
virtual int GetDirection();
-
-
vtkBaseData* GetVtkBaseData();
void SetVtkBaseData(vtkBaseData *vtkbasedata);
-
private:
wxWindow *_parent;
wxVTKRenderWindowInteractor *_iren;
virtual void Refresh();
virtual void Configure();
void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
+ vtkClipping3DDataViewer* GetVtkClipping3DDataViewer();
wxPanel* CreateSurfControlPanel(wxWindow *parent);
wxPanel* CreateVolControlPanel(wxWindow *parent);
- vtkClipping3DDataViewer* GetVtkClipping3DDataViewer();
void VisibleActor(int idTissue, bool visTissue);
void VisibleVolumeActor( bool visVolume );
x1 = (int)(x1*spc[0]);
y1 = (int)(y1*spc[1]);
z1 = (int)(z1*spc[2]);
-
x2 = (int)(x2*spc[0]);
y2 = (int)(y2*spc[1]);
z2 = (int)(z2*spc[2]);
-
_visibleAxis = true;
}
_planeWidgetZ->AddObserver(vtkCommand::InteractionEvent, wlipwc );
}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::SetImage()
+{
+ vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
+ // Orthogonal planes B&W
+ _planeWidgetX->SetInput( imageData );
+ _planeWidgetY->SetInput( imageData );
+ _planeWidgetZ->SetInput( imageData );
+ // -- Plane widget
+ _probe->SetSource( imageData );
+ _vtkmpr3Ddataviewer->SetImage();
+}
+
//-------------------------------------------------------------------
vtkImagePlaneWidget* wxVtkMPR3DView::GetPlaneWidget(unsigned char activationkey, double r, double g, double b, vtkCellPicker* picker)
{
//-------------------------------------------------------------------
void wxVtkMPR3DView::SetFreePlanesOrtho()
{
-
-
-
_planeWidgetX->SetPlaneOrientationToXAxes();
_planeWidgetY->SetPlaneOrientationToYAxes();
_planeWidgetZ->SetPlaneOrientationToZAxes();
{
_wxvtkmpr3DviewCntrlPanel->Refresh();
}
-
}
//-------------------------------------------------------------------
double spc[3];
vtkImageData *image = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
- if(image){
+ if(image)
+ {
image->GetSpacing(spc);
}else{
spc[0] = 0;
virtual void Refresh();
virtual void RefreshView();
virtual void Configure();
+ void SetImage();
+
void SetBackGroundType(int type);
void SetVtkMPR3DDataViewer( vtkMPR3DDataViewer *vtkmpr3Ddataviewer );
wxPanel* CreateControlPanel(wxWindow *parent, bool align);