1. Kevin Archie
  2. DicomEdit

Commits

Kevin A. Archie  committed ef29d00

assigment value should be evaluated on pre-modification object

  • Participants
  • Parent commits 4ebb655
  • Branches v2.1.x
  • Tags v2.1.2

Comments (0)

Files changed (3)

File pom.xml

View file
   <groupId>org.nrg</groupId>
   <artifactId>DicomEdit</artifactId>
   <packaging>jar</packaging>
-  <version>2.1.1</version>
+  <version>2.1.2</version>
   <name>DicomEdit</name>
   <description>Language for modifying DICOM metadata</description>
   <url>http://nrg.wustl.edu</url>
       <url>http://maven.xnat.org/libs-release</url>
     </repository>
   </repositories>
+  <distributionManagement>
+    <repository>
+      <id>XNAT Server</id>
+      <name>XNAT Maven Library Release</name>
+      <url>http://maven.xnat.org/libs-release-local</url>
+    </repository>
+  </distributionManagement>
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

File src/main/java/org/nrg/dcm/edit/Assignment.java

View file
      * (non-Javadoc)
      * @see org.nrg.dcm.edit.Operation#makeAction(org.dcm4che2.data.DicomObject)
      */
-    public Action makeAction(final DicomObject o) throws AttributeException {
+    public Action makeAction(final DicomObject o) throws ScriptEvaluationException {
+        final String v = value.on(o);
         return new Action() {
             public void apply() throws ScriptEvaluationException {
                 try {
-                    o.putString(new int[]{tag}, o.vrOf(tag), value.on(o));
+                    o.putString(new int[]{tag}, o.vrOf(tag), v);
                 } catch (UnsupportedOperationException e) {
                     throw new ScriptEvaluationException("Unable to set attribute "
-                            + TagUtils.toString(tag) + " to \"" + value.on(o) + "\"", e);
+                            + TagUtils.toString(tag) + " to \"" + v + "\"", e);
                 }
             }
 

File src/main/java/org/nrg/dcm/edit/Operation.java

View file
      * @return
      * @throws AttributeException
      */
-    Action makeAction(DicomObject o) throws AttributeException;
+    Action makeAction(DicomObject o) throws AttributeException,ScriptEvaluationException;
 
     /**
      * Compute the value that results from applying this Operation to