-
Notifications
You must be signed in to change notification settings - Fork 245
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
Add PACS Connector extension #1787
base: main
Are you sure you want to change the base?
Conversation
The demo CT dataset predefined in the extension disappeared over the weekend from the public server. |
Probably you need to start the test with uploading your test data set (if not available on the server already). |
I would like to show more information -> some DICOM tags (PatientName, PatientID, StudyDate ..) in the python console after performing just the query. Are these included in tempDb ? Tried to analyze tempDB with ``` tempDb = ctk.ctkDICOMDatabase() conn = sqlite3.connect(':memory:') for row in rows: #commit the changes to db This only gives error messages . |
Each You can access all data in the database using the ctkDICOMDatabase object. See some examples here. In the Query/Retrieve database we don't store references to files, we just store the database tables, so not all examples will work. |
I have not used this in a long time, but the way I recall it working is that the query populates a dicom dataset with the tags that you want to match on and returns all the matching entries. So the server may only return you the values that are specifically in the filter list, or maybe it returns some other tags too. I don't recall if you can specify other tags through the ctkDICOMQuery interface or only the ones exposed in the ctkDICOMQueryWidget. The API could be extended to handle that case if needed. |
List of queried fields are defined here: It could be nice to have an API to edit this list, maybe by adding the tags in the |
Thanks to you both again, I got this working by simply storing the query database locally in a temp dir and then using sqlite3. So cool to have splite3 available in python and Slicer. |
Updated the code and tested with GEPACS. Now, this becomes really helpful. |
Using low-level sqlite3 API breaks the encapsulation: exposes private implementation details that are subject to change at any time. It just means that your code can break anytime when we make internal changes. Was there anything that you could not accomplish with the CTK database class interface? |
I was not able to display the "Patients", "Studies" and "Series" tables in tempDb as well as not able to display all available column headers (tags). It is very interesting to experiment with the public database and check the inputs with all available tags. seriesForStudies in the ctkDICOMDatabase class returned empty sometimes, although there were series records in the tempDB table. And I was just happy to have the good old SQL available. If there are better ways to do this - any ideas welcome |
There are CTK table widgets that can display the contents of database tables, so it should not be necessary to create and manually populate generic table widgets.
Things may be more complex than you assume, due to differences between raw and displayed fields, but of course simple things like accessing list of patients, studies, etc. Should not be a problem. Can you share a code snippet that did not work as expected? |
Sure: (one commit down)
(see below) became true although there were series entries in the series table and the patient has study containing series
|
Can you also add code that you used to create tempDb? |
Yes:
Query parameters were: |
Sorry for keep asking, but I would need a complete script that I can copy-paste into Slicer's Python console. Please include everything - server name, etc. and no |
No problem, miraculously it works now on the public server, I will try in the hospital remotely
|
On the GEPACS I get the error: Patient and study detected, but no series for this patient and study available. although I queried a case with two studies and several series. Can´t test the public server from the hospital because the external network access is blocked and I get a "no results" error from my extension. |
Have you only received a single item in |
When I only put the correct patientID, I receive all the seven studies the patient has. When I additionally put "Lung" into series description, I just see that I still receive the seven studies, but (in SQL) I see that I only - correctly - get the two series that have a lung CT. That is possibly why I get this error, Will try to eliminate this and report back. |
I got it working like this
Will update github later .... Thank you for pointing that out ! |
This looks good. Those hardcoded Also note that dicomRetrieve stores the received series in the main database, not in tempDb and not all IDs are globally unique identifiers, so for example a patient ID that you get from tempDb are not transferable to the patientID in the main database. |
Ok interesting, thank you |
Was aware of the fact that I write to the main database - Why not transferable ? What would happen If I tried the transfer ? |
For example, PatientID is an auto-counter, which assigns simple integers to patients as IDs. These integers do not mean the same patients in For example:
Study and series ID's use DICOM universally unique identifiers StudyInstanceUID and SeriesInstanceUID, and therefore they are the same across all databases. Unfortunately, DICOM does not provide UUID for patients. |
Thanks Andras, all I can say is - relogged to our GEPACS to confirm - test cases in Slicers main database receive the correct GEPACS and hospitalwide patientID upon retrieve and repeated retrieve does not produce additional datasets in the main database |
"Patient ID" DICOM tag is different from the "PatientUID" database field. "Patient ID" may be anything (defined by the hospital) and is not guaranteed to uniquely identify a person (it may be just an internal ID used in the hospital). "PatientUID" database field is guaranteed to uniquely identify the patient, but only within the database. |
Good progress, I was able to use the code committed today for the en bloc retrieval of 15 cases from a GEPACS with seriesDescription="Lung". |
Question 2 was: Can I speed this up? But I withdraw the question :-) |
yes, that should be no problem. It probably should happen automatically but perhaps it was left in by mistake during debugging.
Did you withdraw because the current speed is fast enough? Our implementation is not optimized and there probably tricks that production systems used to speed things up, like overlapping network requests. Anyway glad things are basically working for you! |
Thanks Steve, that was a little irony after reading the Slicer on 25000 Mayo computers thread (which is highly interesting). A retrieval could be a bit faster, but basically no problem because if it is all nicely organized in the DICOM database after 90 min one can plan ahead. |
@rbumm Please check if files are left over if you use the GUI. If they are then please file a bug report, as only one instance should be kept of each file. |
@rbumm What is the status of this extension? |
This is working and I am using it from time to time if I need to batch retrieve DICOM data from our local PACS. The public test server access is functional. |
I checked this extension again and see that the output handling using the Python console is not very elegant. On the other hand, it is helpful for debugging and retrieving batch DICOM data. Any suggestions on what to do with this are welcome. If I invest time in a better query output - where should I put it? |
Before we cab move forward with the integration, I suggest you review and address the following issues: |
@Punzo is working on a new web browser that can query a remote server, show results along with thumbnails, and automatically retrieve data. Maybe it is worth for waiting for this browser to land in Slicer and then check if a separate extension is still needed or the features implemented in that can be integrated into this new browser. @Punzo It seems that this extension supports retrieving multiple patients (e.g., patients that are scheduled to be reviewed on that day), which we would be needed for the funding project, too. So, in addition to the automatic retrieve while browsing data in the currently selected patient, it should be possible to explicitly request retrieve of complete patient, studies, or series (they would be low-priority background tasks). |
we are currently testing the new browser and adding the last features. Probably it will take few more weeks to have a working PR (current branch at https://github.com/Punzo/CTK/tree/addDICOMVisualNavigation)
ok I will add this in my to do list |
@rbumm it would be nice if you could check if there are features in this extension that the new Visual DICOM Browser does not currently provide. We would then see if those features can be added to the Visual DICOM Browser or it is better if this extension provides those features. You can access the Visual DICOM Browser via the menu on the "Show DICOM browser" button in the DICOM browser. |
Dear Andras, I hope you are well. Unfortunately, I cannot test my extension anymore because I’m not I have no longer access to the hospital system and Dicom sources. But a thinkmy extension is no longer necessary. happy holidays. Best regards, Rudolf.Sent from my iPhoneOn 3. Dec 2024, at 07:16, Andras Lasso ***@***.***> wrote:
@rbumm it would be nice if you could check if there are features in this extension that the new Visual DICOM Browser does not currently provide. We would then see if those features can be added to the Visual DICOM Browser or it is better if this extension provides those features. You can access the Visual DICOM Browser via the menu on the "Show DICOM browser" button in the DICOM browser.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Please consider including the extension in the extension index.
It does only work in 4.13, does not in 4.11
Thank you !