Set specific character set encoding (0008,0005) tag when images arrive in DCM4CHEE archive

1,693 views
Skip to first unread message

dhava...@gmail.com

unread,
May 13, 2013, 1:47:30 PM5/13/13
to dcm...@googlegroups.com
Hi

I want to set Specific character set encoding (0008,0005) to GB18030 , when images are sent to DCM4CHEE Archive. Images which are sent to DCM4CHEE Archive does not have this tag. Is still possible to do this ?

Thanks
Dhaval Joshi

Johan Regar

unread,
May 13, 2013, 11:48:06 PM5/13/13
to dcm...@googlegroups.com
Hi Dhaval,

As i remember there are a post here discussing about modifying dicom tag, perhaps you can use those approach to add new tag into you dicom file.

dhaval joshi

unread,
May 14, 2013, 12:36:03 AM5/14/13
to dcm...@googlegroups.com
could you please refer me that post, I remember older version of dcm4chee-2.13.2 had this option to default


--
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/ap9D1szpsNU/unsubscribe?hl=en.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks
Dhaval Joshi

Johan Regar

unread,
May 15, 2013, 2:41:27 AM5/15/13
to dcm...@googlegroups.com
Here some code to modify tag, hope it help.

public static void changementTag(File file, int tagChooser, String aModify, VR vr, String newString )
    {
        try
        {
            DicomInputStream dis = new DicomInputStream(file);
            DicomObject dio = dis.readDicomObject();
            dis.close();
           
            String fileName = file.getAbsolutePath() + ".ori";
            File originFile = new File(fileName);
            file.renameTo(originFile);
           
            boolean change = false;
            dio.putString(tagChooser, vr, newString);
            change = true;
           
            if(change)
            {
                FileOutputStream fos = new FileOutputStream( new File(file.getParent()+ "/" + file.getName()));
                BufferedOutputStream bos = new BufferedOutputStream(fos);
                DicomOutputStream dos = new DicomOutputStream(bos);
                dos.writeDicomFile(dio);
                dos.close();
                originFile.delete();
            }
        }
        catch(IOException ex)
        {
            ex.printStackTrace();
        }
    }


P.S : I've forgot which post discussing about it, so i post the code instead.


On Tuesday, May 14, 2013 12:47:30 AM UTC+7, dhava...@gmail.com wrote:

dhaval joshi

unread,
May 15, 2013, 11:02:14 AM5/15/13
to dcm...@googlegroups.com
I was looking for option to do it from dcm4chee or jmx-console


--
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/ap9D1szpsNU/unsubscribe?hl=en.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks
Dhaval Joshi

fleetwoodfc

unread,
May 15, 2013, 2:03:08 PM5/15/13
to dcm...@googlegroups.com
You can try attribute coercion using a cstorerq.xsl file in the conf/dcm4chee-ae folder. Sample in conf/dcm4chee-ae/MOD_AET 

dhaval joshi

unread,
May 15, 2013, 5:44:43 PM5/15/13
to
How should I do it, can you give me example, below is what I see in cstorerq.xsl

      <xsl:variable name="reqPhysician" select="attr[@tag='00321032']"/>
      <xsl:variable name="reqService" select="attr[@tag='00321033']"/>
      <xsl:variable name="reqProcDesc" select="attr[@tag='00321060']"/>
      <xsl:variable name="reqProcCodeSeq" select="attr[@tag='00321064']"/>
      <xsl:if test="$reqPhysician or $reqService or $reqProcDesc or $reqProcCodeSeq">



jne...@gmail.com

unread,
May 15, 2013, 8:07:26 PM5/15/13
to
Try this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="no"/>
  <!-- overwritten by application with actual values -->
  <xsl:param name="calling" select="'SAMPLE_MOD'"/>
  <xsl:param name="called" select="'DCM4CHEE'"/>
  <xsl:param name="date" select="'20051206'"/>
  <xsl:param name="time" select="'115600.000'"/>
  <xsl:template match="/dataset">
    <dataset>
      <attr tag="00080005" vr="CS">ISO_IR 100</attr>
    </dataset>
  </xsl:template>
</xsl:stylesheet>

dhaval joshi

unread,
May 15, 2013, 8:20:13 PM5/15/13
to
Does't work, Below is how my file looks like

