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

Update DICOM display fields on removal #964

Open
cpinter opened this issue Apr 28, 2021 · 0 comments
Open

Update DICOM display fields on removal #964

cpinter opened this issue Apr 28, 2021 · 0 comments
Labels

Comments

@cpinter
Copy link
Member

cpinter commented Apr 28, 2021

Currently display fields are only updated on insertion of new datasets, but it would be important to also do it upon deletion. Fields that are "multi-instance" (i.e. not only related to a single instance but to a wider neighborhood such as number of images in series, last study date, etc.).

This is how these "multi-instance" roles work in the current version:

  1. Get instances where the DisplayedFieldsUpdatedTimestamp is NULL
  2. Reset container in role that stores the UIDs of the affected level that belong to the instances involved in the update. E.g. in the ctkDICOMDisplayedFieldGeneratorStudyNumberOfSeries class it is the set called UpdatedStudyInstanceUIDs.
  3. For each instance to update, get the UID of the affected level and extend the set if needed. E.g. get study instance UID for the instance and insert to the UpdatedStudyInstanceUIDs set.
  4. In the endUpdate function do an SQL query for the affected level and update the displayed field map accordingly. E.g. for each study stored in UpdatedStudyInstanceUIDs, get count of series in the study, and set the new DisplayedNumberOfSeries value in the study displayed fields map.

So what differs in case of removal:

  • Instead of using the DisplayedFieldsUpdatedTimestamp, we need to collect the instances that are being removed, and do steps 2 and 3 before the removal
  • Do step 4 after the removal

This is a considerable change, so a simple modification of the updateDisplayedFields function is not enough. One solution could be to simply add 2 and 3 in the beginning and 4 at the end of the ctkDICOMDatabase::removeSeries function. It would be some code duplication though, and also the start/end functions would be done for each series even if a study or patient is removed (so slower than the optimal, but probably not noticable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants