]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
- new version
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / ThresholdImageView / LayerImageBase.cxx
index c6d8465096bfd21a7ec43484e7ed82244e2eef78..6f0d5e14b8d1747d126d032830d3f891dc7ec51b 100644 (file)
@@ -25,7 +25,7 @@ ColorLayerImageBasevtkInteractor::~ColorLayerImageBasevtkInteractor()
 //---------------------------------------------------------------------------------------------
 bool ColorLayerImageBasevtkInteractor::OnMouseMove()
 {
-
+       printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n");
     if  (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true)
     {
         _layerImageBase->GetvtkImageReslice()->Modified();
@@ -94,10 +94,14 @@ void LayerImageBase::SetImage(vtkImageData* image)
 //----------------------------------------------------------------------------
 void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
 {
+       printf("EED LayerImageBase::SetwxVtkBaseView start baseview:%p \n", baseview);
+
        _baseView = baseview;
 
     vtkInteractorStyleBaseView *isbv    = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
     isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
+       
+       printf("EED LayerImageBase::SetwxVtkBaseView end \n");
 }
 
 //----------------------------------------------------------------------------
@@ -145,7 +149,9 @@ int LayerImageBase::CleanZ(int z)
 //----------------------------------------------------------------------------
 void LayerImageBase::onThreshold()
 {
-
+       
+       printf("EED LayerImageBase::onThreshold start \n");
+       
        if ((_image!=NULL) && (_baseView!=NULL))
        {
                int z=CleanZ( GetZ() );
@@ -168,7 +174,7 @@ void LayerImageBase::onThreshold()
                                _thresholdActor = vtkImageActor::New( );
                                _thresholdActor->SetOpacity( 0.6 );
                                _thresholdActor->InterpolateOn(  );
-                               _thresholdActor->SetPosition( 0,0, 900-1 );
+                               _thresholdActor->SetPosition( 0,0, -900-1 );
                        } // _thresholdActor
                        _baseView->GetRenderer()->AddActor( _thresholdActor );
                        _actorPresent = true;
@@ -179,7 +185,8 @@ void LayerImageBase::onThreshold()
                _imageReslicer->SetInformationInput( GetImage() );
                _imageReslicer->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
                _imageReslicer->SetOutputDimensionality(2);
-               _imageReslicer->SetInterpolationModeToLinear();
+//             _imageReslicer->SetInterpolationModeToLinear();
+               _imageReslicer->SetInterpolationModeToNearestNeighbor();
                _imageReslicer->SetResliceAxesOrigin(0,0,z);
 
                vtkImageData *img = _imageReslicer->GetOutput();
@@ -189,7 +196,12 @@ void LayerImageBase::onThreshold()
                _thresholdMapper->SetInput( img );
                _thresholdMapper->SetLookupTable( _thresholdTable );
                _thresholdActor->SetInput( _thresholdMapper->GetOutput() );
+
+               printf("EED LayerImageBase::onThreshold working \n");
+               
+               
                } // _image
+       printf("EED LayerImageBase::onThreshold end");
 }