diff --git a/BlueBerry/Bundles/org.blueberry.osgi/src/berryConfig.h.in b/BlueBerry/Bundles/org.blueberry.osgi/src/berryConfig.h.in index 4e81f81667..5c60d5e8b8 100644 --- a/BlueBerry/Bundles/org.blueberry.osgi/src/berryConfig.h.in +++ b/BlueBerry/Bundles/org.blueberry.osgi/src/berryConfig.h.in @@ -1,25 +1,25 @@ -/*========================================================================= - - Program: BlueBerry Platform - Language: C++ - Date: $Date: 2008-06-10 11:20:22 +0200 (Di, 10 Jun 2008) $ - Version: $Revision: 14563 $ - - Copyright (c) German Cancer Research Center, Division of Medical and - Biological Informatics. All rights reserved. - See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - - =========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + #ifndef BERRYCONFIG_H_ #define BERRYCONFIG_H_ #cmakedefine BLUEBERRY_DEBUG_SMARTPOINTER #define QT_ASSISTANT_EXECUTABLE "@QT_ASSISTANT_EXECUTABLE@" #endif /* BERRYCONFIG_H_ */ diff --git a/Build/Tools/BundleGenerator/BundleDefaults.cmake b/Build/Tools/BundleGenerator/BundleDefaults.cmake index 8fac34c9e8..b3f5b48a49 100755 --- a/Build/Tools/BundleGenerator/BundleDefaults.cmake +++ b/Build/Tools/BundleGenerator/BundleDefaults.cmake @@ -1,30 +1,29 @@ set(BUNDLE_NAMESPACE "") set(DEFAULT_REQUIRED_BUNDLES "org.mitk.core.services") set(DEFAULT_REQUIRED_BUNDLES_FOR_GUI "org.mitk.gui.qt.common") set(DEFAULT_PLUGIN_VERSION "0.1") set(DEFAULT_PLUGIN_VENDOR "DKFZ, Medical and Biological Informatics") set(DEFAULT_VIEW_BASEID "org.mitk.views.") set(DEFAULT_VIEW_CLASS_BEGIN "Qmitk") set(DEFAULT_VIEW_BASE_CLASS "QmitkFunctionality") set(DEFAULT_VIEW_BASE_CLASS_H "QmitkFunctionality.h") set(PROJECT_STATIC_VAR "MITK_STATIC") set(DOXYGEN_INGROUP "MITKPlugins") set(DEFAULT_CREATE_PLUGIN_MACRO "MACRO_CREATE_MITK_PLUGIN()") set(DEFAULT_CREATE_GUI_PLUGIN_MACRO "MACRO_CREATE_MITK_PLUGIN(QmitkExt)") set(PLUGIN_TEMPLATE "${PROJECT_SOURCE_DIR}/../../../CMake/QBundleTemplate" CACHE PATH "Path to the plugin templates" FORCE) -set(PLUGIN_COPYRIGHT "/*========================================================================= +set(PLUGIN_COPYRIGHT "/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +The Medical Imaging Interaction Toolkit (MITK) -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -=========================================================================*/") +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/") diff --git a/Build/Tools/StateMachineEditor/mitkEventAndActionConstants.xsl b/Build/Tools/StateMachineEditor/mitkEventAndActionConstants.xsl index b44bb20e31..1baabec256 100644 --- a/Build/Tools/StateMachineEditor/mitkEventAndActionConstants.xsl +++ b/Build/Tools/StateMachineEditor/mitkEventAndActionConstants.xsl @@ -1,518 +1,516 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Module: $RCSfile$ -Language: C++ -Date: $Date$ -Version: $Revision$ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #ifndef MITKINTERACTCONST_H #define MITKINTERACTCONST_H //##Documentation //## @file mitkInteractionConst.h //## @brief Constants for most interaction classes, due to the generic StateMachines. //## //## Changes in Type, ButtonState or Key has to be don in mitkEventMapper.cpp, too. //## @ingroup Interaction /*Prefixes for Constants: E = Enumeration EID = EventId's Op = Operations Ac = Action Type_ = Type of Event BS_ = ButtonStates and Buttons Key_ = Keys like in QT */ namespace mitk{ /* //UndoMechanism: //constants for UndoMechanism; */ //different UndoModels: typedef enum EUndoModels{LIMITEDLINEARUNDO=10, VERBOSE_LIMITEDLINEARUNDO=11, TREEUNDO=20}; //Constants for EventIds; use the according constant to through an event in the code typedef enum EEventIds { = , // }; //##Constants for Operations //## xomments are always examples of the usage typedef enum EOperations { OpNOTHING = 0, OpTEST = 1, OpNEWCELL = 10, //add a new cell OpADD = 100, //add a point or a vessel OpUNDOADD = 101, OpADDLINE = 1001, //add a line OpINSERT = 200, //insert a point at position OpINSERTLINE = 201, //insert a line at position OpINSERTPOINT = 202, OpCLOSECELL = 250, //close a cell (to a polygon) OpOPENCELL = 251, //close a cell (to a polygon) OpMOVE = 300, //move a point OpMOVELINE = 301, //move a line OpMOVECELL = 302, //move a line OpUNDOMOVE = 303, OpREMOVE = 400, //remove a point at position OpREMOVELINE = 401, //remove a line at position OpREMOVECELL = 402, //remove a cell OpREMOVEPOINT = 403, OpDELETE = 500, //delete OpDELETELINE = 501, //delete the last line in a cell OpUNDELETE = 502, OpDELETECELL = 505, OpSTATECHANGE = 600, //change a state OpTERMINATE = 666, //change a state OpSELECTPOINT = 700, OpSELECTLINE = 701, OpSELECTCELL = 702, OpSELECTSUBOBJECT = 703, //for VesselGraphInteractor //OpSELECTNEWSUBOBJECT = 704, //for VesselGraphInteractor OpSELECT = 705, OpDESELECTPOINT = 800, OpDESELECTLINE = 801, OpDESELECTCELL = 802, OpDESELECTSUBOBJECT = 803, //for VesselGraphInteractor OpDESELECTALL = 804, //for VesselGraphInteractor OpDESELECT = 805, OpNAVIGATE = 900, OpZOOM = 1000, OpSCALE = 1100, OpROTATE = 1200, OpSETPOINTTYPE = 1210, OpMODECHANGE = 1500, OpSENDCOORDINATES = 1600, OpPERIPHERYSEARCH = 2000, //used in VesselGraphInteractor OpROOTSEARCH = 2001, //used in VesselGraphInteractor OpTHICKSTVESSELSEARCH = 2002, //used in VesselGraphInteractor OpSHORTESTPATHSEARCH = 2003, //used in VesselGraphInteractor OpATTRIBUTATION = 2004, //used in VesselGraphInteractor OpDEFAULT = 2006, //used in VesselGraphInteractor }; //##Constants for EventMapping... //##connects the statemachine.xml-File with the implemented conditions. //##within one statemachine the choice of the actionconstants is freely //## //## ActionId typedef enum EActions { = , // }; /* //!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!! //EventMechanism: //If you change anything from here on, then change in mitkEventMapper.cpp (Array of constants) as well. //!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!! */ //Type of an Event; typedef enum EEventType { Type_None = 0, // invalid event Type_Timer = 1, // timer event Type_MouseButtonPress = 2, // mouse button pressed Type_MouseButtonRelease = 3, // mouse button released Type_MouseButtonDblClick = 4, // mouse button double click Type_MouseMove = 5, // mouse move Type_KeyPress = 6, // key pressed Type_KeyRelease = 7, // key released Type_FocusIn = 8, // keyboard focus received Type_FocusOut = 9, // keyboard focus lost Type_Enter = 10, // mouse enters widget Type_Leave = 11, // mouse leaves widget Type_Paint = 12, // paint widget Type_Move = 13, // move widget Type_Resize = 14, // resize widget Type_Create = 15, // after object creation Type_Destroy = 16, // during object destruction Type_Show = 17, // widget is shown Type_Hide = 18, // widget is hidden Type_Close = 19, // request to close widget Type_Quit = 20, // request to quit application Type_Reparent = 21, // widget has been reparented Type_ShowMinimized = 22, // widget is shown minimized Type_ShowNormal = 23, // widget is shown normal Type_WindowActivate = 24, // window was activated Type_WindowDeactivate = 25, // window was deactivated Type_ShowToParent = 26, // widget is shown to parent Type_HideToParent = 27, // widget is hidden to parent Type_ShowMaximized = 28, // widget is shown maximized Type_ShowFullScreen = 29, // widget is shown full-screen Type_Accel = 30, // accelerator event Type_Wheel = 31, // wheel event Type_AccelAvailable = 32, // accelerator available event Type_CaptionChange = 33, // caption changed Type_IconChange = 34, // icon changed Type_ParentFontChange = 35, // parent font changed Type_ApplicationFontChange = 36, // application font changed Type_ParentPaletteChange = 37, // parent palette changed Type_ApplicationPaletteChange = 38, // application palette changed Type_PaletteChange = 39, // widget palette changed Type_Clipboard = 40, // internal clipboard event Type_Speech = 42, // reserved for speech input Type_SockAct = 50, // socket activation Type_AccelOverride = 51, // accelerator override event Type_DeferredDelete = 52, // deferred delete event Type_DragEnter = 60, // drag moves into widget Type_DragMove = 61, // drag moves in widget Type_DragLeave = 62, // drag leaves or is cancelled Type_Drop = 63, // actual drop Type_DragResponse = 64, // drag accepted/rejected Type_ChildInserted = 70, // new child widget Type_ChildRemoved = 71, // deleted child widget Type_LayoutHint = 72, // child min/max size changed Type_ShowWindowRequest = 73, // widget's window should be mapped Type_ActivateControl = 80, // ActiveX activation Type_DeactivateControl = 81, // ActiveX deactivation Type_ContextMenu = 82, // context popup menu Type_IMStart = 83, // input method composition start Type_IMCompose = 84, // input method composition Type_IMEnd = 85, // input method composition end Type_Accessibility = 86, // accessibility information is requested Type_TabletMove = 87, // Wacom tablet event Type_LocaleChange = 88, // the system locale changed Type_LanguageChange = 89, // the application language changed Type_LayoutDirectionChange = 90, // the layout direction changed Type_Style = 91, // internal style event Type_TabletPress = 92, // tablet press Type_TabletRelease = 93, // tablet release Type_User = 1000, // first user event id Type_MaxUser = 65535 }; //##ButtonState // mouse/keyboard state values //QT combinations if MOUSEBUTTONRelease: left MouseButton + ControlButton: 0x201 typedef enum EButtonStates { BS_NoButton = 0x0000, BS_LeftButton = 0x0001, BS_RightButton = 0x0002, BS_MidButton = 0x0004, BS_MouseButtonMask = 0x0007, BS_ShiftButton = 0x0100, BS_ControlButton = 0x0200, BS_AltButton = 0x0400, BS_MetaButton = 0x0800, BS_KeyButtonMask = 0x0f00, BS_Keypad = 0x4000 }; //##Key typedef enum EKeys { Key_Escape = 0x1000, // misc keys Key_Tab = 0x1001, Key_Backtab = 0x1002, Key_BackTab = 0x1002, //= Key_Backtab Key_Backspace = 0x1003, Key_BackSpace = 0x1003, //= Key_Backspace Key_Return = 0x1004, Key_Enter = 0x1005, Key_Insert = 0x1006, Key_Delete = 0x1007, Key_Pause = 0x1008, Key_Print = 0x1009, Key_SysReq = 0x100a, Key_Home = 0x1010, // cursor movement Key_End = 0x1011, Key_Left = 0x1012, Key_Up = 0x1013, Key_Right = 0x1014, Key_Down = 0x1015, Key_Prior = 0x1016, Key_PageUp = 0x1016, //=Key_Prior Key_Next = 0x1017, Key_PageDown = 0x1017, //=Key_Next Key_Shift = 0x1020, // modifiers Key_Control = 0x1021, Key_Meta = 0x1022, Key_Alt = 0x1023, Key_CapsLock = 0x1024, Key_NumLock = 0x1025, Key_ScrollLock = 0x1026, Key_F1 = 0x1030, // function keys Key_F2 = 0x1031, Key_F3 = 0x1032, Key_F4 = 0x1033, Key_F5 = 0x1034, Key_F6 = 0x1035, Key_F7 = 0x1036, Key_F8 = 0x1037, Key_F9 = 0x1038, Key_F10 = 0x1039, Key_F11 = 0x103a, Key_F12 = 0x103b, Key_F13 = 0x103c, Key_F14 = 0x103d, Key_F15 = 0x103e, Key_F16 = 0x103f, Key_F17 = 0x1040, Key_F18 = 0x1041, Key_F19 = 0x1042, Key_F20 = 0x1043, Key_F21 = 0x1044, Key_F22 = 0x1045, Key_F23 = 0x1046, Key_F24 = 0x1047, Key_F25 = 0x1048, // F25 .. F35 only on X11 Key_F26 = 0x1049, Key_F27 = 0x104a, Key_F28 = 0x104b, Key_F29 = 0x104c, Key_F30 = 0x104d, Key_F31 = 0x104e, Key_F32 = 0x104f, Key_F33 = 0x1050, Key_F34 = 0x1051, Key_F35 = 0x1052, Key_Super_L = 0x1053, // extra keys Key_Super_R = 0x1054, Key_Menu = 0x1055, Key_Hyper_L = 0x1056, Key_Hyper_R = 0x1057, Key_Help = 0x1058, // International input method support (X keycode - = 0xEE00) // Only interesting if you are writing your own input method Key_Muhenkan = 0x1122, // Cancel Conversion Key_Henkan = 0x1123, // Start/Stop Conversion Key_Hiragana_Katakana = 0x1127, // Hiragana/Katakana toggle Key_Zenkaku_Hankaku = 0x112A, // Zenkaku/Hankaku toggle Key_Space = 0x20, // 7 bit printable ASCII Key_Any = 0x20, //= Key_Space Key_Exclam = 0x21, Key_QuoteDbl = 0x22, Key_NumberSign = 0x23, Key_Dollar = 0x24, Key_Percent = 0x25, Key_Ampersand = 0x26, Key_Apostrophe = 0x27, Key_ParenLeft = 0x28, Key_ParenRight = 0x29, Key_Asterisk = 0x2a, Key_Plus = 0x2b, Key_Comma = 0x2c, Key_Minus = 0x2d, Key_Period = 0x2e, Key_Slash = 0x2f, Key_0 = 0x30, Key_1 = 0x31, Key_2 = 0x32, Key_3 = 0x33, Key_4 = 0x34, Key_5 = 0x35, Key_6 = 0x36, Key_7 = 0x37, Key_8 = 0x38, Key_9 = 0x39, Key_Colon = 0x3a, Key_Semicolon = 0x3b, Key_Less = 0x3c, Key_Equal = 0x3d, Key_Greater = 0x3e, Key_Question = 0x3f, Key_At = 0x40, Key_A = 0x41, Key_B = 0x42, Key_C = 0x43, Key_D = 0x44, Key_E = 0x45, Key_F = 0x46, Key_G = 0x47, Key_H = 0x48, Key_I = 0x49, Key_J = 0x4a, Key_K = 0x4b, Key_L = 0x4c, Key_M = 0x4d, Key_N = 0x4e, Key_O = 0x4f, Key_P = 0x50, Key_Q = 0x51, Key_R = 0x52, Key_S = 0x53, Key_T = 0x54, Key_U = 0x55, Key_V = 0x56, Key_W = 0x57, Key_X = 0x58, Key_Y = 0x59, Key_Z = 0x5a, Key_BracketLeft = 0x5b, Key_Backslash = 0x5c, Key_BracketRight = 0x5d, Key_AsciiCircum = 0x5e, Key_Underscore = 0x5f, Key_QuoteLeft = 0x60, Key_BraceLeft = 0x7b, Key_Bar = 0x7c, Key_BraceRight = 0x7d, Key_AsciiTilde = 0x7e, Key_nobreakspace = 0x0a0, Key_exclamdown = 0x0a1, Key_cent = 0x0a2, Key_sterling = 0x0a3, Key_currency = 0x0a4, Key_yen = 0x0a5, Key_brokenbar = 0x0a6, Key_section = 0x0a7, Key_diaeresis = 0x0a8, Key_copyright = 0x0a9, Key_ordfeminine = 0x0aa, Key_guillemotleft = 0x0ab, // left angle quotation mark Key_notsign = 0x0ac, Key_hyphen = 0x0ad, Key_registered = 0x0ae, Key_macron = 0x0af, Key_degree = 0x0b0, Key_plusminus = 0x0b1, Key_twosuperior = 0x0b2, Key_threesuperior = 0x0b3, Key_acute = 0x0b4, Key_mu = 0x0b5, Key_paragraph = 0x0b6, Key_periodcentered = 0x0b7, Key_cedilla = 0x0b8, Key_onesuperior = 0x0b9, Key_masculine = 0x0ba, Key_guillemotright = 0x0bb, // right angle quotation mark Key_onequarter = 0x0bc, Key_onehalf = 0x0bd, Key_threequarters = 0x0be, Key_questiondown = 0x0bf, Key_Agrave = 0x0c0, Key_Aacute = 0x0c1, Key_Acircumflex = 0x0c2, Key_Atilde = 0x0c3, Key_Adiaeresis = 0x0c4, Key_Aring = 0x0c5, Key_AE = 0x0c6, Key_Ccedilla = 0x0c7, Key_Egrave = 0x0c8, Key_Eacute = 0x0c9, Key_Ecircumflex = 0x0ca, Key_Ediaeresis = 0x0cb, Key_Igrave = 0x0cc, Key_Iacute = 0x0cd, Key_Icircumflex = 0x0ce, Key_Idiaeresis = 0x0cf, Key_ETH = 0x0d0, Key_Ntilde = 0x0d1, Key_Ograve = 0x0d2, Key_Oacute = 0x0d3, Key_Ocircumflex = 0x0d4, Key_Otilde = 0x0d5, Key_Odiaeresis = 0x0d6, Key_multiply = 0x0d7, Key_Ooblique = 0x0d8, Key_Ugrave = 0x0d9, Key_Uacute = 0x0da, Key_Ucircumflex = 0x0db, Key_Udiaeresis = 0x0dc, Key_Yacute = 0x0dd, Key_THORN = 0x0de, Key_ssharp = 0x0df, Key_agrave = 0x0e0, Key_aacute = 0x0e1, Key_acircumflex = 0x0e2, Key_atilde = 0x0e3, Key_adiaeresis = 0x0e4, Key_aring = 0x0e5, Key_ae = 0x0e6, Key_ccedilla = 0x0e7, Key_egrave = 0x0e8, Key_eacute = 0x0e9, Key_ecircumflex = 0x0ea, Key_ediaeresis = 0x0eb, Key_igrave = 0x0ec, Key_iacute = 0x0ed, Key_icircumflex = 0x0ee, Key_idiaeresis = 0x0ef, Key_eth = 0x0f0, Key_ntilde = 0x0f1, Key_ograve = 0x0f2, Key_oacute = 0x0f3, Key_ocircumflex = 0x0f4, Key_otilde = 0x0f5, Key_odiaeresis = 0x0f6, Key_division = 0x0f7, Key_oslash = 0x0f8, Key_ugrave = 0x0f9, Key_uacute = 0x0fa, Key_ucircumflex = 0x0fb, Key_udiaeresis = 0x0fc, Key_yacute = 0x0fd, Key_thorn = 0x0fe, Key_ydiaeresis = 0x0ff, Key_unknown = 0xffff, Key_none = 0xffff//= Key_unknown }; }//namespace mitk #endif //ifndef MITKINTERACTCONST_H \ No newline at end of file diff --git a/CMake/QBundleTemplate/BundleDefaults.cmake b/CMake/QBundleTemplate/BundleDefaults.cmake index 8982dfceb5..d24bd3aad9 100644 --- a/CMake/QBundleTemplate/BundleDefaults.cmake +++ b/CMake/QBundleTemplate/BundleDefaults.cmake @@ -1,30 +1,29 @@ set(BUNDLE_NAMESPACE "") set(DEFAULT_REQUIRED_BUNDLES "org.mitk.core.services") set(DEFAULT_REQUIRED_BUNDLES_FOR_GUI "org.mitk.gui.qt.common") set(DEFAULT_PLUGIN_VERSION "0.1") set(DEFAULT_PLUGIN_VENDOR "DKFZ, Medical and Biological Informatics") set(DEFAULT_VIEW_BASEID "org.mitk.views.") set(DEFAULT_VIEW_CLASS_BEGIN "Qmitk") set(DEFAULT_VIEW_BASE_CLASS "QmitkFunctionality") set(DEFAULT_VIEW_BASE_CLASS_H "QmitkFunctionality.h") set(PROJECT_STATIC_VAR "MITK_STATIC") set(DOXYGEN_INGROUP "MITKPlugins") set(DEFAULT_CREATE_PLUGIN_MACRO "MACRO_CREATE_MITK_PLUGIN()") set(DEFAULT_CREATE_GUI_PLUGIN_MACRO "MACRO_CREATE_MITK_PLUGIN(QmitkExt)") -set(PLUGIN_COPYRIGHT "/*========================================================================= +set(PLUGIN_COPYRIGHT "/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision: 16706 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +The Medical Imaging Interaction Toolkit (MITK) -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -=========================================================================*/") +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/") diff --git a/CMake/moduleExports.h.in b/CMake/moduleExports.h.in index 34ec3993df..4fc81d8da9 100644 --- a/CMake/moduleExports.h.in +++ b/CMake/moduleExports.h.in @@ -1,50 +1,49 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-05-19 21:14:21 +0200 (Di, 19 Mai 2009) $ -Version: $Revision: 17326 $ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include #ifndef @MODULE_NAME@_EXPORTS_H #define @MODULE_NAME@_EXPORTS_H /** * provide a macro for adding compiler specific export/import declarations * to classes. * This is needed for the export of symbols, when you build a DLL. Then write * * class @MODULE_EXPORT_DEFINE@ ClassName : public SomeClass {}; */ #ifdef MITK_BUILD_STATIC #define @MODULE_EXPORT_DEFINE@ #define @MODULE_NAME@_LOCAL #else #ifdef @MODULE_PROVIDES@_EXPORTS #define @MODULE_EXPORT_DEFINE@ MITK_EXPORT #else #define @MODULE_EXPORT_DEFINE@ MITK_IMPORT #endif #define @MODULE_NAME@_LOCAL MITK_LOCAL #endif #ifndef _CMAKE_MODULENAME #ifdef @MODULE_PROVIDES@_EXPORTS #define _CMAKE_MODULENAME "@MODULE_NAME@" #endif #endif #endif diff --git a/Documentation/Doxygen/DeveloperManual/NewPlugin.dox b/Documentation/Doxygen/DeveloperManual/NewPlugin.dox index fcba7ae993..e664deaada 100644 --- a/Documentation/Doxygen/DeveloperManual/NewPlugin.dox +++ b/Documentation/Doxygen/DeveloperManual/NewPlugin.dox @@ -1,97 +1,97 @@ /** \page NewPluginPage How to create a new MITK Plug-in The MITK Plugin Generator is a command line tool to simplify the process of creating your own MITK project (optional) and plug-ins. It can either be downloaded here or used from an existing MITK build. The Plugin Generator takes the following command line arguments: \verbatim ./MITKPluginGenerator -h A CTK plug-in generator for MITK (version 1.2.0) -h, --help Show this help text -o, --out-dir Output directory (default: /tmp) -l, --license Path to a file containing license information (default: :/MITKLicense.txt) -v, --vendor The vendor of the generated code (default: DKFZ, Medical and Biological Informatics) -q, --quiet Do not print additional information -y, --confirm-all Answer all questions with 'yes' -u, --check-update Check for updates and exit -n, --no-networking Disable all network requests Plug-in View options -vc, --view-class The View's' class name -vn, --view-name * The View's human readable name Plug-in options -ps, --plugin-symbolic-name * The plugin's symbolic name -pn, --plugin-name The plug-in's human readable name Project options - --project-copyright Path to a file containing copyright information (default: :/MITKCopyright.txt) + --project-copyright Path to a file containing copyright information (default: :/LICENSE.txt) --project-name The project name --project-app-name The application name [* - options are required] \endverbatim If a project name is provided via the --project-name argument, the new plug-in will be generated as part of a new project. \section NewPluginOnly Creating a new MITK plug-in Here is an example call to the Plugin Generator, creating one plug-in with the symbolic name com.mycompany.myplugin and a View named My View: \verbatim ./MITKPluginGenerator --plugin-symbolic-name org.mycompany.myplugin --view-name "My View" \endverbatim If you did not already specify the final location of the plug-in via the --out-dir argument, move the directory (in our example /tmp/org.mycompany.myplugin) to your existing project. Do not forget to add the plug-in in your project's build system (usually in the file <your-project>/Plugins/Plugins.cmake). \section NewPluginWithProject Creating a new MITK project \subsection NewPluginProjectPrerequisites Prerequisites MITK-based projects created with the Plugin Generator need the same prerequisites as MITK itself. See the \ref BuildInstructionsPage for MITK for details. Here is an example call to the Plugin Generator, creating the same plug-in as above but integrated in a new project: \verbatim ./MITKPluginGenerator --plugin-symbolic-name org.mycompany.myplugin --view-name "My View" --project-name "MyProject" --project-app-name "MyApp" \endverbatim The generated project is completely self-contained and can be configured via CMake immediately. When building the generated project, it will first download all required dependencies (like MITK itself). For an explanation of the project's build directory layout and how to configure MITK from your project's superbuild CMake configuration, see SetupAMITKBasedProject. \subsection NewPluginLimitations Limitations The Plugin Generator supports only a very limited set of possible configuration options. For more customizations of your project or plug-in, you must familiarize yourself with CMake and the generated build system. Further, the generator is not able to modify existing projects, it can only create new ones. \section NewPluginBuildSystem Build system for plug-ins Just put new files in your plug-in's \c src or \c src/internal directory and edit the \c files.cmake file there. If you have any fancy stuff like external libraries and include directories you should have a look at the CMake manual and general MITK build system documentation. \section NewPluginTroubleshooting Troubleshooting \par I get "Could not find library" messages and similar stuff when I try to start my project's executable. This is mostly due to wrong environment settings. On Windows, make sure that you use the supplied batch files to start Visual Studio or your project's executable. If you still get errors, double check the value of the PATH variable in your batch files (it must contain MITK's binary directory and paths to the ITK, VTK and Qt libraries. \par On Linux, set your LD_LIBRARY_PATH variable accordingly. */ diff --git a/Documentation/Doxygen/DeveloperManual/StyleGuideAndNotes.dox b/Documentation/Doxygen/DeveloperManual/StyleGuideAndNotes.dox index a52ca3b7fd..514e421ba2 100644 --- a/Documentation/Doxygen/DeveloperManual/StyleGuideAndNotes.dox +++ b/Documentation/Doxygen/DeveloperManual/StyleGuideAndNotes.dox @@ -1,493 +1,495 @@ /** \page StyleGuideAndNotesPage The MITK Style Guide and Technical Notes The following document is a description of the accepted coding style for the Medical Imaging Interaction Toolkit (MITK). Developers who wish to contribute code to MITK should read and adhere to the standards described here. Available sections: - \ref NameConventions - \ref Pointer - \ref Namespace - \ref CodeLayoutandIndentation - \ref UseofBraces - \ref IncludeGuards - \ref TechnicalNotes \section StyleGuideAndNotesPage_NameConventions Name Conventions \li Using case change to indicate separate words @code ImageFilter PixelType DataStorage NodePredicateProperty @endcode \li Underscores are not used e.g. Image_Filer, _Node \li Variable names should convey the meaning behind the code @code BoundingBox::Pointer boundingBox = BoundingBox::New(); @endcode \li Names are generally spelled out @code mitk::DataTreeNode* node; @endcode \li Abbreviation are allowable when in common use e.g. ROI for Region of Interest \subsection StyleGuideAndNotesPage_NamingClasses Naming Classes \li Classes are named beginning with a capital letter \li Classes are named according to the following general rule: @code class name = @endcode \li Examples of concetpts \n Accessor: Access and convert between types e.g. NullScalarAccessor \n Container: A container of objects such as points or images e.g. VectorContainer \n Filter: A class that participates in the data processing pipeline e.g. AddImageFilter \n Mapper: Transform data from one form into another e.g. ContourMapper2D \n Reader/Wirter: A class that reads/writes a single data object e.g. VtkSurfaceReader \n \subsection StyleGuideAndNotesPage_NamingFiles Naming Files \li MITK classes like @a ExampleClass should be in namespace @a mitk and their corresponding files should be named @a mitkExampleClass.h/.cpp. @code mitkDataStorage @endcode \li Qt specific MITK classes like @a QmitkListView should have the prefix Qmitk in their class names and their corresponding files should be named @a QmitkListView.h/.cpp. @code QmitkDataStorageComboBox @endcode \li Header Files ends with an .h and \li Implementation Files with an .cpp or .txx for a template class \subsection StyleGuideAndNotesPage_NamingMethodsandFunctions Naming Methods and Functions \li Functions and methods are named beginning with a capital letter \li Referring to class methods in code, an explicit this-> pointer should be used @code mitk::DataStorage::SetOfObjects::ConstPointer all = this->GetAll(); @endcode \subsection StyleGuideAndNotesPage_NamingSignalSlots Naming Signal/Slots Methods and Functions \li Slots are named according to the following general rule @code On[variable name who send the signal][signal](); @endcode \li Example @code connect( loadImagePushButton, SIGNAL( clicked(bool ) ), SLOT( OnLoadImagePushButtonClicked( bool ) ) ); void mitk::Image::OnLoadImagePushButtonClicked( bool ) { ... Do something ... } @endcode \li Signals are named according to the following general rule @code Signal[MethodName](); @endcode \li Example @code emit SignalFinishedSegmentation(); @endcode \subsection StyleGuideAndNotesPage_NamingClassDataMembers Naming Class Data Members \li Class data member are prepended with m_ @code m_Volumes m_OffsetTable m_ImageMask @endcode \li Except of QT class Data Members, those begins in lowercase. @code loadImageButton; closeImageAction; @endcode \subsection StyleGuideAndNotesPage_NamingLocalVariables Naming Local Variables \li Local variables begin in lowercase @code offset data slicesIt @endcode \subsection StyleGuideAndNotesPage_NamingQtVariables Naming Qt Variables \li GUI variables ends with name of used QT tool. @code QPushButton* loadImagePushButton; QAction* closeImageAction; QCheckBox* hideImageCheckBox; QRadioButton* binaryImageRadioButton; @endcode \subsection StyleGuideAndNotesPage_NamingTypedefs Naming Typedefs \li Typedef names end in the word Type @code typedef TPixel PixelType; typedef itk::Image< TPixel, VImageDimension > ImageType; typedef std::list ImageListType; @endcode \section StyleGuideAndNotesPage_Pointer Pointer \subsection StyleGuideAndNotesPage_DeclarationofPointers Declaration of Pointers \li Position of * pointers are connected with the declaration type @code int* counter; @endcode \li Analog to references @code int& counter; @endcode \subsection StyleGuideAndNotesPage_SmartPointer SmartPointer \li SmartPointers must be used for classes that have itk::Object as a base class. \li Assignment of a just created instance to a normal pointer results in a crash, since the reference count is decreased immediately to zero and the object is destroyed. @code itk::Object::Pointer object = itk::Object::New(); @endcode \li Static declarations are also forbidden and result into an exception when the scope of the variable is left, because the destructor is called while the reference count is still greater than zero. \li Note that using smart pointers requires using real (normal) pointers when setting input. If you want to return a newly created smart pointer that is not also kept within the class (e.g., if you write a Clone method), you have to return a smart pointer on output (compare itkMacro.h). If the smart pointer is kept within the class, returning a real (normal) pointer is sufficient. \li Testing a SmartPointer against NULL is done with the IsNull() and Is- NotNull() methods. A simple ==NULL issues a warning. \section StyleGuideAndNotesPage_Namespace Namespace \li MITK classes should be in namespace @a mitk @code mitk::Image::Pointer mitk::ImageGenerator::MakeImage() { // already in namespace mitk here! Image::Pointer image = mitk::Image::New(); ImageDecorator::Pointer decorator = mitk::ImageDecorator::New(); d->Decorate( image ); return image; } @endcode \li Constants in MITK for mitk::Operation and mitk::Action are set in namespace, so don't forget to add prefix mitk:: @code switch (actionId) { case mitk::AcMOVESELECTED: ....Do something ... break; default: break; } @endcode \section StyleGuideAndNotesPage_CodeLayoutandIndentation Code Layout and Indentation \subsection StyleGuideAndNotesPage_GeneralLayout General Layout \li Each line of code should take no more than 81 characters. \li Use lots of whitespace to separate logical blocks of code, intermixed with comments \li DO NOT USE TABS. The standard indention is 2 spaces (see ITK Style Guide). Configure your editor accordingly. \li Declaration of variables should be one declaration per line @code int sliceNumber; char* stringName; ImageType::Pointer image; @endcode \subsection StyleGuideAndNotesPage_ClassLayout Class Layout \li Copyright @code -/*========================================================================= -Program: Medical Imaging & Interaction Toolkit -Module: $RCSfile$ -Language: C++ -Date: $Date$ -Version: $Revision$ -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ @endcode \li Include Guards @code #ifndef __mitkClassName_h #define __mitkClassName_h @endcode \li Includes [A .. Z] @code #include "... .h" @endcode \li Doxygen @code /*! \brief mitkClassName \sa ..... \verbatim Last contributor: $Author$ \endverbatim */ @endcode \li Namespace @code namespace mitk { @endcode \li Class (Template) @code template class ClassName : public ImageBase { @endcode \li Typedefs @code public: ....typedefs.... @endcode \li Methods @code public: ....methods.... protected: ....methods.... private: ....methods.... @endcode \li QT Signals @code signals: Signal...(); @endcode \li QT Slots @code public slots: On...(); protected slots: On...(); @endcode \li Data Member @code private/protected: ....class data members.... }; } #endif @endcode \section StyleGuideAndNotesPage_UseofBraces Use of Braces \li Used to delimit the scope of an if, for, while, switch. \li Braces are placed on a line by themselves: @code for ( unsigned int i = 0; i < 3; ++i ) { ... do something ... } @endcode or @code if ( condition ) { ... do something ... } else if ( other condition ) { ... do something ... } else { ... do something ... } @endcode \li You can choose to use braces on a line with a code block when the block consists of a single line: @code if ( condition ) { foo = 1; } else if ( condition2 ) { foo = 3; } else { return; } @endcode or @code for ( unsigned int i = 0; i < 3; ++i) { x[i] = 0.0; } @endcode \section StyleGuideAndNotesPage_IncludeGuards Include Guards \li #inlcude guard is a particular construct used to avoid the problem of double inclusion when dealing with the #include directive. \li Naming convention for #inlcude guards is: ClassName_h \li Following example demonstrates a problem that can arise if #include guards are missing: Here, the file child.cpp has indirectly included two copies of the text in the header file grandfather.h. This causes a compilation error, since the structure type foo is apparently defined twice. @code grandfather.h struct foo { int m Member; }; father.h #include "grandfather.h" child.h #include "grandfather.h" #include "father.h" @endcode \subsection StyleGuideAndNotesPage_Useofincludeguards Use of #include guards \li Here, the first inclusion of grandfather.h causes the macro grandfather h to be defined. Then, when child.cpp includes grandfather.h the second time, the #ifndef test fails, and the preprocessor skips down to the #endif, thus avoiding the second definition of struct foo. The program compiles correctly. @code grandfather.h #ifndef grandfather h #define grandfather h struct foo { int m Member; }; father.h #include "grandfather.h" child.h #include "grandfather.h" #include "father.h" @endcode \section StyleGuideAndNotesPage_TechnicalNotes Some Technical Notes \li Use forward declarations in header files wherever possible. Only include those header files in a header file that are really necessary. Include the rest in the implementation file. \li For classes inheriting directly or indirectly from @a itk::LightObject (most of the MITK-classes do so), the class definition should include the mitkClassMacro. Additionally, if the class can be instantiated (normally the case, if the class is not abstract) and has @em only a constructor without parameters, the constructor should be declared protected and the @a itkNewMacro should be used to create a @a New() method for instantiation. Here is an example: @code class ExampleClass : public SuperClassOfTheExampleClass { public: mitkClassMacro(ExampleClass, SuperClassOfTheExampleClass); itkNewMacro(Self); // Self is a typedef to the class name generated by the mitkClassMacro [...] protected: ExampleClass(); virtual ~ExampleClass(); } @endcode \li Set- and Get-methods can be created with the macros @a itkSetObjectMacro(name,type) and @a itkGetObjectMacro(name,type), respectively, if the @a type is derived from @a itk::LightObject or @a itk::Object. There are also macros for other types, e.g., strings, see itkMacro.h. \li When using inner classes of a parent class which is templated, you have to use the keyword @a typename for gcc 3.x and standard compliance. For example, @a TreeChangeListener is an inner class of @a Tree, therefore use: @code class LinkedTree : public Tree { public: typedef typename LinkedTree::TreeChangeListener TreeChangeListener; [...] } @endcode Another example: @code typename std::vector::iterator pos = treeChangeListenerList.begin(); @endcode @a iterator is an inner class of @a vector. \li Constants in MITK for mitk::Operation and mitk::Action are set in namespace, so don't forget to add prefix @a mitk:: @code switch (actionId) { case mitk::AcMOVESELECTED: @endcode Prefixes for the constants are to be used like corresponding others. See file @a Interactions\\mitkBaseInteraction\\mitkInteractionConst.h for further details. \li Often QmitkFunctionality::Activated() and QmitkFunctionality::Deactivated() is the right place to connect and disconnnect event-handlers (e.g., mitk::GlobalStateMachine::AddStateMachine() in Activated() and mitk::GlobalStateMachine::RemoveStateMachine() in Deactivated()). \li The four widgets of the QmitkStdMultiWidget should be initialized in QmitkFunctionality::Activated(), but does @em not need to be restored in QmitkFunctionality::Deactivated(): It is the responsiblity of the subsequently activated functionality to initialize them according to its needs. */ diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ deleted file mode 100644 index 405d92b4c1..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.cpp~ +++ /dev/null @@ -1,355 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef __mitkTbssImporter_cpp -#define __mitkTbssImporter_cpp - -#include "mitkTbssImporter.h" -#include -#include -#include "itkNrrdImageIO.h" - - -namespace mitk -{ - - mitk::TbssImporter::TbssImporter() - { - - } - - - mitk::TbssImporter::TbssImporter(std::string path) : m_File(path) - { - - } - - - - mitk::TbssImage::Pointer mitk::TbssImporter::Import() - { - // read all images with all_*.nii.gz - mitk::TbssImage::Pointer tbssImg = mitk::TbssImage::New(); - - FileReaderType4D::Pointer reader = FileReaderType4D::New(); - reader->SetFileName(m_File); - reader->Update(); - - FloatImage4DType::Pointer img = FloatImage4DType::New(); - img = reader->GetOutput(); - - - - m_Data = DataImageType::New(); - - FloatImage4DType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - FloatImage4DType::SpacingType spacing = img->GetSpacing(); - - - DataImageType::SizeType dataSize; - dataSize[0] = size[0]; - dataSize[1] = size[1]; - dataSize[2] = size[2]; - - m_Data->SetRegions(dataSize); - - - DataImageType::SpacingType dataSpacing; - dataSpacing[0] = spacing[0]; - dataSpacing[1] = spacing[1]; - dataSpacing[2] = spacing[2]; - - m_Data->SetSpacing(dataSpacing); - - FloatImage4DType::PointType origin = img->GetOrigin(); - - DataImageType::PointType dataOrigin; - dataOrigin[0] = origin[0]; - dataOrigin[1] = origin[1]; - dataOrigin[2] = origin[2]; - - m_Data->SetOrigin(dataOrigin); - - - FloatImage4DType::DirectionType dir = img->GetDirection(); - - DataImageType::DirectionType dataDir; - for(int i=0; i<=2; i++) - { - for(int j=0; j<=2; j++) - { - dataDir[i][j] = dir[i][j]; - } - } - - m_Data->SetDirection(dataDir); - - - - // Set the length to one because otherwise allocate fails. Should be changed when groups/measurements are added - m_Data->SetVectorLength(size[3]); - m_Data->Allocate(); - - - for(int i=0; i ix; - ix[0] = i; - ix[1] = j; - ix[2] = k; - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - int vecSize = pixel.Size(); - - for(int z=0; z ix4; - ix4[0] = i; - ix4[1] = j; - ix4[2] = k; - ix4[3] = z; - float value = img->GetPixel(ix4); - - - pixel.SetElement(z, value); - } - m_Data->SetPixel(ix, pixel); - } - } - } - - -// mitk::CastToTbssImage(m_Data.GetPointer(), tbssImg); - - tbssImg->SetGroupInfo(m_Groups); - tbssImg->SetMeasurementInfo(m_MeasurementInfo); - tbssImg->SetImage(m_Data); - - - tbssImg->InitializeFromVectorImage(); - - return tbssImg; - - - - } - - mitk::TbssImage::Pointer mitk::TbssImporter::ImportMeta() - { - mitk::TbssImage::Pointer tbssImg = mitk::TbssImage::New(); - - - m_Data = DataImageType::New(); - - std::vector< std::pair > metaInfo; - - // Gradient images are vector images, so they will add more dimensions to the vector - int vecLength = m_MetaFiles.size(); - //Check if there is a gradient image - - for(int i=0; i < m_MetaFiles.size(); i++) - { - std::pair p = m_MetaFiles.at(i); - if(RetrieveTbssFunction(p.first) == mitk::TbssImage::GRADIENT_X) - { - vecLength += 2; - } - } - - - int currIndex = 0; - - - for(int i=0; i < m_MetaFiles.size(); i++) - { - std::pair p = m_MetaFiles.at(i); - std::string function = p.first; - std::string file = p.second; - - // Add to metainfo to give the tbss image a function-index pair - std::pair pair; - - - pair.first = RetrieveTbssFunction(function); - pair.second = i; - - if(pair.first == mitk::TbssImage::GRADIENT_X) - { - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_X, i)); - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_Y, i+1)); - metaInfo.push_back(std::pair(mitk::TbssImage::GRADIENT_Z, i+2)); - - - VectorReaderType::Pointer fileReader = VectorReaderType::New(); - fileReader->SetFileName(file); - itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New(); - fileReader->SetImageIO(io); - fileReader->Update(); - - VectorImageType::Pointer img = fileReader->GetOutput(); - - VectorImageType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - - if(i==0) - { - // First image in serie. Properties should be used to initialize m_Data - m_Data->SetRegions(img->GetLargestPossibleRegion().GetSize()); - m_Data->SetSpacing(img->GetSpacing()); - m_Data->SetOrigin(img->GetOrigin()); - m_Data->SetDirection(img->GetDirection()); - m_Data->SetVectorLength(vecLength); - m_Data->Allocate(); - } - - - /* Dealing with a gradient image, so the size of the vector need to be increased by 2 - since this image contains 3 volumes. Old data should not be deleted*/ - - - - for(int x=0; x ix; - ix[0] = x; - ix[1] = y; - ix[2] = z; - - itk::VariableLengthVector vec = img->GetPixel(ix); - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - for(int j=0; jSetPixel(ix, pixel); - } - } - } - - currIndex += img->GetVectorLength(); - tbssImg->SetContainsGradient(true); - // Read vector image and add to m_Data - } - - else { - - metaInfo.push_back(pair); - FileReaderType3D::Pointer fileReader = FileReaderType3D::New(); - fileReader->SetFileName(file); - fileReader->Update(); - - FloatImage3DType::Pointer img = fileReader->GetOutput(); - - FloatImage3DType::SizeType size = img->GetLargestPossibleRegion().GetSize(); - - if(i==0) - { - // First image in serie. Properties should be used to initialize m_Data - m_Data->SetRegions(img->GetLargestPossibleRegion().GetSize()); - m_Data->SetSpacing(img->GetSpacing()); - m_Data->SetOrigin(img->GetOrigin()); - m_Data->SetDirection(img->GetDirection()); - m_Data->SetVectorLength(vecLength); - m_Data->Allocate(); - } - - for(int x=0; x ix; - ix[0] = x; - ix[1] = y; - ix[2] = z; - - float f = img->GetPixel(ix); - itk::VariableLengthVector pixel = m_Data->GetPixel(ix); - pixel.SetElement(currIndex, f); - m_Data->SetPixel(ix, pixel); - - } - } - } - } - - if(pair.first == mitk::TbssImage::MEAN_FA_SKELETON) - { - tbssImg->SetContainsMeanSkeleton(true); - } - else if(pair.first == mitk::TbssImage::MEAN_FA_SKELETON_MASK) - { - tbssImg->SetContainsSkeletonMask(true); - } - else if(pair.first == mitk::TbssImage::DISTANCE_MAP) - { - tbssImg->SetContainsDistanceMap(true); - } - - currIndex++; - - } - - tbssImg->SetIsMeta(true); - tbssImg->SetImage(m_Data); - tbssImg->SetMetaInfo(metaInfo); - tbssImg->InitializeFromVectorImage(); - - return tbssImg; - } - - - mitk::TbssImage::MetaDataFunction mitk::TbssImporter::RetrieveTbssFunction(std::string s) - { - if(s == "skeleton mask") - { - return mitk::TbssImage::MEAN_FA_SKELETON_MASK; - } - else if(s == "mean fa skeleton") - { - return mitk::TbssImage::MEAN_FA_SKELETON; - } - else if(s == "gradient image") - { - return mitk::TbssImage::GRADIENT_X; - } - else if(s == "tubular structure") - { - return mitk::TbssImage::TUBULAR_STRUCTURE; - } - else if(s == "distance map") - { - return mitk::TbssImage::DISTANCE_MAP; - } - return mitk::TbssImage::MISC; - } - -} - - - -#endif // __mitkTbssImporter_cpp diff --git a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ b/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ deleted file mode 100644 index 726a513662..0000000000 --- a/Modules/DiffusionImaging/IODataStructures/TbssImages/mitkTbssImporter.h~ +++ /dev/null @@ -1,114 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-14 19:11:20 +0200 (Tue, 14 Jul 2009) $ -Version: $Revision: 18127 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef __mitkTbssImporter_h -#define __mitkTbssImporter_h - -#include "mitkCommon.h" -#include "mitkFileReader.h" - -#include "itkImage.h" -#include "itkVectorImage.h" -#include "itkImageFileReader.h" -#include "mitkTbssImage.h" - - -namespace mitk -{ - //template - class TbssImporter : public itk::Object { - - public: - // typedef TPixelType PixelType; - typedef itk::VectorImage DataImageType; // type of the 3d vector image containing the skeletonized images - typedef itk::VectorImage VectorImageType; // Datatype of the tbss gradient images - typedef itk::Image FloatImage4DType; - typedef itk::ImageFileReader FileReaderType4D; - typedef itk::ImageFileReader VectorReaderType; - - typedef itk::Image FloatImage3DType; - typedef itk::ImageFileReader FileReaderType3D; - - - - mitkClassMacro( TbssImporter, Object ) - itkNewMacro(Self) - - - - - mitk::TbssImage::Pointer Import(); - - mitk::TbssImage::Pointer ImportMeta(); - - - void SetGroupInfo(std::vector< std::pair > groups) - { - m_Groups = groups; - } - - std::vector< std::pair > GetGroupInfo() - { - return m_Groups; - } - - void SetTbssDatasets(std::vector< std::pair > files) - { - m_MetaFiles = files; - } - - void SetMeasurementInfo(std::string s) - { - m_MeasurementInfo = s; - } - - std::string GetMeasurementInfo() - { - return m_MeasurementInfo; - } - - - void SetImportVolume(FloatImage4DType::Pointer inputVolume) - { - m_InputVolume = inputVolume; - } - - protected: - - - - virtual ~TbssImporter(){} - - DataImageType::Pointer m_Data; - std::vector< std::pair > m_Groups; - std::vector< std::pair > m_MetaFiles; - - std::string m_MeasurementInfo; - - - FloatImage4DType::Pointer m_InputVolume; - - - mitk::TbssImage::MetaDataFunction RetrieveTbssFunction(std::string s); - - - }; - -} - -#include "mitkTbssImporter.cpp" -#endif // __mitkTbssImporter_h diff --git a/Modules/MitkExt/IO/mitkChiliPluginIpPicStub.c b/Modules/MitkExt/IO/mitkChiliPluginIpPicStub.c index d0ae2e2a63..d05c50b105 100644 --- a/Modules/MitkExt/IO/mitkChiliPluginIpPicStub.c +++ b/Modules/MitkExt/IO/mitkChiliPluginIpPicStub.c @@ -1,19 +1,18 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #undef CHILIPLUGIN #include "mitkIpPicGet.c" diff --git a/Modules/MitkExt/Interactions/mitkEventAndActionConstants.xsl b/Modules/MitkExt/Interactions/mitkEventAndActionConstants.xsl index b44bb20e31..1baabec256 100644 --- a/Modules/MitkExt/Interactions/mitkEventAndActionConstants.xsl +++ b/Modules/MitkExt/Interactions/mitkEventAndActionConstants.xsl @@ -1,518 +1,516 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Module: $RCSfile$ -Language: C++ -Date: $Date$ -Version: $Revision$ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #ifndef MITKINTERACTCONST_H #define MITKINTERACTCONST_H //##Documentation //## @file mitkInteractionConst.h //## @brief Constants for most interaction classes, due to the generic StateMachines. //## //## Changes in Type, ButtonState or Key has to be don in mitkEventMapper.cpp, too. //## @ingroup Interaction /*Prefixes for Constants: E = Enumeration EID = EventId's Op = Operations Ac = Action Type_ = Type of Event BS_ = ButtonStates and Buttons Key_ = Keys like in QT */ namespace mitk{ /* //UndoMechanism: //constants for UndoMechanism; */ //different UndoModels: typedef enum EUndoModels{LIMITEDLINEARUNDO=10, VERBOSE_LIMITEDLINEARUNDO=11, TREEUNDO=20}; //Constants for EventIds; use the according constant to through an event in the code typedef enum EEventIds { = , // }; //##Constants for Operations //## xomments are always examples of the usage typedef enum EOperations { OpNOTHING = 0, OpTEST = 1, OpNEWCELL = 10, //add a new cell OpADD = 100, //add a point or a vessel OpUNDOADD = 101, OpADDLINE = 1001, //add a line OpINSERT = 200, //insert a point at position OpINSERTLINE = 201, //insert a line at position OpINSERTPOINT = 202, OpCLOSECELL = 250, //close a cell (to a polygon) OpOPENCELL = 251, //close a cell (to a polygon) OpMOVE = 300, //move a point OpMOVELINE = 301, //move a line OpMOVECELL = 302, //move a line OpUNDOMOVE = 303, OpREMOVE = 400, //remove a point at position OpREMOVELINE = 401, //remove a line at position OpREMOVECELL = 402, //remove a cell OpREMOVEPOINT = 403, OpDELETE = 500, //delete OpDELETELINE = 501, //delete the last line in a cell OpUNDELETE = 502, OpDELETECELL = 505, OpSTATECHANGE = 600, //change a state OpTERMINATE = 666, //change a state OpSELECTPOINT = 700, OpSELECTLINE = 701, OpSELECTCELL = 702, OpSELECTSUBOBJECT = 703, //for VesselGraphInteractor //OpSELECTNEWSUBOBJECT = 704, //for VesselGraphInteractor OpSELECT = 705, OpDESELECTPOINT = 800, OpDESELECTLINE = 801, OpDESELECTCELL = 802, OpDESELECTSUBOBJECT = 803, //for VesselGraphInteractor OpDESELECTALL = 804, //for VesselGraphInteractor OpDESELECT = 805, OpNAVIGATE = 900, OpZOOM = 1000, OpSCALE = 1100, OpROTATE = 1200, OpSETPOINTTYPE = 1210, OpMODECHANGE = 1500, OpSENDCOORDINATES = 1600, OpPERIPHERYSEARCH = 2000, //used in VesselGraphInteractor OpROOTSEARCH = 2001, //used in VesselGraphInteractor OpTHICKSTVESSELSEARCH = 2002, //used in VesselGraphInteractor OpSHORTESTPATHSEARCH = 2003, //used in VesselGraphInteractor OpATTRIBUTATION = 2004, //used in VesselGraphInteractor OpDEFAULT = 2006, //used in VesselGraphInteractor }; //##Constants for EventMapping... //##connects the statemachine.xml-File with the implemented conditions. //##within one statemachine the choice of the actionconstants is freely //## //## ActionId typedef enum EActions { = , // }; /* //!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!! //EventMechanism: //If you change anything from here on, then change in mitkEventMapper.cpp (Array of constants) as well. //!!!!!!!!!!!!!!!!!!!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!! */ //Type of an Event; typedef enum EEventType { Type_None = 0, // invalid event Type_Timer = 1, // timer event Type_MouseButtonPress = 2, // mouse button pressed Type_MouseButtonRelease = 3, // mouse button released Type_MouseButtonDblClick = 4, // mouse button double click Type_MouseMove = 5, // mouse move Type_KeyPress = 6, // key pressed Type_KeyRelease = 7, // key released Type_FocusIn = 8, // keyboard focus received Type_FocusOut = 9, // keyboard focus lost Type_Enter = 10, // mouse enters widget Type_Leave = 11, // mouse leaves widget Type_Paint = 12, // paint widget Type_Move = 13, // move widget Type_Resize = 14, // resize widget Type_Create = 15, // after object creation Type_Destroy = 16, // during object destruction Type_Show = 17, // widget is shown Type_Hide = 18, // widget is hidden Type_Close = 19, // request to close widget Type_Quit = 20, // request to quit application Type_Reparent = 21, // widget has been reparented Type_ShowMinimized = 22, // widget is shown minimized Type_ShowNormal = 23, // widget is shown normal Type_WindowActivate = 24, // window was activated Type_WindowDeactivate = 25, // window was deactivated Type_ShowToParent = 26, // widget is shown to parent Type_HideToParent = 27, // widget is hidden to parent Type_ShowMaximized = 28, // widget is shown maximized Type_ShowFullScreen = 29, // widget is shown full-screen Type_Accel = 30, // accelerator event Type_Wheel = 31, // wheel event Type_AccelAvailable = 32, // accelerator available event Type_CaptionChange = 33, // caption changed Type_IconChange = 34, // icon changed Type_ParentFontChange = 35, // parent font changed Type_ApplicationFontChange = 36, // application font changed Type_ParentPaletteChange = 37, // parent palette changed Type_ApplicationPaletteChange = 38, // application palette changed Type_PaletteChange = 39, // widget palette changed Type_Clipboard = 40, // internal clipboard event Type_Speech = 42, // reserved for speech input Type_SockAct = 50, // socket activation Type_AccelOverride = 51, // accelerator override event Type_DeferredDelete = 52, // deferred delete event Type_DragEnter = 60, // drag moves into widget Type_DragMove = 61, // drag moves in widget Type_DragLeave = 62, // drag leaves or is cancelled Type_Drop = 63, // actual drop Type_DragResponse = 64, // drag accepted/rejected Type_ChildInserted = 70, // new child widget Type_ChildRemoved = 71, // deleted child widget Type_LayoutHint = 72, // child min/max size changed Type_ShowWindowRequest = 73, // widget's window should be mapped Type_ActivateControl = 80, // ActiveX activation Type_DeactivateControl = 81, // ActiveX deactivation Type_ContextMenu = 82, // context popup menu Type_IMStart = 83, // input method composition start Type_IMCompose = 84, // input method composition Type_IMEnd = 85, // input method composition end Type_Accessibility = 86, // accessibility information is requested Type_TabletMove = 87, // Wacom tablet event Type_LocaleChange = 88, // the system locale changed Type_LanguageChange = 89, // the application language changed Type_LayoutDirectionChange = 90, // the layout direction changed Type_Style = 91, // internal style event Type_TabletPress = 92, // tablet press Type_TabletRelease = 93, // tablet release Type_User = 1000, // first user event id Type_MaxUser = 65535 }; //##ButtonState // mouse/keyboard state values //QT combinations if MOUSEBUTTONRelease: left MouseButton + ControlButton: 0x201 typedef enum EButtonStates { BS_NoButton = 0x0000, BS_LeftButton = 0x0001, BS_RightButton = 0x0002, BS_MidButton = 0x0004, BS_MouseButtonMask = 0x0007, BS_ShiftButton = 0x0100, BS_ControlButton = 0x0200, BS_AltButton = 0x0400, BS_MetaButton = 0x0800, BS_KeyButtonMask = 0x0f00, BS_Keypad = 0x4000 }; //##Key typedef enum EKeys { Key_Escape = 0x1000, // misc keys Key_Tab = 0x1001, Key_Backtab = 0x1002, Key_BackTab = 0x1002, //= Key_Backtab Key_Backspace = 0x1003, Key_BackSpace = 0x1003, //= Key_Backspace Key_Return = 0x1004, Key_Enter = 0x1005, Key_Insert = 0x1006, Key_Delete = 0x1007, Key_Pause = 0x1008, Key_Print = 0x1009, Key_SysReq = 0x100a, Key_Home = 0x1010, // cursor movement Key_End = 0x1011, Key_Left = 0x1012, Key_Up = 0x1013, Key_Right = 0x1014, Key_Down = 0x1015, Key_Prior = 0x1016, Key_PageUp = 0x1016, //=Key_Prior Key_Next = 0x1017, Key_PageDown = 0x1017, //=Key_Next Key_Shift = 0x1020, // modifiers Key_Control = 0x1021, Key_Meta = 0x1022, Key_Alt = 0x1023, Key_CapsLock = 0x1024, Key_NumLock = 0x1025, Key_ScrollLock = 0x1026, Key_F1 = 0x1030, // function keys Key_F2 = 0x1031, Key_F3 = 0x1032, Key_F4 = 0x1033, Key_F5 = 0x1034, Key_F6 = 0x1035, Key_F7 = 0x1036, Key_F8 = 0x1037, Key_F9 = 0x1038, Key_F10 = 0x1039, Key_F11 = 0x103a, Key_F12 = 0x103b, Key_F13 = 0x103c, Key_F14 = 0x103d, Key_F15 = 0x103e, Key_F16 = 0x103f, Key_F17 = 0x1040, Key_F18 = 0x1041, Key_F19 = 0x1042, Key_F20 = 0x1043, Key_F21 = 0x1044, Key_F22 = 0x1045, Key_F23 = 0x1046, Key_F24 = 0x1047, Key_F25 = 0x1048, // F25 .. F35 only on X11 Key_F26 = 0x1049, Key_F27 = 0x104a, Key_F28 = 0x104b, Key_F29 = 0x104c, Key_F30 = 0x104d, Key_F31 = 0x104e, Key_F32 = 0x104f, Key_F33 = 0x1050, Key_F34 = 0x1051, Key_F35 = 0x1052, Key_Super_L = 0x1053, // extra keys Key_Super_R = 0x1054, Key_Menu = 0x1055, Key_Hyper_L = 0x1056, Key_Hyper_R = 0x1057, Key_Help = 0x1058, // International input method support (X keycode - = 0xEE00) // Only interesting if you are writing your own input method Key_Muhenkan = 0x1122, // Cancel Conversion Key_Henkan = 0x1123, // Start/Stop Conversion Key_Hiragana_Katakana = 0x1127, // Hiragana/Katakana toggle Key_Zenkaku_Hankaku = 0x112A, // Zenkaku/Hankaku toggle Key_Space = 0x20, // 7 bit printable ASCII Key_Any = 0x20, //= Key_Space Key_Exclam = 0x21, Key_QuoteDbl = 0x22, Key_NumberSign = 0x23, Key_Dollar = 0x24, Key_Percent = 0x25, Key_Ampersand = 0x26, Key_Apostrophe = 0x27, Key_ParenLeft = 0x28, Key_ParenRight = 0x29, Key_Asterisk = 0x2a, Key_Plus = 0x2b, Key_Comma = 0x2c, Key_Minus = 0x2d, Key_Period = 0x2e, Key_Slash = 0x2f, Key_0 = 0x30, Key_1 = 0x31, Key_2 = 0x32, Key_3 = 0x33, Key_4 = 0x34, Key_5 = 0x35, Key_6 = 0x36, Key_7 = 0x37, Key_8 = 0x38, Key_9 = 0x39, Key_Colon = 0x3a, Key_Semicolon = 0x3b, Key_Less = 0x3c, Key_Equal = 0x3d, Key_Greater = 0x3e, Key_Question = 0x3f, Key_At = 0x40, Key_A = 0x41, Key_B = 0x42, Key_C = 0x43, Key_D = 0x44, Key_E = 0x45, Key_F = 0x46, Key_G = 0x47, Key_H = 0x48, Key_I = 0x49, Key_J = 0x4a, Key_K = 0x4b, Key_L = 0x4c, Key_M = 0x4d, Key_N = 0x4e, Key_O = 0x4f, Key_P = 0x50, Key_Q = 0x51, Key_R = 0x52, Key_S = 0x53, Key_T = 0x54, Key_U = 0x55, Key_V = 0x56, Key_W = 0x57, Key_X = 0x58, Key_Y = 0x59, Key_Z = 0x5a, Key_BracketLeft = 0x5b, Key_Backslash = 0x5c, Key_BracketRight = 0x5d, Key_AsciiCircum = 0x5e, Key_Underscore = 0x5f, Key_QuoteLeft = 0x60, Key_BraceLeft = 0x7b, Key_Bar = 0x7c, Key_BraceRight = 0x7d, Key_AsciiTilde = 0x7e, Key_nobreakspace = 0x0a0, Key_exclamdown = 0x0a1, Key_cent = 0x0a2, Key_sterling = 0x0a3, Key_currency = 0x0a4, Key_yen = 0x0a5, Key_brokenbar = 0x0a6, Key_section = 0x0a7, Key_diaeresis = 0x0a8, Key_copyright = 0x0a9, Key_ordfeminine = 0x0aa, Key_guillemotleft = 0x0ab, // left angle quotation mark Key_notsign = 0x0ac, Key_hyphen = 0x0ad, Key_registered = 0x0ae, Key_macron = 0x0af, Key_degree = 0x0b0, Key_plusminus = 0x0b1, Key_twosuperior = 0x0b2, Key_threesuperior = 0x0b3, Key_acute = 0x0b4, Key_mu = 0x0b5, Key_paragraph = 0x0b6, Key_periodcentered = 0x0b7, Key_cedilla = 0x0b8, Key_onesuperior = 0x0b9, Key_masculine = 0x0ba, Key_guillemotright = 0x0bb, // right angle quotation mark Key_onequarter = 0x0bc, Key_onehalf = 0x0bd, Key_threequarters = 0x0be, Key_questiondown = 0x0bf, Key_Agrave = 0x0c0, Key_Aacute = 0x0c1, Key_Acircumflex = 0x0c2, Key_Atilde = 0x0c3, Key_Adiaeresis = 0x0c4, Key_Aring = 0x0c5, Key_AE = 0x0c6, Key_Ccedilla = 0x0c7, Key_Egrave = 0x0c8, Key_Eacute = 0x0c9, Key_Ecircumflex = 0x0ca, Key_Ediaeresis = 0x0cb, Key_Igrave = 0x0cc, Key_Iacute = 0x0cd, Key_Icircumflex = 0x0ce, Key_Idiaeresis = 0x0cf, Key_ETH = 0x0d0, Key_Ntilde = 0x0d1, Key_Ograve = 0x0d2, Key_Oacute = 0x0d3, Key_Ocircumflex = 0x0d4, Key_Otilde = 0x0d5, Key_Odiaeresis = 0x0d6, Key_multiply = 0x0d7, Key_Ooblique = 0x0d8, Key_Ugrave = 0x0d9, Key_Uacute = 0x0da, Key_Ucircumflex = 0x0db, Key_Udiaeresis = 0x0dc, Key_Yacute = 0x0dd, Key_THORN = 0x0de, Key_ssharp = 0x0df, Key_agrave = 0x0e0, Key_aacute = 0x0e1, Key_acircumflex = 0x0e2, Key_atilde = 0x0e3, Key_adiaeresis = 0x0e4, Key_aring = 0x0e5, Key_ae = 0x0e6, Key_ccedilla = 0x0e7, Key_egrave = 0x0e8, Key_eacute = 0x0e9, Key_ecircumflex = 0x0ea, Key_ediaeresis = 0x0eb, Key_igrave = 0x0ec, Key_iacute = 0x0ed, Key_icircumflex = 0x0ee, Key_idiaeresis = 0x0ef, Key_eth = 0x0f0, Key_ntilde = 0x0f1, Key_ograve = 0x0f2, Key_oacute = 0x0f3, Key_ocircumflex = 0x0f4, Key_otilde = 0x0f5, Key_odiaeresis = 0x0f6, Key_division = 0x0f7, Key_oslash = 0x0f8, Key_ugrave = 0x0f9, Key_uacute = 0x0fa, Key_ucircumflex = 0x0fb, Key_udiaeresis = 0x0fc, Key_yacute = 0x0fd, Key_thorn = 0x0fe, Key_ydiaeresis = 0x0ff, Key_unknown = 0xffff, Key_none = 0xffff//= Key_unknown }; }//namespace mitk #endif //ifndef MITKINTERACTCONST_H \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app b/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app deleted file mode 100644 index 285949bdc0..0000000000 --- a/Plugins/org.mitk.gui.qt.dtiatlasapp/src/internal/QmitkDTIAtlasAppApplication.h~bug-8511-DTI-atlas-app +++ /dev/null @@ -1,41 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef QMITKDTIAtlasAppAPPLICATION_H_ -#define QMITKDTIAtlasAppAPPLICATION_H_ - -#include - -class QmitkDTIAtlasAppApplication : public QObject, public berry::IApplication -{ - Q_OBJECT - -public: - - QmitkDTIAtlasAppApplication() {} - QmitkDTIAtlasAppApplication(const QmitkDTIAtlasAppApplication& other) - { - Q_UNUSED(other) - throw std::runtime_error("Copy constructor not implemented"); - } - ~QmitkDTIAtlasAppApplication() {} - - int Start(); - void Stop(); -}; - -#endif /*QMITKDTIAtlasAppAPPLICATION_H_*/ diff --git a/Utilities/ipSegmentation/ipSegmentationClear.c b/Utilities/ipSegmentation/ipSegmentationClear.c index 148822b81b..1a85501250 100644 --- a/Utilities/ipSegmentation/ipSegmentationClear.c +++ b/Utilities/ipSegmentation/ipSegmentationClear.c @@ -1,81 +1,80 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include #include "empty.xpm" #include "ipSegmentationP.h" void ipMITKSegmentationClear (mitkIpPicDescriptor* segmentation) { ipMITKSegmentationTYPE *cur, *last; mitkIpPicTSV_t* tag; const char *src; mitkIpUInt1_t *dst; mitkIpUInt4_t i, j; assert (segmentation); if (ipMITKSegmentationUndoIsEnabled (segmentation)) { ipMITKSegmentationUndoSave (segmentation); } /* clear the image data */ cur = (ipMITKSegmentationTYPE *) segmentation->data; last = cur + _mitkIpPicElements (segmentation); while (cur < last) { *cur++ = 0; } /* create an 'empty' tag */ tag = mitkIpPicQueryTag (segmentation, tagSEGMENTATION_EMPTY); if (!tag) { tag = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); strcpy (tag->tag, tagSEGMENTATION_EMPTY); tag->type = mitkIpPicBool; tag->bpe = sizeof (mitkIpBool_t) / 8; tag->dim = 1; tag->n[0] = 1; tag->value = malloc (sizeof (mitkIpBool_t)); *((mitkIpBool_t *) tag->value) = mitkIpTrue; mitkIpPicAddTag (segmentation, tag); } /* create an `empty` icon */ tag = mitkIpPicQueryTag (segmentation, "ICON80x80"); if (!tag) { tag = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); tag->type = mitkIpPicUInt; tag->bpe = 8; tag->dim = 2; tag->n[0] = 80; tag->n[1] = 80; tag->value = malloc (tag->n[0] * tag->n[1] * sizeof (mitkIpUInt1_t)); strcpy (tag->tag, "ICON80x80"); mitkIpPicAddTag (segmentation, tag); } dst = (mitkIpUInt1_t *) tag->value; for (i = 0; i < 80; i++) { src = empty_xpm [3+i]; for (j = 0; j < 80; j++) { *dst = (*src == '.' ? 0 : 196); src++; dst++; } } } diff --git a/Utilities/ipSegmentation/ipSegmentationError.c b/Utilities/ipSegmentation/ipSegmentationError.c index 5592c8186b..4c2309b4ba 100644 --- a/Utilities/ipSegmentation/ipSegmentationError.c +++ b/Utilities/ipSegmentation/ipSegmentationError.c @@ -1,58 +1,57 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include #include "ipSegmentationP.h" static const char* messages [] = { "ok.", "sorry, out of memory.", "sorry, wrong data type of segmentation image.", "sorry, undo is disabled.", "sorry, PIC descriptor is null.", "sorry, unknown error occurred." }; void ipMITKSegmentationError (int error) { switch (error) { case ipMITKSegmentationOK: case ipMITKSegmentationOUT_OF_MEMORY: case ipMITKSegmentationWRONG_TYPE: case ipMITKSegmentationUNDO_DISABLED: printf ("ipMITKSegmentation: %s\n", messages [error]); break; default: printf ("ipMITKSegmentation: %s\n", messages [ipMITKSegmentationUNKNOWN_ERROR]); break; } if (error > 0) { exit (-1); } } void ipMITKSegmentationCheckImage (mitkIpPicDescriptor* segmentation) { if ((segmentation->type != ipMITKSegmentationTYPE_ID) || (segmentation->bpe != ipMITKSegmentationBPE)) { ipMITKSegmentationError (ipMITKSegmentationWRONG_TYPE); } if (!segmentation->data) { ipMITKSegmentationError (ipMITKSegmentationUNKNOWN_ERROR); } } diff --git a/Utilities/ipSegmentation/ipSegmentationFree.c b/Utilities/ipSegmentation/ipSegmentationFree.c index e8183c3b98..da3c74f992 100644 --- a/Utilities/ipSegmentation/ipSegmentationFree.c +++ b/Utilities/ipSegmentation/ipSegmentationFree.c @@ -1,27 +1,26 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include void ipMITKSegmentationFree (mitkIpPicDescriptor* segmentation) { if (!segmentation) return; mitkIpPicFree (segmentation); } diff --git a/Utilities/ipSegmentation/ipSegmentationInterpolate.c b/Utilities/ipSegmentation/ipSegmentationInterpolate.c index 4ad6ba2bef..a45534d683 100644 --- a/Utilities/ipSegmentation/ipSegmentationInterpolate.c +++ b/Utilities/ipSegmentation/ipSegmentationInterpolate.c @@ -1,324 +1,323 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include #include #include #include "ipSegmentationP.h" /*! The algorithm implements the shape-based interpolation technique. Further detailed information can be found in: G.T. Herman, J. Zheng, C.A. Bucholtz: "Shape-based interpolation" IEEE Computer Graphics & Applications, pp. 69-79,May 1992 */ #define MAX 2048 extern float truncf (float x); static mitkIpPicDescriptor* setup (mitkIpPicDescriptor* pic_old); static mitkIpInt2_t distance (const mitkIpInt2_t* const old_distance, const mitkIpInt2_t* mask_dist, const mitkIpInt2_t* mask_offset, const mitkIpUInt4_t mask_elements); // DON'T ever touch this code again - rather rewrite it! Then use ITK or some other library! // Works ONLY with 2D images. mitkIpPicDescriptor* ipMITKSegmentationPadBy1Pixel (mitkIpPicDescriptor* pic_in) { //prepare the images mitkIpPicDescriptor* pic_out; ipMITKSegmentationTYPE* out_pixel_pointer; ipMITKSegmentationTYPE* in_pixel_pointer; unsigned int x, y; pic_out = mitkIpPicCopyHeader(pic_in, NULL); if (pic_out == NULL) { ipMITKSegmentationError (ipMITKSegmentationPIC_NULL); } if ((pic_out->type != ipMITKSegmentationTYPE_ID) || (pic_out->bpe != ipMITKSegmentationBPE)) { ipMITKSegmentationError (ipMITKSegmentationWRONG_TYPE); } // pad by 1 pixel pic_out->n[0] += 4; pic_out->n[1] += 4; // allocate image data pic_out->data = malloc ( pic_out->n[0] * pic_out->n[1] * ((pic_out->bpe)/8) ); // copy pixel data out_pixel_pointer = (ipMITKSegmentationTYPE*) (pic_out->data); in_pixel_pointer = (ipMITKSegmentationTYPE*) (pic_in->data); for (y = 0; y < pic_out->n[1]; ++y) for (x = 0; x < pic_out->n[0]; ++x) { if ( x < 2 || y < 2 || (x > pic_out->n[0]-3) || (y > pic_out->n[1]-3) ) // set border pixels to 0 { *out_pixel_pointer = 0; } else { *out_pixel_pointer = *in_pixel_pointer; ++in_pixel_pointer; } ++out_pixel_pointer; } return pic_out; } // Works ONLY with 2D images. mitkIpPicDescriptor* ipMITKSegmentationShrinkBy1Pixel (mitkIpPicDescriptor* pic_in ) { mitkIpPicDescriptor* pic_out; ipMITKSegmentationTYPE* out_pixel_pointer; ipMITKSegmentationTYPE* in_pixel_pointer; unsigned int x, y; //prepare the images pic_out = mitkIpPicCopyHeader(pic_in, NULL); if (pic_out == NULL) { ipMITKSegmentationError (ipMITKSegmentationPIC_NULL); } if ((pic_out->type != ipMITKSegmentationTYPE_ID) || (pic_out->bpe != ipMITKSegmentationBPE)) { ipMITKSegmentationError (ipMITKSegmentationWRONG_TYPE); } // pad by 1 pixel pic_out->n[0] -= 4; pic_out->n[1] -= 4; // allocate image data pic_out->data = malloc ( pic_out->n[0] * pic_out->n[1] * (pic_out->bpe/8) ); // copy pixel data out_pixel_pointer = pic_out->data; in_pixel_pointer = pic_in->data; for (y = 0; y < pic_in->n[1]; ++y) for (x = 0; x < pic_in->n[0]; ++x) { if ( x < 2 || y < 2 || (x > pic_in->n[0]-3) || (y > pic_in->n[1]-3) ) // ignore border pixels { } else { *out_pixel_pointer = *in_pixel_pointer; ++out_pixel_pointer; } ++in_pixel_pointer; } return pic_out; } mitkIpPicDescriptor* ipMITKSegmentationInterpolate (mitkIpPicDescriptor* pPic1, mitkIpPicDescriptor* pPic2, const mitkIpFloat4_t ratio) { mitkIpPicDescriptor *pic_out, *pic[2]; /* pointer to image data */ mitkIpUInt4_t frame [_mitkIpPicNDIM]; /* pointer for definition of frame-size */ mitkIpInt4_t x, y; mitkIpUInt4_t i; /* loop counters */ mitkIpFloat4_t weight[] = {1.0f-ratio, ratio}; /* weights of the interpolants */ mitkIpInt2_t mask_width = 1; /* mask width from center to border */ mitkIpInt2_t mask_x[] = {0, -1, +1, 0, -1}; /* relativ position in x-axis of mask */ mitkIpInt2_t mask_y[] = {0, 0, -1, -1, -1}; /* relativ position in y-axis of mask */ mitkIpInt2_t mask_dist[] = {0, 10, 14, 10, 14};/* distance to central element */ mitkIpInt2_t mask_offset [5]; /* relative start position in given image */ mitkIpUInt4_t mask_elements = 5; /* elements in distance mask */ mitkIpInt2_t first_x, first_y; /* first pixel for distance calculation in enlarged image version */ mitkIpInt2_t last_x, last_y; /* last pixel for distance calculation in enlarged image version */ mitkIpInt2_t *pixel[2]; /* pointer to the current pixels */ ipMITKSegmentationTYPE* pixel_out; mitkIpPicDescriptor* returnImage; mitkIpPicDescriptor* pic1 = ipMITKSegmentationPadBy1Pixel( pPic1 ); mitkIpPicDescriptor* pic2 = ipMITKSegmentationPadBy1Pixel( pPic2 ); /* prepare the images */ pic_out = mitkIpPicCopyHeader(pic1, NULL); if (pic_out == NULL) { ipMITKSegmentationError (ipMITKSegmentationPIC_NULL); } if ((pic_out->type != ipMITKSegmentationTYPE_ID) || (pic_out->bpe != ipMITKSegmentationBPE)) { ipMITKSegmentationError (ipMITKSegmentationWRONG_TYPE); } pic_out->data = malloc (_mitkIpPicSize (pic_out)); for (i = 0; i < pic1->dim; i++) { frame [i] = 1; } pic[0] = setup (pic1); pic[1] = setup (pic2); /* apply the mask in both directions */ for (i=0; i< mask_elements; i++) { mask_offset [i] = mask_x[i] + mask_y[i]*pic[0]->n[0]; } first_x = mask_width; first_y = mask_width; last_x = pic[0]->n[0] - mask_width-1; last_y = pic[0]->n[1] - mask_width-1; /* top-left to bottom-right, borders are neglected */ for (y = first_y; y <= last_y; y++) { pixel [0] = (mitkIpInt2_t *) pic [0]->data + (first_x + y * pic [0]->n [0]); pixel [1] = (mitkIpInt2_t *) pic [1]->data + (first_x + y * pic [1]->n [0]); for (x = first_x; x <= last_x; x++) { *(pixel [0])++ = distance (pixel [0], mask_dist, mask_offset, mask_elements); *(pixel [1])++ = distance (pixel [1], mask_dist, mask_offset, mask_elements); } } /* bottom-right to top-left, borders are neglected */ for (i=0; i< mask_elements; i++) { mask_offset [i] = -mask_offset [i]; } pixel_out = (ipMITKSegmentationTYPE *) pic_out->data + _mitkIpPicElements(pic_out) - 1; for (y = last_y; y >= first_y; y--) { pixel [0] = (mitkIpInt2_t *) pic [0]->data + (last_x + y * pic [0]->n [0]); pixel [1] = (mitkIpInt2_t *) pic [1]->data + (last_x + y * pic [1]->n [0]); for (x = last_x; x >= first_x; x--) { *(pixel [0]) = distance (pixel [0], mask_dist, mask_offset, mask_elements); *(pixel [1]) = distance (pixel [1], mask_dist, mask_offset, mask_elements); *pixel_out-- = (weight [0] * *(pixel [0]) + weight [1] * *(pixel[1]) > 0 ? 1 : 0); pixel[0]--; pixel[1]--; } } mitkIpPicFree(pic [0]); mitkIpPicFree(pic [1]); mitkIpPicFree(pic1); mitkIpPicFree(pic2); returnImage = ipMITKSegmentationShrinkBy1Pixel( pic_out ); mitkIpPicFree(pic_out); return returnImage; } static mitkIpPicDescriptor* setup (mitkIpPicDescriptor* pic_old) { mitkIpPicDescriptor* pic; ipMITKSegmentationTYPE* src; mitkIpInt2_t* dst; mitkIpUInt4_t x, y; /* Allocate new image for distance transform */ pic = mitkIpPicCopyHeader (pic_old, NULL); pic->type = mitkIpPicInt; pic->bpe = 16; pic->n[0] += 2; pic->n[1] += 2; pic->data = malloc (_mitkIpPicSize (pic)); /* Set the frame to -1 */ dst = (mitkIpInt2_t *) pic->data; for (x = 0; x < pic->n[0]; x++) { *dst++ = -MAX; } dst = (mitkIpInt2_t *) pic->data + _mitkIpPicElements (pic) - pic->n[0]; for (x = 0; x < pic->n[0]; x++) { *dst++ = -MAX; } dst = (mitkIpInt2_t *) pic->data; for (y = 0; y < pic->n[1]; y++) { *dst = -MAX; dst += pic->n[0]; } dst = (mitkIpInt2_t *) pic->data + (pic->n[0] - 1); for (y = 0; y < pic->n[1]; y++) { *dst = -MAX; dst += pic->n[0]; } /* Set the image data to initial values */ src = (ipMITKSegmentationTYPE *) pic_old->data; dst = (mitkIpInt2_t *) pic->data + (1 + pic->n[0]); for (y = 0; y < pic_old->n[1]; y++) { for (x = 0; x < pic_old->n[0]; x++) { *dst++ = (*src++ > 0 ? MAX : -MAX); } dst += 2; } dst = (mitkIpInt2_t *) pic->data + (1 + pic->n[0]); for (y = 0; y < pic_old->n[1]; y++) { for (x = 0; x < pic_old->n[0]; x++) { if ((dst[0] < dst[1]) || (dst[0] < dst[pic->n[0]])) { *dst = -5; } else if ((dst[0] > dst[1]) || (dst[0] > dst[pic->n[0]])) { *dst = 5; } dst++; } dst += 2; } dst -= 2; for (y = 0; y < pic_old->n[1]; y++) { for (x = 0; x < pic_old->n[0]; x++) { dst--; if (abs (dst[0]) > 5) { if ((dst[0] < dst[-1]) || (dst[0] < dst[-(int)(pic->n[0])])) { *dst = -5; } else if ((dst[0] > dst[-1]) || (dst[0] > dst[-(int)(pic->n[0])])) { *dst = 5; } } } } return pic; } static mitkIpInt2_t distance (const mitkIpInt2_t* const old_distance, const mitkIpInt2_t* mask_dist, const mitkIpInt2_t* mask_offset, const mitkIpUInt4_t mask_elements) { mitkIpInt2_t cur_distance, new_distance; mitkIpUInt4_t i; cur_distance = old_distance [0]; if (abs (cur_distance) != 5) { if (cur_distance > 0) { for (i = 0; i < mask_elements; i++) { new_distance = *mask_dist + old_distance [*mask_offset]; if (new_distance < cur_distance) { cur_distance = new_distance; } mask_dist++; mask_offset++; } } else if (cur_distance < 0) { for (i = 0; i < mask_elements; i++) { new_distance = old_distance [*mask_offset] - *mask_dist; if (new_distance > cur_distance) { cur_distance = new_distance; } mask_dist++; mask_offset++; } } } return cur_distance; } diff --git a/Utilities/ipSegmentation/ipSegmentationNew.c b/Utilities/ipSegmentation/ipSegmentationNew.c index b9b5bead5d..23d84ad7c0 100644 --- a/Utilities/ipSegmentation/ipSegmentationNew.c +++ b/Utilities/ipSegmentation/ipSegmentationNew.c @@ -1,35 +1,34 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include "ipSegmentationP.h" mitkIpPicDescriptor* ipMITKSegmentationNew (mitkIpPicDescriptor* image) { mitkIpPicDescriptor* s = NULL; if (image) { s = mitkIpPicNew (); s->type = ipMITKSegmentationTYPE_ID; s->bpe = ipMITKSegmentationBPE; s->dim = 2; s->n[0] = image->n[0]; s->n[1] = image->n[1]; s->data = malloc (_mitkIpPicSize (s)); } return s; } diff --git a/Utilities/ipSegmentation/ipSegmentationUndo.c b/Utilities/ipSegmentation/ipSegmentationUndo.c index 56594c44b8..3f72bb1604 100644 --- a/Utilities/ipSegmentation/ipSegmentationUndo.c +++ b/Utilities/ipSegmentation/ipSegmentationUndo.c @@ -1,245 +1,244 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #include #include #include "ipSegmentationP.h" static char* tagUNDO = "SEGMENTATION_UNDO"; static char* tagUNDO_DATA = "DATA"; static char* tagUNDO_LEVEL = "LEVEL"; // Implemented in mitkIpPicDelT.c static mitkIpPicTSV_t *_mitkIpPicRemoveTag( _mitkIpPicTagsElement_t **head, _mitkIpPicTagsElement_t *which, char *tag ); void ipMITKSegmentationUndoEnable (mitkIpPicDescriptor* segmentation, const mitkIpUInt1_t level) { mitkIpPicTSV_t *undo, *data, *max; assert (segmentation); undo = mitkIpPicQueryTag (segmentation, tagUNDO); if (!undo) { undo = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); if (!undo) { ipMITKSegmentationError (ipMITKSegmentationOUT_OF_MEMORY); } strcpy (undo->tag, tagUNDO); undo->type = mitkIpPicTSV; undo->bpe = 32; undo->dim = 1; undo->n[0] = 0; undo->value = NULL; mitkIpPicAddTag (segmentation, undo); } data = mitkIpPicQuerySubTag (undo, tagUNDO_DATA); if (!data) { data = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); if (!data) { ipMITKSegmentationError (ipMITKSegmentationOUT_OF_MEMORY); } strcpy (data->tag, tagUNDO_DATA); data->type = mitkIpPicTSV; data->bpe = 32; data->dim = 1; data->n[0] = 0; data->value = NULL; mitkIpPicAddSubTag (undo, data); } if (data->n[0] > level) { /* remove levels which exceed the maximum */ mitkIpUInt1_t i; for (i = data->n[0] - level; i > 0; i--) { _mitkIpPicTagsElement_t *head = (_mitkIpPicTagsElement_t *) data->value; mitkIpPicTSV_t* tag = _mitkIpPicRemoveTag (&head, head, head->tsv->tag); data->value = head; data->n[0]--; mitkIpPicFreeTag (tag); } } max = mitkIpPicQuerySubTag (undo, tagUNDO_LEVEL); if (max) { /* change the maximum of levels */ mitkIpUInt1_t* value = (mitkIpUInt1_t *) max->value; *value = level; } else { mitkIpUInt1_t* value = (mitkIpUInt1_t *) malloc (sizeof (mitkIpUInt1_t)); if (!value) { ipMITKSegmentationError (ipMITKSegmentationOUT_OF_MEMORY); } *value = level; max = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); if (!max) { ipMITKSegmentationError (ipMITKSegmentationOUT_OF_MEMORY); } strcpy (max->tag, tagUNDO_LEVEL); max->type = mitkIpPicUInt; max->bpe = 8; max->dim = 1; max->n[0] = 1; max->value = value; mitkIpPicAddSubTag (undo, max); } } void ipMITKSegmentationUndoDisable (mitkIpPicDescriptor* segmentation) { mitkIpPicTSV_t *undo; assert (segmentation); undo = mitkIpPicDelTag (segmentation, tagUNDO); mitkIpPicFreeTag (undo); } mitkIpBool_t ipMITKSegmentationUndoIsEnabled (mitkIpPicDescriptor* segmentation) { mitkIpPicTSV_t *undo = NULL; if (segmentation) { undo = mitkIpPicQueryTag (segmentation, tagUNDO); } return (undo ? mitkIpTrue : mitkIpFalse); } void ipMITKSegmentationUndoSave (mitkIpPicDescriptor* segmentation) { mitkIpPicTSV_t *undo, *data, *level, *tag; assert (segmentation); undo = mitkIpPicQueryTag (segmentation, tagUNDO); if (!undo) { ipMITKSegmentationError (ipMITKSegmentationUNDO_DISABLED); } /* if no level is available ... */ data = mitkIpPicQuerySubTag (undo, tagUNDO_DATA); level = mitkIpPicQuerySubTag (undo, tagUNDO_LEVEL); if (*((mitkIpUInt1_t *) level->value) > 0) { if (data->n[0] == *((mitkIpUInt1_t *) level->value)) { /* ... remove the first one. */ _mitkIpPicTagsElement_t* head = (_mitkIpPicTagsElement_t *) data->value; mitkIpPicTSV_t* tag = _mitkIpPicRemoveTag (&head, head, head->tsv->tag); data->value = head; data->n[0]--; mitkIpPicFreeTag (tag); } /* build and store the level */ tag = (mitkIpPicTSV_t *) malloc (sizeof (mitkIpPicTSV_t)); if (!tag) { ipMITKSegmentationError (ipMITKSegmentationOUT_OF_MEMORY); } strcpy (tag->tag, "IMAGE"); tag->type = segmentation->type; tag->bpe = segmentation->bpe; tag->dim = segmentation->dim; tag->n[0] = segmentation->n[0]; tag->n[1] = segmentation->n[1]; tag->value = malloc (_mitkIpPicSize (segmentation)); memmove (tag->value, segmentation->data, _mitkIpPicSize (segmentation)); mitkIpPicAddSubTag (data, tag); } } void ipMITKSegmentationUndo (mitkIpPicDescriptor* segmentation) { mitkIpPicTSV_t *undo, *data; assert (segmentation); undo = mitkIpPicQueryTag (segmentation, tagUNDO); if (!undo) { ipMITKSegmentationError (ipMITKSegmentationUNDO_DISABLED); } /* if any level is stored ... */ data = mitkIpPicQuerySubTag (undo, tagUNDO_DATA); if (data->n[0]) { /* ... replace the image data and remove this level */ _mitkIpPicTagsElement_t* head = (_mitkIpPicTagsElement_t *) data->value; _mitkIpPicTagsElement_t* current = head; mitkIpPicTSV_t* tag; while( current->next != NULL ) { current = current->next; } tag = _mitkIpPicRemoveTag (&head, current, current->tsv->tag); data->value = head; data->n[0]--; memmove (segmentation->data, tag->value, _mitkIpPicSize (segmentation)); mitkIpPicFreeTag (tag); tag = mitkIpPicDelTag (segmentation, tagSEGMENTATION_EMPTY); if (tag) { mitkIpPicFreeTag (tag); } } } mitkIpBool_t ipMITKSegmentationUndoAvailable (mitkIpPicDescriptor* segmentation) { mitkIpPicTSV_t *undo, *data; assert (segmentation); undo = mitkIpPicQueryTag (segmentation, tagUNDO); if (!undo) { ipMITKSegmentationError (ipMITKSegmentationUNDO_DISABLED); } data = mitkIpPicQuerySubTag (undo, tagUNDO_DATA); return (data->n[0] ? mitkIpTrue : mitkIpFalse); } mitkIpPicTSV_t * _mitkIpPicRemoveTag( _mitkIpPicTagsElement_t **head, _mitkIpPicTagsElement_t *which, char *tag) { mitkIpPicTSV_t *tsv = NULL; if( which != NULL ) { tsv = which->tsv; if( which->prev == NULL ) /* which is the current head */ { *head = which->next; if( *head ) (*head)->prev = NULL; } else if( which->next == NULL ) /* which is the current tail */ { which->prev->next = NULL; } else /* which is somewhere if the list */ { which->prev->next = which->next; which->next->prev = which->prev; } free( which ); } return( tsv ); } diff --git a/Utilities/mbilog/mbilogConfig.h.in b/Utilities/mbilog/mbilogConfig.h.in index 2e04ee41c5..8d7a179cbc 100644 --- a/Utilities/mbilog/mbilogConfig.h.in +++ b/Utilities/mbilog/mbilogConfig.h.in @@ -1,20 +1,22 @@ -/*========================================================================= +/*=================================================================== -Program: mbilog - logging for mitk / BlueBerry +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #ifndef _MBILOG_CONFIG_H_ #define _MBILOG_CONFIG_H_ @_define_enable_debug@ #endif /* _MBILOG_CONFIG_H_ */ \ No newline at end of file diff --git a/mitkExportMacros.h.in b/mitkExportMacros.h.in index 36cd194923..a083c0f2e3 100644 --- a/mitkExportMacros.h.in +++ b/mitkExportMacros.h.in @@ -1,41 +1,40 @@ -/*========================================================================= +/*=================================================================== -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ +The Medical Imaging Interaction Toolkit (MITK) -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. -=========================================================================*/ +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ #ifndef MITKEXPORTMACROS_H #define MITKEXPORTMACROS_H #cmakedefine VISIBILITY_AVAILABLE /** * Macros for import/export declarations */ #if defined(WIN32) #define MITK_EXPORT __declspec(dllexport) #define MITK_IMPORT __declspec(dllimport) #define MITK_LOCAL #elif defined(VISIBILITY_AVAILABLE) #define MITK_EXPORT __attribute__ ((visibility ("default"))) #define MITK_IMPORT __attribute__ ((visibility ("default"))) #define MITK_LOCAL __attribute__ ((visibility ("hidden"))) #else #define MITK_EXPORT #define MITK_IMPORT #define MITK_LOCAL #endif #endif // MITKEXPORTMACROS_H