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

Melissa Linkert melissa at glencoesoftware.com
Tue Apr 22 04:11:31 BST 2014


Hi Mohammad,

> Many thanks for your response. We have uploaded three sample images to
> qa.openmicroscopy.org.uk. Please let me know if I can provide additional

Thank you very much for uploading sample files.  We are now reviewing a
fix for this problem here:

http://github.com/openmicroscopy/bioformats/pull/1062

This fix is expected to be included in the 5.0.2 version of Bio-Formats, at
which point your code and the examples sent previously should provide
the correct behavior.

Regards,
-Melissa

On Wed, Apr 16, 2014 at 01:07:13PM -0400, Mohammad Samarah wrote:
> Dear Dr. Flynn,
> 
> Many thanks for your response. We have uploaded three sample images to
> qa.openmicroscopy.org.uk. Please let me know if I can provide additional
> details.
> 
> Best wishes,
> M. Samarah
> 
> 
> -- 
> Mohammad Samarah, PhD
> Email: msamarah at alumni.fit.edu
> Time zone: EST/EDT, UTC/GMT -5 hours, UTC/GMT -4 hours
> 
> 
> 
> From: Helen Flynn <h.flynn at dundee.ac.uk>
> Date: Wed, 16 Apr 2014 08:38:24 +0000
> To: "msamarah at alumni.fit.edu" <msamarah at alumni.fit.edu>
> Cc: "<melissa at glencoesoftware.com>" <melissa at glencoesoftware.com>,
> "ome-users at lists.openmicroscopy.org.uk"
> <ome-users at lists.openmicroscopy.org.uk>
> Subject: Re: [ome-users] ImageProcessorReader.getSeriesMetadata() for
> extracting DICOM tags
> 
> Dear Mohammad, 
> 
> Sorry to hear this still isn't working for you. Could you submit the image
> file via http://qa.openmicroscopy.org.uk so we can do further testing
> please?
> 
> Regards,
> 
> Helen
> 
> 
> Dr Helen Flynn
> OME Technical Writer
> Centre for Gene Regulation & Expression
> Open Microscopy Environment
> University of Dundee
> http://openmicroscopy.org
> 
> On 11 Apr 2014, at 16:25, Mohammad Samarah <isamarah at mac.com> wrote:
> 
> > Hi Melissa,
> > 
> > We tried both options. We are unable to retrieve the nested DICOM tags. Here
> > is the code fragment in question.
> > 
> > Thanks for your help,
> > M. Samarah
> > 
> > 
> > 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);
> > 
> > CoreMetadata data[] = r.getCoreMetadata();
> > metadata = data[r.getCoreIndex()].seriesMetadata;
> > Set<String> keys = metadata.keySet();
> > 
> > for(String key: keys)
> > {
> >    System.out.println("Value of "+key+" is: "+metadata.get(key));
> > }
> > 
> > Object obj = r.getSeriesMetadataValue("0008,2228 Primary Anatomic Structure
> > Sequence");
> > 
> > if (obj instance of List)
> > {
> >    System.out.println("obj is a list");
> >    // order they were found
> >    //  List values = (List) obj;
> >    // Object firstCodeMeaning = values.get(0);
> > }
> > else {
> >    // single value
> >    System.out.println("obj is a single value");
> > }
> > 
> >> From: Melissa Linkert <melissa at glencoesoftware.com>
> >> Reply-To: <melissa at glencoesoftware.com>
> >> Date: Mon, 07 Apr 2014 18:59:58 -0500
> >> To: "msamarah at alumni.fit.edu" <msamarah at alumni.fit.edu>
> >> Cc: "ome-users at lists.openmicroscopy.org.uk"
> >> <ome-users at lists.openmicroscopy.org.uk>
> >> Subject: Re: [ome-users] ImageProcessorReader.getSeriesMetadata() for
> >> extracting DICOM tags
> >> 
> >> 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
> >> 
> > 
> > 
> > _______________________________________________
> > ome-users mailing list
> > ome-users at lists.openmicroscopy.org.uk
> > http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
> 
> 
> The University of Dundee is a registered Scottish Charity, No: SC015096
> 



More information about the ome-users mailing list