<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Dear Mohammad,
<div><br>
</div>
<div>Sorry to hear this still isn't working for you. Could you submit the image file via <a href="http://qa.openmicroscopy.org.uk">http://qa.openmicroscopy.org.uk</a> so we can do further testing please?</div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Helen<br>
<div><br>
</div>
<div><br>
<div>
<div>
<div>Dr Helen Flynn</div>
<div>OME Technical Writer</div>
<div>Centre for Gene Regulation & Expression</div>
<div>Open Microscopy Environment</div>
<div>University of Dundee</div>
<div><a href="http://openmicroscopy.org">http://openmicroscopy.org</a></div>
</div>
</div>
<br>
<div>
<div>On 11 Apr 2014, at 16:25, Mohammad Samarah <<a href="mailto:isamarah@mac.com">isamarah@mac.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">Hi Melissa,<br>
<br>
We tried both options. We are unable to retrieve the nested DICOM tags. Here<br>
is the code fragment in question.<br>
<br>
Thanks for your help,<br>
M. Samarah<br>
<br>
<br>
ServiceFactory factory = new ServiceFactory();<br>
OMEXMLService service = factory.getInstance(OMEXMLService.class);<br>
IMetadata meta = service.createOMEXMLMetadata();<br>
<br>
log_message("INFO: Examining file " + imagePath);<br>
r.setMetadataStore(meta);<br>
r.setGroupFiles(false);<br>
r.setId(imagePath);<br>
<br>
CoreMetadata data[] = r.getCoreMetadata();<br>
metadata = data[r.getCoreIndex()].seriesMetadata;<br>
Set<String> keys = metadata.keySet();<br>
<br>
for(String key: keys)<br>
{<br>
System.out.println("Value of "+key+" is: "+metadata.get(key));<br>
}<br>
<br>
Object obj = r.getSeriesMetadataValue("0008,2228 Primary Anatomic Structure<br>
Sequence");<br>
<br>
if (obj instance of List)<br>
{<br>
System.out.println("obj is a list");<br>
// order they were found<br>
// List values = (List) obj;<br>
// Object firstCodeMeaning = values.get(0);<br>
}<br>
else {<br>
// single value<br>
System.out.println("obj is a single value");<br>
}<br>
<br>
<blockquote type="cite">From: Melissa Linkert <<a href="mailto:melissa@glencoesoftware.com">melissa@glencoesoftware.com</a>><br>
Reply-To: <<a href="mailto:melissa@glencoesoftware.com">melissa@glencoesoftware.com</a>><br>
Date: Mon, 07 Apr 2014 18:59:58 -0500<br>
To: "<a href="mailto:msamarah@alumni.fit.edu">msamarah@alumni.fit.edu</a>" <<a href="mailto:msamarah@alumni.fit.edu">msamarah@alumni.fit.edu</a>><br>
Cc: "<a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a>"<br>
<<a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a>><br>
Subject: Re: [ome-users] ImageProcessorReader.getSeriesMetadata() for<br>
extracting DICOM tags<br>
<br>
Hi Mohammad,<br>
<br>
<blockquote type="cite">We are using ImageProcessorReader to extract DICOM tags from an RVG image.<br>
All seems to be well, however it does not seem to return repeating tags<br>
particularly tag id 0008,0104. Are there specific options needed to extract<br>
repeated tags? And are there known limitations with the Imetadata class? I<br>
have attached the DICOM tags table and Java code in question below.<br>
</blockquote>
<br>
Typically if there would be multiple entries in the metadata hashtable<br>
that have the same key, then a suffix is appended to the relevant keys.<br>
I would expect something like this to work:<br>
<br>
metadata = r.getSeriesMetadata();<br>
Object firstCodeMeaning = metadata.get("Code Meaning #0");<br>
Object secondCodeMeaning = metadata.get("Code Meaning #1");<br>
Object thirdCodeMeaning = metadata.get("Code Meaning #2");<br>
<br>
Alternately, you can do this to preserve the original key and access the<br>
values as a List:<br>
<br>
metadata = r.getCoreMetadataList().get(r.getCoreIndex()).seriesMetadata;<br>
Object value = metadata.get("Code Meaning");<br>
if (value instanceof List) {<br>
// multiple values for the same key; values are stored in the<br>
// order they were found<br>
List values = (List) value;<br>
Object firstCodeMeaning = values.get(0);<br>
}<br>
else {<br>
// single value<br>
}<br>
<br>
If neither of those options work, please let us know.<br>
<br>
Regards,<br>
-Melissa<br>
<br>
On Fri, Apr 04, 2014 at 01:48:30AM -0400, Mohammad Samarah wrote:<br>
<blockquote type="cite">We are using ImageProcessorReader to extract DICOM tags from an RVG image.<br>
All seems to be well, however it does not seem to return repeating tags<br>
particularly tag id 0008,0104. Are there specific options needed to extract<br>
repeated tags? And are there known limitations with the Imetadata class? I<br>
have attached the DICOM tags table and Java code in question below.<br>
<br>
Thanks for your help,<br>
M. Samarah<br>
<a href="mailto:msamarah@alumni.fit.edu">msamarah@alumni.fit.edu</a><br>
<br>
<br>
Tag ID VR VM Len Description Value<br>
(0008,2228) SQ 0 0 Primary Anatomic Structure<br>
Sequence<br>
(FFFE,E000)<br>
(0008,0100)<br>
(0008,0102)<br>
(0008,0104) LO 1 34 Code Meaning Maxillary<br>
right third molar tooth<br>
(FFFE,E000)<br>
(0008,0100)<br>
(0008,0102)<br>
(0008,0104) LO 1 34 Code Meaning Maxillary<br>
right second molar tooth<br>
(FFFE,E000)<br>
(0008,0100)<br>
(0008,0102)<br>
(0008,0104) LO 1 34 Code Meaning Maxillary<br>
right first molar tooth<br>
<br>
<br>
ImageProcessorReader r = new ImageProcessorReader(new<br>
ChannelSeparator(LociPrefs.makeImageReader()));<br>
try<br>
{<br>
ServiceFactory factory = new ServiceFactory();<br>
OMEXMLService service = factory.getInstance(OMEXMLService.class);<br>
IMetadata meta = service.createOMEXMLMetadata();<br>
log_message("INFO: Examining file " + imagePath);<br>
r.setMetadataStore(meta);<br>
r.setGroupFiles(false);<br>
r.setId(imagePath);<br>
<br>
metadata = r.getSeriesMetadata();<br>
Set<String> keys = metadata.keySet();<br>
for(String key: keys)<br>
{<br>
System.out.println("Value of "+key+" is: "+metadata.get(key));<br>
}<br>
}<br>
<br>
</blockquote>
<br>
<blockquote type="cite">_______________________________________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a><br>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
_______________________________________________<br>
ome-users mailing list<br>
<a href="mailto:ome-users@lists.openmicroscopy.org.uk">ome-users@lists.openmicroscopy.org.uk</a><br>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>