[ome-users] ImageProcessorReader.getSeriesMetadata() for extracting DICOM tags

Melissa Linkert melissa at glencoesoftware.com
Tue Apr 8 00:59:58 BST 2014


Hi Mohammad,

> We are using ImageProcessorReader to extract DICOM tags from an RVG image.
> All seems to be well, however it does not seem to return repeating tags
> particularly tag id 0008,0104.  Are there specific options needed to extract
> repeated tags? And are there known limitations with the Imetadata class? I
> have attached the DICOM tags table and Java code in question below.

Typically if there would be multiple entries in the metadata hashtable
that have the same key, then a suffix is appended to the relevant keys.
I would expect something like this to work:

     metadata = r.getSeriesMetadata();
     Object firstCodeMeaning = metadata.get("Code Meaning #0");
     Object secondCodeMeaning = metadata.get("Code Meaning #1");
     Object thirdCodeMeaning = metadata.get("Code Meaning #2");

Alternately, you can do this to preserve the original key and access the
values as a List:

    metadata = r.getCoreMetadataList().get(r.getCoreIndex()).seriesMetadata;
    Object value = metadata.get("Code Meaning");
    if (value instanceof List) {
      // multiple values for the same key; values are stored in the
      // order they were found
      List values = (List) value;
      Object firstCodeMeaning = values.get(0);
    }
    else {
      // single value
    }

If neither of those options work, please let us know.

Regards,
-Melissa

On Fri, Apr 04, 2014 at 01:48:30AM -0400, Mohammad Samarah wrote:
> We are using ImageProcessorReader to extract DICOM tags from an RVG image.
> All seems to be well, however it does not seem to return repeating tags
> particularly tag id 0008,0104.  Are there specific options needed to extract
> repeated tags? And are there known limitations with the Imetadata class? I
> have attached the DICOM tags table and Java code in question below.
> 
> Thanks for your help,
> M. Samarah
> msamarah at alumni.fit.edu
> 
> 
> Tag ID                          VR    VM   Len    Description       Value
> (0008,2228)                SQ    0      0       Primary Anatomic Structure
> Sequence
>    (FFFE,E000)
>       (0008,0100)
>       (0008,0102)
>       (0008,0104)          LO  1        34      Code Meaning    Maxillary
> right third molar tooth
>    (FFFE,E000)
>       (0008,0100)
>       (0008,0102)
>       (0008,0104)          LO  1        34      Code Meaning    Maxillary
> right second molar tooth
>    (FFFE,E000)
>       (0008,0100)
>       (0008,0102)
>       (0008,0104)       LO  1           34      Code Meaning    Maxillary
> right first molar tooth
>    
> 
> ImageProcessorReader r = new ImageProcessorReader(new
> ChannelSeparator(LociPrefs.makeImageReader()));
> try
> {
>     ServiceFactory factory = new ServiceFactory();
>     OMEXMLService service = factory.getInstance(OMEXMLService.class);
>     IMetadata meta = service.createOMEXMLMetadata();
>     log_message("INFO: Examining file " + imagePath);
>     r.setMetadataStore(meta);
>     r.setGroupFiles(false);
>     r.setId(imagePath);
>   
>     metadata = r.getSeriesMetadata();
>     Set<String> keys = metadata.keySet();
>     for(String key: keys)
>     {
>         System.out.println("Value of "+key+" is: "+metadata.get(key));
>     }
> }
> 

> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users




More information about the ome-users mailing list