23 #include <QSignalMapper> 28 m_Controls.setupUi(
this);
31 m_Controls.tableView->setHorizontalHeader(patientTableHeaderView);
32 m_Controls.tableView->horizontalHeader()->setHighlightSections(
false);
33 m_Controls.tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
34 m_Controls.tableView->verticalHeader()->setHighlightSections(
false);
35 m_Controls.tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
36 m_Controls.tableView->setSelectionMode(QAbstractItemView::SingleSelection);
37 m_Controls.tableView->setSelectionBehavior(QAbstractItemView::SelectItems);
38 m_Controls.tableView->setContextMenuPolicy(Qt::CustomContextMenu);
41 m_Controls.tableView->setModel(m_StorageModel);
50 return m_Controls.tableView;
55 return m_Controls.tableView;
60 m_Controls.tableView->setSelectionMode(mode);
65 return m_Controls.tableView->selectionMode();
80 return m_Controls.tableView->selectionModel();
98 void QmitkPatientTableInspector::OnModelUpdated()
100 m_Controls.tableView->resizeRowsToContents();
101 m_Controls.tableView->resizeColumnsToContents();
104 void QmitkPatientTableInspector::OnNodeButtonClicked(
const QString& nodeType)
106 m_StorageModel->
SetNodeType(nodeType.toStdString());
109 void QmitkPatientTableInspector::OnDataNodeSelectionChanged(
const QList<mitk::DataNode::Pointer>& dataNodeSelection)
122 void QmitkPatientTableInspector::OnItemDoubleClicked(
const QModelIndex& itemIndex)
124 if (itemIndex.isValid())
135 void QmitkPatientTableInspector::SetUpConnections()
140 QSignalMapper* nodeButtonSignalMapper =
new QSignalMapper(
this);
141 nodeButtonSignalMapper->setMapping(m_Controls.imageNodeButton, QString(
"Image"));
142 nodeButtonSignalMapper->setMapping(m_Controls.segmentationNodeButton, QString(
"Segmentation"));
143 connect(nodeButtonSignalMapper,
static_cast<void (QSignalMapper::*)(
const QString&)
>(&QSignalMapper::mapped),
this, &QmitkPatientTableInspector::OnNodeButtonClicked);
144 connect(m_Controls.imageNodeButton, &QRadioButton::clicked, nodeButtonSignalMapper, static_cast<
void(QSignalMapper::*)()>(&
QSignalMapper::map));
145 connect(m_Controls.segmentationNodeButton, &QRadioButton::clicked, nodeButtonSignalMapper, static_cast<
void(QSignalMapper::*)()>(&
QSignalMapper::map));
146 m_Controls.imageNodeButton->setChecked(
true);
149 connect(m_Controls.tableView, &QTableView::doubleClicked,
this, &QmitkPatientTableInspector::OnItemDoubleClicked);
152 void QmitkPatientTableInspector::keyPressEvent(QKeyEvent* e)
155 QModelIndex selectedIndex = m_Controls.tableView->currentIndex();
156 if (selectedIndex.isValid())
165 if (
nullptr == dataNode)
QAbstractItemView * GetView() override
itk::SmartPointer< T > Lock() const
void SetSelectionMode(SelectionMode mode) override
void SetDataStorage(mitk::DataStorage *dataStorage)
void SetCaseID(const mitk::SemanticTypes::CaseID &caseID)
Set the current case ID which is needed to access the semantic relations storage. ...
mitk::NodePredicateBase::ConstPointer m_NodePredicate
void Initialize() override
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
void SetNodeType(const std::string &nodeType)
end override
QItemSelectionModel * GetSelectionModel()
void CurrentSelectionChanged(NodeList nodes)
A signal that will be emitted if the selected node has changed.
void SetCurrentSelection(NodeList selectedNodes)
Transform a list of data nodes into a model selection and set this as a new selection of the selectio...
bool IsExpired() const noexcept
QmitkPatientTableInspector(QWidget *parent=nullptr)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void OnNodeRemoved(const mitk::DataNode *)
void SetCaseID(const mitk::SemanticTypes::CaseID &caseID) override
Extends the abstract base class to allow setting the current case ID which is needed to access the se...
void SetLesion(const mitk::SemanticTypes::Lesion &lesion) override
Extends the abstract base class to allow setting the current lesion. The function sets the lesion in ...
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map(const InputImageType *input, const RegistrationType *registration, bool throwOnOutOfInputAreaError=false, const double &paddingValue=0, const ResultImageGeometryType *resultGeometry=nullptr, bool throwOnMappingError=true, const double &errorValue=0, mitk::ImageMappingInterpolator::Type interpolatorType=mitk::ImageMappingInterpolator::Linear)
void SetLesion(const mitk::SemanticTypes::Lesion &lesion)
Set the current lesion which can be used to show on which images the lesion is visible.
void OnContextMenuRequested(const QPoint &)
void DataNodeDoubleClicked(const mitk::DataNode *)
QAbstractItemView::SelectionMode SelectionMode
SelectionMode GetSelectionMode() const override
std::unique_ptr< QmitkModelViewSelectionConnector > m_Connector
void SetNodePredicate(const mitk::NodePredicateBase *nodePredicate)
const mitk::SemanticTypes::Lesion & GetLesion() const
The QmitkPatientTableModel is a subclass of the QmitkAbstractSemanticRelationsStorageModel and holds ...
Class for nodes of the DataTree.