Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSelectXnatUploadDestinationDialog Class Reference

Dialog for selecting an upload destination on an XNAT server. More...

#include <QmitkSelectXnatUploadDestinationDialog.h>

Inheritance diagram for QmitkSelectXnatUploadDestinationDialog:
Collaboration diagram for QmitkSelectXnatUploadDestinationDialog:

Public Member Functions

 QmitkSelectXnatUploadDestinationDialog (ctkXnatSession *session, const QStringList &availableResources, QWidget *parent=nullptr)
 Construct the upload destination dialog. More...
 
 ~QmitkSelectXnatUploadDestinationDialog () override
 Destructor. More...
 
ctkXnatObject * GetUploadDestination ()
 Retrieve the selected upload destination as an XNAT object. More...
 
void SetXnatResourceFolderUrl (const QString &url)
 Set the XNAT resource folder URL used when creating a new resource. More...
 

Protected Slots

void OnUpload ()
 Slot called when the user clicks the Upload button. Accepts the dialog. More...
 
void OnSelectResource (bool selectResource)
 Slot called when the "Select Resource" radio button is toggled. More...
 
void OnSelectFromTreeView (bool selectFromTreeView)
 Slot called when the "Select From Tree View" radio button is toggled. More...
 
void OnResourceEntered (const QString &resourceEntered)
 Slot called when the user types a new resource folder name. More...
 
void OnResourceSelected (const QString &resource)
 Slot called when an existing resource is selected from the combo box. More...
 
void OnXnatNodeSelected (const QModelIndex &index)
 Slot called when an XNAT node is selected in the tree view. More...
 
void OnCancel ()
 Slot called when the user clicks the Cancel button. Rejects the dialog. More...
 

Detailed Description

Dialog for selecting an upload destination on an XNAT server.

QmitkSelectXnatUploadDestinationDialog provides a user interface for choosing where to upload data on an XNAT server. The user can either select an existing resource from a combo box, create a new resource folder by entering a name, or browse the XNAT hierarchy using a tree view to pick a destination.

The dialog populates a tree model from the given XNAT session and offers radio buttons to toggle between resource selection mode and tree-based browsing mode.

See also
QmitkXnatTreeModel, QmitkXnatUploadFromDataStorageDialog, ctkXnatSession

Definition at line 44 of file QmitkSelectXnatUploadDestinationDialog.h.

Constructor & Destructor Documentation

◆ QmitkSelectXnatUploadDestinationDialog()

QmitkSelectXnatUploadDestinationDialog::QmitkSelectXnatUploadDestinationDialog ( ctkXnatSession *  session,
const QStringList &  availableResources,
QWidget *  parent = nullptr 
)
explicit

Construct the upload destination dialog.

Initializes the tree model from the given XNAT session and populates the resource combo box with the available resource names. If no resources are available, the dialog defaults to tree view selection mode.

Parameters
[in]sessionThe active XNAT session to browse.
[in]availableResourcesList of existing resource folder names to offer for selection.
[in]parentOptional parent widget.

◆ ~QmitkSelectXnatUploadDestinationDialog()

QmitkSelectXnatUploadDestinationDialog::~QmitkSelectXnatUploadDestinationDialog ( )
override

Destructor.

Member Function Documentation

◆ GetUploadDestination()

ctkXnatObject* QmitkSelectXnatUploadDestinationDialog::GetUploadDestination ( )

Retrieve the selected upload destination as an XNAT object.

If the user selected or created a resource via the combo box, a new ctkXnatResource is created (and saved to the server if it does not exist yet) under the object identified by the resource folder URL. If the user selected a node from the tree view, the corresponding ctkXnatObject is returned directly.

Returns
Pointer to the ctkXnatObject representing the chosen upload destination.
Precondition
The dialog has been accepted (i.e., the user clicked Upload).

◆ OnCancel

void QmitkSelectXnatUploadDestinationDialog::OnCancel ( )
protectedslot

Slot called when the user clicks the Cancel button. Rejects the dialog.

◆ OnResourceEntered

void QmitkSelectXnatUploadDestinationDialog::OnResourceEntered ( const QString &  resourceEntered)
protectedslot

Slot called when the user types a new resource folder name.

Parameters
[in]resourceEnteredThe text entered by the user as a new resource folder name.

◆ OnResourceSelected

void QmitkSelectXnatUploadDestinationDialog::OnResourceSelected ( const QString &  resource)
protectedslot

Slot called when an existing resource is selected from the combo box.

Parameters
[in]resourceThe name of the selected resource, or "Create new resource folder..." to switch to name entry mode.

◆ OnSelectFromTreeView

void QmitkSelectXnatUploadDestinationDialog::OnSelectFromTreeView ( bool  selectFromTreeView)
protectedslot

Slot called when the "Select From Tree View" radio button is toggled.

Parameters
[in]selectFromTreeViewtrue if the tree view browsing mode is selected.

◆ OnSelectResource

void QmitkSelectXnatUploadDestinationDialog::OnSelectResource ( bool  selectResource)
protectedslot

Slot called when the "Select Resource" radio button is toggled.

Parameters
[in]selectResourcetrue if the resource combo box mode is selected.

◆ OnUpload

void QmitkSelectXnatUploadDestinationDialog::OnUpload ( )
protectedslot

Slot called when the user clicks the Upload button. Accepts the dialog.

◆ OnXnatNodeSelected

void QmitkSelectXnatUploadDestinationDialog::OnXnatNodeSelected ( const QModelIndex &  index)
protectedslot

Slot called when an XNAT node is selected in the tree view.

Enables the Upload button only if the selected node is a ctkXnatResource.

Parameters
[in]indexThe model index of the selected tree node.

◆ SetXnatResourceFolderUrl()

void QmitkSelectXnatUploadDestinationDialog::SetXnatResourceFolderUrl ( const QString &  url)

Set the XNAT resource folder URL used when creating a new resource.

This URL identifies the parent XNAT object under which a new resource folder will be created if the user opts to create one via the combo box.

Parameters
[in]urlThe XNAT REST URL of the resource folder parent.

The documentation for this class was generated from the following file: