void AddContainerSettings::Process()
{
- if(bbGetInputIn1()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn1() );
- }
- if(bbGetInputIn2()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn2() );
- }
- if(bbGetInputIn3()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn3() );
- }
- if(bbGetInputIn4()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn4() );
- }
- if(bbGetInputIn5()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn5() );
- }
- if(bbGetInputIn6()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn6() );
- }
- if(bbGetInputIn7()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn7() );
- }
- if(bbGetInputIn8()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn8() );
- }
- if(bbGetInputIn9()!=NULL){
- m_BCSettingsVector.push_back( bbGetInputIn9() );
- }
- bbSetOutputOut( m_BCSettingsVector );
-
+ m_BCSettingsVector.clear();
+ if(bbGetInputIn1()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn1() );
+ }
+ if(bbGetInputIn2()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn2() );
+ }
+ if(bbGetInputIn3()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn3() );
+ }
+ if(bbGetInputIn4()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn4() );
+ }
+ if(bbGetInputIn5()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn5() );
+ }
+ if(bbGetInputIn6()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn6() );
+ }
+ if(bbGetInputIn7()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn7() );
+ }
+ if(bbGetInputIn8()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn8() );
+ }
+ if(bbGetInputIn9()!=NULL){
+ m_BCSettingsVector.push_back( bbGetInputIn9() );
+ }
+ bbSetOutputOut( m_BCSettingsVector );
}
void AddContainerSettings::bbUserSetDefaultValues()
{
-
+ bbSetInputIn1(NULL);
+ bbSetInputIn2(NULL);
+ bbSetInputIn3(NULL);
+ bbSetInputIn4(NULL);
+ bbSetInputIn5(NULL);
+ bbSetInputIn6(NULL);
+ bbSetInputIn7(NULL);
+ bbSetInputIn8(NULL);
+ bbSetInputIn9(NULL);
}
void AddContainerSettings::bbUserInitializeProcessing()
//=====
void ColorLayerImageView::Process()
{
-printf("ColorLayerImageView::Process start\n");
ColorLayerImageViewPanel *clivp = (ColorLayerImageViewPanel*)bbGetOutputWidget();
+ clivp->SetActive( bbGetInputActive() );
+
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() );
clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() );
clivp->SetImage( bbGetInputIn() );
+
+
// std::string msg;
// if (bbGetInputTitle()!="")
// {
// }
// ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) );
-printf("ColorLayerImageView::Process end\n");
-
}
//=====
// Don't edit this file. This file is generated from xml description..
void ColorLayerImageView::bbUserSetDefaultValues()
{
bbSetInputIn(NULL);
+ bbSetInputActive(true);
bbSetInputWxVtkBaseView(NULL);
bbSetInputWxVtkBaseView1(NULL);
bbSetInputWxVtkBaseView2(NULL);
//=====
// Don't edit this file. This file is generated from xml description..
//=====
+ BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_INPUT(Active,bool);
BBTK_DECLARE_INPUT(WxVtkBaseView,wxVtkBaseView *);
BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView *);
BBTK_DECLARE_INPUT(WxVtkBaseView2,wxVtkBaseView *);
- BBTK_DECLARE_INPUT(In,vtkImageData*);
BBTK_DECLARE_INPUT(lstBaseColor,std::vector<double>);
BBTK_DECLARE_INPUT(lstGreyLevelBoundaries,std::vector<double>);
BBTK_DECLARE_INPUT(PlainOrGradientColor,bool);
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ColorLayerImageView,bbtk::WxBlackBox);
-BBTK_NAME("ColorLayerImageView");
-BBTK_AUTHOR("Eduardo DAVILA (Creatis)");
-BBTK_DESCRIPTION("Color Layer Image View");
-BBTK_CATEGORY("__CategoryBlackBox__");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,WxVtkBaseView2," 2 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
-BBTK_INPUT(ColorLayerImageView,In,"Input Image",vtkImageData*,"");
-BBTK_INPUT(ColorLayerImageView,lstBaseColor,"List of Base Colors in RGB format to define the color map. Requirement: must be of a size being a multiple of 3, with values between 0 and 1. For example, for 2 colors: \"1 0 0 0 0 1\". If not provided as required, the histogram is equally split into three areas, blue, yellow and red.",std::vector<double>,"");
-BBTK_INPUT(ColorLayerImageView,lstGreyLevelBoundaries,"List of the Grey Level Boundaries to define the color map (grey level outside the color boundaries will not be disayed). Requirement: Must have one more element than the number of colours. For example, for 2 colors: \"50 150 250\". If not provided as required, the histogram is equally split into areas, which number corresponds to the number of colors provided (3 by default).",std::vector<double>,"");
-BBTK_INPUT(ColorLayerImageView,PlainOrGradientColor,"Choose between Plain (true) or Gradient (false) colors. Default is false.",bool,"");
-BBTK_INPUT(ColorLayerImageView,FittingMode,"Choose the fitting mode between the images, the transformation can be either by Dimension (1), by Spacing (2) or by Pixel (3). If you want to make the choice through a dialog box, choose (-1). Default is by Pixel (3).",int,"");
+ BBTK_NAME("ColorLayerImageView");
+ BBTK_AUTHOR("Eduardo DAVILA (Creatis)");
+ BBTK_DESCRIPTION("Color Layer Image View");
+ BBTK_CATEGORY("__CategoryBlackBox__");
+ BBTK_INPUT(ColorLayerImageView,In,"Input Image",vtkImageData*,"");
+ BBTK_INPUT(ColorLayerImageView,Active,"Active True/False (default True)",bool,"");
+ BBTK_INPUT(ColorLayerImageView,WxVtkBaseView," 0 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+ BBTK_INPUT(ColorLayerImageView,WxVtkBaseView1," 1 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+ BBTK_INPUT(ColorLayerImageView,WxVtkBaseView2," 2 creaMaracasVisuViewer viewer XY,YZ ou XZ",wxVtkBaseView*,"");
+ BBTK_INPUT(ColorLayerImageView,lstBaseColor,"List of Base Colors in RGB format to define the color map. Requirement: must be of a size being a multiple of 3, with values between 0 and 1. For example, for 2 colors: \"1 0 0 0 0 1\". If not provided as required, the histogram is equally split into three areas, blue, yellow and red.",std::vector<double>,"");
+ BBTK_INPUT(ColorLayerImageView,lstGreyLevelBoundaries,"List of the Grey Level Boundaries to define the color map (grey level outside the color boundaries will not be disayed). Requirement: Must have one more element than the number of colours. For example, for 2 colors: \"50 150 250\". If not provided as required, the histogram is equally split into areas, which number corresponds to the number of colors provided (3 by default).",std::vector<double>,"");
+ BBTK_INPUT(ColorLayerImageView,PlainOrGradientColor,"Choose between Plain (true) or Gradient (false) colors. Default is false.",bool,"");
+ BBTK_INPUT(ColorLayerImageView,FittingMode,"Choose the fitting mode between the images, the transformation can be either by Dimension (1), by Spacing (2) or by Pixel (3). If you want to make the choice through a dialog box, choose (-1). Default is by Pixel (3).",int,"");
BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView);
//=====
// Don't edit this file. This file is generated from xml description..
Connect( _btn_ReadImage->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &ColorLayerImageViewPanel::onReadImage );
- Connect( _cb_ShowHide->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdShow );
+ Connect( _cb_ShowHide->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED , (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdShow );
Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onThresholdInterpolation );
Connect( _opacity->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &ColorLayerImageViewPanel::onChangeOpacity );
Connect( _cb_SliceFixDinamic->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceFixDinamic );
Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageX->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageY->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_LINEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEUP , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
- Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
+ Connect( _sl_SliceImageZ->GetId(), wxEVT_SCROLL_PAGEDOWN , (wxObjectEventFunction) &ColorLayerImageViewPanel::onSliceImage );
//EED01 if (_colorLayerImageView!=NULL)
//EED01 {
//EED01 _colorLayerImageView->onThreshold();
- _colorLayerImageViewManager->onThreshold();
- RefreshView();
+ if (_active==true)
+ {
+ _colorLayerImageViewManager->onThreshold();
+ RefreshView();
+ }
//EED01 }
return _thresholdGo;
}
+//----------------------------------------------------------------------------
+void ColorLayerImageViewPanel::SetActive(bool active)
+{
+ _active=active;
+ _cb_ShowHide->SetValue( _active );
+}
// EOF
void SetImage(vtkImageData *img);
void SetFittingMode(int fitting_mode);
int GetFittingMode();
+ void SetActive(bool active);
private:
+ bool _active;
int _fitting_mode;
int _dimBase[3];
//----------------------------------------------------------------------------
void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
{
- printf("EED LayerImageBase::SetwxVtkBaseView start baseview:%p \n", baseview);
if (_baseView==NULL)
{
_baseView = baseview;
vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
} // if _baseView
- 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))
{
double spc[3];
x = x*spc[0];
y = y*spc[1];
z = z*spc[2];
-
-
- printf("EED LayerImageBase::onThreshold z = %d spcZ%f\n" , z, spc[2]);
-
vtkCamera *camera = _baseView->GetRenderer()->GetActiveCamera();
int directionViewer=0;
directionViewer = wxvtk2dbasevie->GetDirection();
} // ParallelProjection
-printf("EED LayerImageBase::onThreshold projection = %d\n" , camera->GetParallelProjection() );
-printf("EED LayerImageBase::onThreshold direction = %d\n" , directionViewer );
-
if (!GetActorPresent())
{
_thresholdMapper->SetInput( img );
_thresholdMapper->SetLookupTable( _thresholdTable );
_thresholdActor->SetInput( _thresholdMapper->GetOutput() );
-
- printf("EED LayerImageBase::onThreshold working \n");
-
} // _image
- printf("EED LayerImageBase::onThreshold end \n");
}