00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or http://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 00019 #ifndef QMITKDEFORMABLEREGISTRATION_H 00020 #define QMITKDEFORMABLEREGISTRATION_H 00021 00022 #include "QmitkFunctionality.h" 00023 #include "ui_QmitkDeformableRegistrationViewControls.h" 00024 00025 #include "../DeformableregistrationDll.h" 00026 00027 #include "berryISelectionListener.h" 00028 #include "berryIStructuredSelection.h" 00029 00045 class DEFORMABLEREGISTRATION_EXPORT QmitkDeformableRegistrationView : public QObject, public QmitkFunctionality 00046 { 00047 00048 friend struct SelListenerDeformableRegistration; 00049 00050 Q_OBJECT 00051 00052 public: 00053 00054 static const std::string VIEW_ID; 00055 00059 QmitkDeformableRegistrationView(QObject *parent=0, const char *name=0); 00060 00064 virtual ~QmitkDeformableRegistrationView(); 00065 00069 virtual void CreateQtPartControl(QWidget *parent); 00070 00074 virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); 00075 00079 virtual void StdMultiWidgetNotAvailable(); 00080 00084 virtual void CreateConnections(); 00085 00089 virtual void Activated(); 00090 00094 virtual void Deactivated(); 00095 00096 virtual void Visible(); 00097 00098 virtual void Hidden(); 00099 00100 void DataNodeHasBeenRemoved(const mitk::DataNode* node); 00101 00102 signals: 00103 00107 void reinitFixed(const mitk::Geometry3D *); 00108 00112 void reinitMoving(const mitk::Geometry3D *); 00113 00117 void calculateBSplineRegistration(); 00118 00119 protected slots: 00120 00124 void FixedSelected(mitk::DataNode::Pointer fixedImage); 00125 00129 void MovingSelected(mitk::DataNode::Pointer movingImage); 00130 00134 bool CheckCalculate(); 00135 00140 void ShowRedGreen(bool show); 00141 00146 void OpacityUpdate(float opacity); 00147 00153 void OpacityUpdate(int opacity); 00154 00159 void SetImageColor(bool redGreen); 00160 00164 void CheckCalculateEnabled(); 00165 00169 void Calculate(); 00170 00174 void ApplyDeformationField(); 00175 00176 void SetImagesVisible(berry::ISelection::ConstPointer selection); 00177 00178 void TabChanged(int index); 00179 00180 void SwitchImages(); 00181 00182 protected: 00183 00184 berry::ISelectionListener::Pointer m_SelListener; 00185 berry::IStructuredSelection::ConstPointer m_CurrentSelection; 00186 00191 QmitkStdMultiWidget * m_MultiWidget; 00192 00196 Ui::QmitkDeformableRegistrationViewControls m_Controls; 00197 mitk::DataNode::Pointer m_MovingNode; 00198 mitk::DataNode::Pointer m_FixedNode; 00199 bool m_ShowRedGreen; 00200 float m_Opacity; 00201 float m_OriginalOpacity; 00202 mitk::Color m_FixedColor; 00203 mitk::Color m_MovingColor; 00204 bool m_Deactivated; 00205 }; 00206 00207 #endif //QMITKDEFORMABLEREGISTRATION_H