_visibleTissue[i] = false;
_representationType[i] = true;
}
- _visibleVolume=false;
- _isRayCasting=true;
- _isMIP=false;
- _interpolation=false;
- _shade=false;
+ _visibleVolume = false;
+ _isRayCasting = true;
+ _isMIP = false;
+ _interpolation = false;
+ _shade = false;
- _volumerendererdata = VolumeRendererData::New();
- _volumeMapper = vtkVolumeRayCastMapper::New();
- _newvol = vtkVolume::New();
- _volumeProperty = vtkVolumeProperty::New();
- _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
- _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
+ _volumerendererdata = VolumeRendererData::New();
+ _volumeMapper = vtkVolumeRayCastMapper::New();
+ _newvol = vtkVolume::New();
+ _volumeProperty = vtkVolumeProperty::New();
+ _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+ _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
}
//-------------------------------------------------------------------
Configure_VolumeBox();
// An outline provides context around the data.
//
- _outlineData = vtkOutlineFilter::New();
+ _outlineData = vtkOutlineFilter::New();
_outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() );
- _mapOutline = vtkPolyDataMapper::New();
- _mapOutline->SetInput(_outlineData->GetOutput());
- _outline = vtkActor::New();
+ _mapOutline = vtkPolyDataMapper::New();
+
+//EED 4 nov 2015 Estelle
+// _mapOutline->SetInput(_outlineData->GetOutput());
+
+ _outline = vtkActor::New();
_outline->SetMapper(_mapOutline);
_outline->GetProperty()->SetColor(0,0,0);
}
// Actors are added to the renderer.
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
+
+
_wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
+
// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0) ); // _saggital
// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1) ); // _axial
// _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal
//-------------------------------------------------------------------
wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() throw (char*)
{
- if(_wxvtk3Dbaseview==NULL){
+ if(_wxvtk3Dbaseview==NULL)
+ {
throw "wxVtk3DBaseView* wxVtkMPR3DView::GetWxvtk3Dbaseview() _wxvtk3Dbaseview=NULL";
}
return _wxvtk3Dbaseview;
// 4. Putting again the originals actors
// 5. Refresh
+//EED 4 nov 2015 (For Estelle)
+// This works in ViewerNV with nTymeView=6
+// Because the others modules (5) generate also more actors with an OutLineFilter -> Actor
+//showOutlineActor(false);
+
// step 1, step 2
vtkActorCollection *tmpCollection = vtkActorCollection::New();
vtkActorCollection *collectionActors = _wxvtk3Dbaseview->GetRenderer()->GetActors();
int i,size=collectionActors->GetNumberOfItems();
for (i=0; i<size; i++)
{
+ printf(" wxVtkMPR3DView::VisibleImageActor %d\n" , i);
tmpCollection->AddItem ( (vtkActor*)collectionActors->GetItemAsObject(0) );
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( (vtkProp*)tmpCollection->GetItemAsObject(i) );
} // for
//CPR: Method added 30 Nov 2009
void wxVtkMPR3DView::showOutlineActor(bool value)
{
+
vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
if(value == true)
{
{
_wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
}
+
}
//-------------------------------------------------------------------
vtkPlane *slicePlane = vtkPlane::New();
this->_planeWidget->GetPlane( slicePlane );
-
vtkCutter* sliceCutter = vtkCutter::New();
vtkImageData *vtkimagedata = this->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
sliceCutter->SetInput( vtkimagedata );
//EED
// vtkLookupTable *lut = BuildHueWeightBaseMap();
-
vtkPolyDataMapper *slice = vtkPolyDataMapper::New();
slice->SetInput( sliceCutter->GetOutput() );
double range[2];
contourMapper->SetScalarRange( range );
// contourMapper->SetLookupTable( lut );
-
vtkActor *contourActor = vtkActor::New();
contourActor->SetMapper( contourMapper );
-
-
// The usual rendering stuff.
vtkCamera *camera = vtkCamera::New();
camera->SetPosition(1,1,1);
iren->Start();
}
+//-------------------------------------------------------------------
+void wxVtkMPR3DView::SetBackGroundType(int type)
+{
+ if (_wxvtk3Dbaseview!=NULL)
+ {
+ if (type==0)
+ {
+ _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOff();
+ _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0 , 0 , 0 );
+ } // if type
+ if (type==1)
+ {
+ _wxvtk3Dbaseview->GetRenderer()->GradientBackgroundOn();
+ _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.33 , 0.33 , 0.33 );
+ _wxvtk3Dbaseview->GetRenderer()->SetBackground2( 0.66 , 0.66 , 0.66 );
+ } // if type
+ _wxvtk3Dbaseview->Refresh();
+ }// if _wxvtk3Dbaseview
+
+}
wxButton *btnColorTable = new wxButton (panel, -1, _T("Color table") );
wxButton *btnFreePlanesOrtho= new wxButton (panel, -1, _T("Orthogonal planes GL") );
- _ckFreePlaneX= new wxCheckBox(panel,-1,_T("X "));;
- _ckFreePlaneY= new wxCheckBox(panel,-1,_T("Y "));;
- _ckFreePlaneZ= new wxCheckBox(panel,-1,_T("Z "));;
- _ckFreePlaneInteraction= new wxCheckBox(panel,-1,_T("Interaction planes GL"));;
+ _ckFreePlaneX= new wxCheckBox(panel,-1,_T("X "));
+ _ckFreePlaneY= new wxCheckBox(panel,-1,_T("Y "));
+ _ckFreePlaneZ= new wxCheckBox(panel,-1,_T("Z "));
+ _ckFreePlaneInteraction= new wxCheckBox(panel,-1,_T("Interaction planes GL"));
//EED: If-else statements added 30 Nov 2009
_ckFreePlaneX->SetValue(false);
////EED 05Nov2012 _ckBox_BW_Color_Plane->SetValue(true);
_ckBoxPlane->SetValue(false);
+ _ckBoxOutline= new wxCheckBox(panel,-1,_T("Outline"));
+ _ckBoxOutline->SetValue(true);
+
+
+ _ckBoxBackGroundBlack= new wxCheckBox(panel,-1,_T("Background Black"));;
+ _ckBoxBackGroundBlack->SetValue(false);
+
_positionX->SetSize(400,20);
_positionY->SetSize(400,20);
_positionZ->SetSize(400,20);
- Connect(_ckBoxX->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX );
- Connect(_positionX->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionX );
- Connect(_ckBoxY->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY );
- Connect(_positionY->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionY );
- Connect(_ckBoxZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ );
- Connect(_positionZ->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionZ );
+ Connect(_ckBoxX->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisX );
+ Connect(_positionX->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionX );
+ Connect(_ckBoxY->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisY );
+ Connect(_positionY->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionY );
+ Connect(_ckBoxZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisZ );
+ Connect(_positionZ->GetId() , wxEVT_COMMAND_SLIDER_UPDATED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnPositionZ );
- Connect(btnColorTable->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnEditColorTable );
- Connect(_ckBoxXYZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ );
- Connect(_ckBoxPlane->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisiblePlane );
+ Connect(btnColorTable->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnEditColorTable );
+ Connect(_ckBoxXYZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ );
+ Connect(_ckBoxPlane->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisiblePlane );
////EED 05Nov2012 Connect(_ckBox_BW_Color_Plane->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::On_BW_Color_Plane );
- Connect(_ckFreePlaneX->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneX);
- Connect(_ckFreePlaneY->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneY);
- Connect(_ckFreePlaneZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneZ);
- Connect(btnFreePlanesOrtho->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnFreePlanesOrtho );
+ Connect(_ckFreePlaneX->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneX );
+ Connect(_ckFreePlaneY->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneY );
+ Connect(_ckFreePlaneZ->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneZ );
+ Connect(btnFreePlanesOrtho->GetId() , wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnFreePlanesOrtho );
Connect(_ckFreePlaneInteraction->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnVisibleFreePlaneInteraction );
-
- Connect(_cbStereo->GetId() , wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnSetStereo );
+ Connect(_cbStereo->GetId() , wxEVT_COMMAND_COMBOBOX_SELECTED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnSetStereo );
+ Connect(_ckBoxOutline->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnOutline );
+ Connect(_ckBoxBackGroundBlack->GetId() , wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack );
wxFlexGridSizer *sizer;
sizerH5->Add( new wxStaticText(panel, -1,_T(" ")) , 1, wxALL|wxEXPAND, 0);
sizerH5->Add( _cbStereo, 1, wxALL|wxEXPAND, 0);
+ sizerH6 = new wxFlexGridSizer(1);
+ sizerH6->Add( _ckBoxOutline , 1, wxALL|wxEXPAND, 0);
+ sizerH6->Add( _ckBoxBackGroundBlack , 1, wxALL|wxEXPAND, 0);
+
+
sizer->Add( sizerH4, 1, wxALL|wxGROW, 2);
sizer->Add( sizerH5, 1, wxALL|wxEXPAND,2);
+ sizer->Add( sizerH6, 1, wxALL|wxEXPAND,2);
} else {
_ckBoxPlane->SetValue(value);
_wxvtkmpr3Dview->VisiblePlaneWidget(value);
}
+
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::OnOutline(wxCommandEvent& event)
+{
+ _wxvtkmpr3Dview->showOutlineActor( _ckBoxOutline->GetValue() );
+ _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->Refresh();
+
+}
+
+//-------------------------------------------------------------------
+void wxVtkMPR3DViewCntrlPanel::OnBackGroundBlack(wxCommandEvent& event)
+{
+ if (_ckBoxBackGroundBlack->GetValue()==true)
+ {
+ _wxvtkmpr3Dview->SetBackGroundType(0);
+ } else {
+ _wxvtkmpr3Dview->SetBackGroundType(1);
+ }
+}
+
+