DCMTK > find and store dicom files to local folder
Moderator: Moderator Team
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
DCMTK > find and store dicom files to local folder
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.
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.
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
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):
By the way, why don't you use findscu with option -X (--extract)?
Code: Select all
error: --output-directory only allowed with --port
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
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
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
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
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.
Maybe, you could post your exact command line call and the error message you get.
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
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
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
I: reading dump file: cfind.result
E: dump2dcm: cfind.result: no Tag found (line 1)
E: dump2dcm: cfind.result: no Tag found (line
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
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
Did you see this line?
Code: Select all
$dcmtk: movescu v1.0 2005-07-30 $
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
ha! just did. getting the newer version now!
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
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
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
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
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
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
You haven't specified the first (mandatory) parameter "peer" = hostname or IP address.
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
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?
-
- DCMTK Developer
- Posts: 2505
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
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
Maybe, you should first read how DICOM Query/Retrieve works and then look into this HOWTO: https://support.dcmtk.org/redmine/proje ... ng-movescu
-
- Posts: 7
- Joined: Mon, 2019-06-03, 07:35
Re: DCMTK > find and store dicom files to local folder
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...?
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...?
-
- DCMTK Developer
- Posts: 2051
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: DCMTK > find and store dicom files to local folder
Hi,
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
Best,
Michael
Why do you provide two IP Adresses and ports? (also it seems that a space is missing before the 111...)-aet CALLING_AET111.111.111.111 4321 ^
-aec CALLED_AET 222.222.222.222 104 ^
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
if the server is at 111.... port 4321. Of course you must add line separators again to match your custom format..... -aet CALLING_AET -aec CALLED_AET 111.111.111.111 4321....
Best,
Michael
Who is online
Users browsing this forum: No registered users and 1 guest