<!--
Sample C-STORE-RQ attribute coercion for copying request attributes exported
on root level to item of Request Attributes Sequence (0040,0275), which is
extracted into DB series record by default attribute filter configuration.
Therefore request attributes becomes available by DICOM Query C-FIND on
SERIES level.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="no"/>
  <!-- overwritten by application with actual values -->
  <xsl:param name="calling" select="'SAMPLE_MOD'"/>
  <xsl:param name="called" select="'DCM4CHEE'"/>
  <xsl:param name="date" select="'20051206'"/>
  <xsl:param name="time" select="'115600.000'"/>
  <xsl:template match="/dataset">
    <dataset>
      <xsl:variable name="reqPhysician" select="attr[@tag='00321032']"/>
      <xsl:variable name="reqService" select="attr[@tag='00321033']"/>
      <xsl:variable name="reqProcDesc" select="attr[@tag='00321060']"/>
      <xsl:variable name="reqProcCodeSeq" select="attr[@tag='00321064']"/>
      <xsl:if test="$reqPhysician or $reqService or $reqProcDesc or $reqProcCodeSeq">
        <!-- (0040,0275) SQ #-1 Request Attributes Sequence -->
        <attr tag="00400275" vr="SQ">
          <item>
            <xsl:copy-of select="$reqPhysician"/>
            <xsl:copy-of select="$reqService"/>
            <xsl:copy-of select="$reqProcDesc"/>
            <xsl:copy-of select="$reqProcCodeSeq"/>
          </item>
        </attr>
      </xsl:if>

      <attr tag="00080005" vr="CS">ISO_IR 100</attr>
    </dataset>
  </xsl:template>
</xsl:stylesheet>



On Wed, May 15, 2013 at 5:06 PM, <jne...@gmail.com> wrote:
Try this in :


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="no"/>
  <!-- overwritten by application with actual values -->
  <xsl:param name="calling" select="'SAMPLE_MOD'"/>
  <xsl:param name="called" select="'DCM4CHEE'"/>
  <xsl:param name="date" select="'20051206'"/>
  <xsl:param name="time" select="'115600.000'"/>
  <xsl:template match="/dataset">
    <dataset>
      <attr tag="00080005" vr="CS">ISO_IR 100</attr>
    </dataset>
  </xsl:template>
</xsl:stylesheet>




On Monday, May 13, 2013 10:47:30 AM UTC-7, dhava...@gmail.com wrote:
--
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/ap9D1szpsNU/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to dcm4che+unsubscribe@googlegroups.com.

To post to this group, send email to dcm...@googlegroups.com.
Visit this group at http://groups.google.com/group/dcm4che?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks
Dhaval Joshi

jne...@gmail.com

unread,
May 15, 2013, 11:37:24 PM5/15/13
to dcm...@googlegroups.com
If you want the changes to be made to the files on disk, as opposed to only in the database - change CoerceBeforeWrite to True in the service=StoreScp mbean in the jmx-console.

Also check and make sure that you have put the cstorerq.xsl file in the correct location. Placed directly under server/default/conf/dcm4chee-ae - it applies to ALL images received. Placed under server/default/conf/dcm4chee-ae/AETITLE/ - it will apply only images received from AETITLE.

It may also be that you need to have the tag defined in the dcm4chee-attribute-filter.xml in order to be able to coerce it - check the file server/default/conf/dcm4chee-attribute-filter.xml.

If still stuck after that - you can turn on coercion logging in the service=StoreScp mbean as well, and look at the logs generated under log/coercion. The files will look something like:

20130218142611.706.out-cstorerq.xsl.in
20130218142611.706.out-cstorerq.xsl.out
--
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/ap9D1szpsNU/unsubscribe?hl=en.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks
Dhaval Joshi

dhaval joshi

unread,
May 16, 2013, 11:38:52 AM5/16/13
to dcm...@googlegroups.com
I was not able to see/download cstore.xsl file

dhaval joshi

unread,
May 16, 2013, 8:25:38 PM5/16/13
to dcm...@googlegroups.com
I was able to get it done, Thanks for your help
--
Thanks
Dhaval Joshi

PM

unread,
Mar 5, 2014, 8:50:09 PM3/5/14
to dcm...@googlegroups.com
Dhaval, could you share how you create/modify the xsl file and where you place the file?

Thanks,
Pat

Dhaval Joshi

unread,
Mar 5, 2014, 8:54:35 PM3/5/14
to dcm...@googlegroups.com

Just overwrite it


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.
Reply all
Reply to author
Forward
0 new messages