From: Eduardo Davila Date: Tue, 5 Jan 2010 12:06:37 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: CREATOOLS.2-0-3~82 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4ed4922b791cc64cd91c56d5fa285b5cfedc0811;p=creaMaracasVisu.git *** empty log message *** --- diff --git a/bbtk/bbs/appli/ExampleSurfaceRendering.bbs b/bbtk/bbs/appli/ExampleSurfaceRendering.bbs index 2540f20..a09f671 100644 --- a/bbtk/bbs/appli/ExampleSurfaceRendering.bbs +++ b/bbtk/bbs/appli/ExampleSurfaceRendering.bbs @@ -1,3 +1,7 @@ +description "Surface rendering" +author "info-dev@creatis.insa-lyon.fr" +category "demo" + load vtk load wxvtk load creaMaracasVisu diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx index 4a25107..cef78ac 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx @@ -60,9 +60,31 @@ void TransferFunctionView::onColorChange(){ std::cout<<"TransferFunctionView::Process()transfer function "<RemoveAllPoints(); - for(int i = 0; i < greylevelcolors.size();i++){ + _ctfun->SetScaleToLinear (); + _ctfun->ClampingOff(); + _ctfun->AllowDuplicateScalarsOn(); + double w=mwxwidget->GetWindowLevel(); + double c=mwxwidget->GetColorLevel(); + + if (greylevelcolors.size()>1) + { + double min = greylevelcolors[0]; + double max = greylevelcolors[greylevelcolors.size()-1]; + double dif = max-min; + if (dif==0) dif=0.0001; + double nc; + int i; + i=0; _ctfun->AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); - std::cout<<"TransferFunctionView::Process()transfer color function "<AddRGBPoint(greylevelcolors[i], red[i],green[i], blue[i]); + _ctfun->AddRGBPoint( nc , red[i],green[i], blue[i]); + std::cout<<"EED TransferFunctionView::Process()transfer color function <<"<AddRGBPoint( greylevelcolors[i] , red[i],green[i], blue[i]); } bbSignalOutputModification(); @@ -74,13 +96,13 @@ void TransferFunctionView::onColorChange(){ void TransferFunctionView::onSliderChange(){ - - +//EED +onColorChange(); bbSignalOutputModification(); - bbSetOutputWindowLevel(mwxwidget->GetWindowLevel()); - bbSetOutputColorLevel(mwxwidget->GetColorLevel()); +// bbSetOutputWindowLevel(mwxwidget->GetWindowLevel()); +// bbSetOutputColorLevel(mwxwidget->GetColorLevel()); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManagerDataMhd.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManagerDataMhd.cxx index cb6734c..2c6a6cd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManagerDataMhd.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasSurfaceRenderingManagerDataMhd.cxx @@ -26,6 +26,7 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd _dataMapper->ImmediateModeRenderingOn(); vtkActor* dataActor = vtkActor::New(); + //if(_boxWidgetS1){ if(interactor){ _boxWidgetS1 = vtkBoxWidget::New(); @@ -47,6 +48,9 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd _boxWidgetS1->SetInput(striper->GetOutput()); _boxWidgetS1->PlaceWidget(); + _boxWidgetS1->HandlesOn (); + _boxWidgetS1->On(); + _tissuePlanes = vtkPlanes::New(); int x1,x2,y1,y2,z1,z2; @@ -83,13 +87,16 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd } -wxMaracasSurfaceRenderingManagerDataMhd::~wxMaracasSurfaceRenderingManagerDataMhd(){ + +wxMaracasSurfaceRenderingManagerDataMhd::~wxMaracasSurfaceRenderingManagerDataMhd() +{ _cubesFilter->Delete(); _cleanFilter->Delete(); _dataMapper->Delete(); } -void wxMaracasSurfaceRenderingManagerDataMhd::UpdateSurface(){ +void wxMaracasSurfaceRenderingManagerDataMhd::UpdateSurface() +{ _cubesFilter->Update(); _cleanFilter->Update(); _dataMapper->Update(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index 18bdf5a..33accb3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -252,12 +252,16 @@ void wxVtk2DBaseView::setColorTransferFunction(vtkColorTransferFunction* colorta } void wxVtk2DBaseView::setWindowLevel(double level){ - _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level); - +// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level); + + vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel(); + imagemaptowindowlevel->SetWindow(level); this->Refresh(); } void wxVtk2DBaseView::setColorLevel(double level){ - _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level); +// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level); + vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel(); + imagemaptowindowlevel->SetLevel(level); this->Refresh(); }