Deleting a Series

854 views
Skip to first unread message

Dev G

unread,
Aug 12, 2014, 11:41:20 AM8/12/14
to dcm...@googlegroups.com

I am pretty new to DCM4CHE, so this may be a simple question.

Is there a way to delete a Series using a program (without using the GUI) using the instance UID?

Alternately, is there a way to replace an existing series with a changed DICOM file using a program? When I tried doing this using DcmSnd, it created tow instances.

thanks

Arnold Maderthaner

unread,
Aug 25, 2014, 10:09:05 AM8/25/14
to dcm...@googlegroups.com
There is only a deleteSeries method in the content edit service but it needs the PK from the database as parameter.

Dev G

unread,
Aug 25, 2014, 11:18:44 AM8/25/14
to dcm...@googlegroups.com
Thanks for the info. I think I can get the PK from the database. Can you tell me how I can call the method?

Thanks

fleetwoodfc

unread,
Aug 25, 2014, 2:13:46 PM8/25/14
to dcm...@googlegroups.com
You can use the twiddle script in the dcm4chee/bin folder - there are examples how to use on this forum.

Dev G

unread,
Sep 4, 2014, 2:01:22 PM9/4/14
to dcm...@googlegroups.com
Sorry took so long to get back. I tried calling the deleteSeries method in the edit service using the twiddle script, but it does seem to do anything. See below:

$ /home/pacs/dcm4chee-2.18.0-mysql/bin/twiddle.sh -uadmin -padmin invoke dcm4chee.archive:service=ContentEditService moveSeriesToTrash 183
$ echo $?
1

183 is pk from the series table in pacsdb. The status return is 1, saying failed and series is still there.

Any idea what I am doing wrong?

Thanks

Arnold Maderthaner

unread,
Sep 4, 2014, 4:11:39 PM9/4/14
to dcm...@googlegroups.com
any output in dcm4chee's server.log ?

Dev G

unread,
Sep 4, 2014, 6:01:56 PM9/4/14
to dcm...@googlegroups.com
No output at all.

BTW I also tried
$ /home/pacs/dcm4chee-2.18.0-mysql/bin/twiddle.sh -uadmin -padmin invoke dcm4chee.archive:service=ContentEditService deleteSeries183

with the same result

Arnold Maderthaner

unread,
Sep 8, 2014, 3:37:40 AM9/8/14
to dcm...@googlegroups.com
hmm !
maybe you also need to move it first to the trash (i remember that I had to do this for some reason using the contenteditservice)

Dev G

unread,
Sep 8, 2014, 12:15:31 PM9/8/14
to dcm...@googlegroups.com
I did try to move it to trash first and it did not work either. No log or error in server.log.

Anyway, I think I see the problem there two moveSeriesToTrash methods in the service. I think the server has a problem figuring it out which one to call. It may be calling the wrong one (but then it should at least log an error).

I will try compiling from source and renaming one of the methods for now, until it gets fixed in the next version.

Thanks

Pawel Miaszkiewicz

unread,
Sep 24, 2014, 9:40:19 AM9/24/14
to
Hi
I have the same problem:
twiddle.sh -u admin -p admin invoke "dcm4chee.archive:service=ContentEditService" moveSeriesToTrash 24
does not work
using jmx-console works fine

Dev, does renaming fixed the problem ?

EDIT:
something else about diffrent between delete and moveToTrash
using deleteSeries I have: "javax.ejb.ObjectNotFoundException: No such entity!"
but I'm sure I have such entity, so checked pg_log:

SELECT t0_Series.pk FROM series t0_Series WHERE t0_Series.pk=$1           -- this is when invoking moveSeriesToTrash (using jmx)
SELECT t0_PrivateSeries.pk FROM priv_series t0_PrivateSeries WHERE t0_PrivateSeries.pk=$1        -- this is when invoking DeleteSeries (using jmx)

what kind of data is in priv_series ? is it trash for series ?



Dev Gude

