Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

ImageLutAction.cpp 2.02 KB
Newer Older
1
/*****************************************************************************
2
3
4
 * $CAMITK_LICENCE_BEGIN$
 *
 * CamiTK - Computer Assisted Medical Intervention ToolKit
5
 * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *
 * Visit http://camitk.imag.fr for more information
 *
 * This file is part of CamiTK.
 *
 * CamiTK is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * CamiTK is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with CamiTK.  If not, see <http://www.gnu.org/licenses/>.
 *
 * $CAMITK_LICENCE_END$
 ****************************************************************************/
25

26
27
#include "ImageComponent.h"
#include "Application.h"
28
29
30
31
32
33
34
35
36
37

#include "ImageLutAction.h"
#include "ImageLutWidget.h"


using namespace camitk;



// --------------- constructor -------------------
38
ImageLutAction::ImageLutAction(ActionExtension* extension) : Action(extension) {
Emmanuel Promayon's avatar
Emmanuel Promayon committed
39
    setName("Image Look Up Table");
40
    setDescription("Modify the LUT of an image components");
41
    setComponent("ImageComponent");
Emmanuel Promayon's avatar
Emmanuel Promayon committed
42
43
    setFamily("Image LUT");
    addTag("LUT");
44
45
}

46
// --------------- getWidget -------------------
47
QWidget* ImageLutAction::getWidget() {
48
    //-- create the widget if needed
49
    if (!actionWidget) {
50
        actionWidget = new ImageLutWidget();
51
    }
52

53
    //--  update the LUT values (the getTargets() might have changed since the last call)
54
    dynamic_cast<ImageLutWidget*>(actionWidget)->updateComponent(dynamic_cast<ImageComponent*>(getTargets().last()));
55

56
    return actionWidget;
57
58
}

59
60
61
62
63
// --------------- getWidget -------------------
Action::ApplyStatus ImageLutAction::apply() {
    return Action::SUCCESS;
}