From: Eduardo Davila Date: Mon, 25 Oct 2010 08:49:04 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ManualPaint~15 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=1875ac5ea44f35fb7259e847f628bb840e3964a8;p=creaMaracasVisu.git *** empty log message *** --- diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint.cxx index 3ff6fbe..1f19f5b 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint.cxx @@ -41,7 +41,7 @@ void ManualPaint::Process() ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); */ - if (bbGetInputWxVtkBaseView()==NULL) + if (bbGetInputWxVtkBaseView1()==NULL) { wxMessageDialog(NULL, bbtk::std2wx("(ManualPaint) Input 'WxVtkBaseView' is not set"), bbtk::std2wx(bbGetFullName()) ).ShowModal(); } @@ -62,11 +62,44 @@ void ManualPaint::Process() wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget(); mpPanel->SetManualPaintModel(mpModel); - ManualPaintControler *mpControler = new ManualPaintControler(); - mpControler->SetManualPaintModel(mpModel); - mpControler->SetManualPaintPanel(mpPanel); - mpControler->SetWxVtkBaseView( bbGetInputWxVtkBaseView() ); - mpControler->Config(); + if (bbGetInputWxVtkBaseView1()!=NULL) + { + ManualPaintControler *mpControler = new ManualPaintControler(); + mpControler->SetManualPaintModel(mpModel); + mpControler->SetManualPaintPanel(mpPanel); + mpControler->SetWxVtkBaseView( bbGetInputWxVtkBaseView1() ); + mpControler->Config(); + } + + if (bbGetInputWxVtkBaseView2()!=NULL) + { + ManualPaintControler *mpControler = new ManualPaintControler(); + mpControler->SetManualPaintModel(mpModel); + mpControler->SetManualPaintPanel(mpPanel); + mpControler->SetWxVtkBaseView( bbGetInputWxVtkBaseView2() ); + mpControler->Config(); + } + + if (bbGetInputWxVtkBaseView3()!=NULL) + { + ManualPaintControler *mpControler = new ManualPaintControler(); + mpControler->SetManualPaintModel(mpModel); + mpControler->SetManualPaintPanel(mpPanel); + mpControler->SetWxVtkBaseView( bbGetInputWxVtkBaseView3() ); + mpControler->Config(); + } + + if (bbGetInputWxVtkBaseView4()!=NULL) + { + ManualPaintControler *mpControler = new ManualPaintControler(); + mpControler->SetManualPaintModel(mpModel); + mpControler->SetManualPaintPanel(mpPanel); + mpControler->SetWxVtkBaseView( bbGetInputWxVtkBaseView4() ); + mpControler->Config(); + } + + + } } diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint.h b/bbtk/src/bbcreaMaracasVisuManualPaint.h index f53621c..c35662f 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint.h +++ b/bbtk/src/bbcreaMaracasVisuManualPaint.h @@ -24,7 +24,10 @@ class bbcreaMaracasVisu_EXPORT ManualPaint // Don't edit this file. This file is generated from xml description.. //===== BBTK_DECLARE_INPUT(In,vtkImageData*); - BBTK_DECLARE_INPUT(WxVtkBaseView,wxVtkBaseView*); + BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView*); + BBTK_DECLARE_INPUT(WxVtkBaseView2,wxVtkBaseView*); + BBTK_DECLARE_INPUT(WxVtkBaseView3,wxVtkBaseView*); + BBTK_DECLARE_INPUT(WxVtkBaseView4,wxVtkBaseView*); BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); @@ -40,9 +43,12 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualPaint,bbtk::WxBlackBox); BBTK_NAME("ManualPaint"); BBTK_AUTHOR("eduardo davila (Creatis)"); BBTK_DESCRIPTION("Voxel manual paint"); -BBTK_CATEGORY("__CategoryBlackBox__"); +BBTK_CATEGORY("widget"); BBTK_INPUT(ManualPaint,In,"Input image to be modified",vtkImageData*,""); -BBTK_INPUT(ManualPaint,WxVtkBaseView,"creaMaracasVisu viewer",wxVtkBaseView*,""); +BBTK_INPUT(ManualPaint,WxVtkBaseView1,"creaMaracasVisu viewer 2D",wxVtkBaseView*,""); +BBTK_INPUT(ManualPaint,WxVtkBaseView2,"creaMaracasVisu viewer 2D",wxVtkBaseView*,""); +BBTK_INPUT(ManualPaint,WxVtkBaseView3,"creaMaracasVisu viewer 2D",wxVtkBaseView*,""); +BBTK_INPUT(ManualPaint,WxVtkBaseView4,"creaMaracasVisu viewer 2D",wxVtkBaseView*,""); BBTK_END_DESCRIBE_BLACK_BOX(ManualPaint); //===== // Don't edit this file. This file is generated from xml description.. diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002 b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002 index ea4947e..b197404 100644 --- a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002 +++ b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002 @@ -1,6 +1,6 @@ format 73 "wxVtkViwer" // wxVtkViwer - revision 10 + revision 11 modified_by 2 "davila" // class settings //class diagram settings @@ -238,6 +238,15 @@ ${inlines} classrelation_ref 131842 // b parent class_ref 131074 // InteractorStyleMaracas end + + classrelation 174978 // + relation 174850 ---> + a role_name "" private + cpp default " ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value}; +" + classrelation_ref 174978 // + b parent class_ref 128002 // vtkInfoTextImage + end end class 128770 "wxWindow" diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002.diagram b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002.diagram index 392ee32..e430b49 100644 --- a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002.diagram +++ b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/128002.diagram @@ -2,7 +2,7 @@ format 73 classcanvas 128002 class_ref 128002 // vtkInfoTextImage draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default - xyz 191.2 729.6 2000 + xyz 263.2 625.6 2000 end classcanvas 128130 class_ref 128130 // wxVtk2DBaseView draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default @@ -14,11 +14,11 @@ classcanvas 128386 class_ref 128258 // wxVtkBaseView end classcanvas 128642 class_ref 128386 // vtkImageViewer2_XYZ draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default - xyz 211.1 666.7 2000 + xyz 154.1 807.7 2000 end classcanvas 128898 class_ref 128514 // vtkBaseData draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default - xyz 246.4 494.2 2000 + xyz 199.4 679.2 2000 end classcanvas 129026 class_ref 128642 // vtkInfoTextImageInteractor draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default @@ -91,22 +91,22 @@ end classcanvas 136194 class_ref 130690 // vtkImageViewer2 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default color magenta - xyz 194.1 609.6 2005 + xyz 60.1 751.6 2005 end classcanvas 136450 class_ref 130818 // marImageData draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default - xyz 68.8 609.6 2000 + xyz 112.8 623.6 2000 end classcanvas 137090 class_ref 130946 // vtkTextActor draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default color magenta - xyz 40.6 758.3 2007 + xyz 227.6 554.3 2007 end note 137346 "_vtkText_WindowLevel _vtkText_ColorLevel _vtkText_position _vtkText_Intensity" - xyzwh 105.9 809.6 2013 177 78 + xyzwh 38.9 534.6 2013 177 78 classcanvas 137602 class_ref 131074 // InteractorStyleMaracas draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default xyz 176.1 25.8 2006 @@ -150,7 +150,7 @@ classcanvas 140930 class_ref 130306 // vtkPolyDataMapper end classcanvas 141314 class_ref 131458 // vtkMPRBaseData draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default - xyz 234.1 549 2010 + xyz 189.1 733 2010 end classcanvas 142082 class_ref 132226 // wxVtk3DBaseView draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default @@ -169,7 +169,7 @@ classcanvas 143490 class_ref 140802 // vtkInteractorStyleBaseView3D xyz 450.2 233 2000 end note 144002 "All Controlers herite from this class Ex. manualControles" - xyzwh 52.7 445.4 2000 145 63 + xyzwh 30.7 449.4 2000 145 63 classcanvas 147330 class_ref 154114 // vtkInteractorStyleSphere draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default xyz 36 116 2012 @@ -213,8 +213,7 @@ relationcanvas 129154 relation_ref 128386 // no_multiplicity_a no_multiplicity_b end relationcanvas 129282 relation_ref 128514 // - from ref 128130 z 2001 to point 341 518 - line 151298 z 2001 to ref 128898 + from ref 128130 z 2001 to ref 128898 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end @@ -322,8 +321,7 @@ relationcanvas 136322 relation_ref 131202 // no_multiplicity_a no_multiplicity_b end relationcanvas 136578 relation_ref 131330 // - from ref 128002 z 2001 to point 128 676 - line 136706 z 2001 to ref 136450 + from ref 128002 z 2001 to ref 136450 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end @@ -388,8 +386,7 @@ relationcanvas 141698 relation_ref 138754 // no_multiplicity_a no_multiplicity_b end relationcanvas 141826 relation_ref 138882 // - from ref 128898 z 2001 to point 158 543 - line 141954 z 2001 to ref 136450 + from ref 128898 z 2001 to ref 136450 no_role_a no_role_b no_multiplicity_a no_multiplicity_b end @@ -483,6 +480,12 @@ relationcanvas 151426 relation_ref 168322 // no_role_a no_role_b no_multiplicity_a no_multiplicity_b end +relationcanvas 151682 relation_ref 174850 // + from ref 129026 z 2001 to point 308 302 + line 151810 z 2001 to ref 128002 + no_role_a no_role_b + no_multiplicity_a no_multiplicity_b +end line 137474 -_-_ from ref 137346 z 2014 to ref 137218 line 150786 -_-_ diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session index 479fa14..d24ed41 100644 --- a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session +++ b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/2.session @@ -1,8 +1,8 @@ -window_sizes 1386 821 293 1083 628 104 +window_sizes 1333 818 293 1030 634 104 motif_style diagrams active classdiagram_ref 128002 // wxVtkViewer class Diagram 1 - 1080 630 100 4 0 0 + 1030 634 100 4 173 0 classdiagram_ref 128130 // wxVtkViewer class Diagram 2 870 699 100 4 255 0 end diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/wxVtkViewer.prj b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/wxVtkViewer.prj index 1de09d1..be7904b 100644 --- a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/wxVtkViewer.prj +++ b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer/wxVtkViewer.prj @@ -1,6 +1,6 @@ format 73 "wxVtkViewer" - revision 10 + revision 11 modified_by 2 "davila" diff --git a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer_classDiagram1_HTML/fig128002.png b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer_classDiagram1_HTML/fig128002.png index eb4f553..3135d7b 100644 Binary files a/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer_classDiagram1_HTML/fig128002.png and b/lib/doxygen/bouml/wxVtkViewer/wxVtkViewer_classDiagram1_HTML/fig128002.png differ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx index 9b4a06a..8b80071 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.cxx @@ -10,6 +10,10 @@ #include "OpenImageDialog.h" +//--------------------------------------------------------- +//--------------------------------------------------------- +//--------------------------------------------------------- + wxDlgTransformByDimensionBySpacingByPixel::wxDlgTransformByDimensionBySpacingByPixel() { } @@ -51,8 +55,10 @@ void wxDlgTransformByDimensionBySpacingByPixel::GetTransformType(wxWindow *paren } } -//--------------------------------------------------------- +//--------------------------------------------------------- +//--------------------------------------------------------- +//--------------------------------------------------------- /** diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h index 1912199..29a5dd1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewPanel.h @@ -19,6 +19,9 @@ #include "ColorLayerImageView.h" + +//----------------------------------------------------- + //EED 21-08-2010 class wxDlgTransformByDimensionBySpacingByPixel { @@ -28,9 +31,11 @@ class wxDlgTransformByDimensionBySpacingByPixel void GetTransformType(wxWindow *parent , wxString message,int &typeOfTransformation,bool &dlgWxOK) ; }; + + //----------------------------------------------------- - class ColorLayerImageViewPanel +class ColorLayerImageViewPanel : public wxPanel { public: @@ -65,7 +70,8 @@ class wxDlgTransformByDimensionBySpacingByPixel void onChangeOpacity(wxScrollEvent& event); void onSliceFixDinamic(wxCommandEvent& event); void onSliceImage(wxScrollEvent& event); - }; + +}; #endif diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index ee8a7fc..c6d8465 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -6,6 +6,41 @@ #include "LayerImageBase.h" + +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- + +ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase) +{ + _layerImageBase=layerImageBase; +} + +//--------------------------------------------------------------------------------------------- +ColorLayerImageBasevtkInteractor::~ColorLayerImageBasevtkInteractor() +{ +} + + +//--------------------------------------------------------------------------------------------- +bool ColorLayerImageBasevtkInteractor::OnMouseMove() +{ + + if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true) + { + _layerImageBase->GetvtkImageReslice()->Modified(); + } + + return true; +} + + +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- + + + LayerImageBase::LayerImageBase() { _actorPresent = false; @@ -60,6 +95,9 @@ void LayerImageBase::SetImage(vtkImageData* image) void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview) { _baseView = baseview; + + vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView()); + isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) ); } //---------------------------------------------------------------------------- @@ -71,6 +109,7 @@ wxVtkBaseView *LayerImageBase::GetwxVtkBaseView() //---------------------------------------------------------------------------- void LayerImageBase::Refresh() { + printf("EED LayerImageBase::Refresh\n"); if (_baseView!=NULL) { _baseView->Refresh(); @@ -200,6 +239,16 @@ void LayerImageBase::onThresholdRemove() } } +//---------------------------------------------------------------------------- +vtkLookupTable *LayerImageBase::GetvtkLookupTable() +{ + return _thresholdTable; +} + +vtkImageReslice *LayerImageBase::GetvtkImageReslice() +{ + return _imageReslicer; +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h index 29c8940..5beffe7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h @@ -21,6 +21,34 @@ #include #include "wxVtkBaseView.h" +#include "InteractorStyleMaracas.h" + +//---------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------- +class LayerImageBase; + +class ColorLayerImageBasevtkInteractor : public InteractorStyleMaracas { +public: + ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase); + virtual ~ColorLayerImageBasevtkInteractor(); + + virtual bool OnMouseMove(); + +private: + LayerImageBase* _layerImageBase; + +protected: + +}; + + +//---------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------- +//---------------------------------------------------------------------------------- + + + class LayerImageBase { public: @@ -37,6 +65,9 @@ class LayerImageBase void onThresholdRemove(); wxVtkBaseView *GetwxVtkBaseView(); void Refresh(); + vtkLookupTable *GetvtkLookupTable(); + vtkImageReslice *GetvtkImageReslice(); + virtual int GetZ(); private: int _Z; @@ -54,7 +85,6 @@ class LayerImageBase protected: - virtual int GetZ(); vtkLookupTable* GetThresholdTable(); vtkImageData* GetImage(); }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp index 6cab077..c23e6f4 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp @@ -36,9 +36,8 @@ void ManualPaintControler::SetWxVtkBaseView(wxVtkBaseView *baseview) //--------------------------------------------------------------------------- void ManualPaintControler::Config() { - vtkInteractorManualPaint *imp = new vtkInteractorManualPaint(this); vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_wxvtkbaseview->GetInteractorStyleBaseView()); - isbv->AddInteractorStyleMaracas(imp); + isbv->AddInteractorStyleMaracas( new vtkInteractorManualPaint(this) ); } @@ -47,15 +46,10 @@ void ManualPaintControler::Config() void ManualPaintControler::PaintImage(int px,int py, int pz) { _manualPaintModel->PaintImage(px,py,pz); - RefreshView(); + + //The refresh mechanisme is made in the vtkInteractorManualPaint +// RefreshView(); } //--------------------------------------------------------------------------- -void ManualPaintControler::RefreshView() -{ - wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview; - vtkImageViewer2 *vtkimageviewer2 = wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2(); - vtkimageviewer2->GetWindowLevel()->Modified(); - -} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.h index 66c8d9e..c36e80d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.h @@ -23,8 +23,6 @@ private: ManualPaintPanel *_manualPaintPanel; wxVtkBaseView *_wxvtkbaseview; - void RefreshView(); - protected: }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp index a9a84e0..d6b0d5b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp @@ -4,8 +4,11 @@ ManualPaintModel::ManualPaintModel() { - _graylevel=0.0; - _brushsize=1; + _graylevel = 0.0; + _brushsize = 1; + _brushform = 0; // 0 rectangle-box , 1 circle-sphere + _2D3D = 0; // 0 2D , 1 true 3D + _brushtool = 0; // 0 pensil , 1 fill } //--------------------------------------------------------------------------- @@ -20,6 +23,8 @@ void ManualPaintModel::SetImage(vtkImageData *image) void ManualPaintModel::PaintImage(int px,int py, int pz) { + + printf("EED ManualPaintModel::PaintImage %d %d %d\n", px,py,pz); if (_image!=NULL) { float value=(float)_graylevel; @@ -32,37 +37,69 @@ void ManualPaintModel::PaintImage(int px,int py, int pz) int minZ=pz-size; int maxZ=pz+size; + double xx,yy,zz,rr=size*size; + + printf("EED bbcreaMaracasvisu::vtkInteractorManualPaint::PaintImage brushForm=%d\n",_brushform); for (i=minX; i<=maxX; i++) { + xx=px-i; + xx=xx*xx; for (j=minY; j<=maxY; j++) { + yy=py-j; + yy=yy*yy; for (k=minZ; k<=maxZ; k++) { - _image->SetScalarComponentFromFloat (i,j,k, 0, value ); - } - } - } + zz=pz-k; + zz=zz*zz; + if (_brushform==0) + { + _image->SetScalarComponentFromFloat (i,j,k, 0, value ); + } else if (_brushform==1) + { + if ((xx+yy+zz)<=rr) + { + _image->SetScalarComponentFromFloat (i,j,k, 0, value ); + } + } // _brushform + + }//k + }//j + }//i _image->Modified(); - _image->UpdateInformation(); - _image->Update(); - _image->UpdateData(); } else { printf("ERROR : bbcreaMaracasvisu::vtkInteractorManualPaint::PaintImage : Image not set. \n"); - } + } // _image } //--------------------------------------------------------------------------- void ManualPaintModel::SetBrushSize( int brushsize ) { - printf("EED %p ManualPaintModel::SetBrushSize \n", this); _brushsize = brushsize; } //--------------------------------------------------------------------------- void ManualPaintModel::SetGrayLevel( double graylevel ) { - printf("EED %p ManualPaintModel::SetGrayLevel \n", this); _graylevel = graylevel; } +//--------------------------------------------------------------------------- +void ManualPaintModel::SetBrushForm( int brushform ) +{ + _brushform = brushform; +} + +//--------------------------------------------------------------------------- +void ManualPaintModel::SetBrushTool( int brushtool ) +{ + _brushtool = brushtool; +} + +//--------------------------------------------------------------------------- +void ManualPaintModel::Set2D3D( int dim2D3D ) +{ + _2D3D = dim2D3D; +} + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h index 2be8224..e7996f1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h @@ -12,6 +12,9 @@ public: void SetImage(vtkImageData *image); void PaintImage(int px,int py, int pz); void SetBrushSize( int brushsize ); + void SetBrushForm( int brushform ); + void SetBrushTool( int brushtool ); + void Set2D3D( int dim2D3D ); void SetGrayLevel( double graylevel ); @@ -19,6 +22,9 @@ public: private: vtkImageData *_image; int _brushsize; + int _brushform; + int _brushtool; + bool _2D3D; double _graylevel; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.cpp index 78114cc..ecb7243 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.cpp @@ -43,3 +43,37 @@ void ManualPaintPanel::SetGrayLevel( double graylevel ) } } +//--------------------------------------------------------------------------- +void ManualPaintPanel::SetBrushTool(int brushtool) +{ + if (_manualPaintModel!=NULL) + { + _manualPaintModel->SetBrushTool( brushtool ); + } else { + printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n"); + } +} + +//--------------------------------------------------------------------------- +void ManualPaintPanel::Set2D3D(int dim2D3D) +{ + if (_manualPaintModel!=NULL) + { + _manualPaintModel->Set2D3D( dim2D3D ); + } else { + printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n"); + } +} + +//--------------------------------------------------------------------------- +void ManualPaintPanel::SetBrushForm(int brushform) +{ + if (_manualPaintModel!=NULL) + { + _manualPaintModel->SetBrushForm( brushform ); + } else { + printf("ERROR in ManualPaintPanel _manualPaintModel not set.\n"); + } +} + + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.h index 07e5dfa..817ecf7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintPanel.h @@ -11,6 +11,9 @@ public: void SetManualPaintModel(ManualPaintModel* manualPaintModel); void SetBrushSize( int brushsize ); void SetGrayLevel( double graylevel ); + void SetBrushTool(int brushtool); + void Set2D3D(int dim2D3D); + void SetBrushForm(int brushform); private: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp index 0a9a18f..ba0a778 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp @@ -47,16 +47,15 @@ bool vtkInteractorManualPaint::OnMouseMove () int px,py; wxVTKiren->GetEventPosition(px,py); - int typeView = 2; +// int typeView = 1; double X = (double)px; double Y = (double)py; double Z = wxvtk2Dbaseview->GetActualSlice(); - wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,false, typeView); - -// int px = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[0]; -// int py = _vtkInteractorStyleBaseView->GetInteractor()->GetEventPosition()[1]; +// wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,true, typeView); + wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,true); _manualPaintControler->PaintImage((int)X,(int)Y,(int)Z); + this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); /* wxvtk2Dbaseview->_imageViewer2XYZ->GetVtkImageViewer2()->Modified(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp index 40dcd5f..babf727 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp @@ -12,42 +12,41 @@ wxManualPaintPanel::wxManualPaintPanel(wxWindow * parent) // Widget interface wxStaticText *tittleText = new wxStaticText(panel, -1, _T(" Manual Paint")); wxStaticText *txtBrushSize = new wxStaticText(panel, -1, wxString(_T(" Brush size "))); - sldBrushSize = new wxSlider(panel, -1, 1, 1, 20, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + _sldBrushSize = new wxSlider(panel, -1, 1, 1, 20, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); wxStaticText *txtGrayLevel = new wxStaticText(panel, -1, wxString(_T(" Gray Level "))); - sldGrayLevel = new wxSlider(panel, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); - graylevelCtrl = new wxTextCtrl(panel , -1); + _sldGrayLevel = new wxSlider(panel, -1, 0, 0, 50, wxDefaultPosition, wxDefaultSize, wxSL_LABELS); + _graylevelCtrl = new wxTextCtrl(panel , -1); wxString lst2D3D[2]; lst2D3D[0]=_T("2D circle"); lst2D3D[1]=_T("3D sphere"); - wxRadioBox * rb2D3D = new wxRadioBox(panel, -1, _T("2D / 3D"), wxDefaultPosition, wxSize(270,45), 2 , lst2D3D, 2, wxRA_SPECIFY_COLS); - rb2D3D->SetSelection(1); - rb2D3D->Disable(); + _rb2D3D = new wxRadioBox(panel, -1, _T("2D / 3D"), wxDefaultPosition, wxSize(270,45), 2 , lst2D3D, 2, wxRA_SPECIFY_COLS); + _rb2D3D->SetSelection(1); + _rb2D3D->Disable(); wxString lstBrushForm[2]; lstBrushForm[0]=_T("rectangle/cube"); lstBrushForm[1]=_T("circle/sphere"); - wxRadioBox * rbBrushForm = new wxRadioBox(panel, -1, _T("Brush form"), wxDefaultPosition, wxSize(270,45), 2 , lstBrushForm, 2, wxRA_SPECIFY_COLS); - rbBrushForm->Disable(); + _rbBrushForm = new wxRadioBox(panel, -1, _T("Brush form"), wxDefaultPosition, wxSize(270,45), 2 , lstBrushForm, 2, wxRA_SPECIFY_COLS); wxString lstBrushTool[2]; lstBrushTool[0]=_T("Pensil"); lstBrushTool[1]=_T("Fill"); - wxRadioBox *rbBrushTool = new wxRadioBox(panel, -1, _T("Brush tool"), wxDefaultPosition, wxSize(270,45), 2 , lstBrushTool, 2, wxRA_SPECIFY_COLS); - rbBrushTool->Disable(); + _rbBrushTool = new wxRadioBox(panel, -1, _T("Brush tool"), wxDefaultPosition, wxSize(270,45), 2 , lstBrushTool, 2, wxRA_SPECIFY_COLS); + _rbBrushTool->Disable(); - wxButton *btnCopy = new wxButton( panel, -1, _T("Copy")); + wxButton *btnCopy = new wxButton( panel, -1, _T("Copy")); btnCopy->Disable(); - wxButton *btnUndo = new wxButton( panel, -1, _T("Undo")); + wxButton *btnUndo = new wxButton( panel, -1, _T("Undo")); btnUndo->Disable(); - Connect(sldBrushSize->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushSize); - Connect(sldGrayLevel->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxManualPaintPanel::OnSldGrayLevel); - Connect(graylevelCtrl->GetId() , wxEVT_COMMAND_TEXT_UPDATED , (wxObjectEventFunction) &wxManualPaintPanel::OnCtrTxtGrayLevel); + Connect(_sldBrushSize->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushSize); + Connect(_sldGrayLevel->GetId() , wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction) &wxManualPaintPanel::OnSldGrayLevel); + Connect(_graylevelCtrl->GetId() , wxEVT_COMMAND_TEXT_UPDATED , (wxObjectEventFunction) &wxManualPaintPanel::OnCtrTxtGrayLevel); - Connect(rb2D3D->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::On2D3D); - Connect(rbBrushForm->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushForm); - Connect(rbBrushTool->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushTool); + Connect(_rb2D3D->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::On2D3D); + Connect(_rbBrushForm->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushForm); + Connect(_rbBrushTool->GetId() , wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &wxManualPaintPanel::OnBrushTool); Connect(btnCopy->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxManualPaintPanel::OnCopy); Connect(btnUndo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxManualPaintPanel::OnUndo); @@ -56,17 +55,17 @@ wxManualPaintPanel::wxManualPaintPanel(wxWindow * parent) sizer1->Add(tittleText); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); sizer1->Add(txtBrushSize); - sizer1->Add(sldBrushSize, 1, wxGROW ); + sizer1->Add(_sldBrushSize, 1, wxGROW ); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); sizer1->Add(txtGrayLevel); - sizer1->Add(sldGrayLevel, 1, wxGROW ); - sizer1->Add(graylevelCtrl); + sizer1->Add(_sldGrayLevel, 1, wxGROW ); + sizer1->Add(_graylevelCtrl); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); - sizer1->Add(rb2D3D, 1, wxGROW ); + sizer1->Add(_rb2D3D, 1, wxGROW ); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); - sizer1->Add(rbBrushForm, 1, wxGROW ); + sizer1->Add(_rbBrushForm, 1, wxGROW ); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); - sizer1->Add(rbBrushTool, 1, wxGROW ); + sizer1->Add(_rbBrushTool, 1, wxGROW ); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); sizer1->Add(btnCopy, 1, wxGROW ); sizer1->Add(new wxStaticText(panel,-1,_T(" "))); @@ -86,28 +85,24 @@ wxManualPaintPanel::~wxManualPaintPanel() //--------------------------------------------------------------------------- void wxManualPaintPanel::OnBrushSize(wxScrollEvent& event) { - printf("EED %p wxManualPaintPanel::OnBrushSize\n", this); - SetBrushSize( sldBrushSize->GetValue() ); + SetBrushSize( _sldBrushSize->GetValue() ); } //--------------------------------------------------------------------------- void wxManualPaintPanel::OnSldGrayLevel(wxScrollEvent& event) { - printf("EED %p wxManualPaintPanel::OnGrayLevel\n", this); - SetGrayLevel( (double)(sldGrayLevel->GetValue()) ); + SetGrayLevel( (double)(_sldGrayLevel->GetValue()) ); wxString text; - text.Printf( wxT("%d"), sldGrayLevel->GetValue() ); - graylevelCtrl->SetValue(text); + text.Printf( wxT("%d"), _sldGrayLevel->GetValue() ); + _graylevelCtrl->SetValue(text); } //--------------------------------------------------------------------------- void wxManualPaintPanel::OnCtrTxtGrayLevel(wxCommandEvent &event) { - printf("EED %p wxManualPaintPanel::OnCtrTxtGrayLevel\n", this); - double graylevel; - wxString text=graylevelCtrl->GetValue(); + wxString text=_graylevelCtrl->GetValue(); if (text.ToDouble(&graylevel)) { SetGrayLevel( graylevel ); @@ -119,16 +114,20 @@ void wxManualPaintPanel::OnCtrTxtGrayLevel(wxCommandEvent &event) //--------------------------------------------------------------------------- void wxManualPaintPanel::On2D3D(wxCommandEvent &event) { + Set2D3D( _rb2D3D->GetSelection() ); } //--------------------------------------------------------------------------- void wxManualPaintPanel::OnBrushForm(wxCommandEvent &event) { + printf("EED wxManualPaintPanel::OnBrushForm BrushForm=%d \n", _rbBrushForm->GetSelection()); + SetBrushForm( _rbBrushForm->GetSelection() ); } //--------------------------------------------------------------------------- void wxManualPaintPanel::OnBrushTool(wxCommandEvent &event) { + SetBrushTool( _rbBrushTool->GetSelection() ); } //--------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.h index 0a175e4..e52f412 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.h @@ -20,9 +20,12 @@ public: private: - wxSlider *sldBrushSize; - wxSlider *sldGrayLevel; - wxTextCtrl *graylevelCtrl; + wxSlider *_sldBrushSize; + wxSlider *_sldGrayLevel; + wxTextCtrl *_graylevelCtrl; + wxRadioBox *_rbBrushForm; + wxRadioBox *_rb2D3D; + wxRadioBox *_rbBrushTool; protected: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index 4203d27..c3f8516 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -15,20 +15,20 @@ wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent) //EED 5mai2009 //------------------------------------------------------------------- wxVtk2DBaseView::~wxVtk2DBaseView() -{ - if (_vtkIinfoTextImage!=NULL) +{ + if (_vtkIinfoTextImage!=NULL) { - delete _vtkIinfoTextImage; + delete _vtkIinfoTextImage; } - if (_imageViewer2XYZ!=NULL) + if (_imageViewer2XYZ!=NULL) { - delete _imageViewer2XYZ; + delete _imageViewer2XYZ; } } //------------------------------------------------------------------- -void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z) // virtual +void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z) // virtual { //EEDx5 double spc[3]; @@ -42,7 +42,7 @@ void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel(double &X,double & spc[1] = 1; spc[2] = 1; } - + X = X / spc[0]; Y = Y / spc[1]; @@ -51,7 +51,7 @@ void wxVtk2DBaseView::TransformCoordinate_spacing_ViewToModel(double &X,double & } //------------------------------------------------------------------- -void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z) // virtual +void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z) // virtual { //EEDx5 double spc[3]; @@ -78,7 +78,7 @@ void wxVtk2DBaseView::ResetView() double spx = 0,spy = 0,spz = 0; int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1; wxVtkBaseView::Configure(); - + wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor(); vtkImageData *imageData = GetVtkBaseData()->GetImageData(); if(imageData){ @@ -90,10 +90,13 @@ void wxVtk2DBaseView::ResetView() imageData->GetExtent (x1,x2,y1,y2,z1,z2); } - + _imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2); _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren ); +//EED 24oct2010 + _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified(); + _imageViewer2XYZ->GetVtkImageViewer2()->Render(); ////////////// @@ -115,7 +118,7 @@ void wxVtk2DBaseView::ResetView() // RaC ////////////// - + } @@ -157,7 +160,7 @@ void wxVtk2DBaseView::Configure(bool okimage) vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData(); if (imageData!=NULL){ - + imageData->UpdateInformation(); imageData->SetUpdateExtent( imageData->GetWholeExtent()); imageData->Update(); @@ -195,39 +198,39 @@ void wxVtk2DBaseView::Configure(bool okimage) vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); -//EED 17Avril2009 -/* +//EED 17Avril2009 +/* camera->SetViewUp ( spx*0 , -spy*1 , spz*0 ); - camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000 ); - camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); -*/ + camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000 ); + camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); +*/ camera->SetViewUp ( spx*0 , spy*1 , spz*0 ); - camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000 ); - camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); - - + camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000 ); + camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 ); + + camera->SetClippingRange( 0.01 , 1000000 ); camera->ComputeViewPlaneNormal(); camera->SetParallelScale( spx*(x2-x1)/3.0 ); - + // text information over the graphic window if(_vtkIinfoTextImage == NULL){ _vtkIinfoTextImage = new vtkInfoTextImage(); - _vtkIinfoTextImageInteractor = new vtkInfoTextImageInteractor(); + _vtkIinfoTextImageInteractor = new vtkInfoTextImageInteractor(); ((vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView())->AddInteractorStyleMaracas(_vtkIinfoTextImageInteractor); } _vtkIinfoTextImage->SetWxVtk2DBaseView(this); _vtkIinfoTextImage->SetMarImageData( GetVtkBaseData()->GetMarImageData() ); - _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage); + _vtkIinfoTextImageInteractor->SetModelVtkInfoTextImage(_vtkIinfoTextImage); _vtkIinfoTextImage->Configure(); - + } // okimage } // imageData } //------------------------------------------------------------------- -int wxVtk2DBaseView::GetActualSlice() // virtual +int wxVtk2DBaseView::GetActualSlice() // virtual { return (int)(_vtkbasedata->GetZ()); } @@ -257,7 +260,10 @@ void wxVtk2DBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata) void wxVtk2DBaseView::Refresh() { int z = (int)(GetVtkBaseData()->GetZ()); - _imageViewer2XYZ->SetZSlice( z ); + _imageViewer2XYZ->SetZSlice( z ); + +//EED 24oct2010 + _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified(); wxVtkBaseView::Refresh(); } @@ -271,7 +277,7 @@ void wxVtk2DBaseView::SetInteractorStyleImage(vtkInteractorStyleBaseView *intera wxVTKRenderWindowInteractor *iren = GetWxVTKRenderWindowInteractor(); interactorstylebaseview->SetInteractor ( iren ); iren->SetInteractorStyle(interactorstylebaseview); - interactorstylebaseview->SetwxVtkBaseView(this); + interactorstylebaseview->SetwxVtkBaseView(this); vtkMaracasImageViewer2Callback * cbk = vtkMaracasImageViewer2Callback::New(); cbk->IV = _imageViewer2XYZ->GetVtkImageViewer2(); @@ -282,7 +288,7 @@ void wxVtk2DBaseView::SetInteractorStyleImage(vtkInteractorStyleBaseView *intera } //--------------------------------------------------------------------------- -vtkRenderer* wxVtk2DBaseView::GetRenderer() // virtual +vtkRenderer* wxVtk2DBaseView::GetRenderer() // virtual { return _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer(); } @@ -300,7 +306,7 @@ void wxVtk2DBaseView::GetSpacing(double spc[3]) // virtual if(imageData){ imageData->GetSpacing(spc); }else{ - spc[0] = 0; + spc[0] = 0; spc[1] = 0; spc[2] = 0; } @@ -314,7 +320,7 @@ void wxVtk2DBaseView::setColorTransferFunction(vtkColorTransferFunction* colorta } void wxVtk2DBaseView::setWindowLevel(double level){ -// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level); +// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level); vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel(); imagemaptowindowlevel->SetWindow(level); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index bbceacf..06d455d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -228,7 +228,6 @@ void wxVtkMPR2DView::Refresh() //vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); // JPRx - int x1 = 0,x2 = 0,y1 = 0,y2 = 0,z1 = 0,z2 = 0; int x = 0, y = 0, z = 0; int xx = 0, yy = 0, zz = 0; @@ -301,6 +300,10 @@ void wxVtkMPR2DView::Refresh() _backY=yy; _backZ=zz; } + +//EED 24oct2010 +_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified(); + wxVtkBaseView::Refresh(); } }