00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2009-05-15 18:09:46 +0200 (Fr, 15 Mai 2009) $ 00006 Version: $Revision: 1.12 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef QmitkVtkLineProfileWidget_H_ 00019 #define QmitkVtkLineProfileWidget_H_ 00020 00021 #include "QmitkExtExports.h" 00022 #include "mitkImage.h" 00023 #include "mitkPlanarFigure.h" 00024 00025 #include <qlayout.h> 00026 #include <qtextedit.h> 00027 #include <qdialog.h> 00028 00029 #include <itkParametricPath.h> 00030 #include <itkPolyLineParametricPath.h> 00031 00032 #include <vtkQtChartWidget.h> 00033 #include <vtkQtLineChart.h> 00034 #include <vtkQtBarChart.h> 00035 00036 #include <QStandardItemModel> 00037 00038 00039 00040 00045 class QmitkExt_EXPORT QmitkVtkLineProfileWidget : public QDialog 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 QmitkVtkLineProfileWidget( QWidget * /*parent = 0*/ ); 00051 virtual ~QmitkVtkLineProfileWidget(); 00052 00053 typedef itk::ParametricPath< 3 >::Superclass PathType; 00054 typedef itk::PolyLineParametricPath< 3 > ParametricPathType; 00055 00056 enum 00057 { 00058 PATH_MODE_DIRECT = 0, 00059 PATH_MODE_PLANARFIGURE 00060 }; 00061 00062 00064 void SetImage(mitk::Image* image); 00065 00067 void SetPath(const PathType* path); 00068 00070 void SetPlanarFigure(const mitk::PlanarFigure* planarFigure); 00071 00073 void SetPathMode(unsigned int pathMode); 00074 00076 unsigned int GetPathMode(); 00077 00079 void SetPathModeToDirectPath(); 00080 00082 void SetPathModeToPlanarFigure(); 00083 00084 00086 void UpdateItemModelFromPath(); 00087 00089 void ClearItemModel(); 00090 00091 00092 protected slots: 00093 00094 00095 protected: 00096 00097 void CreatePathFromPlanarFigure(); 00098 00099 void ComputePath(); 00100 00101 vtkQtChartWidget *m_ChartWidget; 00102 vtkQtLineChart *m_LineChart; 00103 vtkQtBarChart *m_BarChart; 00104 std::vector<vtkQtLineChart*> m_VectorLineCharts; 00105 00106 QStandardItemModel *m_ItemModel; 00107 00108 mitk::Image::Pointer m_Image; 00109 00110 mitk::PlanarFigure::ConstPointer m_PlanarFigure; 00111 00112 unsigned int m_PathMode; 00113 00114 00115 // Path set explicitly by user 00116 PathType::ConstPointer m_Path; 00117 00118 // Parametric path as generated from PlanarFigure 00119 ParametricPathType::Pointer m_ParametricPath; 00120 00121 // Path derived either form user-specified path or from PlanarFigure-generated 00122 // path 00123 PathType::ConstPointer m_DerivedPath; 00124 00125 }; 00126 00127 #endif /* QmitkVtkLineProfileWidget_H_ */