de.unihalle.informatik.MiToBo.io.tools
Class ImageIOUtils

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.io.tools.ImageIOUtils

@ALDMetaInfo(export=MANDATORY)
public class ImageIOUtils
extends Object

A class of utility functions used by the MiToBo's image-IO classes

Author:
Oliver Gress

Constructor Summary
ImageIOUtils()
           
 
Method Summary
static HashMap<Integer,String> availableCodecs(Class<? extends loci.formats.IFormatWriter> writerclass)
          Get available codecs of a specific writer class.
static HashMap<Integer,String> availableQualities(Class<? extends loci.formats.IFormatWriter> writerclass)
          Get available qualities of a specific writer class.
static Integer getKey(HashMap<Integer,String> hmap, String value)
          Obtain the key for a given value of a HashMap, if available.
static String imgReadInfo(loci.formats.IFormatReader r)
          Create a string of image reading information
static String imgWriteInfo(String filename, loci.formats.IFormatWriter w, int imgIdx)
          Create a string of image writing information
static ome.xml.model.enums.PixelType omePixelType(MTBImage.MTBImageType type)
          Get the OME pixel type corresponding to the specified MTB image type
static void physicalPixelSize_from_OME(ij.measure.Calibration cal, loci.formats.meta.IMetadata omemeta, int imageIdx)
          Set the calibration of an image from the OME meta data of image of index imageIdx
static void physicalPixelSize_to_OME(ij.measure.Calibration cal, loci.formats.meta.IMetadata omemeta, int imageIdx)
          Set OME meta data for image of index imageIdx using information from a Calibration object
static double toMicrons(double val, String unit)
          Convert a value of given space unit to microns.
static double toSeconds(double val, String unit)
          Convert a value of given time unit to seconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageIOUtils

public ImageIOUtils()
Method Detail

omePixelType

public static ome.xml.model.enums.PixelType omePixelType(MTBImage.MTBImageType type)
Get the OME pixel type corresponding to the specified MTB image type

Parameters:
type -
Returns:
OME pixel type

physicalPixelSize_to_OME

public static void physicalPixelSize_to_OME(ij.measure.Calibration cal,
                                            loci.formats.meta.IMetadata omemeta,
                                            int imageIdx)
Set OME meta data for image of index imageIdx using information from a Calibration object

Parameters:
cal -
omemeta -
imageIdx -

toMicrons

public static double toMicrons(double val,
                               String unit)
Convert a value of given space unit to microns.

Parameters:
val -
unit -
Returns:

toSeconds

public static double toSeconds(double val,
                               String unit)
Convert a value of given time unit to seconds.

Parameters:
val -
unit -
Returns:

physicalPixelSize_from_OME

public static void physicalPixelSize_from_OME(ij.measure.Calibration cal,
                                              loci.formats.meta.IMetadata omemeta,
                                              int imageIdx)
Set the calibration of an image from the OME meta data of image of index imageIdx

Parameters:
cal -
omemeta -
imageIdx -

imgWriteInfo

public static String imgWriteInfo(String filename,
                                  loci.formats.IFormatWriter w,
                                  int imgIdx)
Create a string of image writing information

Parameters:
filename -
w -
imgIdx -
Returns:

imgReadInfo

public static String imgReadInfo(loci.formats.IFormatReader r)
Create a string of image reading information

Parameters:
r -
Returns:

availableCodecs

public static HashMap<Integer,String> availableCodecs(Class<? extends loci.formats.IFormatWriter> writerclass)
Get available codecs of a specific writer class. The returned HashMap contains the codec ID as key and corresponding to a key a String containing the codec's name.

Parameters:
writerclass -
Returns:

availableQualities

public static HashMap<Integer,String> availableQualities(Class<? extends loci.formats.IFormatWriter> writerclass)
Get available qualities of a specific writer class. The returned HashMap contains the quality ID as key and corresponding to a key a String containing the quality's name.

Parameters:
writerclass -
Returns:

getKey

public static Integer getKey(HashMap<Integer,String> hmap,
                             String value)
Obtain the key for a given value of a HashMap, if available. Otherwise null is returned

Parameters:
hmap -
value -
Returns:


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.