This isn’t directly related to Orthanc, but could be a nice addition for a Python Plug-in.
Radiant has a tool that allows one run the Radiant Viewer from a USB with an
unzipped Archive folder added to the package that they supply here:
https://www.radiantviewer.com/dicom-viewer-manual/recording-dicom-cd_dvd.html
It requires a license, but it does run with a watermark without one.
It is apparently possible to override the Archive Downloading in a Python Plug-in Script
with something like that shown below. There is some stuff for logging included, but that could be ignored (bold).
I’m not very experienced with manipulating .zip archives in Python, but it seems like
there should be a way to:
-
Create a ‘blank’ .zip in memory.
-
Add the unzipped Radiant package to the new .zip Archive.
-
Add the Study .zip to the new .zip Archive.
-
Return the new .zip archive that has the Radiant Viewer and the Study .zip.
Unzipping the new download would have the Radiant Viewer files and the Study .zip at the root of the unzipped Radiant Folder. The Study has to actually be unzipped (I think) in order for the Viewer to work, and it has to be run from a USB/CD.
The idea would be to create an archive that could very easily allow one to use the
Radiant Viewer as an embedded viewer when downloading study Archives.
There is a reference on SO that has some suggestions about how to do that ?
https://stackoverflow.com/questions/2463770/python-in-memory-zip-library
Intercept native method to enable logging, .zip archive
def OnDownloadStudyArchive(output, uri, **request):
host = “Not Defined”
userprofilejwt = “Not Defined”
if “headers” in request and “host” in request[‘headers’]:
host = request[‘headers’][‘host’]
if “headers” in request and “userprofilejwt” in request[‘headers’]:
userprofilejwt = request[‘headers’][‘userprofilejwt’]
logging.info(“STUDY|DOWNLOAD_ARCHIVE|ID=” + request[‘groups’][0] + " HOST=" + host + " PROFILE= " + userprofilejwt)
archive = orthanc.RestApiGet(uri)
output.AnswerBuffer(archive, ‘application/zip’)
orthanc.RegisterRestCallback(‘/studies/(.*)/archive’, OnDownloadStudyArchive)
Just wondering if anyone has experience with that sort of thing and if that seems feasible.
Stephen D. Scotti