Adding custom mapped dicom attributes

1,273 views
Skip to first unread message

rmarino14

unread,
Dec 5, 2012, 11:48:45 AM12/5/12
to dcm...@googlegroups.com
Hi,

I was wondering if anyone has added additional custom fields to the DB in dcm4chee. For example there are additional DICOM tags from the header we would like to store in the DB. But we are limited to three that are currently handled in the DB using the DICOM attribute filter (ex, STUDY has 3, SERIES has 3....). If it can't be done does DCM4CHEE store the whole DICOM header somewhere in the DB?

We are using 2.17.1 of DCM4CHEE on Postgres.

Thanks,
Bob

Damien Evans

unread,
Dec 5, 2012, 12:58:18 PM12/5/12
to dcm...@googlegroups.com
If these additional attributes are stored in the database, do you need to use them as matching values in queries (e.g. via C-FIND or SQL)?

rmarino14

unread,
Dec 5, 2012, 1:09:04 PM12/5/12
to dcm...@googlegroups.com
No, I would run my own SQL against the DB to find the data in the additional custom fields.

Damien Evans

unread,
Dec 5, 2012, 5:00:27 PM12/5/12
to dcm...@googlegroups.com
Ok, you can add items in the attribute filter, but you wouldn't be able to query them in SQL - they're just stored in the blob.  

In order to add more attribute values which are accessible via SQL, you would need to modify the code to add the additional fields (e.g. patientCustomAttribute4) and modify the DB schema.  See the section called "Custom matching Attributes" near the bottom of this page for a general overview of the custom attrs feature.

 -- Damien

--
You received this message because you are subscribed to the Google Groups "dcm4che" group.
To post to this group, send email to dcm...@googlegroups.com.
To unsubscribe from this group, send email to dcm4che+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/dcm4che?hl=en.
 
 

Arnold Maderthaner

unread,
Dec 6, 2012, 9:15:03 AM12/6/12
to dcm...@googlegroups.com
Shouldn't it be enough to change the attributefilter to add the patientCustomAttribute4 field ?

Damien Evans

unread,
Dec 6, 2012, 9:32:45 AM12/6/12
to dcm...@googlegroups.com
I'm not sure - never done it before (you'd have to add it to the schema too).  Seems to be worth a try....

rmarino14

unread,
Dec 6, 2012, 9:53:36 AM12/6/12
to dcm...@googlegroups.com
Thanks for the help, I will try what Arnold proposed since that would be the quickest and if that doesn't work I will then look at the source and go from there.

Thank you,
Bob

rmarino14

unread,
Dec 8, 2012, 1:25:06 PM12/8/12
to dcm...@googlegroups.com
I got this working yesterday. Here are the steps I did to get this working in case someone else needs to do it:

1. I had to set up a build environment by following these steps:
http://www.dcm4che.org/confluence/download/attachments/501/dcm4chee+Build+Instructions+Rev3.txt?version=1&modificationDate=1343861264965

2.  I edited the following files (you may only need to edit one or all depending on what level you are looking to store your tags in):
The files that need editing are located at dcm4jboss-all/dcm4jboss-ejb/src/java/org/dcm4chex/archive/ejb/entity/
InstanceBean.java
PatientBean.java
StudyBean.java
SeriesBean.java

3. Edit the file you need:
example: I wanted to add more then the 3 tags (I have more then a 100) that the attribute filter can take.
So I took this code
    /**
     * @ejb.interface-method
     * @ejb.persistence column-name="study_custom1"
     */
    public abstract String getStudyCustomAttribute1();
    public abstract void setStudyCustomAttribute1(String value);

and added this to allow for a additional tag and allowed me to name the column in the study table
 
    /**
     * @ejb.persistence column-name="i_priv_creat"
     */
    public abstract String getStudyCustomAttribute10();
    public abstract void setStudyCustomAttribute10(String value);

4. Once your done editing you will then have to compile your changes and create a new deployment zip file:
cd dcm4jboss-all/dcm4jboss-build/
ant psql-dist *** I use postgres as my DB

5. I deployed the zip file to my test box and made sure everything ran.
6. I then added the the columns to the DB to each table and also created the indexes
8. Next I edited the dcm4chee-attribute-filter.xml file and added the tags I needed:
example:
<study>
     <attr tag="30110010" field="studyCustomAttribute10"/> <!-- PrivateCreator -->
</study>

The studyCustomAttribute10 = i_priv_creat column in the study table
9. Stopped and restarted dcm4chee
10. Sent a DICOM file to dcm4chee and the test tag was in the DB where I needed it to be

****** I'm a system admin and not a developer so the steps above might not have been the quickest way to accomplish my task so if anyone knows or finds an easier way please add to this post.

Thanks for the help on this!

Arnold Maderthaner

unread,
Dec 11, 2012, 9:52:26 AM12/11/12
to dcm...@googlegroups.com
Great that you got it working - do you mind to summarize it also on the Confluence Wiki so that it is available for others ?

yours

Arnold

rmarino14

unread,
Dec 11, 2012, 10:04:48 AM12/11/12
to dcm...@googlegroups.com
Yes, I can do that latter on today.

rmarino14

unread,
Dec 12, 2012, 11:33:24 AM12/12/12
to dcm...@googlegroups.com
Do I need an ID to update the wiki? If so I tried to create one and I received a error stating that it was out of licenses? If not I don't see an option to edit.


On Tuesday, December 11, 2012 9:52:26 AM UTC-5, Arnold Maderthaner wrote:
Reply all
Reply to author
Forward
0 new messages