Computer Assited Medical Intervention Tool Kit  version 5.0
MultiPickingWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef MULTIPLEPICKINGWIDGET_H
27 #define MULTIPLEPICKINGWIDGET_H
28 
29 // Includes Qt
30 #include <QWidget>
31 
32 // Includes CamiTK
33 #include <ImageComponent.h>
34 
35 // local includes
36 #include "MultiPickingAPI.h"
37 #include "ui_MultiPickingWidget.h"
38 #include "PickedPixelMap.h"
39 
47 class MULTIPICKING_API MultiPickingWidget : public QWidget {
48  Q_OBJECT
49 
50 public:
52  MultiPickingWidget(QWidget* parent = nullptr);
53 
55  ~MultiPickingWidget() override = default;
56 
58  void updateComponent(camitk::ImageComponent* image);
59 
61  PickedPixelMap* getPickedPixelMap(camitk::ImageComponent* image);
62 
63 
64 public slots:
66  void setPointTypeTable();
67 
69  void addPixelinTable();
70 
72  void removePixelFromTable();
73 
74  void removeSeedNumber(int, int);
75 
77  void savePixelList();
78 
80  void openPixelList();
81 
83  void manuallyModified(int, int);
84 
86  void updateTable();
87 
88 
89 protected:
90  Ui::MultiPickingWidget ui;
91 
96  void createItems(QList< QVector3D >* liste, QList<double>* valueList);
97 
100 
102  PickedPixelMap* pPM;
103 
104  QMap<camitk::ImageComponent*, PickedPixelMap*> map;
105 
107  void resizeGraphicalTable();
108 
109 };
110 
111 #endif // MULTIPLEPICKINGWIDGET_H
camitk::ImageComponent::pixelPicked
void pixelPicked(double x, double y, double z) override
Method called when a pixel has been picked in the 3D view.
Definition: ImageComponent.cpp:657
PickedPixelMap::getPixelValueList
QList< double > * getPixelValueList()
return the liste of pixel values
Definition: PickedPixelMap.cpp:98
MultiPickingWidget::getPickedPixelMap
PickedPixelMap * getPickedPixelMap(camitk::ImageComponent *image)
Give the picked pixel map (for other actions needing picking)
Definition: MultiPickingWidget.cpp:86
PickedPixelMap::openPixelList
void openPixelList(QString fileName)
open a list of pixel in a given file base name (CSV format, separator = comma).
Definition: PickedPixelMap.cpp:202
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
MultiPickingWidget::savePixelList
void savePixelList()
Slot called when save as button is clicked.
Definition: MultiPickingWidget.cpp:215
HEADER_TABLE_REAL
#define HEADER_TABLE_REAL
Definition: MultiPickingWidget.cpp:41
VALUE_TABLE_INDEX
#define VALUE_TABLE_INDEX
Definition: MultiPickingWidget.cpp:45
SingleImageComponent.h
MultiPickingWidget::updateComponent
void updateComponent(camitk::ImageComponent *image)
Update the widget with the correct PickedPixelMap (ImageComponent + Qlist of the selected points)
Definition: MultiPickingWidget.cpp:65
PickedPixelMap::addPixel
void addPixel()
Allows one to add a pixel in the list using the last picked pixel.
Definition: PickedPixelMap.cpp:62
Y_TABLE_INDEX
#define Y_TABLE_INDEX
Definition: MultiPickingWidget.cpp:43
MultiPickingWidget
The multipicking action widget (a table with the pixel coordinates/3D indexes + some buttons to inter...
Definition: MultiPickingWidget.h:47
camitk::ImageComponent
The manager of the Image Volume data. An image volume data has no concrete 3D representation,...
Definition: ImageComponent.h:77
MultiPickingWidget::img
camitk::ImageComponent * img
the current Image Component
Definition: MultiPickingWidget.h:122
camitk::ImageComponent::getImageName
QString getImageName() const
getter/setter for the property
Definition: ImageComponent.cpp:530
MultiPickingWidget::MultiPickingWidget
MultiPickingWidget(QWidget *parent=nullptr)
basic constructor
Definition: MultiPickingWidget.cpp:58
PickedPixelMap.h
MultiPickingWidget::createItems
void createItems(QList< QVector3D > *liste, QList< double > *valueList)
allows one to construct the table
Definition: MultiPickingWidget.cpp:238
camitk::ImageComponent::getAxialSlices
SingleImageComponent * getAxialSlices()
Returns the axial slice.
Definition: ImageComponent.cpp:472
MultiPickingWidget::removeSeedNumber
void removeSeedNumber(int, int)
Definition: MultiPickingWidget.cpp:170
PickedPixelMap::getRealWorldList
QList< QVector3D > * getRealWorldList()
return the list of coordinates in real world frame
Definition: PickedPixelMap.cpp:108
Log.h
MULTIPICKING_API
#define MULTIPICKING_API
Definition: MultiPickingAPI.h:50
PickedPixelMap::removePixel
void removePixel(int id)
Allows one to remove one pixel in the list.
Definition: PickedPixelMap.cpp:145
Z_TABLE_INDEX
#define Z_TABLE_INDEX
Definition: MultiPickingWidget.cpp:44
MultiPickingWidget::pPM
PickedPixelMap * pPM
the current PickedPixelMap
Definition: MultiPickingWidget.h:125
MultiPickingWidget::openPixelList
void openPixelList()
Slot called when open CSV file button is clicked.
Definition: MultiPickingWidget.cpp:200
MultiPickingAPI.h
HEADER_TABLE_VOXEL
#define HEADER_TABLE_VOXEL
Definition: MultiPickingWidget.cpp:39
EDIT_TABLE_FILE
#define EDIT_TABLE_FILE
Definition: MultiPickingWidget.cpp:53
NB_TABLE_COLUMNS
#define NB_TABLE_COLUMNS
Definition: MultiPickingWidget.cpp:50
camitk::Component::getName
QString getName() const override
get the name to be displayed
Definition: sdk/libraries/core/component/Component.h:907
MultiPickingWidget::map
QMap< camitk::ImageComponent *, PickedPixelMap * > map
Definition: MultiPickingWidget.h:127
MultiPickingWidget::addPixelinTable
void addPixelinTable()
Slot called when the button add is clicked.
Definition: MultiPickingWidget.cpp:146
REMOVE_TABLE_FILE
#define REMOVE_TABLE_FILE
Definition: MultiPickingWidget.cpp:54
MultiPickingWidget::ui
Ui::MultiPickingWidget ui
Definition: MultiPickingWidget.h:113
X_TABLE_INDEX
#define X_TABLE_INDEX
Definition: MultiPickingWidget.cpp:42
MultiPickingWidget::setPointTypeTable
void setPointTypeTable()
Slot called when the state of the radioButton pixel index changed.
Definition: MultiPickingWidget.cpp:232
camitk::Component::setSlice
vtkSmartPointer< vtkImageData > vtkSmartPointer< vtkImageActor > vtkSmartPointer< vtkActor > updatePickPlane setSlice
Definition: sdk/libraries/core/component/Component.h:740
MultiPickingWidget.h
PickedPixelMap::getCoordIndexList
QList< QVector3D > * getCoordIndexList()
return the list of coordinates pixel index
Definition: PickedPixelMap.cpp:94
PickedPixelMap::getPixelIndexList
QList< QVector3D > * getPixelIndexList()
return the list of pixel index
Definition: PickedPixelMap.cpp:103
PickedPixelMap::modifyPixel
void modifyPixel(int row)
Allows one to modify one pixel in the list.
Definition: PickedPixelMap.cpp:113
PickedPixelMap::savePixelList
void savePixelList(QString fileName)
save the list of pixel in a given file base name (CSV format, separator = comma).
Definition: PickedPixelMap.cpp:155
camitk::ImageComponent::getImageData
vtkSmartPointer< vtkImageData > getImageData() const override
get the image volume managed by this Component
Definition: ImageComponent.h:123
REMOVE_TABLE_INDEX
#define REMOVE_TABLE_INDEX
Definition: MultiPickingWidget.cpp:48
VIEW_TABLE_INDEX
#define VIEW_TABLE_INDEX
Definition: MultiPickingWidget.cpp:46
PickedPixelMap
This class is dedicated to manage an ImageComponent with a list of selected/picked pixels....
Definition: PickedPixelMap.h:53
MultiPickingWidget::resizeGraphicalTable
void resizeGraphicalTable()
allows one to resize the QtableWidget
Definition: MultiPickingWidget.cpp:279
camitk::refresh
void refresh()
refresh the display
ImageComponent.h
MultiPickingWidget::manuallyModified
void manuallyModified(int, int)
Slot called when the user manually changes a value in the table.
Definition: MultiPickingWidget.cpp:293
VIEW_TABLE_FILE
#define VIEW_TABLE_FILE
Definition: MultiPickingWidget.cpp:52
MultiPickingWidget::removePixelFromTable
void removePixelFromTable()
Slot called when remove button is clicked.
Definition: MultiPickingWidget.cpp:156
EDIT_TABLE_INDEX
#define EDIT_TABLE_INDEX
Definition: MultiPickingWidget.cpp:47
MultiPickingWidget::updateTable
void updateTable()
Update the tableWidget when it's necessary.
Definition: MultiPickingWidget.cpp:102
Application.h
camitk
Definition: Action.cpp:35
HEADER_TABLE_IMG
#define HEADER_TABLE_IMG
Definition: MultiPickingWidget.cpp:40