-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
# ----------------------------------
-# - BBTKGEditor v 1.3 BBG BlackBox Diagram file
-# - /home/mouton/Creatis/all/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbg
# ----------------------------------
APP_START
DESCRIPTION:Description ??
AUTHOR:Author ??
COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
BOXES:4
BOX
creaMaracasVisu:ColorLayerImageView:Box00
BOX
vtk:LoadHola:Box01
ISEXEC:FALSE
--23.247801:74.823885:-900.000000
-22.327199:64.823885:-900.000000
+56.503805:75.675326:-900.000000
+102.078805:65.675326:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ViewerNV:Box02
ISEXEC:FALSE
--66.477630:32.155340:-900.000000
--20.902630:22.155340:-900.000000
-PORT
-nTypeView:"0"
+-9.147294:53.441356:-900.000000
+51.492706:43.441356:-900.000000
FIN_BOX
BOX
wx:LayoutSplit:Box03
PORT
Orientation:"H"
FIN_BOX
-CONNECTIONS:5
+CONNECTIONS:7
CONNECTION
-Box02:Widget:Box03:Widget1
+Box01:Out:Box00:In
NumberOfControlPoints:0
CONNECTION
-Box00:Widget:Box03:Widget2
+Box01:Out:Box02:In
NumberOfControlPoints:0
CONNECTION
-Box01:Out:Box00:In
+Box02:wxVtkBaseView2:Box00:WxVtkBaseView
NumberOfControlPoints:0
CONNECTION
-Box02:wxVtkBaseView1:Box00:WxVtkBaseView
+Box02:wxVtkBaseView3:Box00:WxVtkBaseView1
NumberOfControlPoints:0
CONNECTION
-Box01:Out:Box02:In
+Box02:wxVtkBaseView4:Box00:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box03:Widget2
NumberOfControlPoints:0
APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la Sant�)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
# ----------------------------------
-# - BBTKGEditor v 1.3 BBS BlackBox Script
-# - /home/mouton/Creatis/all/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleColorLayer.bbs
# ----------------------------------
# BBTK GEditor Script
new LoadHola Box01
new ViewerNV Box02
- set Box02.nTypeView "0"
new LayoutSplit Box03
set Box03.Orientation "H"
-connect Box02.Widget Box03.Widget1
-connect Box00.Widget Box03.Widget2
connect Box01.Out Box00.In
-connect Box02.wxVtkBaseView1 Box00.WxVtkBaseView
+
connect Box01.Out Box02.In
+connect Box02.wxVtkBaseView2 Box00.WxVtkBaseView
+
+connect Box02.wxVtkBaseView3 Box00.WxVtkBaseView1
+
+connect Box02.wxVtkBaseView4 Box00.WxVtkBaseView2
+
+connect Box00.Widget Box03.Widget1
+
+connect Box02.Widget Box03.Widget2
+
+
+
+# Complex input ports
+message
exec Box03
void Process();
private:
- bool firsttime;
- vtkPolyData *mallData;
- vtkActor *mvtkactor;
+ bool firsttime;
+ vtkPolyData *mallData;
+ vtkActor *mvtkactor;
vtkPolyDataMapper *polydatamapper;
};
#include "LayerImageBase.h"
+#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
#include "wxVTKRenderWindowInteractor.h"
+
+
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------
+
+// Callback for the interaction
+class ColorLayerObserver : public vtkCommand{
+ public:
+ virtual char const *GetClassName() const { return "ColorLayerObserver";}
+
+ static ColorLayerObserver *New() { return new ColorLayerObserver; }
+
+ ColorLayerObserver()
+ {
+ _layerimagebase = NULL;
+ }
+
+ virtual void Execute(vtkObject *wdg, unsigned long event, void* calldata)
+ {
+ if (_layerimagebase!= NULL)
+ {
+
+ wxVtkBaseView *wxvtkbaseview = _layerimagebase->GetwxVtkBaseView();
+ if (wxvtkbaseview!=NULL)
+ {
+
+ vtkMPRBaseData *vtkmprbasedata = (vtkMPRBaseData*)wxvtkbaseview->GetVtkBaseData();
+ if (vtkmprbasedata!=NULL)
+ {
+ _layerimagebase->SetX( vtkmprbasedata->GetX() );
+ _layerimagebase->SetY( vtkmprbasedata->GetY() );
+ _layerimagebase->SetZ( vtkmprbasedata->GetZ() );
+ _layerimagebase->onThresholdChange();
+ } // if basedata
+
+ } // if wxvtkbaseview
+ } //if layerimagebase
+ }
+
+ void SetLayerImageBase(LayerImageBase* layerimagebase)
+ {
+ _layerimagebase = layerimagebase;
+ }
+
+private:
+ LayerImageBase* _layerimagebase;
+};
+
+
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase)
{
- _state=false;
- _stateKey=false;
- _layerImageBase=layerImageBase;
+ _state = false;
+ _stateKey = false;
+ _layerImageBase = layerImageBase;
}
// if ( this->_vtkInteractorStyleBaseView->GetParent_refresh_waiting() == true )
if ( interactor->GetControlKey()==1 ) // EED This if for ManaulPaint Interaction compatibility
- {
+ {
printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove need Refresh \n" );
_layerImageBase->onThreshold();
- _layerImageBase->GetvtkImageReslice()->Modified();
- }
- else {
- printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
+ _layerImageBase->GetvtkImageReslice()->Modified();
+ } else {
+ printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove NOT need Refresh \n" );
}
{
printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonDown \n");
_state=true;
- return true;
+ return true;
}
+
//---------------------------------------------------------------------------------------------
bool ColorLayerImageBasevtkInteractor::OnRightButtonUp() // virtual
{
LayerImageBase::LayerImageBase()
{
_actorPresent = false;
- _X = 0;
- _Y = 0;
- _Z = 0;
- _thresholdTable = NULL;
+ _X = 0;
+ _Y = 0;
+ _Z = 0;
+ _thresholdTable = NULL;
_thresholdMapper = NULL;
- _scalarbarActor = NULL;
- _thresholdActor = NULL;
- _image = NULL;
- _baseView = NULL;
+ _scalarbarActor = NULL;
+ _thresholdActor = NULL;
+ _image = NULL;
+ _baseView = NULL;
_imageReslicer = vtkImageReslice::New();
-
}
//----------------------------------------------------------------------------
- LayerImageBase::~LayerImageBase()
- {
- }
+LayerImageBase::~LayerImageBase()
+{
+}
//----------------------------------------------------------------------------
void LayerImageBase::SetX(int x)
void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
{
if (_baseView==NULL)
- {
- _baseView = baseview;
- vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
- isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
+ {
+ _baseView = baseview;
+// Old EED 2014 11 13
+// vtkInteractorStyleBaseView *isbv = (vtkInteractorStyleBaseView*)(_baseView->GetInteractorStyleBaseView());
+// isbv->AddInteractorStyleMaracas( new ColorLayerImageBasevtkInteractor(this) );
+
+ ColorLayerObserver *colorlayerobserver = ColorLayerObserver::New();
+ _baseView->GetVtkBaseData()->AddObserver( 1, colorlayerobserver );
+ colorlayerobserver->SetLayerImageBase(this);
+
} // if _baseView
}
return _thresholdTable;
}
+//----------------------------------------------------------------------------
vtkImageReslice *LayerImageBase::GetvtkImageReslice()
{
return _imageReslicer;
//----------------------------------------------------------------------------------
class LayerImageBase;
-class ColorLayerImageBasevtkInteractor : public InteractorStyleMaracas {
+class ColorLayerImageBasevtkInteractor : public InteractorStyleMaracas
+{
public:
ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase);
virtual ~ColorLayerImageBasevtkInteractor();
class LayerImageBase
- {
+ {
public:
LayerImageBase();
virtual ~LayerImageBase();
bool GetActorPresent();
private:
- int _X;
- int _Y;
- int _Z;
- bool _actorPresent;
- vtkImageData *_image;
+ int _X;
+ int _Y;
+ int _Z;
+ bool _actorPresent;
+ vtkImageData *_image;
vtkImageReslice *_imageReslicer;
- vtkLookupTable *_thresholdTable;
+ vtkLookupTable *_thresholdTable;
vtkImageMapToColors *_thresholdMapper;
- vtkImageActor *_thresholdActor;
- wxVtkBaseView *_baseView;
+ vtkImageActor *_thresholdActor;
+ wxVtkBaseView *_baseView;
- vtkScalarBarActor *_scalarbarActor;
+ vtkScalarBarActor *_scalarbarActor;
virtual void ConfigLookupTable() = 0;
void CleanXYZ(double &x, double &y, double &z);
#ifndef manualContour3DControler_h
#define manualContour3DControler_h
+#include "wxMPRBaseData.h"
#include "manualContourControler.h"
#include "manualView3DContour.h"
#ifndef manualContour3VControler_h
#define manualContour3VControler_h
+#include "wxMPRBaseData.h"
#include "manualContourControler.h"
// ----------------------------------------------------------------------------
#ifndef manualContourPerpPlaneControler_h
#define manualContourPerpPlaneControler_h
+
+#include "wxMPRBaseData.h"
#include "manualContourControler.h"
#include "manualContour3VControler.h"
#ifndef manualView3DContour_h
#define manualView3DContour_h
+#include "wxMPRBaseData.h"
#include "manualViewContour.h"
// ----------------------------------------------------------------------------
#include "vtkBaseData.h"
+
+
+//-------------------------------------------------------------------
vtkBaseData::vtkBaseData()
{
-
- _z = 0;
- _t = 0;
- _marImageData = 0;
+ _z = 0;
+ _t = 0;
+ _marImageData = 0;
+ _observable = vtkObject::New();
}
//-------------------------------------------------------------------
{
}
+
+
//-------------------------------------------------------------------
void vtkBaseData::SetMarImageData(marImageData *marimagedata)
{
}
//-------------------------------------------------------------------
-void vtkBaseData::SetZ(double z){
+void vtkBaseData::SetZ(double z)
+{
+
//int maxZ;
// int dim[3];
}
_z=z;
+ _observable->InvokeEvent(3);
}
}
return _colorLevel;
}
+
+//-------------------------------------------------------------------
+void vtkBaseData::AddObserver(int eventNumber, vtkCommand *observer)
+{
+ _observable->AddObserver( eventNumber , observer );
+ //Configure();
+}
+
+
#define VTKBASEDATA_H_
#include "marTypes.h"
-
-#include "marImageData.h"
+#include "vtkCommand.h"
#include "vtkImageData.h"
+#include "marImageData.h"
+
class creaMaracasVisu_EXPORT vtkBaseData {
public:
vtkBaseData();
- virtual ~vtkBaseData();
+ virtual ~vtkBaseData();
vtkImageData* GetImageData();
marImageData* GetMarImageData();
- void SetMarImageData(marImageData *marimagedata);
+ void SetMarImageData(marImageData *marimagedata);
virtual void Configure();
double GetZ();
- void SetZ(double z);
+ void SetZ(double z);
int GetT();
- void SetT(double t);
+ void SetT(double t);
- void SetColorWindow(double colorWindow);
- void SetColorLevel(double colorLevel);
- double GetColorWindow();
- double GetColorLevel();
+ void SetColorWindow(double colorWindow);
+ void SetColorLevel(double colorLevel);
+ double GetColorWindow();
+ double GetColorLevel();
+ void AddObserver(int eventNumber, vtkCommand *observer);
protected:
marImageData *_marImageData;
double _colorWindow;
double _colorLevel;
+
+ vtkObject* _observable;
+
+private:
};
#endif /*VTKBASEDATA_H_*/
// vtkImageActor* GetImageActor(int id);
vtkActor* GetOutlineActor();
vtkClipPolyData* GetTissueClipper(int id);
- vtkPolyDataMapper* GetTissueMapper(int id);
+ vtkPolyDataMapper* GetTissueMapper(int id);
vtkPlanes* GetTissuePlanes(int id);
vtkStripper* GetTissueStripper(int id);
// vtkGlyph3D* GetGlyph(int id);
vtkMarchingCubes *GetMCubes(int idTissue);
virtual void Refresh();
- void RefreshSurface();
+ void RefreshSurface();
virtual void Configure();
- void Configure_Tissue();
- void Configure_Volume();
-
- void SetIsovalue(int idTissue, int isoValue);
+ void Configure_Tissue();
+ void Configure_Volume();
+
+ void SetIsovalue(int idTissue, int isoValue);
double GetIsovalue(int idTissue);
vtkVolume *GetVolumeActor();
vtkVolumeRayCastMapper *GetVolumeMapper();
vtkPlanes *GetVolumePlanes();
- void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
- vtkMPRBaseData* GetVtkMPRBaseData();
+ void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
+ vtkMPRBaseData* GetVtkMPRBaseData();
- vtkActor *GetTissueActor(int id);
- void SetVisibleTissue(int idTissue, bool visible);
- bool GetVisibleTissue(int idTissue);
- bool GetVisibleVolume();
- void SetVisibleVolume(bool visibleVolume);
+ vtkActor *GetTissueActor(int id);
+ void SetVisibleTissue(int idTissue, bool visible);
+ bool GetVisibleTissue(int idTissue);
+ bool GetVisibleVolume();
+ void SetVisibleVolume(bool visibleVolume);
- bool GetVisibleVolumeBox();
- void SetVisibleVolumeBox(bool visibleBox);
+ bool GetVisibleVolumeBox();
+ void SetVisibleVolumeBox(bool visibleBox);
- void SetRepresentationType(int idTissue, bool representationType);
- bool GetRepresentationType(int idTissue);
+ void SetRepresentationType(int idTissue, bool representationType);
+ bool GetRepresentationType(int idTissue);
- boxSurfaceObserver *GetObserverS(int idObserverS);
- boxSurfaceObserver *GetObserverV();
+ boxSurfaceObserver *GetObserverS(int idObserverS);
+ boxSurfaceObserver *GetObserverV();
//void ReadVolumeFunctions(char *namefile);
- void ReadVolumeFunctions();
- void ReadMeshVTK(char *namefile);
+ void ReadVolumeFunctions();
+ void ReadMeshVTK(char *namefile);
- void Configure_VolumeBox();
- void SetInteractor(vtkRenderWindowInteractor* interactor);
- void SetRenderer(vtkRenderer* renderer);
+ void Configure_VolumeBox();
+ void SetInteractor(vtkRenderWindowInteractor* interactor);
+ void SetRenderer(vtkRenderer* renderer);
//-------------------
//Getters Vectors
//Getters transference function
//and color of the transference function
//---------------------------------------
- vtkPiecewiseFunction *GetTransferencefunction();
- vtkColorTransferFunction *GetColorTransferenceFunction();
-
- void SetRayCasting(bool active);
- void SetMIPActive(bool active);
- void SetInterpolation(bool active);
- void SetShade(bool active);
- void updateVolume();
+ vtkPiecewiseFunction *GetTransferencefunction();
+ vtkColorTransferFunction *GetColorTransferenceFunction();
-
- void BoxActorChanged(bool changed);
- void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+ void SetRayCasting(bool active);
+ void SetMIPActive(bool active);
+ void SetInterpolation(bool active);
+ void SetShade(bool active);
+ void updateVolume();
+ void BoxActorChanged(bool changed);
+ void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
private:
- vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ];
- vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
- vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
- vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
- vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
+ vtkMarchingCubes *_mCubes[ VTKMPRDATA_MAXTISSUE ];
+ vtkStripper *_tissueStripper[ VTKMPRDATA_MAXTISSUE ];
+ vtkPolyDataMapper *_tissueMapper[ VTKMPRDATA_MAXTISSUE ];
+ vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ];
+ vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ];
// outline
- vtkOutlineFilter *_outlineData;
- vtkPolyDataMapper *_mapOutline;
+ vtkOutlineFilter *_outlineData;
+ vtkPolyDataMapper *_mapOutline;
vtkActor *_outline;
/// Volume
- vtkPiecewiseFunction *_tfun;
- vtkColorTransferFunction *_ctfun;
+ vtkPiecewiseFunction *_tfun;
+ vtkColorTransferFunction *_ctfun;
// vtkVolumeRayCastCompositeFunction *_compositeFunction;
- vtkPlanes *_volumePlanes;
- vtkVolumeRayCastMapper *_volumeMapper;
- vtkVolumeProperty *_volumeProperty;
- vtkVolume *_newvol;
-
- vtkMPRBaseData *_vtkmprbasedata;
-
+ vtkPlanes *_volumePlanes;
+ vtkVolumeRayCastMapper *_volumeMapper;
+ vtkVolumeProperty *_volumeProperty;
+ vtkVolume *_newvol;
+ vtkMPRBaseData *_vtkmprbasedata;
bool _visibleVolume;
-
- bool _visibleVolumeBox;
-
+ bool _visibleVolumeBox;
bool _representationType[VTKMPRDATA_MAXTISSUE];
bool _visibleTissue[VTKMPRDATA_MAXTISSUE];
vtkActor *_tissue[VTKMPRDATA_MAXTISSUE];
- boxSurfaceObserver *_observerV;
- boxSurfaceObserver *_observerS[VTKMPRDATA_MAXTISSUE];
+ boxSurfaceObserver *_observerV;
+ boxSurfaceObserver *_observerS[VTKMPRDATA_MAXTISSUE];
- std::vector<double> greyValuesTransferenceFVector;
- std::vector<double> intensityValuesTransferenceFVector;
- std::vector<double> redColorsOfColorTransferenceFVector;
- std::vector<double> greenColorsOfColorTransferenceFVector;
- std::vector<double> blueColorsOfColorTransferenceFVector;
- std::vector<double> greyValueColorsOfColorTransferenceFVector;
+ std::vector<double> greyValuesTransferenceFVector;
+ std::vector<double> intensityValuesTransferenceFVector;
+ std::vector<double> redColorsOfColorTransferenceFVector;
+ std::vector<double> greenColorsOfColorTransferenceFVector;
+ std::vector<double> blueColorsOfColorTransferenceFVector;
+ std::vector<double> greyValueColorsOfColorTransferenceFVector;
vtkVolumeRayCastCompositeFunction *_compositeFunction;
vtkVolumeRayCastMIPFunction *_compositeFunctionMIP ;
bool _isRayCasting;
- bool _isMIP;
+ bool _isMIP;
bool _interpolation;
bool _shade;
private:
- bool _visiblePosition[3];
+ bool _visiblePosition[3];
// outline
vtkOutlineFilter *_outlineData;
vtkPolyDataMapper *_mapOutline;
- vtkActor *_outline;
+ vtkActor *_outline;
//
- vtkColorTransferFunction *_ctfun;
- std::vector<double> _ctFunVectorPoint;
- std::vector<double> _ctFunVectorRed;
- std::vector<double> _ctFunVectorGreen;
- std::vector<double> _ctFunVectorBlue;
+ vtkColorTransferFunction *_ctfun;
+ std::vector<double> _ctFunVectorPoint;
+ std::vector<double> _ctFunVectorRed;
+ std::vector<double> _ctFunVectorGreen;
+ std::vector<double> _ctFunVectorBlue;
// vtkLookupTable *_bwLut;
// vtkLookupTable *_hueLut;
// vtkLookupTable *_satLut;
- vtkImageMapToColors *_saggitalColors;
+ vtkImageMapToColors *_saggitalColors;
vtkImageActor *_saggital;
- vtkImageMapToColors *_axialColors;
+ vtkImageMapToColors *_axialColors;
vtkImageActor *_axial;
- vtkImageMapToColors *_coronalColors;
+ vtkImageMapToColors *_coronalColors;
vtkImageActor *_coronal;
vtkMPRBaseData *_vtkmprbasedata;
#include "vtkInfoTextImageInteractorPlane2D.h"
#include "vtkInfoTextImage.h"
+#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
#include "vtkTransform.h"
}
_x=x;
+ _observable->InvokeEvent(1);
}
}
//-------------------------------------------------------------------
y=ext[3] + origin[1];
}
_y=y;
+ _observable->InvokeEvent(2);
}
}
//-------------------------------------------------------------------
class creaMaracasVisu_EXPORT vtkMPRBaseData: public vtkBaseData{
public:
vtkMPRBaseData();
- virtual ~vtkMPRBaseData();
- virtual void Configure();
- int GetMaxPositionX( );
- int GetMaxPositionY( );
- int GetMaxPositionZ( );
- double GetX();
- double GetY();
- void SetX(double x);
- void SetY(double y);
- void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
- vtkTransform *GetTransformOrientation();
- void SetNormal(double nx, double ny, double nz);
- void InitTransformOrientation(vtkTransform *trans);
+ virtual ~vtkMPRBaseData();
+ virtual void Configure();
+ int GetMaxPositionX( );
+ int GetMaxPositionY( );
+ int GetMaxPositionZ( );
+ double GetX();
+ double GetY();
+ void SetX(double x);
+ void SetY(double y);
+ void GetDimensionExtention(int *x1,int *x2,int *y1,int *y2,int *z1,int *z2);
+ vtkTransform* GetTransformOrientation();
+ void SetNormal(double nx, double ny, double nz);
+ void InitTransformOrientation(vtkTransform *trans);
protected:
- int _x1,_x2,_y1,_y2,_z1,_z2;
+ int _x1,_x2,_y1,_y2,_z1,_z2;
private:
- double _x,_y;
- vtkTransform *_transformOrientation;
+ double _x,_y;
+ vtkTransform *_transformOrientation;
};
if (type==3)
{
_widgetMesure_B = new wxWidgetMesure2D_Plane_in_MPR(panel);
- _vtkplane2Dview_B = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
+ _vtkplane2Dview_B = new vtkPlane2DView( _widgetMesure_B->GetWindow2());
_widgetMesure_B->SetVtkPlane2DView( _vtkplane2Dview_B );
_vtkplane2Dview_B->SetImgSize( 200 );
_vtkplane2Dview_B->SetVtkBaseData(vtkmprbasedata);
if (type==5)
{
wxSplitterWindow *panelMPR3D = new wxSplitterWindow( panel , -1);
- _wxvtk3Dbaseview_MPR3D_B = new wxVtk3DBaseView( panelMPR3D );
+ _wxvtk3Dbaseview_MPR3D_B = new wxVtk3DBaseView( panelMPR3D , vtkmprbasedata );
- _wxvtkmpr3Dview_B = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
+ _wxvtkmpr3Dview_B = new wxVtkMPR3DView(_wxvtk3Dbaseview_MPR3D_B);
vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
vtkmpr3Ddataviewer->SetVtkMPRBaseData(vtkmprbasedata);
vtkmpr3Ddataviewer->Configure();
_wxvtkmpr3Dview_B->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
- wxWindow *window3D = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
- wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
+ wxWindow *window3D = _wxvtk3Dbaseview_MPR3D_B->GetWxVTKRenderWindowInteractor();
+ wxPanel *controlPanel3D = _wxvtkmpr3Dview_B->CreateControlPanel(panelMPR3D, false);
//EEDxx2.4
panelMPR3D -> SetMinimumPaneSize( 5 );
if (type==6)
{
wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
- _wxvtk3Dbaseview_Clipping3D_BB = new wxVtk3DBaseView( panelClipping3D );
+ _wxvtk3Dbaseview_Clipping3D_BB = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata );
_wxvtkclipping3Dview_BB = new wxVtkClipping3DView(_wxvtk3Dbaseview_Clipping3D_BB);
vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
vtkmpr3Ddataviewer->Configure();
_wxvtkmpr3Dview_BB->SetVtkMPR3DDataViewer(vtkmpr3Ddataviewer);
- wxWindow *window3D = _wxvtk3Dbaseview_Clipping3D_BB->GetWxVTKRenderWindowInteractor();
+ wxWindow *window3D = _wxvtk3Dbaseview_Clipping3D_BB->GetWxVTKRenderWindowInteractor();
wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
wxPanel *controlPanelMPR3D = _wxvtkmpr3Dview_BB->CreateControlPanel(panelControl, false);
wxVTKRenderWindowInteractor *iren3B = _wxsphereview->GetWxVTKRenderWindowInteractor();
notebook->AddPage( iren3B, _T("Sphere") );
-
// view 3.2
wxSplitterWindow *panelMPR3D = new wxSplitterWindow( notebook , -1);
- _wxvtk3Dbaseview_MPRClipping3D = new wxVtk3DBaseView( panelMPR3D );
+ _wxvtk3Dbaseview_MPRClipping3D = new wxVtk3DBaseView( panelMPR3D ,vtkmprbasedata );
_wxvtkmpr3Dview = new wxVtkMPR3DView( _wxvtk3Dbaseview_MPRClipping3D );
vtkMPR3DDataViewer *vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
wxPanel *panel=new wxPanel(parent,-1);
wxSplitterWindow *panelClipping3D = new wxSplitterWindow( panel , -1);
- _wxvtk3Dbaseview_Clipping3D_C = new wxVtk3DBaseView( panelClipping3D );
+ _wxvtk3Dbaseview_Clipping3D_C = new wxVtk3DBaseView( panelClipping3D, vtkmprbasedata );
_wxvtkclipping3Dview_C = new wxVtkClipping3DView(_wxvtk3Dbaseview_Clipping3D_C);
vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
}else if (type==5)
{
panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
- mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
+ mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D);
vtkClipping3DDataViewer *vtkclipping3Ddataviewer = new vtkClipping3DDataViewer();
vtkclipping3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata);
vtkclipping3Ddataviewer->Configure();
wxwindow=panelClipping3D;
} else if (type==6) {
- panelClipping3D = new wxSplitterWindow( panel , -1);
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D );
-
- mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
-
- vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
-
- wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
-
- wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
- wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
-
- wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
+ panelClipping3D = new wxSplitterWindow( panel , -1);
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata);
+ mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D );
+ vtkmpr3Ddataviewer = new vtkMPR3DDataViewer();
+ wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
+ wxPanel *panelControl = new wxPanel(panelClipping3D,-1);
+ wxPanel *controlPanelMPR3D = mwxvtkmpr3Dview->CreateControlPanel(panelControl, true);
+ wxFlexGridSizer *sizerCtrol = new wxFlexGridSizer(1);
sizerCtrol->Add(controlPanelMPR3D, 1, wxALL|wxEXPAND, 2);
panelControl->SetAutoLayout(true);
}else if (type==7)
{
- mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel );
+ mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panel ,vtkmprbasedata);
wxwindow = (wxWindow*) mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor();
}
#ifndef WXSPHEREVIEW_H_
#define WXSPHEREVIEW_H_
+#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
#include "idAlBeRa.h"
#include "vtkInteractorStyleSphere.h"
int wxVtk2DBaseView::GetActualSlice() // virtual
{
- return (int)(_vtkbasedata->GetZ());
+ return (int)(GetVtkBaseData()->GetZ());
}
//-------------------------------------------------------------------
void wxVtk2DBaseView::SetActualSlice(int slice) // Virtual
{
- _vtkbasedata->SetZ(slice);
+ GetVtkBaseData()->SetZ(slice);
}
-//-------------------------------------------------------------------
-
-vtkBaseData *wxVtk2DBaseView::GetVtkBaseData()
-{
- return _vtkbasedata;
-}
-
-//-------------------------------------------------------------------
-
-void wxVtk2DBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata)
-{
- _vtkbasedata=vtkbasedata;
-}
//-------------------------------------------------------------------
void wxVtk2DBaseView::UpdateColorWindowLevel()
vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel();
- imagemaptowindowlevel->SetWindow( _vtkbasedata->GetColorWindow() );
- imagemaptowindowlevel->SetLevel( _vtkbasedata->GetColorLevel() );
+ imagemaptowindowlevel->SetWindow( GetVtkBaseData()->GetColorWindow() );
+ imagemaptowindowlevel->SetLevel( GetVtkBaseData()->GetColorLevel() );
// EED Borrame
-// vtkimageviewer2->SetColorWindow( _vtkbasedata->GetColorWindow() );
-// vtkimageviewer2->SetColorLevel( _vtkbasedata->GetColorLevel() );
+// vtkimageviewer2->SetColorWindow( GetVtkBaseData()->GetColorWindow() );
+// vtkimageviewer2->SetColorLevel( GetVtkBaseData()->GetColorLevel() );
_imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified();
}
void wxVtk2DBaseView::SetColorWindow(double level)
{
// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow(level);
- _vtkbasedata->SetColorWindow(level);
+ GetVtkBaseData()->SetColorWindow(level);
this->Refresh();
}
void wxVtk2DBaseView::SetColorLevel(double level)
{
// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorLevel(level);
- _vtkbasedata->SetColorLevel(level);
+ GetVtkBaseData()->SetColorLevel(level);
this->Refresh();
}
//------------------------------------------------------------------
-
class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{
public:
wxVtk2DBaseView(wxWindow *parent);
virtual ~wxVtk2DBaseView();
virtual void Configure(bool okimage=true);
vtkImageViewer2_XYZ* _imageViewer2XYZ;
- vtkBaseData* GetVtkBaseData();
- void SetVtkBaseData(vtkBaseData *vtkbasedata);
+
+
virtual void Refresh();
virtual void ResetView();
virtual int GetActualSlice();
- virtual void SetActualSlice(int slice);
- void SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview);
+ virtual void SetActualSlice(int slice);
+ void SetInteractorStyleImage(vtkInteractorStyleBaseView *interactorstylebaseview);
- virtual vtkRenderer* GetRenderer();
+ virtual vtkRenderer* GetRenderer();
virtual vtkRenderWindow* GetRenWin();
virtual void TransformCoordinate_spacing_ViewToModel(double &X,double &Y, double &Z);
virtual void TransformCoordinate_spacing_ModelToView(double &X,double &Y, double &Z);
virtual void GetSpacing(double spc[3]);
void setColorTransferFunction(vtkColorTransferFunction* colortable);
-
void SetColorWindow(double level);
void SetColorLevel(double level);
- virtual int GetDirection();
+ virtual int GetDirection();
void SetImageToVtkViewer(vtkImageData *imageData);
//EED 01nov2012
private:
- vtkBaseData *_vtkbasedata;
-
vtkInfoTextImage *_vtkIinfoTextImage;
- vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
- vtkInteractorStyleBaseView2D * _style2D;
+ vtkInfoTextImageInteractor *_vtkIinfoTextImageInteractor;
+ vtkInteractorStyleBaseView2D * _style2D;
protected:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
-wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent)
+wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata)
:wxVtkBaseView( parent )
{
+ SetVtkBaseData( vtkbasedata );
_configure = false;
_aRenderer = NULL;
_renWin = NULL;
- _aCamera = NULL;
+ _aCamera = NULL;
}
//-------------------------------------------------------------------
wxVtk3DBaseView::~wxVtk3DBaseView()
{
- if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
+ if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;}
if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;}
- if (_renWin!=NULL) {
- if(_renWin->GetReferenceCount()==0){
+ if (_renWin!=NULL) {
+ if(_renWin->GetReferenceCount()==0)
+ {
_renWin -> Delete(); _renWin=NULL;
}
}
class creaMaracasVisu_EXPORT wxVtk3DBaseView: public wxVtkBaseView
{
public:
- wxVtk3DBaseView( wxWindow *parent );
+ wxVtk3DBaseView( wxWindow *parent, vtkBaseData* vtkbasedata );
virtual ~wxVtk3DBaseView();
- vtkCamera* GetCamera();
- virtual vtkRenderer* GetRenderer();
+ vtkCamera* GetCamera();
+ virtual vtkRenderer* GetRenderer();
virtual vtkRenderWindow* GetRenWin();
- void Refresh();
- void Configure();
- virtual void GetSpacing(double spc[3]);
- void SetStereo(int type);
- void ResetCamera(int *ext=NULL,double* spc=NULL);
-
+ void Refresh();
+ void Configure();
+ virtual void GetSpacing(double spc[3]);
+ void SetStereo(int type);
+ void ResetCamera(int *ext=NULL,double* spc=NULL);
private:
- bool _configure;
- vtkRenderer *_aRenderer;
- vtkRenderWindow *_renWin;
- vtkCamera *_aCamera;
+ bool _configure;
+ vtkRenderer *_aRenderer;
+ vtkRenderWindow *_renWin;
+ vtkCamera *_aCamera;
protected:
};
return -1;
}
+//-------------------------------------------------------------------
+vtkBaseData *wxVtkBaseView::GetVtkBaseData()
+{
+ return _vtkbasedata;
+}
+
+//-------------------------------------------------------------------
+void wxVtkBaseView::SetVtkBaseData(vtkBaseData *vtkbasedata)
+{
+ _vtkbasedata=vtkbasedata;
+}
+
+
//-------------------------------------------------------------------
//-------------------------------------------------------------------
#include <vtkImageViewer2.h>
#include <vtkInteractorStyleImage.h>
-#include "wxMPRBaseData.h"
+#include "vtkBaseData.h"
#include "wxVTKRenderWindowInteractorEditContour.h"
#include <wx/wx.h>
wxVtkBaseView( wxWindow *parent );
virtual ~wxVtkBaseView();
wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*);
- virtual void Configure();
- virtual void Refresh();
- virtual void RefreshView();
+ virtual void Configure();
+ virtual void Refresh();
+ virtual void RefreshView();
virtual vtkRenderer* GetRenderer();
- virtual vtkRenderWindow* GetRenWin();
- virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2);
+ virtual vtkRenderWindow* GetRenWin();
+ virtual void TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false,int type=2);
//RaC 03-2010 Method used by TransFromCoordScreenToWorld
- void TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2);
+ void TransCoordScreenToWorld(double &X, double &Y, double &Z,int type=2);
/* JCP 04/05/09
void SetInteractorStyleBaseView( vtkInteractorStyleBaseView* interactorStyle);
*/
- void SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle);
+ void SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle);
/* JCP 04/05/09
*
vtkInteractorStyleBaseView* GetInteractorStyleBaseView();
*/
- vtkInteractorStyleImage* GetInteractorStyleBaseView();
- virtual void GetSpacing(double spc[3]);
- virtual int GetDirection();
+ vtkInteractorStyleImage* GetInteractorStyleBaseView();
+ virtual void GetSpacing(double spc[3]);
+ virtual int GetDirection();
+
+
+ vtkBaseData* GetVtkBaseData();
+ void SetVtkBaseData(vtkBaseData *vtkbasedata);
+
private:
- wxWindow *_parent;
- wxVTKRenderWindowInteractor *_iren;
+ wxWindow *_parent;
+ wxVTKRenderWindowInteractor *_iren;
/**
* JCP 04/05/09
* vtkInteractorStyleImage *_interactorStyle;
*/
vtkInteractorStyleImage *_interactorStyle;
+
+// EED Nov 15 2014
+ vtkBaseData *_vtkbasedata;
+
protected:
};
public:
wxVtkClipping3DView( wxVtk3DBaseView* wxvtk3Dbaseview );
virtual ~wxVtkClipping3DView();
- virtual void Refresh();
- virtual void Configure();
+ virtual void Refresh();
+ virtual void Configure();
void SetVtkClipping3DDataViewer( vtkClipping3DDataViewer *vtkclipping3Ddataviewer );
wxPanel* CreateSurfControlPanel(wxWindow *parent);
void VisibleActor(int idTissue, bool visTissue);
void VisibleVolumeActor( bool visVolume );
- void VisibleVolumeBoxActor(bool visible);
+ void VisibleVolumeBoxActor(bool visible);
void SetVisibleBoxSurface(bool visible);
void SetVisibleBoxVolume(bool visible);
void SetRepSurfaceWireFrame(int idTissue , bool typeRepresentation );
- wxVtk3DBaseView* GetWxvtk3Dbaseview()throw(char*);
+ wxVtk3DBaseView* GetWxvtk3Dbaseview()throw(char*);
- void SetRayCasting(bool active);
- void SetMIPActive(bool active);
- void SetInterpolation(bool active);
- void SetShade(bool active);
+ void SetRayCasting(bool active);
+ void SetMIPActive(bool active);
+ void SetInterpolation(bool active);
+ void SetShade(bool active);
- void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
+ void UpdateVolumeBox(vector<double> gf, vector<double> vf, vtkColorTransferFunction* ctfun);
private:
- wxVtk3DBaseView *_wxvtk3Dbaseview;
- vtkClipping3DDataViewer *_vtkclipping3Ddataviewer;
+ wxVtk3DBaseView *_wxvtk3Dbaseview;
+ vtkClipping3DDataViewer *_vtkclipping3Ddataviewer;
vtkBoxWidget *_boxWidgetS1;
vtkBoxWidget *_boxWidgetVolume;
wxPanel *_wxvtkclipping3DviewCntrlPanel;
#include "vtkInteractorStyleMPRView.h"
+#include "wxMPRBaseData.h"
#include "wxVtk2DBaseView.h"
#include "vtkPolyDataMapper.h"