//=====
void ColorLayerImageView::CreateWidget(wxWindow* parent)
{
- ColorLayerImageViewPanel *clivp = new ColorLayerImageViewPanel(parent, 0, 100, bbGetInputTypeControlsInterface() );
+ ColorLayerImageViewPanel *clivp = new ColorLayerImageViewPanel(parent, 0, 100, bbGetInputOpacity() ,bbGetInputTypeControlsInterface() );
bbSetOutputWidget( clivp );
}
//=====
firsttime=true;
bbSetInputIn(NULL);
bbSetInputActive(true);
+ bbSetInputOpacity(100);
bbSetInputPlainOrGradientColor(false);
bbSetInputTypeControlsInterface(1);
bbSetInputWxVtkBaseView(NULL);
//=====
BBTK_DECLARE_INPUT(In,vtkImageData*);
BBTK_DECLARE_INPUT(Active,bool);
+ BBTK_DECLARE_INPUT(Opacity,int);
BBTK_DECLARE_INPUT(TypeControlsInterface,int);
BBTK_DECLARE_INPUT(WxVtkBaseView,wxVtkBaseView *);
BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView *);
BBTK_CATEGORY("__CategoryBlackBox__");
BBTK_INPUT(ColorLayerImageView,In,"Input Image",vtkImageData*,"");
BBTK_INPUT(ColorLayerImageView,Active,"Active True/False (default True)",bool,"");
+ BBTK_INPUT(ColorLayerImageView,Opacity,"(default 100) 0..100",int,"");
BBTK_INPUT(ColorLayerImageView,TypeControlsInterface,"1 (default) All controls, 2 just transparency",int,"");
BBTK_INPUT(ColorLayerImageView,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
BBTK_INPUT(ColorLayerImageView,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
{
SetDefaultBaseColorAndGreyLevelBoundary();
} else { // If at least one color has been set, set the grey level boundaries to build an equipartition of the image grey levels, keeping the base colors defined.
- printf("EED ColorLayerImageView::ConfigLookupTable() %d %d\n", GetBaseColorNb() , _grey_level_boundary.size() );
-
if (_color_type==true) // Plain
{
/**
** Begin of the threshold panel
**/
-ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max, int type)
+ColorLayerImageViewPanel::ColorLayerImageViewPanel(wxWindow* parent, int min, int max,int opacity, int type)
//: wxPanel(parent, -1, wxDefaultPosition, wxSize(600,100), wxBORDER_SUNKEN)
: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
_sl_SliceImageZ->Enable(false);
_interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpole") );
_interpolationCheckBox->SetValue(true);
- _opacity = new wxSlider(this, wxID_ANY, 1, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
// _histogram = new Histogram( this , -1, wxPoint(0,0), wxSize(400,400), /*wxNO_BORDER*/ wxBORDER_DEFAULT );
// _histogramMinMaxLevel = new HistogramMinMaxLevel( (HistogramBase*)_histogram );
sizer = new wxFlexGridSizer(2);
_interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolate") );
_interpolationCheckBox->SetValue(true);
- _opacity = new wxSlider(this, wxID_ANY, 1, 0, 100, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+ _opacity = new wxSlider(this, wxID_ANY, opacity, 0, 100, wxDefaultPosition, wxSize(2,40), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation );
Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity );
: public wxPanel
{
public:
- ColorLayerImageViewPanel(wxWindow * parent, int min, int max, int type);
+ ColorLayerImageViewPanel(wxWindow * parent, int min, int max,int opacity, int type);
~ColorLayerImageViewPanel();
void onThresholdStop();
ColorLayerImageViewManager* GetColorLayerImageViewManager();
_scalarbarActor->SetDisplayPosition(0,0);
}
- _thresholdActor->SetOpacity( 0 );
+ _thresholdActor->SetOpacity( 1 );
_thresholdActor->InterpolateOn( );
if (directionViewer==0)
void SetColorBarPosition(std::vector<int> &colorbarposition);
void SetwxVtkBaseView(wxVtkBaseView *baseview);
-
void onThreshold();
void onThresholdChange();
void onThresholdInterpolation(bool interpolate);
void GetSpcOriginalLayer(double *spc);
void GetSpcBase(double *spc);
-
private:
int _X;
int _Y;
int _dimBase[3];
double _spcBase[3];
-
-
vtkImageData *_image;
vtkImageChangeInformation *_imageChangeInformation;
vtkImageReslice *_imageReslicer;
vtkImageMapToColors *_thresholdMapper;
vtkImageActor *_thresholdActor;
wxVtkBaseView *_baseView;
-
vtkScalarBarActor *_scalarbarActor;
-
virtual void ConfigLookupTable() = 0;
void CleanXYZ(double &x, double &y, double &z);
-
protected:
vtkLookupTable *GetThresholdTable();
double _range[2];
std::vector<double> _rangeForColorBar;
std::vector<int> _colorBarPosition;
-
};
if (_stateFordware==true){
//int fx = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; // JPRx
int fy = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1];
- double delta = (_fordwareY - fy)/3.0;
+ double delta = (_fordwareY - fy)/(3.0*3);
/*JCP 14/05/2009
_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->SetActualSlice( _sliceZ + delta);
*/