-{
- point.clear();
- point.push_back((int)mwxwidget->GetX());
- point.push_back((int)mwxwidget->GetY());
- point.push_back((int)mwxwidget->GetZ());
- bbSetOutputPoint(point);
-
-// WxBlackBox::Process();
- mwxwidget->SetImage( bbGetInputIn() );
- wxVtkBaseView *wvbv1 = mwxwidget->GetwxVtkBaseView(1);
- wxVtkBaseView *wvbv2 = mwxwidget->GetwxVtkBaseView(2);
- wxVtkBaseView *wvbv3 = mwxwidget->GetwxVtkBaseView(3);
- wxVtkBaseView *wvbv4 = mwxwidget->GetwxVtkBaseView(4);
-
- //wxwidget->RefreshView();
-
- bbSetOutputwxVtkBaseView1( wvbv1 );
- bbSetOutputwxVtkBaseView2( wvbv2 );
- bbSetOutputwxVtkBaseView3( wvbv3 );
- bbSetOutputwxVtkBaseView4( wvbv4 );
- if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
- if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
- if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
- if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
+{
+
+ vtkImageData* img = bbGetInputIn();
+/*
+ double spc[3];
+ img->GetSpacing(spc);
+ printf ("EED ViewerNV::Process A %f %f %f \n", spc[0], spc[1], spc[2] );
+ img->SetSpacing( 1,1,1 );
+ img->Update( );
+ img->GetSpacing(spc);
+ img->PrintSelf(std::cout,(vtkIndent)2);
+ img->Print(std::cout);
+ printf ("EED ViewerNV::Process B %f %f %f \n", spc[0], spc[1], spc[2] );
+*/
+ std::vector<int> type = bbGetInputnTypeView();
+
+// std::cout<<"img "<<img<<std::endl;
+// std::cout<<"widget "<<mwxwidget<<std::endl;
+
+// if(img != NULL && mwxwidget != NULL){// && !enter){
+ if( mwxwidget != NULL){// && !enter){
+
+ if(!compareVectors(type, currenttype)){
+ mwxwidget->SetType(&type);
+ mwxwidget->UpdateLayout(img);
+ }else if (img != currentimg){
+ mwxwidget->SetImage(img);
+ //mwxwidget->UpdateLayout(img);
+ }
+
+ mwxwidget->ConfigureVTK();
+ mwxwidget->RefreshView();
+
+ currenttype = type;
+ currentimg = img;
+
+
+ point.clear();
+ point.push_back((int)mwxwidget->GetX());
+ point.push_back((int)mwxwidget->GetY());
+ point.push_back((int)mwxwidget->GetZ());
+ bbSetOutputPoint(point);
+
+ // WxBlackBox::Process();
+// mwxwidget->SetImage(img );
+ wxVtkBaseView *wvbv1 = mwxwidget->GetwxVtkBaseView(1);
+ wxVtkBaseView *wvbv2 = mwxwidget->GetwxVtkBaseView(2);
+ wxVtkBaseView *wvbv3 = mwxwidget->GetwxVtkBaseView(3);
+ wxVtkBaseView *wvbv4 = mwxwidget->GetwxVtkBaseView(4);
+
+ //wxwidget->RefreshView();
+
+ bbSetOutputwxVtkBaseView1( wvbv1 );
+ bbSetOutputwxVtkBaseView2( wvbv2 );
+ bbSetOutputwxVtkBaseView3( wvbv3 );
+ bbSetOutputwxVtkBaseView4( wvbv4 );
+ if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
+ if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
+ if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
+ if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
+
+ if (wvbv1!=NULL) { bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
+ updateObservers();
+ }
+
+ if(bbGetInputColorFunction()!=NULL){
+ mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
+ }
+
+ if(bbGetInputWindowLevel()!=-1){
+ mwxwidget->setWindowLevel(bbGetInputWindowLevel());
+ }
+
+ if(bbGetInputColorLevel()!=-1){
+ if(bbGetInputColorLevel() == 0){
+ std::cout<<"colorlevel "<<bbGetInputColorLevel()<<std::endl;
+ mwxwidget->setColorLevel(0.1);
+ }else{
+ mwxwidget->setColorLevel(bbGetInputColorLevel());
+ }
+ }
+
+
+ }// mwxwidget != NULL