|
From: <gun...@us...> - 2007-12-06 12:12:21
|
Revision: 5592
http://dcm4che.svn.sourceforge.net/dcm4che/?rev=5592&view=rev
Author: gunterze
Date: 2007-12-06 04:12:19 -0800 (Thu, 06 Dec 2007)
Log Message:
-----------
[#DCMEE-657] Upgrade to Enhanced Multi-frame Image Service
Modified Paths:
--------------
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-upgrade2emf-xmbean.xml
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/deploy/dcm4chee-upgrade2emf-service.xml
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/EnhancedMFBuilder.java
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/UpgradeToEnhancedMFService.java
Added Paths:
-----------
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xml
Removed Paths:
-------------
dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xsl
Added: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xml
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xml (rev 0)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xml 2007-12-06 12:12:19 UTC (rev 5592)
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<dataset>
+ <!-- Specific Character Set -->
+ <attr tag="00080005" vr="CS" />
+ <!-- SOP Class UID -->
+ <attr tag="00080016" vr="UI">1.2.40.0.13.1.5.1.4.1.1.2.1</attr>
+ <!-- Contrast/Bolus Agent -->
+ <attr tag="00180010" vr="LO" />
+ <!-- Contrast/Bolus Agent Sequence -->
+ <attr tag="00180012" vr="SQ" />
+ <!-- Contrast/Bolus Administration Route Sequence -->
+ <attr tag="00180014" vr="SQ" />
+ <!-- Contrast/Bolus Route -->
+ <attr tag="00181040" vr="LO" />
+ <!-- Contrast/Bolus Volume -->
+ <attr tag="00181041" vr="DS" />
+ <!-- Contrast/Bolus Start Time -->
+ <attr tag="00181042" vr="TM" />
+ <!-- Contrast/Bolus Stop Time -->
+ <attr tag="00181043" vr="TM" />
+ <!-- Contrast/Bolus Total Dose -->
+ <attr tag="00181044" vr="DS" />
+ <!-- Contrast Flow Rate -->
+ <attr tag="00181046" vr="DS" />
+ <!-- Contrast Flow Duration -->
+ <attr tag="00181047" vr="DS" />
+ <!-- Contrast/Bolus Ingredient -->
+ <attr tag="00181048" vr="CS" />
+ <!-- Contrast/Bolus Ingredient Concentration -->
+ <attr tag="00181049" vr="DS" />
+ <!-- Series Instance UID -->
+ <attr tag="0020000E" vr="UI" />
+ <!-- Samples per Pixel -->
+ <attr tag="00280002" vr="US" />
+ <!-- Photometric Interpretation -->
+ <attr tag="00280004" vr="CS" />
+ <!-- Planar Configuration -->
+ <attr tag="00280006" vr="US" />
+ <!-- Rows -->
+ <attr tag="00280010" vr="US" />
+ <!-- Columns -->
+ <attr tag="00280011" vr="US" />
+ <!-- Pixel Aspect Ratio -->
+ <attr tag="00280034" vr="IS" />
+ <!-- Bits Allocated -->
+ <attr tag="00280100" vr="US" />
+ <!-- Bits Stored -->
+ <attr tag="00280101" vr="US" />
+ <!-- High Bit -->
+ <attr tag="00280102" vr="US" />
+ <!-- Pixel Representation -->
+ <attr tag="00280103" vr="US" />
+ <!-- Shared Functional Groups Sequence -->
+ <!-- Elements marked by (+) are not part of DICOM Enhanced CT IOD -->
+ <attr tag="52009229" vr="SQ">
+ <item>
+ <!-- Derivation Image Sequence -->
+ <attr tag="00089124" vr="SQ">
+ <item>
+ <!-- Derivation Description -->
+ <attr tag="00082111" vr="LO" />
+ <!-- Source Image Sequence -->
+ <attr tag="00082112" vr="SQ" />
+ <!-- Derivation Code Sequence -->
+ <attr tag="00089215" vr="SQ" />
+ </item>
+ </attr>
+ <!-- CT Acquisition Type Sequence -->
+ <attr tag="00189301" vr="SQ">
+ <item>
+ <!-- Scan Options(+) -->
+ <attr tag="00180022" vr="CS" />
+ </item>
+ </attr>
+ <!-- CT Acquisition Details Sequence -->
+ <attr tag="00189304" vr="SQ">
+ <item>
+ <!-- Data Collection Diameter -->
+ <attr tag="00180090" vr="DS" />
+ <!-- Gantry/Detector Tilt -->
+ <attr tag="00181120" vr="DS" />
+ <!-- Table Height -->
+ <attr tag="00181130" vr="DS" />
+ <!-- Rotation Direction -->
+ <attr tag="00181140" vr="CS" />
+ <!-- Revolution Time -->
+ <attr tag="00189305" vr="FD" />
+ <!-- Single Collimation Width -->
+ <attr tag="00189306" vr="FD" />
+ <!-- Total Collimation Width -->
+ <attr tag="00189307" vr="FD" />
+ </item>
+ </attr>
+ <!-- CT Table Dynamics Sequence -->
+ <attr tag="00189308" vr="SQ">
+ <item>
+ <!-- Table Speed -->
+ <attr tag="00189309" vr="FD" />
+ <!-- Table Feed per Rotation -->
+ <attr tag="00189310" vr="FD" />
+ <!-- Spiral Pitch Factor -->
+ <attr tag="00189311" vr="FD" />
+ </item>
+ </attr>
+ <!-- CT Geometry Sequence -->
+ <attr tag="00189312" vr="SQ">
+ <item>
+ <!-- Distance Source to Detector -->
+ <attr tag="00181110" vr="FD" />
+ <!-- Distance Source to Patient(+) -->
+ <attr tag="00181111" vr="FD" />
+ </item>
+ </attr>
+ <!-- CT Reconstruction Sequence -->
+ <attr tag="00189314" vr="SQ">
+ <item>
+ <!-- Reconstruction Diameter -->
+ <attr tag="00181100" vr="DS" />
+ <!-- Convolution Kernel -->
+ <attr tag="00181210" vr="SH" />
+ </item>
+ </attr>
+ <!-- CT Exposure Sequence -->
+ <attr tag="00189321" vr="SQ">
+ <item>
+ <!-- Exposure Time -->
+ <attr tag="00181150" vr="IS" />
+ <!-- X-ray Tube Current -->
+ <attr tag="00181151" vr="IS" />
+ <!-- Exposure -->
+ <attr tag="00181152" vr="IS" />
+ <!-- Exposure in μAs -->
+ <attr tag="00181153" vr="IS" />
+ <!-- Exposure Modulation Type -->
+ <attr tag="00189323" vr="CS" />
+ <!-- Estimated Dose Saving -->
+ <attr tag="00189324" vr="FD" />
+ <!-- CTDIvol -->
+ <attr tag="00189345" vr="FD" />
+ </item>
+ </attr>
+ <!-- CT X-ray Details Sequence -->
+ <attr tag="00189325" vr="SQ">
+ <item>
+ <!-- KVP -->
+ <attr tag="00180060" vr="DS" />
+ <!-- Filter Type -->
+ <attr tag="00181160" vr="SH" />
+ <!-- Generator Power(+) -->
+ <attr tag="00181170" vr="IS" />
+ <!-- Focal Spot -->
+ <attr tag="00181190" vr="DS" />
+ </item>
+ </attr>
+ <!-- Irradiation Event Identification Sequence -->
+ <attr tag="00189477" vr="SQ">
+ <item>
+ <!-- Irradiation Event UID -->
+ <attr tag="00083010" vr="UI" />
+ </item>
+ </attr>
+ <!-- Frame Anatomy Sequence -->
+ <attr tag="00209071" vr="SQ">
+ <item>
+ <!-- Anatomic Region Sequence -->
+ <attr tag="00082218" vr="SQ" />
+ </item>
+ </attr>
+ <!-- Plane Position Sequence -->
+ <attr tag="00209113" vr="SQ">
+ <item>
+ <!-- Image Position (Retired)(+) -->
+ <attr tag="00200030" vr="DS" />
+ <!-- Image Position (Patient) -->
+ <attr tag="00200032" vr="DS" />
+ <!-- Slice Location(+) -->
+ <attr tag="00201041" vr="DS" />
+ </item>
+ </attr>
+ <!-- Plane Orientation Sequence -->
+ <attr tag="00209116" vr="SQ">
+ <item>
+ <!-- Image Orientation (Retired)(+) -->
+ <attr tag="00200035" vr="DS" />
+ <!-- Image Orientation (Patient) -->
+ <attr tag="00200037" vr="DS" />
+ </item>
+ </attr>
+ <!-- Patient Orientation in Frame Sequence -->
+ <attr tag="00209450" vr="SQ">
+ <item>
+ <!-- Patient Orientation -->
+ <attr tag="00200020" vr="CS" />
+ </item>
+ </attr>
+ <!-- Pixel Measures Sequence -->
+ <attr tag="00289110" vr="SQ">
+ <item>
+ <!-- Slice Thickness -->
+ <attr tag="00180050" vr="DS" />
+ <!-- Pixel Spacing -->
+ <attr tag="00280030" vr="DS" />
+ </item>
+ </attr>
+ <!-- Frame VOI LUT Sequence -->
+ <attr tag="00289132" vr="SQ">
+ <item>
+ <!-- Window Center -->
+ <attr tag="00281050" vr="DS" />
+ <!-- Window Width -->
+ <attr tag="00281051" vr="DS" />
+ </item>
+ </attr>
+ <!-- Pixel Value Transformation Sequence -->
+ <attr tag="00289145" vr="SQ">
+ <item>
+ <!-- Rescale Intercept -->
+ <attr tag="00281052" vr="DS" />
+ <!-- Rescale Slope -->
+ <attr tag="00281053" vr="DS" />
+ </item>
+ </attr>
+ </item>
+ </attr>
+</dataset>
Deleted: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xsl
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xsl 2007-12-05 18:04:42 UTC (rev 5591)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/dcm4chee-ae/CT_AET/upgrade-ct.xsl 2007-12-06 12:12:19 UTC (rev 5592)
@@ -1,605 +0,0 @@
-<?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" />
-
- <xsl:template match="/dicomfile">
- <dicomfile>
- <xsl:apply-templates select="filemetainfo" />
- <xsl:apply-templates select="dataset" />
- </dicomfile>
- </xsl:template>
-
- <xsl:template match="filemetainfo">
- <filemetainfo>
- <!-- Transfer Syntax UID -->
- <xsl:copy-of select="attr[@tag='00020010']" />
- </filemetainfo>
- </xsl:template>
-
- <xsl:template match="dataset">
- <dataset>
- <xsl:apply-templates select="attr" />
- <!-- SOP Class UID -->
- <attr tag="00080016" vr="UI">1.2.40.0.13.1.5.1.4.1.1.2.1</attr>
- <!-- Shared Functional Groups Sequence -->
- <attr tag="52009229" vr="SQ">
- <item>
- <!-- Derivation Image Sequence -->
- <attr tag="00089124" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="DerivationImage" />
- </item>
- </attr>
- <!-- CT Acquisition Type Sequence -->
- <attr tag="00189301" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTAcquisitionType" />
- </item>
- </attr>
- <!-- CT Acquisition Details Sequence -->
- <attr tag="00189304" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTAcquisitionDetails" />
- </item>
- </attr>
- <!-- CT Table Dynamics Sequence -->
- <attr tag="00189308" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTTableDynamics" />
- </item>
- </attr>
- <!-- CT Geometry Sequence -->
- <attr tag="00189312" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTGeometry" />
- </item>
- </attr>
- <!-- CT Reconstruction Sequence -->
- <attr tag="00189314" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTReconstruction" />
- </item>
- </attr>
- <!-- CT Exposure Sequence -->
- <attr tag="00189321" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTExposure" />
- </item>
- </attr>
- <!-- CT X-ray Details Sequence -->
- <attr tag="00189325" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTXrayDetails" />
- </item>
- </attr>
- <!--CT Image Frame Type Sequence -->
- <attr tag="00189329" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="CTImageFrameType" />
- </item>
- </attr>
- <!-- Irradiation Event Identification Sequence -->
- <attr tag="00189477" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="IrradiationEventIdentification" />
- </item>
- </attr>
- <!-- Frame Anatomy Sequence -->
- <attr tag="00209071" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="FrameAnatomy" />
- </item>
- </attr>
- <!-- Plane Orientation Sequence -->
- <attr tag="00209116" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="PlaneOrientation" />
- </item>
- </attr>
- <!-- Patient Orientation in Frame Sequence -->
- <attr tag="00209450" vr="SQ">
- <item>
- <xsl:apply-templates mode="PatientOrientation" select="attr" />
- </item>
- </attr>
- <!-- Pixel Measures Sequence -->
- <attr tag="00289110" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="PixelMeasures" />
- </item>
- </attr>
- <!-- Frame VOI LUT Sequence -->
- <attr tag="00289132" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="FrameVOILUT" />
- </item>
- </attr>
- <!-- Pixel Value Transformation Sequence -->
- <attr tag="00289145" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="PixelValueTransformation" />
- </item>
- </attr>
- </item>
- </attr>
- <!-- Per-frame Functional Groups Sequence -->
- <attr tag="52009230" vr="SQ">
- <item>
- <!-- Referenced Image Sequence -->
- <attr tag="00081140" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="ReferencedImage" />
- <!-- Purpose of Reference Code Sequence (0040,A170) -->
- <attr tag="0040A170" vr="SQ">
- <item>
- <!--Code Value -->
- <attr tag="00080100" vr="LO">121326</attr>
- <!-- Coding Scheme Designator -->
- <attr tag="00080102" vr="LO">DCM</attr>
- <!-- Code Meaning -->
- <attr tag="00080104" vr="LO">Alternate SOP Class instance</attr>
- </item>
- </attr>
- </item>
- <xsl:apply-templates select="attr[@tag='00081140']/item" />
- </attr>
- <!-- Frame Content Sequence -->
- <attr tag="00209111" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="FrameContent" />
- </item>
- </attr>
- <!-- Plane Position Sequence -->
- <attr tag="00209113" vr="SQ">
- <item>
- <xsl:apply-templates select="attr" mode="PlanePosition" />
- </item>
- </attr>
- </item>
- </attr>
- </dataset>
- </xsl:template>
-
- <!-- (+) - Element not part of DICOM Enhanced CT IOD -->
- <!--
- Pixel Measures Functional Group
- -->
- <!-- Slice Thickness -->
- <xsl:template match="attr[@tag='00180050']" />
- <xsl:template match="attr[@tag='00180050']" mode="PixelMeasures">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Pixel Spacing -->
- <xsl:template match="attr[@tag='00280030']" />
- <xsl:template match="attr[@tag='00280030']" mode="PixelMeasures">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="PixelMeasures" />
-
- <!--
- Frame Content Functional Group
- -->
- <!-- Acquisition Date -->
- <!-- Acquisition Time -->
- <xsl:template match="attr[@tag='00080022']" />
- <xsl:template match="attr[@tag='00080032']" />
- <xsl:template match="attr[@tag='00080022']" mode="FrameContent">
- <!-- Frame Acquisition Datetime -->
- <attr tag="00189074" vr="DT">
- <xsl:value-of select="." />
- <xsl:value-of select="../attr[@tag='00080032']" />
- </attr>
- </xsl:template>
- <!-- Acquisition Datetime -->
- <xsl:template match="attr[@tag='0008002A']" />
- <xsl:template match="attr[@tag='0008002A']" mode="FrameContent">
- <!-- Frame Acquisition Datetime -->
- <attr tag="00189074" vr="DT">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <!-- Aquisition Number -->
- <xsl:template match="attr[@tag='00200012']" />
- <xsl:template match="attr[@tag='00200012']" mode="FrameContent">
- <!-- Frame Acquisition Number -->
- <attr tag="00209156" vr="US">
- <xsl:value-of select="normalize-space()" />
- </attr>
- </xsl:template>
- <!-- Image Comments -->
- <xsl:template match="attr[@tag='00204000']" />
- <xsl:template match="attr[@tag='00204000']" mode="FrameContent">
- <!-- Frame Comments -->
- <attr tag="00209158" vr="LT">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <!-- Instance Creation Date(+) -->
- <xsl:template match="attr[@tag='00080012']" />
- <xsl:template match="attr[@tag='00080012']" mode="FrameContent">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Instance Creation Time(+) -->
- <xsl:template match="attr[@tag='00080013']" />
- <xsl:template match="attr[@tag='00080013']" mode="FrameContent">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Content Date(+) -->
- <xsl:template match="attr[@tag='00080023']" />
- <xsl:template match="attr[@tag='00080023']" mode="FrameContent">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Content Time(+) -->
- <xsl:template match="attr[@tag='00080033']" />
- <xsl:template match="attr[@tag='00080033']" mode="FrameContent">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Instance Number(+) -->
- <xsl:template match="attr[@tag='00200013']" />
- <xsl:template match="attr[@tag='00200013']" mode="FrameContent">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="FrameContent" />
-
- <!--
- Plane Position Functional Group
- -->
- <!-- Image Position (Patient) -->
- <xsl:template match="attr[@tag='00200032']" />
- <xsl:template match="attr[@tag='00200032']" mode="PlanePosition">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Slice Location(+) -->
- <xsl:template match="attr[@tag='00201041']" />
- <xsl:template match="attr[@tag='00201041']" mode="PlanePosition">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Image Position (Retired)(+) -->
- <xsl:template match="attr[@tag='00200030']" />
- <xsl:template match="attr[@tag='00200030']" mode="PlanePosition">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="PlanePosition" />
-
- <!--
- Plane Orientation Functional Group
- -->
- <!-- Image Orientation (Patient) -->
- <xsl:template match="attr[@tag='00200037']" />
- <xsl:template match="attr[@tag='00200037']" mode="PlaneOrientation">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Image Orientation (Retired)(+) -->
- <xsl:template match="attr[@tag='00200035']" />
- <xsl:template match="attr[@tag='00200035']" mode="PlaneOrientation">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="PlaneOrientation" />
-
- <!--
- Referenced Image Functional Group
- -->
- <!-- Referenced Image Sequence -->
- <xsl:template match="attr[@tag='00081140']" />
- <!-- SOP Class UID -->
- <xsl:template match="attr[@tag='00080016']" />
- <xsl:template match="attr[@tag='00080016']" mode="ReferencedImage">
- <!-- Referenced SOP Class UID -->
- <attr tag="00081150" vr="UI">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <!-- SOP Instance UID -->
- <xsl:template match="attr[@tag='00080018']" />
- <xsl:template match="attr[@tag='00080018']" mode="ReferencedImage">
- <!-- Referenced SOP Instance UID -->
- <attr tag="00081155" vr="UI">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <xsl:template match="attr" mode="ReferencedImage" />
-
- <!--
- Derivation Image Functional Group
- -->
- <!-- Derivation Description -->
- <xsl:template match="attr[@tag='00082111']" />
- <xsl:template match="attr[@tag='00082111']" mode="DerivationImage">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Derivation Code Sequence -->
- <xsl:template match="attr[@tag='00089215']" />
- <xsl:template match="attr[@tag='00089215']" mode="DerivationImage">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Source Image Sequence -->
- <xsl:template match="attr[@tag='00082112']" />
- <xsl:template match="attr[@tag='00082112']" mode="DerivationImage">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="DerivationImage" />
-
- <!--
- Frame Anatomy Functional Group
- -->
- <!-- Laterality -->
- <xsl:template match="attr[@tag='00200060']" mode="FrameAnatomy">
- <!-- Frame Laterality -->
- <attr tag="00209072" vr="CS">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <!-- Anatomic Region Sequence -->
- <xsl:template match="attr[@tag='00082218']" />
- <xsl:template match="attr[@tag='00082218']" mode="FrameAnatomy">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="FrameAnatomy" />
-
- <!--
- Pixel Value Transformation Functional Group
- -->
- <!-- Rescale Intercept -->
- <xsl:template match="attr[@tag='00281052']" />
- <xsl:template match="attr[@tag='00281052']" mode="PixelValueTransformation">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Rescale Slope -->
- <xsl:template match="attr[@tag='00281053']" />
- <xsl:template match="attr[@tag='00281053']" mode="PixelValueTransformation">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="PixelValueTransformation" />
-
- <!--
- Frame VOI LUT Functional Group
- -->
- <!-- Window Center -->
- <xsl:template match="attr[@tag='00281050']" />
- <xsl:template match="attr[@tag='00281050']" mode="FrameVOILUT">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Window Width -->
- <xsl:template match="attr[@tag='00281051']" />
- <xsl:template match="attr[@tag='00281051']" mode="FrameVOILUT">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="FrameVOILUT" />
-
- <!--
- Patient Orientation Type Functional Group
- -->
- <!-- Patient Orientation -->
- <xsl:template match="attr[@tag='00200020']" />
- <xsl:template match="attr[@tag='00200020']" mode="PatientOrientation">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="PatientOrientation" />
-
- <!--
- Irradiation Event Identification Functional Group
- -->
- <!-- Irradiation Event UID -->
- <xsl:template match="attr[@tag='00083010']" />
- <xsl:template match="attr[@tag='00083010']" mode="IrradiationEventIdentification">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="IrradiationEventIdentification" />
-
- <!--
- CT Image Frame Type Functional Group
- -->
- <!-- Image Type -->
- <xsl:template match="attr[@tag='00080008']" />
- <xsl:template match="attr[@tag='00080008']" mode="CTImageFrameType">
- <!-- Frame Type -->
- <attr tag="00089007" vr="CS">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
- <xsl:template match="attr" mode="CTImageFrameType" />
-
- <!--
- CT Acquisition Type Functional Group
- -->
-<!-- Scan Options(+) -->
- <xsl:template match="attr[@tag='00180022']" />
- <xsl:template match="attr[@tag='00180022']" mode="CTAcquisitionType">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTAcquisitionType" />
-
- <!--
- CT Acquisition Details Functional Group
- -->
-<!-- Rotation Direction -->
- <xsl:template match="attr[@tag='00181140']" />
- <xsl:template match="attr[@tag='00181140']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Revolution Time -->
- <xsl:template match="attr[@tag='00189305']" />
- <xsl:template match="attr[@tag='00189305']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Single Collimation Width -->
- <xsl:template match="attr[@tag='00189306']" />
- <xsl:template match="attr[@tag='00189306']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Total Collimation Width -->
- <xsl:template match="attr[@tag='00189307']" />
- <xsl:template match="attr[@tag='00189307']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Table Height -->
- <xsl:template match="attr[@tag='00181130']" />
- <xsl:template match="attr[@tag='00181130']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Gantry/Detector Tilt -->
- <xsl:template match="attr[@tag='00181120']" />
- <xsl:template match="attr[@tag='00181120']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Data Collection Diameter -->
- <xsl:template match="attr[@tag='00180090']" />
- <xsl:template match="attr[@tag='00180090']" mode="CTAcquisitionDetails">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTAcquisitionDetails" />
-
- <!--
- CT Table Dynamics Functional Group
- -->
-<!-- Table Speed -->
- <xsl:template match="attr[@tag='00189309']" />
- <xsl:template match="attr[@tag='00189309']" mode="CTTableDynamics">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Table Feed per Rotation -->
- <xsl:template match="attr[@tag='00189310']" />
- <xsl:template match="attr[@tag='00189310']" mode="CTTableDynamics">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Spiral Pitch Factor -->
- <xsl:template match="attr[@tag='00189311']" />
- <xsl:template match="attr[@tag='00189311']" mode="CTTableDynamics">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTTableDynamics" />
-
- <!--
- CT Geometry Functional Group
- -->
-<!-- Distance Source to Detector -->
- <xsl:template match="attr[@tag='00181110']" />
- <xsl:template match="attr[@tag='00181110']" mode="CTGeometry">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Distance Source to Patient(+) -->
- <xsl:template match="attr[@tag='00181111']" />
- <xsl:template match="attr[@tag='00181111']" mode="CTGeometry">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTGeometry" />
-
- <!--
- CT Reconstruction Functional Group
- -->
-<!-- Convolution Kernel -->
- <xsl:template match="attr[@tag='00181210']" />
- <xsl:template match="attr[@tag='00181210']" mode="CTReconstruction">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Reconstruction Diameter -->
- <xsl:template match="attr[@tag='00181100']" />
- <xsl:template match="attr[@tag='00181100']" mode="CTReconstruction">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTReconstruction" />
-
- <!--
- CT Exposure Functional Group
- -->
-<!-- Exposure Time -->
- <xsl:template match="attr[@tag='00181150']" />
- <xsl:template match="attr[@tag='00181150']" mode="CTExposure">
- <!-- Exposure Time in ms -->
- <attr tag="00189328" vr="FD">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
-<!-- X-ray Tube Current -->
- <xsl:template match="attr[@tag='00181151']" />
- <xsl:template match="attr[@tag='00181151']" mode="CTExposure">
- <!-- X-ray Tube Current in mA -->
- <attr tag="00189330" vr="FD">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
-<!-- Exposure -->
- <xsl:template match="attr[@tag='00181152']" />
- <xsl:template match="attr[@tag='00181152']" mode="CTExposure">
- <!-- Exposure in mAs -->
- <attr tag="00189332" vr="FD">
- <xsl:value-of select="." />
- </attr>
- </xsl:template>
-<!-- Exposure in μAs (0018,1153) -->
- <xsl:template match="attr[@tag='00181153']" />
- <xsl:template match="attr[@tag='00181153']" mode="CTExposure">
- <xsl:variable name="s" select="normalize-space()" />
- <xsl:variable name="l" select="string-length(s)" />
- <!-- Exposure in mAs -->
- <attr tag="00189332" vr="FD">
- <xsl:value-of select="substring(s,1,l-3)" />
- <xsl:text>.</xsl:text>
- <xsl:value-of select="substring(s,l-2)" />
- </attr>
- </xsl:template>
-<!-- Exposure Modulation Type (0018,9323) -->
- <xsl:template match="attr[@tag='00189323']" />
- <xsl:template match="attr[@tag='00189323']" mode="CTExposure">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Estimated Dose Saving (0018,9324) -->
- <xsl:template match="attr[@tag='00189324']" />
- <xsl:template match="attr[@tag='00189324']" mode="CTExposure">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- CTDIvol (0018,9345) -->
- <xsl:template match="attr[@tag='00189345']" />
- <xsl:template match="attr[@tag='00189345']" mode="CTExposure">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTExposure" />
-
- <!--
- CT X-ray Details Functional Group
- -->
- <!-- KVP -->
- <xsl:template match="attr[@tag='00180060']" />
- <xsl:template match="attr[@tag='00180060']" mode="CTXrayDetails">
- <xsl:copy-of select="." />
- </xsl:template>
- <!-- Filter Type -->
- <xsl:template match="attr[@tag='00181160']" />
- <xsl:template match="attr[@tag='00181160']" mode="CTXrayDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Generator Power(+) -->
- <xsl:template match="attr[@tag='00181170']" />
- <xsl:template match="attr[@tag='00181170']" mode="CTXrayDetails">
- <xsl:copy-of select="." />
- </xsl:template>
-<!-- Focal Spot -->
- <xsl:template match="attr[@tag='00181190']" />
- <xsl:template match="attr[@tag='00181190']" mode="CTXrayDetails">
- <xsl:copy-of select="." />
- </xsl:template>
- <xsl:template match="attr" mode="CTXrayDetails" />
-
-<!--
- Attributes available from DB records (=> allow to differ between source images)
- -->
- <!-- Study Time -->
- <xsl:template match="attr[@tag='00080030']" />
- <!-- Study Description -->
- <xsl:template match="attr[@tag='00081030']" />
- <!-- Series Time -->
- <xsl:template match="attr[@tag='00080031']" />
- <!-- Series Description -->
- <xsl:template match="attr[@tag='0008103E']" />
-
- <xsl:template match="attr">
- <!-- exclude private elements -->
- <xsl:if test="translate(substring(@tag,4,1),'13579BCF','')">
- <xsl:copy-of select="." />
- </xsl:if>
- </xsl:template>
- <xsl:template match="item">
- <xsl:copy-of select="." />
- </xsl:template>
-</xsl:stylesheet>
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-upgrade2emf-xmbean.xml
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-upgrade2emf-xmbean.xml 2007-12-05 18:04:42 UTC (rev 5591)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/conf/xmdesc/dcm4chee-upgrade2emf-xmbean.xml 2007-12-06 12:12:19 UTC (rev 5592)
@@ -26,13 +26,12 @@
<attribute access="read-write" getMethod="getConfigDir"
setMethod="setConfigDir">
<description>
- Directory where configuration files defining the generation of DCM4CHEE
+ Directory where XML configuration files defining the generation of DCM4CHEE
Upgraded Multi-frame images from DICOM CT, MR or PET Single-frame images are
- located: if XSL stylesheet "upgrade-ct.xsl", "upgrade-mr.xsl" or
- "upgrade-pet.xsl" exists in this directory or in a sub-directory equal to the
- AE Title of the Storage SCU, received CT, MR or PET Series will be upgraded
- DCM4CHEE Upgraded CT, MR or PET Multi-frame images according the stylesheet.
- A relative path name is resolved relative to
+ located: if "upgrade-ct.xml", "upgrade-mr.xml" or "upgrade-pet.xml" exists in
+ this directory or in a sub-directory equal to the AE Title of the Storage
+ SCU, received CT, MR or PET Series will be upgraded DCM4CHEE Upgraded CT, MR
+ or PET Multi-frame images. A relative path name is resolved relative to
archive-install-directory/server/default/.
</description>
<name>ConfigDirectory</name>
@@ -47,15 +46,15 @@
<description>
<p>Defines, if Patient, Study and Series attributes are merged from
corresponding DB records into the generated Multi-frame image, so they need
- not be copied by XSLT from the Single-frame images to the generated
- Multi-frame image. Attributes not copied by XSLT are not verified for
- equality of values over all source images. Therefore, skipping such
- attributes by XSLT allows the generation of the Multi-frame image even if
- the attribute value differs between source images.</p>
- <p>Series Instance UID is never merged from the DB, so it can be
- defined by the XSL style sheet - by copying the Series Instance UID
- attribute into the output, or not - if the generated Multi-frame image shall
- be put into the same Series as the source images, or not.</p>
+ not be specified in upgrade-XX.xml to be copied from the Single-frame images
+ to the generated Multi-frame image. Attributes not specified in
+ upgrade-XX.xml are not verified for equality of values over all source
+ images. Therefore, skipping such attributes from upgrade-XX.xml allows the
+ generation of the Multi-frame image even if the attribute value differs
+ between source images.</p> <p>Series Instance UID is never merged
+ from the DB, so it can be defined by upgrade-XX.xml - including an entry for
+ the Series Instance UID attribute or not - if the generated Multi-frame image
+ shall be put into the same Series as the source images, or not.</p>
</description>
<name>MergePatientStudySeriesAttributesFromDB</name>
<type>boolean</type>
@@ -153,12 +152,6 @@
<name>FileSystemMgtName</name>
<type>javax.management.ObjectName</type>
</attribute>
- <attribute access="read-write" getMethod="getTemplatesServiceName"
- setMethod="setTemplatesServiceName">
- <description>Used internally. Do NOT modify.</description>
- <name>TemplatesServiceName</name>
- <type>javax.management.ObjectName</type>
- </attribute>
&defaultAttributes;
<!-- Operations -->
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/deploy/dcm4chee-upgrade2emf-service.xml
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/deploy/dcm4chee-upgrade2emf-service.xml 2007-12-05 18:04:42 UTC (rev 5591)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/etc/deploy/dcm4chee-upgrade2emf-service.xml 2007-12-06 12:12:19 UTC (rev 5592)
@@ -16,8 +16,6 @@
>dcm4chee.archive:service=StoreScp</depends>
<depends optional-attribute-name="JMSServiceName"
>dcm4chee.archive:service=JMS</depends>
- <depends optional-attribute-name="TemplatesServiceName"
- >dcm4chee.archive:service=Templates</depends>
<depends>dcm4chee.archive:service=Queue,name=UpgradeToEnhancedMF</depends>
<attribute name="QueueName">UpgradeToEnhancedMF</attribute>
</mbean>
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/EnhancedMFBuilder.java
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/EnhancedMFBuilder.java 2007-12-05 18:04:42 UTC (rev 5591)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/EnhancedMFBuilder.java 2007-12-06 12:12:19 UTC (rev 5592)
@@ -42,16 +42,10 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.sax.SAXTransformerFactory;
-import javax.xml.transform.sax.TransformerHandler;
-
import org.dcm4che.data.Dataset;
import org.dcm4che.data.DcmElement;
import org.dcm4che.data.DcmObjectFactory;
@@ -62,7 +56,6 @@
import org.dcm4che.dict.Tags;
import org.dcm4che.dict.UIDs;
import org.dcm4che.util.UIDGenerator;
-import org.dcm4chex.archive.exceptions.ConfigurationException;
import org.jboss.logging.Logger;
/**
@@ -72,31 +65,47 @@
*/
class EnhancedMFBuilder {
- private static final int[] FG_SEQ_TAGS = new int[] {
- Tags.SharedFunctionalGroupsSeq, Tags.PerFrameFunctionalGroupsSeq };
-
- private final SAXTransformerFactory tf = (SAXTransformerFactory)
- TransformerFactory.newInstance();
+ private static final int[] FG_SEQ_TAGS = {
+ Tags.SharedFunctionalGroupsSeq, Tags.PerFrameFunctionalGroupsSeq };
+ private static final Dataset ALTERNATE_SOP_CLASS_INSTANCE;
+ static {
+ ALTERNATE_SOP_CLASS_INSTANCE =
+ DcmObjectFactory.getInstance().newDataset();
+ ALTERNATE_SOP_CLASS_INSTANCE.putLO(Tags.CodeValue, "121326");
+ ALTERNATE_SOP_CLASS_INSTANCE.putSH(Tags.CodingSchemeDesignator, "DCM");
+ ALTERNATE_SOP_CLASS_INSTANCE.putLO(Tags.CodeMeaning,
+ "Alternate SOP Class instance");
+ }
private final Logger log;
- private final Templates tpl;
+ private final Dataset filter;
+ private final Dataset fgFilters;
+ private final Dataset dataset;
+ private final Dataset sharedFGs;
private final int frameTypeTag;
private final boolean noPixelData;
private final boolean deflate;
+ private final long[] pixelDataOffsets;
+ private final int[] pixelDataLengths;
private File f0;
- private Dataset dataset;
private int pixelDataVR;
private int pixelDataLength;
private int curFrame = 0;
- private final long[] pixelDataOffsets;
- private final int[] pixelDataLengths;
+ private String[] imageType;
+ private Date acquisitionDatetime;
+ private Date contentDatetime;
+ private String instanceNumber;
+
public EnhancedMFBuilder(UpgradeToEnhancedMFService service,
- Templates tpl, int frameTypeTag, int numFrames) {
+ Dataset filter, int frameTypeTag, int numFrames) {
this.log = service.getLog();
this.noPixelData = service.isNoPixelData();
this.deflate = service.isDeflate();
- this.tpl = tpl;
+ this.filter = filter;
+ this.fgFilters = filter.getItem(Tags.SharedFunctionalGroupsSeq);
+ this.dataset = DcmObjectFactory.getInstance().newDataset();
+ this.sharedFGs = dataset.putSQ(Tags.SharedFunctionalGroupsSeq).addNewItem();
this.frameTypeTag = frameTypeTag;
this.pixelDataOffsets = new long[numFrames];
this.pixelDataLengths = new int[numFrames];
@@ -127,14 +136,12 @@
if (log.isDebugEnabled()) {
log.debug("M-READ " + f);
}
- Dataset newFrame = DcmObjectFactory.getInstance().newDataset();
+ Dataset source = DcmObjectFactory.getInstance().newDataset();
BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(f));
DcmParser parser = DcmParserFactory.getInstance().newDcmParser(bis);
try {
- TransformerHandler th = tf.newTransformerHandler(tpl);
- parser.setSAXHandler2(th, null, null, Integer.MAX_VALUE, null);
- th.setResult(new SAXResult(newFrame.getSAXHandler2(null)));
+ parser.setDcmHandler(source.getDcmHandler());
parser.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
if (parser.getReadTag() != Tags.PixelData) {
throw new UpgradeToEnhancedMFException("No Pixel Data in " + f);
@@ -163,17 +170,14 @@
}
pixelDataOffsets[curFrame] = parser.getStreamPosition();
pixelDataLengths[curFrame] = parser.getReadLength();
- } catch (TransformerConfigurationException e) {
- throw new ConfigurationException(e);
} finally {
try { bis.close(); } catch (IOException ignore) {}
}
- purgeEmptyItems(newFrame.get(Tags.SharedFunctionalGroupsSeq).getItem());
- if (dataset == null) {
+ if (curFrame == 0) {
if (log.isDebugEnabled()) {
log.debug("Create new Enhanced MF from " + f);
}
- dataset = newFrame;
+ init(source);
f0 = f;
} else {
if (log.isDebugEnabled()) {
@@ -181,60 +185,147 @@
}
if (!noPixelData
&& !dataset.getFileMetaInfo().getTransferSyntaxUID()
- .equals(newFrame.getFileMetaInfo()
+ .equals(source.getFileMetaInfo()
.getTransferSyntaxUID())) {
throw new UpgradeToEnhancedMFException("Transfer Syntax of "
+ f + " differs from " + f0);
}
- if (!dataset.exclude(FG_SEQ_TAGS).equals(
- newFrame.exclude(FG_SEQ_TAGS))) {
+ if (!dataset.exclude(FG_SEQ_TAGS).equals(source.subSet(filter))) {
throw new UpgradeToEnhancedMFException(
"Non Functional Groups elements of " + f
+ " differs from " + f0);
}
- mergeFunctionalGroups(dataset, newFrame);
+ mergeFunctionalGroups(dataset, source);
}
++curFrame;
}
- private void purgeEmptyItems(Dataset ds) {
- for (Iterator iterator = ds.iterator(); iterator.hasNext();) {
- DcmElement el = (DcmElement) iterator.next();
- if (el.isEmpty() || el.countItems() == 1 && el.getItem().isEmpty()) {
- iterator.remove();
+ private void init(Dataset source) {
+ dataset.putAll(source.subSet(filter));
+ for (Iterator it = fgFilters.iterator(); it.hasNext();) {
+ DcmElement el = (DcmElement) it.next();
+ Dataset fgFilter = el.getItem();
+ Dataset fg = source.subSet(fgFilter);
+ if (!fg.isEmpty()) {
+ sharedFGs.putSQ(el.tag()).addNewItem().putAll(fg);
}
}
+ sharedFGs.putSQ(frameTypeTag).addNewItem().putCS(Tags.FrameType,
+ imageType = source.getStrings(Tags.ImageType));
+ Dataset perFrameFGs = dataset.putSQ(
+ Tags.PerFrameFunctionalGroupsSeq).addNewItem();
+ addReferencedImageFG(perFrameFGs, source);
+ addFrameContentFG(perFrameFGs, source);
}
- private void mergeFunctionalGroups(Dataset dataset, Dataset newframe) {
- Dataset sharedFGs =
- dataset.get(Tags.SharedFunctionalGroupsSeq).getItem();
- Dataset newSharedFGs =
- newframe.get(Tags.SharedFunctionalGroupsSeq).getItem();
- Dataset newPerFrameFGs =
- newframe.get(Tags.PerFrameFunctionalGroupsSeq).getItem();
+ private void addReferencedImageFG(Dataset perFrameFGs, Dataset source) {
+ DcmElement refImageSeq = perFrameFGs.putSQ(Tags.RefImageSeq);
+ Dataset refSource = refImageSeq.addNewItem();
+ refSource.putUI(Tags.RefSOPClassUID,
+ source.getString(Tags.SOPClassUID));
+ refSource.putUI(Tags.RefSOPInstanceUID,
+ source.getString(Tags.SOPInstanceUID));
+ refSource.putSQ(Tags.PurposeOfReferenceCodeSeq)
+ .addItem(ALTERNATE_SOP_CLASS_INSTANCE);
+
+ DcmElement srcRefImageSeq = source.get(Tags.RefImageSeq);
+ if (srcRefImageSeq != null) {
+ for (int i = 0, n = srcRefImageSeq.countItems(); i < n; i++) {
+ refImageSeq.addItem(srcRefImageSeq.getItem(i));
+ }
+ }
+ }
+
+ private void addFrameContentFG(Dataset perFrameFGs, Dataset source) {
+ Dataset fg = perFrameFGs.putSQ(Tags.FrameContentSeq).addNewItem();
+ Date d = source.getDate(Tags.AcquisitionDatetime);
+ if (d == null) {
+ d = source.getDateTime(Tags.AcquisitionDate, Tags.AcquisitionTime);
+ }
+ if (d != null) {
+ fg.putDT(Tags.FrameAcquisitionDatetime, d);
+ if (acquisitionDatetime == null
+ || acquisitionDatetime.compareTo(d) > 0) {
+ acquisitionDatetime = d;
+ }
+ }
+ String s;
+ if ((s = source.getString(Tags.AcquisitionNumber)) != null) {
+ try {
+ fg.putUS(Tags.FrameAcquisitionNumber, Integer.parseInt(s));
+ } catch (NumberFormatException e) {
+ log.info("Ignore non-numeric Acquisition Number: " + s
+ + " of Instance: "
+ + source.getString(Tags.SOPInstanceUID));
+ }
+ }
+ if ((s = source.getString(Tags.ImageComments)) != null) {
+ fg.putLT(Tags.FrameComments, s);
+ }
+ if ((s = source.getString(Tags.InstanceCreationDate)) != null) {
+ fg.putDA(Tags.InstanceCreationDate, s);
+ }
+ if ((s = source.getString(Tags.InstanceCreationTime)) != null) {
+ fg.putTM(Tags.InstanceCreationTime, s);
+ }
+ if ((s = source.getString(Tags.ContentDate)) != null) {
+ fg.putDA(Tags.ContentDate, s);
+ }
+ if ((s = source.getString(Tags.ContentTime)) != null) {
+ fg.putTM(Tags.ContentTime, s);
+ }
+ if ((s = source.getString(Tags.InstanceNumber)) != null) {
+ fg.putIS(Tags.InstanceNumber, s);
+ }
+ d = source.getDateTime(Tags.ContentDate, Tags.ContentTime);
+ if (d != null) {
+ if (contentDatetime == null
+ || contentDatetime.compareTo(d) > 0) {
+ contentDatetime = d;
+ instanceNumber = s;
+ }
+ }
+ }
+
+ private void mergeFunctionalGroups(Dataset dataset, Dataset source) {
+ DcmElement perFrameFGSeq =
+ dataset.get(Tags.PerFrameFunctionalGroupsSeq);
+ Dataset perFrameFGs = perFrameFGSeq.addNewItem();
+ addReferencedImageFG(perFrameFGs, source);
+ addFrameContentFG(perFrameFGs, source);
int[] noLongerSharedFGTags = {};
- for (Iterator sharedFGsIter = sharedFGs.iterator();
- sharedFGsIter.hasNext();) {
- DcmElement sharedFGSeq = (DcmElement) sharedFGsIter.next();
- int fgTag = sharedFGSeq.tag();
- if (sharedFGSeq.equals(newSharedFGs.get(fgTag))) {
- newSharedFGs.remove(fgTag);
- } else {
- noLongerSharedFGTags = append(noLongerSharedFGTags, fgTag);
- }
+ for (Iterator it = fgFilters.iterator(); it.hasNext();) {
+ DcmElement el = (DcmElement) it.next();
+ int fgTag = el.tag();
+ Dataset fgFilter = el.getItem();
+ Dataset fg = source.subSet(fgFilter);
+ Dataset sharedFG = sharedFGs.getItem(fgTag);
+ if (!fg.equals(sharedFG)) {
+ if (sharedFG != null) {
+ noLongerSharedFGTags = append(noLongerSharedFGTags, fgTag);
+ }
+ if (!fg.isEmpty()) {
+ perFrameFGs.putSQ(fgTag).addNewItem().putAll(fg);
+ }
+ }
}
- DcmElement perFrameFGSeq =
- dataset.get(Tags.PerFrameFunctionalGroupsSeq);
+ String[] frameType = source.getStrings(Tags.ImageType);
+ if (!Arrays.equals(this.imageType, frameType)
+ && sharedFGs.contains(frameTypeTag)) {
+ noLongerSharedFGTags = append(noLongerSharedFGTags, frameTypeTag);
+ }
if (noLongerSharedFGTags.length != 0) {
Dataset noLongerSharedFGs = sharedFGs.subSet(noLongerSharedFGTags);
- for (int i = 0, n = perFrameFGSeq.countItems(); i < n; i++) {
+ for (int i = 0, n = perFrameFGSeq.countItems() - 1; i < n; i++) {
perFrameFGSeq.getItem(i).putAll(noLongerSharedFGs);
}
noLongerSharedFGs.clear();
}
- newPerFrameFGs.putAll(newSharedFGs);
- perFrameFGSeq.addItem(newPerFrameFGs);
+ if (!sharedFGs.contains(frameTypeTag)) {
+ perFrameFGs.putSQ(frameTypeTag).addNewItem()
+ .putCS(Tags.FrameType, frameType);
+ }
+ this.imageType = mergeImageType(this.imageType, frameType);
}
private int[] append(int[] a, int i) {
@@ -249,12 +340,17 @@
throw new IllegalStateException("curFrame: " + curFrame
+ " < numFrame: " + pixelDataOffsets.length);
}
- initImageTypeAndAcquisitionDatetime();
+ dataset.putCS(Tags.ImageType, imageType);
+ dataset.putCS(Tags.InstanceNumber, instanceNumber);
+ dataset.putDA(Tags.ContentDate, contentDatetime);
+ dataset.putTM(Tags.ContentTime, contentDatetime);
+ dataset.putDT(Tags.AcquisitionDatetime, acquisitionDatetime);
dataset.putIS(Tags.NumberOfFrames, pixelDataOffsets.length);
UIDGenerator uidGen = UIDGenerator.getInstance();
if (!dataset.containsValue(Tags.SeriesInstanceUID)) {
dataset.putUI(Tags.SeriesInstanceUID, uidGen.createUID());
}
+ dataset.putUI(Tags.SOPClassUID, filter.getString(Tags.SOPClassUID));
dataset.putUI(Tags.SOPInstanceUID, uidGen.createUID());
try {
dataset.setFileMetaInfo(
@@ -270,56 +366,14 @@
return dataset;
}
- private void initImageTypeAndAcquisitionDatetime() {
- Dataset sharedFGs = dataset.getItem(Tags.SharedFunctionalGroupsSeq);
- Dataset sharedFrameTypeFG = sharedFGs.getItem(frameTypeTag);
- DcmElement perFrameFGsSeq = dataset.get(Tags.PerFrameFunctionalGroupsSeq);
- Dataset perFrameFGs = perFrameFGsSeq.getItem(0);
- Dataset frameContentFG = perFrameFGs.getItem(Tags.FrameContentSeq);
- String[] imageType = (sharedFrameTypeFG != null
- ? sharedFrameTypeFG : perFrameFGs.getItem(frameTypeTag))
- .getStrings(Tags.FrameType);
- String instNo = frameContentFG.getString(Tags.InstanceNumber);
- Date contentDateTime = frameContentFG.getDateTime(Tags.ContentDate,
- Tags.ContentTime);
- Date acquistionDateTime = frameContentFG.getDate(
- Tags.FrameAcquisitionDatetime);
- Date d;
- for (int i = 1, n = perFrameFGsSeq.countItems(); i < n; i++) {
- perFrameFGs = perFrameFGsSeq.getItem(i);
- frameContentFG = perFrameFGs.getItem(Tags.FrameContentSeq);
- if (sharedFrameTypeFG == null) {
- imageType = mergeImageType(imageType, perFrameFGs
- .getItem(frameTypeTag).getStrings(Tags.FrameType));
- }
- d = frameContentFG.getDateTime(Tags.ContentDate,
- Tags.ContentTime);
- if (d != null && (contentDateTime == null
- || d.compareTo(contentDateTime) < 0)) {
- contentDateTime = d;
- instNo = frameContentFG.getString(Tags.InstanceNumber);
- }
- d = frameContentFG.getDate(Tags.FrameAcquisitionDatetime);
- if (d != null && (acquistionDateTime == null
- || d.compareTo(acquistionDateTime) < 0)) {
- acquistionDateTime = d;
- }
- }
- dataset.putCS(Tags.ImageType, imageType);
- dataset.putCS(Tags.InstanceNumber, instNo);
- dataset.putDA(Tags.ContentDate, contentDateTime);
- dataset.putTM(Tags.ContentTime, contentDateTime);
- dataset.putDT(Tags.AcquisitionDatetime, acquistionDateTime);
- }
-
private String[] mergeImageType(String[] t1, String[] t2) {
if (t1.length < t2.length) {
String[] tmp = t1;
t1 = t2;
t2 = tmp;
}
- for (int i = 0; i < t2.length; i++) {
- if (!t1[i].equals(t2[i])) {
+ for (int i = 0; i < t1.length; i++) {
+ if (!(i < t2.length && t1[i].equals(t2[i]))) {
t1[i] = "MIXED";
}
}
Modified: dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/UpgradeToEnhancedMFService.java
===================================================================
--- dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/UpgradeToEnhancedMFService.java 2007-12-05 18:04:42 UTC (rev 5591)
+++ dcm4chee/dcm4chee-arc/trunk/dcm4jboss-sar/src/java/org/dcm4chex/archive/emf/UpgradeToEnhancedMFService.java 2007-12-06 12:12:19 UTC (rev 5592)
@@ -50,18 +50,21 @@
import javax.management.Notification;
import javax.management.NotificationListener;
import javax.management.ObjectName;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
import org.dcm4che.data.Dataset;
import org.dcm4che.data.DcmElement;
import org.dcm4che.data.DcmEncodeParam;
+import org.dcm4che.data.DcmObjectFactory;
import org.dcm4che.dict.Tags;
import org.dcm4che.dict.UIDs;
import org.dcm4che.dict.VRs;
import org.dcm4che.util.BufferedOutputStream;
import org.dcm4chex.archive.common.SeriesStored;
import org.dcm4chex.archive.ejb.interfaces.FileDTO;
+import org.dcm4chex.archive.exceptions.ConfigurationException;
import org.dcm4chex.archive.mbean.JMSDelegate;
-import org.dcm4chex.archive.mbean.TemplatesDelegate;
import org.dcm4chex.archive.util.FileUtils;
import org.jboss.system.ServiceMBeanSupport;
@@ -78,11 +81,11 @@
private static final int[] SERIES_IUID = { Tags.SeriesInstanceUID };
- private static final String UPGRADE_CT_XSL = "upgrade-ct.xsl";
+ private static final String UPGRADE_CT_XML = "upgrade-ct.xml";
- private static final String UPGRADE_MR_XSL = "upgrade-mr.xsl";
+ private static final String UPGRADE_MR_XML = "upgrade-mr.xml";
- private static final String UPGRADE_PET_XSL = "upgrade-pet.xsl";
+ private static final String UPGRADE_PET_XML = "upgrade-pet.xml";
private ObjectName storeScpServiceName;
@@ -92,6 +95,8 @@
private int concurrency = 1;
+ private String configDir;
+
private boolean mergePatientStudySeriesAttributesFromDB;
private boolean noPixelData;
@@ -104,16 +109,6 @@
private JMSDelegate jmsDelegate = new JMSDelegate(this);
- private TemplatesDelegate templates = new TemplatesDelegate(this);
-
- public final ObjectName getTemplatesServiceName() {
- return templates.getTemplatesServiceName();
- }
-
- public final void setTemplatesServiceName(ObjectName serviceName) {
- templates.setTemplatesServiceName(serviceName);
- }
-
public final ObjectName getJmsServiceName() {
return jmsDelegate.getJmsServiceName();
}
@@ -147,11 +142,11 @@
}
public final String getConfigDir() {
- return templates.getConfigDir();
+ return configDir;
}
public final void setConfigDir(String path) {
- templates.setConfigDir(path);
+ this.configDir = path;
}
public final boolean isMergePatientStudySeriesAttributesFromDB() {
@@ -227,24 +222,47 @@
public boolean isUpgradeEnabled(SeriesStored seriesStored) {
String modality = seriesStored.getModality();
if ("CT".equals(modality)) {
- return isUpgradeEnabled(seriesStored, UPGRADE_CT_XSL,
+ return isUpgradeEnabled(seriesStored, UPGRADE_CT_XML,
UIDs.CTImageStorage);
}
if ("MR".equals(modality)) {
- return isUpgradeEnabled(seriesStored, UPGRADE_MR_XSL,
+ return isUpgradeEnabled(seriesStored, UPGRADE_MR_XML,
UIDs.MRImageStorage);
}
if ("PT".equals(modality)) {
- return isUpgradeEnabled(seriesStored, UPGRADE_PET_XSL,
+ return isUpgradeEnabled(seriesStored, UPGRADE_PET_XML,
UIDs.PositronEmissionTomographyImageStorage);
}
return false;
}
- private boolean isUpgradeEnabled(SeriesStored seriesStored, String xsl,
+ private File getConfigFile(String aet, String fname) {
+ if (aet != null) {
+ File f = FileUtils.resolve(new File(new File(configDir, aet), fname));
+ if (f.exists()) {
+ return f;
+ }
+ }
+ return FileUtils.resolve(new File(configDir, fname));
+ }
+
+ private Dataset loadConfig(File file) throws ConfigurationException {
+ Dataset ds = DcmObjectFactory.getInstance().newDataset();
+ try {
+ SAXParserFactory f = SAXParserFactory.newInstance();
+ SAXParser p = f.newSAXParser();
+ p.parse(file, ds.getSAXHandler2(null));
+ } catch (Exception e) {
+ throw new ConfigurationException(
+ "Failed to load VMF Configuration from " + file);
+ }
+ return ds;
+ }
+
+ private boolean isUpgradeEnabled(SeriesStored seriesStored, String xml,
String cuid) {
String callingAET = seriesStored.getCallingAET();
- return templates.getTemplatesForAET(callingAET, xsl) != null
+ return getConfigFile(callingAET, xml).exists()
&& containsOnlySOPClass(seriesStored, cuid);
}
@@ -393,17 +411,17 @@
String modality = seriesStored.getModality();
if ("CT".equals(modality)) {
return new EnhancedMFBuilder(this,
- templates.getTemplatesForAET(callingAET, UPGRADE_CT_XSL),
+ loadConfig(getConfigFile(callingAET, UPGRADE_CT_XML)),
Tags.CTImageFrameTypeSeq, numFrames);
}
if ("MR".equals(modality)) {
return new EnhancedMFBuilder(this,
- templates.getTemplatesForAET(callingAET, UPGRADE_MR_XSL),
+ loadConfig(getConfigFile(callingAET, UPGRADE_MR_XML)),
Tags.MRImageFrameTypeSeq, numFrames);
}
if ("PT".equals(modality)) {
return new EnhancedMFBuilder(this,
- templates.getTemplatesForAET(callingAET, UPGRADE_PET_XSL),
+ loadConfig(getConfigFile(callingAET, UPGRADE_PET_XML)),
PETFrameTypeSeqTag, numFrames);
}
throw new IllegalArgumentException("modality: " + modality);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|