Here we describe the complete example available in the Example directory.
The example uses a gui generated with Qt Designer.
We define a class called Dicom (why not ?) that will embed QtDcm widgets.
Let's take a look at the constructor:
Now let's detail the constructor:
First we instanciate the gui objects.
Then we set the settings file of qtdcm that will be used to initialize the QtDcmPreferences object.
Then we give QtDcmManager the pointers to the specific widgets: QtDcm, QtDcmSerieInfoWidget, QtDcmPreviewWidget and QtDcmImportWidget.
Finally, we configure the manager to set the output directory (for conversion to nifti) using a QFileDialog box. The other mode available is QtDcmManager::CUSTOM
Now let's detail the class slots. I think we are ok with the initConnection() method.
The Dicom::openDicomdir() slot is very simple because we directly call the method QtDcm::openDicomdir(). The dicomdir path can be set manually using QtDcmManager::setDicomdir() and the dicomdir can be loaded using QtDcm::loadPatientsFromDicomdir()
The Dicom::exportSerie() slot is also very simple. We directly use the QtDcmManager::importSelectedSeries()
Finally the Dicom::preferences() slot displays a QDialog for setting the application preferences. The called method is QtDcm::editPreferences(). It is also possible to set the preferences from an embedded widget, see QtDcmPreferencesWidget, QtDcmLocalDicomSettingsWidget and QtDcmServersDicomSettingsWidget classes.