dicomweb-server
dicomweb-server copied to clipboard
make a dimse back end
From time to time people ask about using viewers like OHIF with a traditional (non-DICOMweb) PACS. It would be conceivable to implement this in dicomweb-server if someone had enough motivation.
One possible implementation could be to build a bridge to dcmtk or other native toolkit (e.g. like https://github.com/jmhmd/dcmtk-node) or to use the pure javascript code (https://github.com/OHIF/dicom-dimse).
I'm looking forward this!
@pieper Not entirely sure what you are looking for. We have a few items that we have built the may be useful.
For starters, I have a node:12.8.0-alpine container that has dcmtk-3.6-4 built inside. https://github.com/MichaelLeeHobbs/nodejs-dcmtk
Additionally, I have the beginnings of a node dcmtk library. So far it really only has what we needed. If you are interested I will check that I can release it into open source.
For example
const {exec} = require('child_process')
const {DICOM_EVENTS} = require('./dicomEvents')
async function dcmsend({dcmtkPath, ip, port, file, timeOut = 30, aec, aet}) {
return new Promise((resolve, reject) => {
let command = `${dcmtkPath}/dcmsend -v --no-uid-checks -pdu 131072 --max-send-pdu 131072 +sd +r +rd ${aec ? `-aec ${aec}` : ''} ${aet ? `-aet ${aet}` : ''} -to ${timeOut} -nh ${ip} ${port} "${file}"`
exec(command, (err, stdout, stderr) => (err) ?
reject({event: DICOM_EVENTS.DICOM_SEND_FAILED, err, stdout, stderr, message: 'dcmsend failed'}) :
resolve({event: DICOM_EVENTS.DICOM_SEND_SUCCESS, stdout, stderr, message: 'dcmsend success'}))
})
}
module.exports = dcmsend
The code thus far is very solid but it does need some refactoring for hard code values. The event symbols need a refactor as well to fix a lack of consistency.
Thanks @MichaelLeeHobbs - this does look useful.
@emelalkim has been working on this branch and the basics are working but there is definitely more to do.
This might be what you want: https://www.npmjs.com/package/dicomweb-proxy The backend is using nan native plugin: https://www.npmjs.com/package/dicom-dimse-native using Imebra (hence the GPL license) but I'm changing it to use dcmtk and switch to MIT license.
Looks excellent @knopkem 👍
It's done. Have fun.