View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003806||Slicer4||Module DICOM||public||2014-08-14 18:13||2018-06-01 23:58|
|Target Version||Slicer 4.9.0||Fixed in Version||Slicer 4.9.0|
|Summary||0003806: Imported DICOM file does not show up in widget under certain conditions|
Steps to reproduce:
@pieper says this is a CTK issue, but until reproduced in CTK, it's a Slicer bug
|Tags||No tags attached.|
Thanks for filing this Andrey and thanks Nicole for investigating. If debugging isn't leading anywhere, it would be great if you could create a small self test to replicate the issue. I think the ultimate solution is going to require single stepping through some of the ctkDICOMDatabase code, and that will be facilitated if we can easily get back to a known state.
Related bug fix for loading derived data:
Reproducible in Slicer as of Oct 10/14:
indexer = ctk.ctkDICOMIndexer() derivedItem = slicer.app.slicerHome + '/../../Slicer/Testing/Data/Input/CTHeadAxialDicom/CTHead1.dcm' indexer.addFile(slicer.dicomDatabase, derivedItem) # can see it. # click on it and remove it via gui indexer.addFile(slicer.dicomDatabase, derivedItem) # not seeing it in gui
Is this still an issue ?
Yes, I've just tried, and steps in the comment above by Nicole still result in the item not showing up in the DICOM browser GUI.
There is some logic in the ctkDICOMDatabase indexer that tries to optimize database insertions (it has caused issues before by over-optimizing in certain cases). it would be good to try a non-gui test program that operates directly at the ctk lib level and checks to see if the object is correctly inserted the second time. Nicole, let me know if you want to look at this together.
I've experienced this issue several times: once a patient is deleted, it does not show up in the DICOM browser, but it cannot be added again to the database. Probably data is only deleted at the patient and/or study level.
Workaround: delete the DICOM database directory or select a new database directory.
Workaround exists and the issue has been around for years, therefore it is not blocking.
I still believe that for many users who encounter this it will be a blocker. I think the assumption that every user who comes across a problem will ask for help on the email list is overly optimistic. I know people who are not newcomers in the field, but they will almost never contact forum. In any case, I don't think the assignment of the issue status has any effect on anything, so it is just a rant item really.
IDs of last inserted patient, study, series items were cached in the ctkDICOMDatabase to avoid re-inserting when adding each file instance. However, if this patient, study, or series are removed from the database, then their IDs have to be cleared to force adding them back to the database when adding a file instance. Clearing of IDs when items are deleted has been implemented in ctkDICOMDatabase. The problems is that an application may use multiple database connections (ctkDICOMDatabase instances) to connect to the same database, and delete items corresponding to the cached IDs.
Fixed the problem by deleting cached item IDs once, just before a batch of instances are inserted to the database.
To define what is the beginning and end of a "batch", startIndexing and endIndexing method was added to ctkDICOMIndexer. They are called automatically when any of the ctkDICOMIndexer::add...() methods is used. Start/end indexing methods are exposed on the public API as well so that applications can do multiple ctkDICOMIndexer::add...() calls in one batch.
Pull request of the fix was submitted: https://github.com/commontk/CTK/pull/807
How to test:
from DICOMLib import DICOMUtils indexer = ctk.ctkDICOMIndexer() derivedItem = slicer.app.slicerHome + '/../../Slicer/Testing/Data/Input/CTHeadAxialDicom/CTHead1.dcm' indexer.addFile(slicer.dicomDatabase, derivedItem) DICOMUtils.refreshDICOMWidget() # can see it. # click on it and remove it via gui indexer.addFile(slicer.dicomDatabase, derivedItem) DICOMUtils.refreshDICOMWidget() # can see it (problem fixed)
Thanks to @lassoan, this was fixed in http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=27228
For future reference, the corresponding PR was https://github.com/commontk/CTK/pull/807
|2014-08-14 18:13||fedorov||New Issue|
|2014-08-14 18:13||fedorov||Status||new => assigned|
|2014-08-14 18:13||fedorov||Assigned To||=> pieper|
|2014-08-14 18:13||fedorov||Severity||minor => block|
|2014-08-14 18:13||fedorov||Assigned To||pieper => nicole|
|2014-08-15 05:25||pieper||Note Added: 0012375|
|2014-10-14 07:39||nicole||Note Added: 0012616|
|2014-10-14 07:41||nicole||Note Added: 0012617|
|2015-11-12 15:18||jcfr||Note Added: 0013608|
|2015-11-12 15:18||jcfr||Status||assigned => feedback|
|2015-11-12 17:51||fedorov||Note Added: 0013611|
|2015-11-14 03:58||pieper||Note Added: 0013616|
|2017-06-10 00:18||lassoan||Note Added: 0014715|
|2017-06-10 00:18||lassoan||Severity||block => major|
|2017-06-10 00:18||lassoan||Note Added: 0014716|
|2017-06-10 14:36||jcfr||Priority||normal => low|
|2017-06-14 12:57||lassoan||Summary||Imported file does not show up in widget under certain conditions => Imported DICOM file does not show up in widget under certain conditions|
|2017-06-14 13:03||fedorov||Note Added: 0014836|
|2017-06-14 13:03||fedorov||Status||feedback => assigned|
|2018-05-30 14:30||lassoan||Note Edited: 0012617||View Revisions|
|2018-05-31 09:27||lassoan||Note Added: 0015860|
|2018-05-31 09:55||lassoan||Note Added: 0015861|
|2018-05-31 09:56||lassoan||Target Version||=> Slicer 4.9.0|
|2018-06-01 23:58||jcfr||Status||assigned => resolved|
|2018-06-01 23:58||jcfr||Resolution||open => fixed|
|2018-06-01 23:58||jcfr||Fixed in Version||=> Slicer 4.9.0|
|2018-06-01 23:58||jcfr||Note Added: 0015870|