Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add remove signal to DICOM browser #1164

Conversation

cpoetteCertis
Copy link
Contributor

In order to fix slicer's bug described in the following link:

Slicer/Slicer#7290

It is necessary to emit a signal when removing series from DICOM database

Copy link
Member

@lassoan lassoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing the few trivial issues (see comments inline), this pull request looks OK to me.

To fix the issue in Slicer, it is probably better not to rely on these signals (you can only hope that items are only deleted via removePatient/Study/Series methods of a specific database object). Instead, you may want to connect to the databaseChanged signal, which is emitted even when the database is changed via another connection.

These signals can be still useful for in-memory databases and maybe also also for getting notifications faster (caching may delay changes on disk).

@@ -3014,6 +3014,8 @@ bool ctkDICOMDatabase::removeSeries(const QString& seriesInstanceUID, bool clear

d->resetLastInsertedValues();

emit seriesRemoved();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add seriesInstanceUID


if(result)
{
emit studyRemoved();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add studyInstanceUID


if(result)
{
emit patientRemoved();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add patientID

@@ -430,6 +430,15 @@ class CTK_DICOM_CORE_EXPORT ctkDICOMDatabase : public QObject
/// - instanceUID (unique)
void instanceAdded(QString);

/// This signal is emitted when a patient is removed from CTK database.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This signal will not be triggered when a patient is removed from the database. It will only be triggered if it is deleted by calling removePatient method on this object. Unless it is an in-memory database, the database can be simultaneously accessed from via several ctkDICOMDatabase objects in the same process or other processes, so not all deletions will trigger these signals. Update the method documentation to make this clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifications done

@cpoetteCertis cpoetteCertis force-pushed the cpoette/add-remove-signal-to-dicom-browser branch from 078744f to 013d9a4 Compare January 12, 2024 10:55
@Punzo
Copy link
Contributor

Punzo commented Jan 16, 2024

@cpoetteCertis thanks for the contributions. Adding the signals makes sense. @jcfr it could make sense to add this commit 013d9a4 to #1165 as well

@jcfr
Copy link
Member

jcfr commented Jan 17, 2024

Adding the signals makes sense.

The commit can indeed be cherry-picked cleanly and it has been integrated.

@jcfr
Copy link
Member

jcfr commented Jan 18, 2024

Closing. This is superseded by #1183

@jcfr jcfr closed this Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants