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 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 mitkSegTool2D_h_Included 00019 #define mitkSegTool2D_h_Included 00020 00021 #include "mitkCommon.h" 00022 #include "MitkExtExports.h" 00023 #include "mitkTool.h" 00024 #include "mitkImage.h" 00025 00026 #include "mitkStateEvent.h" 00027 #include "mitkPositionEvent.h" 00028 00029 namespace mitk 00030 { 00031 00032 class BaseRenderer; 00033 00055 class MitkExt_EXPORT SegTool2D : public Tool 00056 { 00057 public: 00058 00059 mitkClassMacro(SegTool2D, Tool); 00060 00068 static bool DetermineAffectedImageSlice( const Image* image, const PlaneGeometry* plane, int& affectedDimension, int& affectedSlice ); 00069 00070 00071 protected: 00072 00073 SegTool2D(); // purposely hidden 00074 SegTool2D(const char*); // purposely hidden 00075 virtual ~SegTool2D(); 00076 00077 virtual bool OnMousePressed (Action*, const StateEvent*); 00078 virtual bool OnMouseMoved (Action*, const StateEvent*); 00079 virtual bool OnMouseReleased(Action*, const StateEvent*); 00080 virtual bool OnInvertLogic (Action*, const StateEvent*); 00081 00086 Image::Pointer GetAffectedImageSliceAs2DImage(const PositionEvent*, const Image* image); 00087 00093 Image::Pointer GetAffectedWorkingSlice(const PositionEvent*); 00094 00100 Image::Pointer GetAffectedReferenceSlice(const PositionEvent*); 00101 00102 void InteractiveSegmentationBugMessage( const std::string& message ); 00103 00104 private: 00105 00106 BaseRenderer* m_LastEventSender; 00107 unsigned int m_LastEventSlice; 00108 }; 00109 00110 } // namespace 00111 00112 #endif 00113 00114