knopkem / dicom-dimse-native Goto Github PK
View Code? Open in Web Editor NEWnode js native addon for dimse services
License: Other
node js native addon for dimse services
License: Other
I am trying to use this module in a Vue3 + Vuex + Electron project. My problem is that I can't import it and use it. All I am trying to do is a C-ECHO from my app.
Can I get some advice please on this?
If I go into the node_modules\dicom-dimse-native and run "npm run example:echoscu" I am able to see that it is working and see results. So basically running the echoscu.ts file works fine.
In my app i am trying to do the following:
The problem is that it fails to load the module. I have googled and tried many things but no success.
It is the first time when I use this kind of module that uses c++ and I know I am doing something wrong here. Anything that could help me use it would be highly appreciated.
Thank you
I would like to be able to capture the dimse output in my code.
currently its being sent to stdout which could be captured of course but makes it messy.
I would prefer getting the output as an object with the results.
it would be great if that could be added.
Hi
Test the modality worklist database server failed. Can the later version integrate this server?Thanks!
Hi, I did some tests and it works well ... congratulations ...
Is there a way to use fork child process for each association to use multi-process options?
Hi,
I have a very strange issue, when running dicom-dimse-native on linux; the PN attributes are incorrectly encoded in the JSON message.
We have an array too much in the Value.
Example result:
[ { "00080052": { "Value": [ "STUDY" ], "vr": "CS" }, "00100010": { "Value": [ [ { "Alphabetic": "Vannieuwenhuyze^Nico" } ] ], "vr": "PN" }, "00100020": { "Value": [ "7406121003" ], "vr": "LO" } } ]
It is caused by the statement below on line 270 in FindAsyncWorker.cc - https://github.com/knopkem/dicom-dimse-native/blob/master/src/FindAsyncWorker.cc
jsonValue.push_back({json{{"Alphabetic", value}}});
when modified to "jsonValue.push_back(json{{"Alphabetic", value}});" the result is OK, but I don't know if this has any other impact ?
Thanks for your feedback !
Best Regards
Nico
ps: also interested in the dcmtk upgrade to 3.6.7 (which includes also the functionality to encode as JSON)
Do you have any problems with CPU? I simple start my storeScp with some options and my CPU goes to 100%.
Here is my code:
const StoreScpOptions: storeScpOptions = {
source: {
aet: AppService.getInstance().loggedBeeRadsBox.pacsConfig.aeTitle,
ip: '127.0.0.1',
port: AppService.getInstance().loggedBeeRadsBox.pacsConfig.port,
},
peers: [
{
aet: AppService.getInstance().loggedBeeRadsBox.pacsConfig.aeTitle,
ip: '127.0.0.1',
port: AppService.getInstance().loggedBeeRadsBox.pacsConfig.port + 1,
}
],
storagePath: './',
netTransferPrefer: '1.2.840.10008.1.2.4.80', // preferred network transfer syntax (accepted ts - additional to default ts)
netTransferPropose: '1.2.840.10008.1.2.4.80', // proposed network transfer syntax (for outgoing associations - additional to default ts)
writeTransfer: '', // write transfer syntax (storage only, recompress on the fly), keep empty (or leave out) to store ts as original
permissive: false, // if true any AET can perform FIND,GET and STORE
verbose: false,
storeOnly: true, // do not provide FindSCP and MoveSCP (requires db) only StoreSCP
writeFile: false, // do not write file to disk, send via buffer as base64 in response (only taken into account when storeOnly is true)
}
// StoreSCP que aguarda recebimento das imagens
startStoreScp(StoreScpOptions, async (result) => {
console.log('result', {result});
})
Using the storeScu example with a DICOM-SEG file results in the following error:
I: ======================= END A-ASSOCIATE-AC ======================
I: Association Accepted (Max Send PDV: 16372)
I: Sending file: Slicer/tumor_User1_Manual_Trial1.dcm
D: DcmDataDictionary: Loading file: /usr/local/share/dcmtk/dicom.dic
D: DcmMetaInfo::checkAndReadPreamble() TransferSyntax="Little Endian Explicit"
D: DcmDataset::read() TransferSyntax="Little Endian Explicit"
E: No presentation context for: (SG) 1.2.840.10008.5.1.4.1.1.66.4
I: C-Store progress: 100
E: 0006:0208 DIMSE No valid Presentation Context ID
The same error is returned when I use the command line storescu
from DCMTK but it can be solved by adding the "unknown" presentation context (1.2.840.10008.5.1.4.1.1.66.4) in the config file used, as described here. Or just use dcmsend
How we can do the same with this package?
Thank you so much!
I have used this library in linux x64 without problems, but now I'm working in a macbook air with apple silicon, so the architechture is darwin-arm64 and I didn't find any binaries for this target. I tried to compile to the code using cmake and gcc/g++ but it didn't work and the error trace is very large to post it here. Is there any possibility to have a binary for this target, or do you have any advice to compile it?
There's no easy way to unref or cancel async workers such as startStoreScp. While shutDownSCU exists, it only works if storeOnly is false. Is there a better way to exit all dcmtk workers on exit?
I tried the demo code
const dimse = require('dicom-dimse-native');
dimse.startScp(JSON.stringify({
"source": {
"aet": "IMEBRA",
"ip" : "0.0.0.0",
"port": "9999"
},
"storagePath": "./data"
}), (result) => {
try {
console.log(`scp: `, JSON.parse(result));
} catch (e) {
console.log(`scp: `, e);
}
});
It received dicom through C-STORE correctly. However, the callback wasn't called. (nothing printed)
Any idea?
node v10.19.0
macOS 10.15.4
When the Scp is initiated with multiple peers, it seems impossible to run the shutdownScp command whatever target is used. It runs fine when only 1 peer is used in the startScp though.
when i use this module on electron-vue
i have installed dicom-dimse-native module, but got an error when i 'require('dicom-dimse-native')'.
----------error:
vue.esm.js?efeb:1897 Error: Invalid access to memory location.
\?.../node_modules\dicom-dimse-native\build\Release\dcmtk.node
I need print dcm | png to dicom camera,Does this library support it?
Hi,
It would be nice to know how to turn off the console when StoreScp is receiving dicom files. It runs really slow as well. Thanks!
.....
cmFileFormat::checkMetaHeaderValue() use SOPInstanceUID [1.3.12.2.1107.5.1.4.91007.3000002208022330229870002387991] from Dataset
D: DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [Little Endian Explicit] on writing following Dataset
D: DcmFileFormat::validateMetaInfo() found 7 Elements in DcmMetaInfo 'metinf'
D: DcmFileFormat::checkMetaHeaderValue() Version of MetaHeader is ok: 0x0001
D: DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [Little Endian Explicit] on writing following Dataset
D: DcmFileFormat::validateMetaInfo() found 7 Elements in DcmMetaInfo 'metinf'
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
D: DcmDataset::read() TransferSyntax="Little Endian Explicit"
D: DcmFileFormat::checkMetaHeaderValue() Version of MetaHeader is ok: 0x0001
D: DcmFileFormat::checkMetaHeaderValue() use SOPClassUID [1.2.840.10008.5.1.4.1.1.2] from Dataset
D: DcmFileFormat::checkMetaHeaderValue() use SOPInstanceUID [1.3.12.2.1107.5.1.4.91007.3000002208022330229870002392191] from Dataset
D: DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [Little Endian Explicit] on writing following Dataset
D: DcmFileFormat::validateMetaInfo() found 7 Elements in DcmMetaInfo 'metinf'
D: DcmFileFormat::checkMetaHeaderValue() Version of MetaHeader is ok: 0x0001
D: DcmFileFormat::checkMetaHeaderValue() use new TransferSyntaxUID [Little Endian Explicit] on writing following Dataset
D: DcmFileFormat::validateMetaInfo() found 7 Elements in DcmMetaInfo 'metinf'
D: DcmDataset::read() TransferSyntax="Little Endian Implicit"
Hi,
Is there anyway to setup multiple accept transfer syntax or accept all? Thanks!
I think it's in this library, as it doesn't do it when I use other libraries.
The two UIDs should always be identical. Not sure whether it's supposed to change at all, but I don't think so?
As you know, normally I'd fix bugs myself, but I don't know C++ :)
Hi guys,
I've just started to use this cool module, and I've been trying to query patients from a local ConQuest server.
The responses were always empty when I set the '0008,0052' tag to 'PATIENT' and I haven't understand why.
After testing the pynetdicom library, and finding that the same query there did return me the expected results, I looked here where is the RootQuery model is set. (In conquest, no matter what tags I've put in the query, it always logged 'StudyRootQuery')
Then, I noticed that in the 'FindAsyncWorker.cc' file you set the UID_FINDStudyRootQueryRetrieveInformationModel hardcoded, so it isn't possible to change it in order to perform PatientRootQuery.
Have I missed something?
Thanks from advance !!!!!
npm run example:[echoscu|findscu|getscu|movescu|storescu|storescp] error
C:\dicom-dimse-native>npm run example:[echoscu|findscu|getscu|movescu|storescu|storescp]
'findscu' is not recognized as an internal or external command,
operable program or batch file.
HI, I'm runing a simple storescp, almost like the one in the example
''
const dimse = require('dicom-dimse-native')
dimse.startScp(JSON.stringify(
{
"source": {
"aet": "LOCALAET",
"ip" : "192.168.1.X",
"port": "8080"
},
"storagePath": "./data"
}
), (result) => {
if (result && result.length > 0) {
try
{
console.log(JSON.parse(result));
}
catch (e) {
console.log(e, result);
}
}
});
But any operation made to this prints in the console:
DIMSE failure (aborting association): Data dictionary missing
I even have dcmtk globally installed with the $DCM_DICT_DEFAULT_PATH
set to the global .dic file
What am I missing?
How I can compile the project c++ again?
I am trying but don't have success.
I am using cmake
Hi,
What could be the reason for " Refusing Association (TooManyAssociations)" ,Node js on ubuntu 20.
this happens only on the 4th or 5th study and give error in dul , all the other studies -no problem.
Thanks! (v2.4.0 -)
Thanks for great work!
Just wondering how to set other network options available in DCMTK, for example proposed or preferred transfer syntaxes.
In my case I have an error on moveScu which sends message
unable to convert dataset from 'RLE Lossless' transfer syntax to 'Little Endian Explicit'
I believe setting some options will allow this kind of problems to be solved.
The library doesn't work on a Mac with M1 chip. Is there a way that I can configure it to work?
Hello,
How to stop SCP without killing the parent process?
update to 1.0.0, start a scp callback func will not be triggered
What is the DCMTK version used in this library? Also, is it kept up to date?
Hi,
I would like to use your package, but would like to avoid having to install g++ in our container to compile it. Would you consider adding an Alpine linux (musl) pre-built binary?
[email protected] install /usr/src/app/node_modules/dicom-dimse-native
prebuild-install -r napi || cmake-js compile
prebuild-install WARN install No prebuilt binaries found (target=4 runtime=napi arch=x64 libc=musl platform=linux)
[
'/usr/local/bin/node',
'/usr/src/app/node_modules/.bin/cmake-js',
'compile'
]
ERR! OMG C++ Compiler toolset is not available. Install proper compiler toolset with your package manager, eg. 'sudo apt-get install g++'.
Error: "a dynamic link library (dll) initialization routine failed with electron" with electron project
nodeJs: v12.18.3, electron: v15.3.0
Hi! Is there any way to get any errors that occur?
Currently when I run findScu with a server that doesn't exist, the response is this:
{
code: 0,
container: null,
message: 'request succeeded',
status: 'success'
}
In stdout it logs this:
E: Association Rejected:
E: Result: Rejected Permanent, Source: Service User
E: Reason: Called AE Title Not Recognized
However, the response I get in the callback is the same as if there were just no studies, not that there was an error with the request.
Thanks!
Try to send this file to scp.dicom file
Hi, really appreciate your effort on this project, it is great and easy to use.
I saw in storeScp there is an option to send via buffer as base64(writeFile = false),
just wonder is there a way to send this base64 buffer through storeScu?
Thanks so much for the help!
When running c-get it appears the callback is being called when the dicoms are still being written to disc
Is this correct behavior or is it a bug
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.