std::cout<<"TransferFunctionView::Process()transfer function "<<greylevel[i]<<" "<< value[i]<<std::endl;
}
_ctfun->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 "<<greylevelcolors[i]<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
+ for(i = 0; i < greylevelcolors.size();i++)
+ {
+ nc = ((greylevelcolors[i]-min)/dif)*w + c-w/2;
+// _ctfun->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 <<"<<nc<<" "<<red[i]<<" "<<green[i]<<" "<<blue[i]<<std::endl;
+ }
+ i=greylevelcolors.size()-1;
+ _ctfun->AddRGBPoint( greylevelcolors[i] , red[i],green[i], blue[i]);
}
bbSignalOutputModification();
void TransferFunctionView::onSliderChange(){
-
-
+//EED
+onColorChange();
bbSignalOutputModification();
- bbSetOutputWindowLevel(mwxwidget->GetWindowLevel());
- bbSetOutputColorLevel(mwxwidget->GetColorLevel());
+// bbSetOutputWindowLevel(mwxwidget->GetWindowLevel());
+// bbSetOutputColorLevel(mwxwidget->GetColorLevel());
}
_dataMapper->ImmediateModeRenderingOn();
vtkActor* dataActor = vtkActor::New();
+ //if(_boxWidgetS1){
if(interactor){
_boxWidgetS1 = vtkBoxWidget::New();
_boxWidgetS1->SetInput(striper->GetOutput());
_boxWidgetS1->PlaceWidget();
+ _boxWidgetS1->HandlesOn ();
+ _boxWidgetS1->On();
+
_tissuePlanes = vtkPlanes::New();
int x1,x2,y1,y2,z1,z2;
}
-wxMaracasSurfaceRenderingManagerDataMhd::~wxMaracasSurfaceRenderingManagerDataMhd(){
+
+wxMaracasSurfaceRenderingManagerDataMhd::~wxMaracasSurfaceRenderingManagerDataMhd()
+{
_cubesFilter->Delete();
_cleanFilter->Delete();
_dataMapper->Delete();
}
-void wxMaracasSurfaceRenderingManagerDataMhd::UpdateSurface(){
+void wxMaracasSurfaceRenderingManagerDataMhd::UpdateSurface()
+{
_cubesFilter->Update();
_cleanFilter->Update();
_dataMapper->Update();
}
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();
}