Closed naterichman closed 5 days ago
Thank you very much for reporting! It's hard to suggest the right approach here, but the the first erroneous output suggests that the Find SCU is reading a command data set with the wrong transfer syntax. I assumed that a command part of the response would always be in implicit VR LE, but maybe more erroneous assumptions are at play.
I'm not sure the best way to implement that change, I can't quite understand from the standard whether there are limits on the number of PDVs within a PDU or if there might be a different number for different statuses/mismatch of commands/datasets, etc. Seems like there can be a ton of combinations...
It's true that a PDU can contain multiple P-Data values. Though I would expect responses to be in command data set / (main) data set pairs, I'd better consult some references before saying anything else.
Yea I've been trying to read up as much as I can from the standard and consult the pydicom codebase (since I'm familiar), The approach there seems to be similar to the PDataReader
in that it stores a buffer and extends the buffer with each PDV
, then returns a tuple of (<command set>, <data set>)
which I think might be a decent approach to modifying PDataReader
.
Also you can disregard my # 1 above
The SeriesInstanceUID is not present even though I requested it in the query (I also tried -q SeriesInstanceUID= and a couple other variants) even though it is returned when I use DCMTKs findscu (see below),
This was user error passing in the wrong QueryRetrieveLevel
I've been dipping my toes into learning dimse by trying to write my own custom connector to a real pacs system, mostly using the code from
findscu
as a template. I found that my code wasn't working and I trieddicom-findscu
itself and that also had strange behavior, whereas DCMTKsfindscu
returned immediately.(the pacs is not my own system so I'm redacting everything just to be safe)
I ended up finding during debugging that the dataset was included in the same
PDU
as anotherPDataValue
(I think I'm using these terms correctly), so I changed the code as follows:And now the same
dicom-findscu
command returns as such:This certainly looks better and noticeably the command doesn't hang indefinitely. I think it was hanging because the subsequent call to
scu.receive_pdata()
when the status was pending was consuming the next command that actually returned the status of 0.There are still a couple issues with the output from this modified code:
SeriesInstanceUID
is not present even though I requested it in the query (I also tried-q SeriesInstanceUID=
and a couple other variants) even though it is returned when I use DCMTKsfindscu
(see below),Match #1 command
Anyway, just wanted to report this, I'm not sure the best way to implement that change, I can't quite understand from the standard whether there are limits on the number of PDVs within a PDU or if there might be a different number for different statuses/mismatch of commands/datasets, etc. Seems like there can be a ton of combinations...
findscu
for same dataset: