dicomweb-server icon indicating copy to clipboard operation
dicomweb-server copied to clipboard

make a dimse back end

Open pieper opened this issue 4 years ago • 6 comments

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).

pieper avatar Aug 28 '19 17:08 pieper

I'm looking forward this!

lam0620 avatar Oct 21 '19 06:10 lam0620

@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.

MichaelLeeHobbs avatar Jan 26 '20 21:01 MichaelLeeHobbs

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.

pieper avatar Jan 27 '20 19:01 pieper

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.

knopkem avatar Apr 03 '20 09:04 knopkem

Looks excellent @knopkem 👍

pieper avatar Apr 03 '20 12:04 pieper

It's done. Have fun.

knopkem avatar Apr 06 '20 05:04 knopkem