DCMTK > find and store dicom files to local folder

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

DCMTK > find and store dicom files to local folder

#1 Post by smalltownghosts »

Currently using DCMTK to find studies in a database. next i need to be able to move those studies from the database to either a local folder (on my machine) or a fileshare.

i am able to find the study and write it to a file but, the MOVESCU bombs out with an error of "unknown option -od".

My code currently looks like this:

for /F %%X in (SIUIDS.txt) do ( findscu -S -k 0008,0052="STUDY" -k 0020,000D="%%X" --aetitle CODYPC --call SPECIFIC_AET 111.111.111.111 104> cfind.result

dump2dcm -v +E cfind.result cmove.dcm
movescu -v --move MOVESCU -od C:\DCMTK_LOCAL_STORE cmove.dcm

I was under the impression that the "-od" or "--output-directory" option would allow me to write to a folder.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#2 Post by J. Riesmeier »

First of all, you should check that the version of the movescu you use is not more than ten years old (option -od has been introduced back in November 2008). Then, you also have to specify option +P (--port) with the number of the port the movescu should listen on for incoming connection requests. Otherwise you get the following error message (with the most recent git version of the DCMTK):

Code: Select all

error: --output-directory only allowed with --port
By the way, why don't you use findscu with option -X (--extract)?

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#3 Post by smalltownghosts »

we are using version: dcmtk-3.6.3-win64-dynamic . it looks like this version came out in Feb of 2018

this code, STILL bombs with not recognizing "-od"
movescu -v -aec SPECIFIC_AET -aet test1 -od C:\DCMTK_LOCAL_STORE 111.111.111.112 128 cmove.dcm

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#4 Post by J. Riesmeier »

Then, option -od should be available (also see -h output).

Maybe, you could post your exact command line call and the error message you get.

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#5 Post by smalltownghosts »

here is the error:
I: reading dump file: cfind.result
E: dump2dcm: cfind.result: no Tag found (line 1)
E: dump2dcm: cfind.result: no Tag found (line 8)
E: 2 Errors found in cfind.result
I: writing DICOM file
W: output transfer syntax unknown, assuming --write-xfer-little
I: dump successfully converted
$dcmtk: movescu v1.0 2005-07-30 $

movescu: DICOM retrieve (C-MOVE) SCU
error: Unknown option -od

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#6 Post by J. Riesmeier »

Did you see this line?

Code: Select all

$dcmtk: movescu v1.0 2005-07-30 $

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#7 Post by smalltownghosts »

ha! just did. getting the newer version now!

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#8 Post by smalltownghosts »

ok, got the latest version. here is my code:

for /F %%X in (SIUIDS.txt) do (
findscu -S -k 0008,0052="STUDY" -k 0020,000D="%%X" --aetitle CODYPC --call AET_REP 111.111.111.111> cfind.result



dump2dcm -v +E cfind.result cmove.dcm
movescu -v -aet AET_REP -aec ANY-SCP 128 -od C:\DCMTK_LOCAL_STORE cmove.dcm

PAUSE
)

here is my new error:

I: reading dump file: cfind.result
E: dump2dcm: cfind.result: no Tag found (line 1)
E: dump2dcm: cfind.result: no Tag found (line 2)
E: dump2dcm: cfind.result: no Tag found (line 3)
E: dump2dcm: cfind.result: no Tag found (line 4)
E: dump2dcm: cfind.result: no Tag found (line 5)
E: dump2dcm: cfind.result: no Tag found (line 6)
E: dump2dcm: cfind.result: no Tag found (line 7)
E: dump2dcm: cfind.result: no Tag found (line 8)
E: dump2dcm: cfind.result: no Tag found (line 9)
E: 9 Errors found in cfind.result
I: writing DICOM file
W: output transfer syntax unknown, assuming --write-xfer-little
I: dump successfully converted
Press any key to continue . . .
$dcmtk: movescu v3.6.4 2018-11-29 $

movescu: DICOM retrieve (C-MOVE) SCU
error: Invalid parameter value cmove.dcm

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#9 Post by J. Riesmeier »

You haven't specified the first (mandatory) parameter "peer" = hostname or IP address.

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#10 Post by smalltownghosts »

so, this is the intrinsic issue; I want to store the results of the FIND, to my local machine, which has an IP but no port. does that make sense?

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#11 Post by J. Riesmeier »

What do you mean by the "results of the FIND"? Do you want to store the C-FIND response datasets (then use findscu with option -X) or the DICOM SOP Instances retrieved with movescu?

Maybe, you should first read how DICOM Query/Retrieve works and then look into this HOWTO: https://support.dcmtk.org/redmine/proje ... ng-movescu

smalltownghosts
Posts: 7
Joined: Mon, 2019-06-03, 07:35

Re: DCMTK > find and store dicom files to local folder

#12 Post by smalltownghosts »

Thank you for the info above. we have actually been able to resolve the issues i originally posted about yesterday.However, we have now run into a new issue. Here is the new CODE:

set BIN="E:\DCMT_GSH_MIG_MOVE\dcmtk-3.6.4-win64-dynamic\bin"

%BIN%\getscu ^
-d ^
-aet CALLING_AET111.111.111.111 4321 ^
-aec CALLED_AET 222.222.222.222 104 ^
-od . ^
-S ^
-k 0008,0052="STUDY" ^
-k 0020,000D="1.1.2222.555..66232.215433"
pause


When we run this, our error now states: "ERROR: cannot access file: 222.222.222.222"


I am not sure what we are missing, now...?

Michael Onken
DCMTK Developer
Posts: 2049
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DCMTK > find and store dicom files to local folder

#13 Post by Michael Onken »

Hi,
-aet CALLING_AET111.111.111.111 4321 ^
-aec CALLED_AET 222.222.222.222 104 ^
Why do you provide two IP Adresses and ports? (also it seems that a space is missing before the 111...)

You only need one ip and port. You can insert them at any position, i.e. before or after any of the options, e.g. try
.... -aet CALLING_AET -aec CALLED_AET 111.111.111.111 4321....
if the server is at 111.... port 4321. Of course you must add line separators again to match your custom format.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest