#include "LayerImageBase.h"
+
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+
+ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase)
+{
+ _layerImageBase=layerImageBase;
+}
+
+//---------------------------------------------------------------------------------------------
+ColorLayerImageBasevtkInteractor::~ColorLayerImageBasevtkInteractor()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------
+bool ColorLayerImageBasevtkInteractor::OnMouseMove()
+{
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n");
+ if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true)
+ {
+ _layerImageBase->GetvtkImageReslice()->Modified();
+ }
+
+ return true;
+}
+
+
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+
+
+
LayerImageBase::LayerImageBase()
{
_actorPresent = false;
//----------------------------------------------------------------------------
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");
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void LayerImageBase::Refresh()
{
+ printf("EED LayerImageBase::Refresh\n");
if (_baseView!=NULL)
{
_baseView->Refresh();
//----------------------------------------------------------------------------
void LayerImageBase::onThreshold()
{
-
+
+ printf("EED LayerImageBase::onThreshold start \n");
+
if ((_image!=NULL) && (_baseView!=NULL))
{
int z=CleanZ( GetZ() );
_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;
_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();
_thresholdMapper->SetInput( img );
_thresholdMapper->SetLookupTable( _thresholdTable );
_thresholdActor->SetInput( _thresholdMapper->GetOutput() );
+
+ printf("EED LayerImageBase::onThreshold working \n");
+
+
} // _image
+ printf("EED LayerImageBase::onThreshold end");
}
}
}
+//----------------------------------------------------------------------------
+vtkLookupTable *LayerImageBase::GetvtkLookupTable()
+{
+ return _thresholdTable;
+}
+
+vtkImageReslice *LayerImageBase::GetvtkImageReslice()
+{
+ return _imageReslicer;
+}