Hi, I have a question regarding storing non-DICOM files e.g. JPEGs/PNGs in Orthanc. What’s the current best approach for that in your experience? I would like to upload JPGs via Orthanc’s API. Is creating DICOM from scratch (e.g. via PyDicom) the way to go? If yes, do you have a reference to what kind of metatags/structure is required for Orthanc to accept the file?
For the file to be accepted by Orthanc, you’ll need to have at least all 4 Dicom Ids set (https://book.orthanc-server.com/faq/orthanc-ids.html) but it’s recommended to include as many tags as possible (like Study/Series Description, PatientName, Modality, pixelSpacings, …)
Pydicom does work for this - I don’t see a good example for making secondary capture images on the web. But once you’ve created your *.dcm file you should try validating it using Dave Clunie’s dciovfy tool (http://www.dclunie.com/dicom3tools/dciodvfy.html). In the last few weeks I’ve had two different unexpected glitches with missing fields in the DICOM headers
OHIF wouldn’t display on its study list a study which was missing StudyDate - the image had been mangled by an anonymization tool
The dcmqi tool for generating DICOM seg wouldn’t work when StudyId (not the StudyInstanceUID - a different field) was missing. It’s a type 2 field (it can be empty - but it must be present).
If the image loads into Osirix you can look at the output of the validation button on the metadata page - this might be more convenient than invoking dciovfy directly.
Thank you guys for help. I was able to create minimalistic DICOM with Pydicom and store it in Orthanc. Thanks Sean for the suggestion regarding OHIF: right now I’m working with base cornerstone, but I will keep that in mind. I did not know about dciovfy – will look into this as well.
Because I don’t think there is a working example of making DICOM from scratch in Python (that would be store-able in Orthanc) on the web so far, let me leave the code snippet for future reference. Maybe someone will find it useful.
Please be more specific, otherwise nobody will be able to answer your question. From what I read in the previous messages, this thread concerns pydicom and OHIF, so your questions should be redirected to those respective communities.
If your question is related to the generation of DICOM instances embedding PDF files using the REST API of Orthanc, this is explained in the Orthanc Book.
I ended up creating a topic, but I have already managed to work around my issue. I’m finalizing the documentation and will soon post the solution in the mentioned topic.
If the approval of the solution and documentation is required, I will be happy to share it with you and your team in advance.
I sincerely appreciate all the help provided by the team, the community, and of course, the Orthanc Book with all its detailed information.