unread,
Sep 24, 2014, 11:13:27 AM9/24/14
to dcm...@googlegroups.com

Yes, I renamed the second function to moveSeriesToTrash2 and rebuilt dmc4chee.jar, then the twiddle script worked.

 

From: dcm...@googlegroups.com [mailto:dcm...@googlegroups.com] On Behalf Of Pawel Miaszkiewicz
Sent: Wednesday, September 24, 2014 6:40 AM
To: dcm...@googlegroups.com
Subject: [dcm4che-group] Re: Deleting a Series

 

Hi
I have the same problem:
twiddle.sh -u admin -p admin invoke "dcm4chee.archive:service=ContentEditService" moveSeriesToTrash 24
does not work

using jmx-console works fine

Dev, does renaming fixed the problem ?

--
You received this message because you are subscribed to a topic in the Google Groups "dcm4che" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dcm4che/UJBMM6cdjFU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at http://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/d/optout.

Grzegorz Brzęczyszczykiewicz

unread,
Sep 26, 2014, 5:30:36 AM9/26/14
to dcm...@googlegroups.com
Can't find this function by name. Could You give me more detailed tip where You found it?

dtc...@gmail.com

unread,
Apr 10, 2017, 8:57:43 PM4/10/17
to dcm...@googlegroups.com
For anyone wondering how to actually do this without recompiling DCM4CHEE and renaming methods...

twiddle.sh -u user -p password serverinfo -l | grep ContentEditService
dcm4chee.web:service=ContentEditService
dcm4chee.archive:service=ContentEditService

If you examine dcm4chee.web:service=ContentEditService you'll see this also contains a moveSeriesToTrash method - it takes two parameters.

Get the SeriesUID you want to delete and replace it in the command below.

twiddle.sh -u user -p password invoke 'dcm4chee.web:service=ContentEditService' moveSeriesToTrash SeriesIUID true

You probably also want to clear out the trash after doing this.

twiddle.sh -u user -p password invoke 'dcm4chee.web:service=ContentEditService' emptyTrash

To answer the latter part of the question, if you want to alter a DICOM instance object in the archive directly you can do this using dcmodify or similar. For every file you alter, you also need to update files.file_md5 and files.file_size in the database otherwise DCM4CHEE will be very unhappy and probably won't let you access the study via the web interface or WADO.
In short: Make alterations, compute an MD5 digest, update the database. Depending on how you use the database, you might also want to update a bunch of fields in other tables, consider the attrs fields as well, you might need to regenerate these depending on your circumstances.

George Wang

unread,
Aug 18, 2022, 10:09:55 PM8/18/22
to dcm4che
Hi,

I want to do a quick modify of SUID on the server using twiddle  . 

The goal is to modify the SUID (Study instance UID) of a study already on PACS, from existing SUID of for example 1.2.34.56.789 to a new SUID of my choice (for example 9.87.654.32.1) without doing this : Download to local drive -> modify -> reupload. 

The DCM4CHEE2 web3 GUI mouse clicking interphase shows editing SUID is achievable quickly on the server side.  However I have not been able to achieve this using commandline (be it twiddle or PHP).   
web3 edit study instance uid.jpg

I checked out dcmodify also, and it works on local DICOM only, not modify the SUID on server. 

My current long workaround is the following:
1. Upload a dummy empty shell new DICOM that is SUID 9.87.654.32.1 and no series, no images.
2. Move all series from 1.2.34.56.789  -> 9.87.654.32.1 by doing: 
jboss-4.2.3.GA\bin\twiddle.bat -s localhost -u admin -p admin invoke dcm4chee.web:service=ContentEditService moveSeriesToStudy  1.2.34.56.789   9.87.654.32.1
3. Delete 1.2.34.56.789 by doing:
jboss-4.2.3.GA\bin\twiddle.bat -s localhost -u admin -p admin invoke dcm4chee.archive:service=ContentEditService moveStudyToTrash 1.2.34.56.789

Thanks in advance. 
George
Reply all
Reply to author
Forward
0 new messages