41 #include "vtkImageData.h"
42 #include "vtkLookupTable.h"
43 #include "vtkContourWidget.h"
44 #include "vtkOrientedGlyphContourRepresentation.h"
45 #include "vtkImageActorPointPlacer.h"
46 #include "vtkProperty.h"
50 #include "vtkImageExtractComponents.h"
53 #include <QColorDialog>
54 #include <QDockWidget>
56 #include <QVBoxLayout>
68 for (
int i = 0; i < 3; i++ )
71 vtkSmartPointer< vtkOrientedGlyphContourRepresentation >::New() );
77 vtkSmartPointer< vtkContourWidget >::New() );
111 std::pair< QGoDockWidgetStatus *, QDockWidget * >(
139 QIcon::Normal, QIcon::Off);
140 QuadViewAction->
setIcon(quadviewicon);
154 QIcon::Normal, QIcon::Off);
155 FullScreenXYAction->
setIcon(xyicon);
169 QIcon::Normal, QIcon::Off);
170 FullScreenXZAction->
setIcon(xzicon);
184 QIcon::Normal, QIcon::Off);
185 FullScreenYZAction->
setIcon(yzicon);
199 QIcon::Normal, QIcon::Off);
200 FullScreenXYZAction->
setIcon(xyzicon);
215 LookupTableAction->
setStatusTip(
tr(
" Change the associated lookup table") );
219 QIcon::Normal, QIcon::Off);
220 LookupTableAction->
setIcon(luticon);
233 QIcon::Normal, QIcon::Off);
234 ScalarBarAction->
setIcon(scalarbaricon);
259 QAction *DisplayAnnotationsAction =
new QAction(
tr(
"Display annotations"),
this);
262 DisplayAnnotationsAction->
setStatusTip(
tr(
" Display or not annotations in each 2d view") );
264 QIcon displayannotationsicon;
266 QIcon::Normal, QIcon::Off);
267 DisplayAnnotationsAction->
setIcon(displayannotationsicon);
274 QAction *DisplaySplinePlanesAction =
new QAction(
tr(
"Display spline planes"),
this);
277 DisplaySplinePlanesAction->
setStatusTip(
tr(
" Display or not spline planes on each view") );
279 QIcon displaysplineplaneicon;
281 QIcon::Normal, QIcon::Off);
282 DisplaySplinePlanesAction->
setIcon(displaysplineplaneicon);
296 QIcon::Normal, QIcon::Off);
297 DisplayCube3D->
setIcon(cube3dicon);
304 QAction *Change3DPerspectiveToAxialAction =
305 new QAction(
tr(
"Change 3D view to Posterior "),
this);
306 this->
m_ViewActions.push_back(Change3DPerspectiveToAxialAction);
310 QIcon::Normal, QIcon::Off);
311 Change3DPerspectiveToAxialAction->
setIcon(axialicon);
316 QAction *Change3DPerspectiveToCoronalAction =
317 new QAction(
tr(
"Change 3D view to Dorsal "),
this);
318 this->
m_ViewActions.push_back(Change3DPerspectiveToCoronalAction);
322 QIcon::Normal, QIcon::Off);
323 Change3DPerspectiveToCoronalAction->
setIcon(coronalicon);
325 QObject::connect( Change3DPerspectiveToCoronalAction, SIGNAL( triggered() ),
328 QAction *Change3DPerspectiveToSagittalAction =
329 new QAction(
tr(
"Change 3D view to Left "),
this);
330 this->
m_ViewActions.push_back(Change3DPerspectiveToSagittalAction);
334 QIcon::Normal, QIcon::Off);
335 Change3DPerspectiveToSagittalAction->
setIcon(sagittalicon);
337 QObject::connect( Change3DPerspectiveToSagittalAction, SIGNAL( triggered() ),
371 iParent->
resize(800, 800);
445 vtkLookupTable *lut = vtkLookupTable::New();
448 tr(
"Choose one look-up table") ) );
645 double r(0.), g(0.), b(0.);
673 vtkSmartPointer<vtkLookupTable> bwLut =
674 vtkSmartPointer<vtkLookupTable>::New();
675 double* range = image->GetScalarRange();
676 bwLut->SetTableRange (0, range[1]);
677 bwLut->SetValueRange (0, 1);
678 bwLut->SetSaturationRange(0.0, 0.0);
685 vtkImageActorPointPlacer *point_placer = vtkImageActorPointPlacer::New();
689 point_placer->Delete();
707 std::vector< vtkActor * >
709 vtkProperty *iProperty)
763 double r(0.), g(0.), b(0.);
769 this,
tr(
"Choose Background Color") );
872 switch ( FullScreenView )
875 filename.
append(
"snapshot-xy-");
880 filename.
append(
"snapshot-xz-");
885 filename.
append(
"snapshot-yz-");
890 filename.
append(
"snapshot-xyz-");
virtual void ShowScalarBar(const bool &)
QString toNativeSeparators(const QString &pathName)
QString & append(QChar ch)
GoFigure::TabDimensionType GetTabDimensionType() const
void setSeparator(bool b)
void setRgbF(qreal r, qreal g, qreal b, qreal a)
virtual void SetSlice(int iDir, int *iIdx)
virtual void PanInteractorBehavior(bool)
Mouse interaction style allows user to pan volume with all buttons.
void fill(const QColor &color)
std::vector< vtkSmartPointer< vtkContourWidget > > m_ContourWidget
std::list< QGoDockWidgetStatusPair > m_DockWidgetList
void GetBackgroundColor(double &r, double &g, double &b)
Returns used background color by viewers.
virtual void RemoveActorFromViewer(const int &iId, vtkActor *iActor)
void SetImageToImageViewer(vtkImageData *image)
QAction * m_BackgroundColorAction
void setIcon(const QIcon &icon)
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz-"))
vtkSmartPointer< vtkImageData > m_Image
void SetFullScreenView(const int &iS)
QAction * addAction(QAction *action)
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
void ShowOneChannel(int iChannel)
std::vector< vtkActor * > AddContour(vtkPolyData *iDataset, vtkProperty *iProperty=NULL)
Add contour with given property into the visualization.
void GetBackgroundColorFromImageViewer()
QString tr(const char *sourceText, const char *disambiguation, int n)
void DefaultMode()
Use the default interactor style.
void SetSliceViewXY(const int &)
void SetSliceViewXZ(const int &)
QString fromUtf8(const char *str, int size)
QAction * m_TakeSnapshotAction
class for the visualization of 3D Image represented by one vtkImageData*.
int GetFullScreenView() const
virtual void RemoveActor(const int &iId, vtkActor *iActor)
virtual void CreateModeToolBar(QMenu *iMenu, QToolBar *iToolBar)
QString SnapshotViewXYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xyz-"))
QVTKInteractor * GetInteractor(const int &)
Returns the interactor for one given view.
vtkLookupTable * GetLookupTable()
get the selected look up table
void Change3DPerspectiveToAxial()
void CreateAllViewActions()
void ShowScalarBar(const bool &)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
void setCentralWidget(QWidget *widget)
void SetSliceViewXZ(const int &)
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
QGoImageView3D * m_ImageView
void Change3DPerspectiveToCoronal()
int * GetImageCoordinatesFromWorldCoordinates(double pos[3])
void SetSliceViewYZ(const int &)
QString SnapshotViewYZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-yz"))
void SliceViewYZChanged(int Slice)
void DisplayAnnotations()
void FullScreenViewChanged(int View)
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QFlags< QColorDialog::ColorDialogOption > options)
virtual void AddActor(const int &iId, vtkActor *iActor)
std::list< QGoToolBarStatus * > m_ToolBarList
void CreateModeToolBar(QMenu *iMenu, QToolBar *iToolBar)
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xy-"))
virtual void SetImage(vtkImageData *iImage)
Set the image to displaid.
virtual void ReadSettings()
Read Settings.
void Change3DPerspectiveToSagittal()
void SetFullScreenView(const int &iS)
Abstract class for representing one tab element which contains 2D or 3D image (without any temporal c...
void SetBackgroundColorToImageViewer()
void SliceViewXYChanged(int Slice)
virtual void SetLookupTable(vtkLookupTable *)
void setStatusTip(const QString &statusTip)
int * GetImageCoordinatesFromWorldCoordinates(double pos[3])
Get Image Coordinates from World Coordinates.
void PanMode()
Use the pan interactor style.
virtual void DefaultInteractorBehavior(bool)
Mouse interaction style set as default.
virtual ~QGoTabImageView3D()
void SetSliceViewYZ(const int &)
QGoNavigationDockWidget * m_NavigationDockWidget
void retranslateUi(QWidget *parent)
QString SnapshotViewXZ(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xz-"))
std::vector< QAction * > m_ViewActions
QString SnapshotViewXY(const GoFigure::FileType &iType, const QString &iBaseName=QString("snapshot-xy-"))
void setupUi(QWidget *parent)
std::vector< vtkSmartPointer< vtkOrientedGlyphContourRepresentation > > m_ContourRepresentation
virtual void Update()
Update the rendering of the tab.
void DisplaySplinePlanes()
void ChangeBackgroundColor()
void SliceViewXZChanged(int Slice)
vtkImageActor * GetImageActor(const int &iId)
Get the image actor.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void ZoomMode()
Use the zoom interactor style.
void SetBackgroundColor(const double &r, const double &g, const double &b)
Set background color for all views.
void ShowAllChannels(bool iChecked)
void SetSliceViewXY(const int &)
virtual std::vector< vtkActor * > AddContour(vtkPolyData *dataset, vtkProperty *property=NULL)
virtual void ZoomInteractorBehavior(bool)
Mouse interaction style allows user to zoom in/out volume with all buttons.
QGoToolBarStatus * m_ModeToolBar
void ShowAnnotations()
Show annotations in the collection.
virtual void DisplayActorInViewer(const int &iId, vtkActor *iActor)
QGoTabImageView3D(QWidget *parent=0)
Constructor.