+/*# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ */
+
#ifndef __WX__MPR__BASE__DATA__H
#define __WX__MPR__BASE__DATA__H
-#include <vtkCommand.h>
+/*#include <vtkCommand.h>
#include "vtkRenderWindow.h"
#include <vtkVolumeRayCastMapper.h>
-#include "vtkImageActor.h"
+
#include "vtkProp.h"
-#include "vtkActor.h"
-#include "vtkPolyDataMapper.h"
+
+
#include "vtkStripper.h"
#include <vtkGlyph3D.h>
#include "vtkLODActor.h"
#include <vtkMarchingCubes.h>
#include <vtkClipPolyData.h>
-#include "vtkOutlineFilter.h"
+
#include <vtkPiecewiseFunction.h>
-#include <vtkColorTransferFunction.h>
+
#include <vtkVolume.h>
#include <vtkVolumeProperty.h>
#include <vtkVolumeRayCastMapper.h>
#include <vtkVolumeRayCastCompositeFunction.h>
-#include <vtkBoxWidget.h>
+#include <vtkBoxWidget.h>*/
+
-#include "vtkImageData.h"
-#include "vtkLookupTable.h"
+
+//#include "vtkLookupTable.h"
//#include "vtkImageActor.h"
-#include <vtkImageMapToColors.h>
-#include <vtkPointWidget.h>
-#include "marImageData.h"
+//#include <vtkPointWidget.h>
+
+
//#include "./pPlotter/HistogramDialog.h"
-
+#include "vtkTransform.h"
#include "marTypes.h"
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
-class MARACASVISULIB_EXPORTS vtkBaseData {
-public:
- vtkBaseData();
- virtual ~vtkBaseData();
- vtkImageData* GetImageData();
- marImageData* GetMarImageData();
- void SetMarImageData(marImageData *marimagedata);
- virtual void Configure();
- double GetZ();
- void SetZ(double z);
-
- int GetT();
- void SetT(double t);
-
-protected:
- marImageData *_marImageData;
- double _z;
- int _t;
-};
-
+#include "vtkBaseData.h"
+//#include "boxSurfaceObserver.h"
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
-
-class MARACASVISULIB_EXPORTS vtkMPRBaseData: public vtkBaseData{
+#ifdef _DEBUG
+#include <crtdbg.h>
+#define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
+#else
+#define DEBUG_NEW new
+#endif
+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;
};
//------------------------------------------------------------------
//------------------------------------------------------------------
-class MARACASVISULIB_EXPORTS vtkMPR3DDataViewer {
-public:
- vtkMPR3DDataViewer();
- virtual ~vtkMPR3DDataViewer();
- vtkImageActor* GetImageActor(int id);
- vtkActor* GetOutlineActor();
- virtual void Refresh();
- virtual void Configure();
- void SetVisiblePosition(int idPosition, bool visible);
- bool GetVisiblePosition(int idPosition);
- vtkImageActor* GetvtkActor_saggital();
- vtkImageActor* GetvtkActor_axial();
- vtkImageActor* GetvtkActor_coronal();
- void SetPositionX(int pos);
- void SetPositionY(int pos);
- void SetPositionZ(int pos);
- void SetVtkMPRBaseData(vtkMPRBaseData *vtkmprbasedata);
- vtkMPRBaseData* GetVtkMPRBaseData();
-
- vtkColorTransferFunction *GetvtkColorTransferFunction();
- std::vector<double > *GetctFunVectorPoint();
- std::vector<double > *GetctFunVectorRed();
- std::vector<double > *GetctFunVectorGreen();
- std::vector<double > *GetctFunVectorBlue();
-
-private:
-
- bool _visiblePosition[3];
-
- // outline
- vtkOutlineFilter *_outlineData;
- vtkPolyDataMapper *_mapOutline;
- vtkActor *_outline;
-
- //
- 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;
- vtkImageActor *_saggital;
- vtkImageMapToColors *_axialColors;
- vtkImageActor *_axial;
- vtkImageMapToColors *_coronalColors;
- vtkImageActor *_coronal;
- vtkMPRBaseData *_vtkmprbasedata;
-
-
-};
//------------------------------------------------------------------
//------------------------------------------------------------------
-// Callback for the interaction
-class boxSurfaceObserver : public vtkCommand
-{
- public:
- vtkPlanes *_planes;
- vtkProp *_actor;
- vtkVolumeRayCastMapper *_vtkVolumeRayCastMapper;
-
- boxSurfaceObserver()
- {
- _vtkVolumeRayCastMapper = NULL;
- }
-
- virtual char const *GetClassName() const { return "boxSurfaceObserver";}
-
- static boxSurfaceObserver *New(){
- boxSurfaceObserver * result;
- result = new boxSurfaceObserver();
- return result;
- }
-
- virtual void Execute(vtkObject *wdg, unsigned long eventId, void* calldata) ;
- void SetPlanes(vtkPlanes *planes);
- void SetActor(vtkProp *actor);
- void SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvolumeraycastmapper);
-};
-
-
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
-class vtkClipping3DDataViewer {
-public:
- //----------------------
- //Constructo-Destructor
- //----------------------
- vtkClipping3DDataViewer();
- virtual ~vtkClipping3DDataViewer();
-
-// vtkImageActor* GetImageActor(int id);
- vtkActor* GetOutlineActor();
- vtkClipPolyData* GetTissueClipper(int id);
- vtkPolyDataMapper* GetTissueMapper(int id);
- vtkPlanes* GetTissuePlanes(int id);
- vtkStripper* GetTissueStripper(int id);
-// vtkGlyph3D* GetGlyph(int id);
- vtkLODActor* GetMaceActor(int id);
-
- vtkMarchingCubes *GetMCubes(int idTissue);
-
- virtual void Refresh();
- void RefreshSurface();
-
- virtual void Configure();
- 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();
-
- vtkActor *GetTissueActor(int id);
- void SetVisibleTissue(int idTissue, bool visible);
- bool GetVisibleTissue(int idTissue);
- bool GetVisibleVolume();
- void SetVisibleVolume(bool visibleVolume);
-
- void SetRepresentationType(int idTissue, bool representationType);
- bool GetRepresentationType(int idTissue);
-
- boxSurfaceObserver *GetObserverS(int idObserverS);
- boxSurfaceObserver *GetObserverV();
-
- //void ReadVolumeFunctions(char *namefile);
- void ReadVolumeFunctions();
- void ReadMeshVTK(char *namefile);
-
-
- //-------------------
- //Getters Vectors
- //-------------------
-
- std::vector<double>* GetGreyValuesTransferenceFVector();
- std::vector<double>* GetIntensityValuesTransferenceFVector();
- std::vector<double>* GetRedColorsOfColorTransferenceFVector();
- std::vector<double>* GetGreenColorsOfColorTransferenceFVector();
- std::vector<double>* GetBlueColorsOfColorTransferenceFVector();
- std::vector<double>* GetGreyValueColorsOfColorTransferenceFVector();
-
- //--------------------------------------
- //Getters transference function
- //and color of the transference function
- //---------------------------------------
- vtkPiecewiseFunction *GetTransferencefunction();
- vtkColorTransferFunction *GetColorTransferenceFunction();
-
-
-
-private:
-
- 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;
- vtkActor *_outline;
-
- /// Volume
- vtkPiecewiseFunction *_tfun;
- vtkColorTransferFunction *_ctfun;
- vtkVolumeRayCastCompositeFunction *_compositeFunction;
- vtkPlanes *_volumePlanes;
- vtkVolumeRayCastMapper *_volumeMapper;
- vtkVolumeProperty *_volumeProperty;
- vtkVolume *_newvol;
-
- vtkMPRBaseData *_vtkmprbasedata;
-
- bool _visibleVolume;
- bool _representationType[VTKMPRDATA_MAXTISSUE];
- bool _visibleTissue[VTKMPRDATA_MAXTISSUE];
- vtkActor *_tissue[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;
-};
#endif // __WX__MPR__BASE__DATA__H