00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Module: $RCSfile$ 00005 Language: C++ 00006 Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ 00007 Version: $Revision: 17495 $ 00008 00009 Copyright (c) German Cancer Research Center, Division of Medical and 00010 Biological Informatics. All rights reserved. 00011 See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. 00012 00013 This software is distributed WITHOUT ANY WARRANTY; without even 00014 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 PURPOSE. See the above copyright notices for more information. 00016 00017 =========================================================================*/ 00018 00019 #ifndef _QMITKTBSSVIEW_H_INCLUDED 00020 #define _QMITKTBSSVIEW_H_INCLUDED 00021 00022 #include <QmitkFunctionality.h> 00023 00024 #include <string> 00025 00026 #include "ui_QmitkTbssViewControls.h" 00027 00028 #include "mitkDiffusionImage.h" 00029 #include <itkImage.h> 00030 00031 #include <berryIPartListener.h> 00032 #include <berryISelectionListener.h> 00033 #include <berryIStructuredSelection.h> 00034 00035 00036 00037 typedef short DiffusionPixelType; 00038 typedef itk::Image<char, 3> RoiImageType; 00039 typedef itk::Image<float, 4> AllSkeletonType; 00040 00041 struct TrSelListener; 00042 00052 class QmitkTbssView : public QObject, public QmitkFunctionality 00053 { 00054 00055 00056 00057 friend struct TbSelListener; 00058 00059 // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) 00060 Q_OBJECT 00061 00062 public: 00063 00064 static const std::string VIEW_ID; 00065 00066 QmitkTbssView(); 00067 virtual ~QmitkTbssView(); 00068 00069 virtual void CreateQtPartControl(QWidget *parent); 00070 00072 virtual void CreateConnections(); 00073 00075 virtual void Activated(); 00076 00077 virtual void Deactivated(); 00078 00079 virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); 00080 virtual void StdMultiWidgetNotAvailable(); 00081 00082 static const int nrconvkernels; 00083 00084 protected slots: 00085 00086 // For lines 00087 void OutputValues(); 00088 00089 // For unconnected points 00090 void OutputUnconnectedPointValues(); 00091 00092 00093 protected: 00094 00095 Ui::QmitkTbssViewControls* m_Controls; 00096 00097 QmitkStdMultiWidget* m_MultiWidget; 00098 00099 00100 void SetDefaultNodeProperties(mitk::DataNode::Pointer node, std::string name); 00101 00102 berry::ISelectionListener::Pointer m_SelListener; 00103 berry::IStructuredSelection::ConstPointer m_CurrentSelection; 00104 00105 bool m_IsInitialized; 00106 00107 void SkeletonSelected(mitk::DataNode::Pointer skeletonNode); 00108 void RoiSelected(mitk::DataNode::Pointer roiNode); 00109 00110 mitk::DataNode::Pointer m_SkeletonNode; 00111 mitk::DataNode::Pointer m_RoiNode; 00112 00113 std::vector<RoiImageType::IndexType> SortPoints(RoiImageType::Pointer roi); 00114 bool PointVisited(std::vector<RoiImageType::IndexType> points, RoiImageType::IndexType point); 00115 00116 // Modifies the current point by reference and returns true if no more points need to be visited 00117 RoiImageType::IndexType FindNextPoint(std::vector<RoiImageType::IndexType> pointsVisited, 00118 RoiImageType::IndexType currentPoint, RoiImageType::Pointer roi, bool &ready); 00119 00120 00121 }; 00122 00123 00124 00125 00126 #endif // _QMITKTENSORRECONSTRUCTIONVIEW_H_INCLUDED 00127