## loci.formats
Class OMETools

    java.lang.Object
      loci.formats.OMETools

public abstract class OMETools
extends Object

A utility class for constructing and manipulating OME-XML DOMs. It uses reflection to access the loci.ome.xml package so that the class compiles if the loci.ome.xml package is unavailable.

Constructor Summary
`OMETools()`

Method Summary
`static Object` `createRoot()` Constructs a new OME-XML root node.
`static Object` `createRoot(String xml)` Constructs a new OME-XML root node with the given XML block.
`static String` `dumpXML(Object root)` Dumps the given OME-XML DOM tree to a string.
`static Boolean` `getBigEndian(Object root)` Gets the first OME/Image/CA/Pixels element's BigEndian attribute.
`static String` `getCreationDate(Object root)` Gets the first OME/Image element's CreationDate attribute.
`static String` `getDescription(Object root, String description)` Gets the first OME/Image element's Description attribute.
`static String` `getDimensionOrder(Object root)` Gets the first OME/Image/CA/Pixels element's DimensionOrder attribute.
`static String` `getImageName(Object root)` Gets the first OME/Image element's Name attribute.
`static Float` `getPixelSizeC(Object root)` Gets the first OME/Image/CA/Dimensions element's PixelSizeC attribute.
`static Float` `getPixelSizeT(Object root)` Gets the first OME/Image/CA/Dimensions element's PixelSizeT attribute.
`static Float` `getPixelSizeX(Object root)` Gets the first OME/Image/CA/Dimensions element's PixelSizeX attribute.
`static Float` `getPixelSizeY(Object root)` Gets the first OME/Image/CA/Dimensions element's PixelSizeY attribute.
`static Float` `getPixelSizeZ(Object root)` Gets the first OME/Image/CA/Dimensions element's PixelSizeZ attribute.
`static String` `getPixelType(Object root)` Gets the first OME/Image/CA/Pixels element's PixelType attribute.
`static Integer` `getSizeC(Object root)` Gets the first OME/Image/CA/Pixels element's SizeC attribute.
`static Integer` `getSizeT(Object root)` Gets the first OME/Image/CA/Pixels element's SizeT attribute.
`static Integer` `getSizeX(Object root)` Gets the first OME/Image/CA/Pixels element's SizeX attribute.
`static Integer` `getSizeY(Object root)` Gets the first OME/Image/CA/Pixels element's SizeY attribute.
`static Integer` `getSizeZ(Object root)` Gets the first OME/Image/CA/Pixels element's SizeZ attribute.
`static String` `getStageName(Object root, String name)` Gets the first OME/Image/CA/StageLabel element's Name attribute.
`static Float` `getStageX(Object root)` Gets the first OME/Image/CA/StageLabel element's X attribute.
`static Float` `getStageY(Object root)` Gets the first OME/Image/CA/StageLabel element's Y attribute.
`static Float` `getStageZ(Object root)` Gets the first OME/Image/CA/StageLabel element's Z attribute.
`static Object` `setBigEndian(Object root, boolean bigEndian)` Populates the first OME/Image/CA/Pixels element's BigEndian attribute.
`static Object` `setCreationDate(Object root, String creationDate)` Populates the first OME/Image element's CreationDate attribute.
`static Object` `setDescription(Object root, String description)` Populates the first OME/Image element's Description attribute.
`static Object` `setDimensionOrder(Object root, String dimensionOrder)` Populates the first OME/Image/CA/Pixels element's DimensionOrder attribute.
`static Object` `setDimensions(Object root, Float pixelSizeX, Float pixelSizeY, Float pixelSizeZ, Float pixelSizeC, Float pixelSizeT)` Populates the first OME/Image/CA/Dimensions element.
`static Object` `setDisplayROI(Object root, Integer x0, Integer y0, Integer z0, Integer x1, Integer y1, Integer z1, Integer t0, Integer t1, Object displayOptions)` Populates the first OME/Image/CA/DisplayROI element.
`static Object` `setExperimenter(Object root, String firstName, String lastName, String email, String institution, String dataDirectory, Object group)` Populates the first OME/CA/Experimenter element.
`static Object` `setGroup(Object root, String name, Object leader, Object contact)` Populates the first OME/CA/Group element.
`static Object` `setImage(Object root, String name, String creationDate, String description)` Populates the first OME/Image element.
`static Object` `setImageName(Object root, String name)` Populates the first OME/Image element's Name attribute.
`static Object` `setInstrument(Object root, String manufacturer, String model, String serialNumber, String type)` Populates the first OME/CA/Instrument element.
`static Object` `setPixels(Object root, Integer sizeX, Integer sizeY, Integer sizeZ, Integer sizeC, Integer sizeT, String pixelType, Boolean bigEndian, String dimensionOrder)` Populates the first OME/Image/CA/Pixels element.
`static Object` `setPixelSizeC(Object root, float pixelSizeC)` Populates the first OME/Image/CA/Dimensions element's PixelSizeC attribute.
`static Object` `setPixelSizeT(Object root, float pixelSizeT)` Populates the first OME/Image/CA/Dimensions element's PixelSizeT attribute.
`static Object` `setPixelSizeX(Object root, float pixelSizeX)` Populates the first OME/Image/CA/Dimensions element's PixelSizeX attribute.
`static Object` `setPixelSizeY(Object root, float pixelSizeY)` Populates the first OME/Image/CA/Dimensions element's PixelSizeY attribute.
`static Object` `setPixelSizeZ(Object root, float pixelSizeZ)` Populates the first OME/Image/CA/Dimensions element's PixelSizeZ attribute.
`static Object` `setPixelType(Object root, String pixelType)` Populates the first OME/Image/CA/Pixels element's PixelType attribute.
`static Object` `setSizeC(Object root, int sizeC)` Populates the first OME/Image/CA/Pixels element's SizeC attribute.
`static Object` `setSizeT(Object root, int sizeT)` Populates the first OME/Image/CA/Pixels element's SizeT attribute.
`static Object` `setSizeX(Object root, int sizeX)` Populates the first OME/Image/CA/Pixels element's SizeX attribute.
`static Object` `setSizeY(Object root, int sizeY)` Populates the first OME/Image/CA/Pixels element's SizeY attribute.
`static Object` `setSizeZ(Object root, int sizeZ)` Populates the first OME/Image/CA/Pixels element's SizeZ attribute.
`static Object` `setStageLabel(Object root, String name, Float x, Float y, Float z)` Populates the first OME/Image/CA/StageLabel element.
`static Object` `setStageName(Object root, String name)` Populates the first OME/Image/CA/StageLabel element's Name attribute.
`static Object` `setStageX(Object root, float x)` Populates the first OME/Image/CA/StageLabel element's X attribute.
`static Object` `setStageY(Object root, float y)` Populates the first OME/Image/CA/StageLabel element's Y attribute.
`static Object` `setStageZ(Object root, float z)` Populates the first OME/Image/CA/StageLabel element's Z attribute.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OMETools

    public OMETools()

Method Detail

### createRoot

    public static Object createRoot()

  Constructs a new OME-XML root node.

### createRoot

    public static Object createRoot(String xml)

  Constructs a new OME-XML root node with the given XML block.

### dumpXML

    public static String dumpXML(Object root)

  Dumps the given OME-XML DOM tree to a string.

### setImage

    public static Object setImage(Object root,
                                  String name,
                                  String creationDate,
                                  String description)

  Populates the first OME/Image element.

### setExperimenter

    public static Object setExperimenter(Object root,
                                         String firstName,
                                         String lastName,
                                         String email,
                                         String institution,
                                         String dataDirectory,
                                         Object group)

  Populates the first OME/CA/Experimenter element.

### setGroup

    public static Object setGroup(Object root,
                                  String name,
                                  Object leader,
                                  Object contact)

  Populates the first OME/CA/Group element.

### setInstrument

    public static Object setInstrument(Object root,
                                       String manufacturer,
                                       String model,
                                       String serialNumber,
                                       String type)

  Populates the first OME/CA/Instrument element.

### setDimensions

    public static Object setDimensions(Object root,
                                       Float pixelSizeX,
                                       Float pixelSizeY,
                                       Float pixelSizeZ,
                                       Float pixelSizeC,
                                       Float pixelSizeT)

  Populates the first OME/Image/CA/Dimensions element.

### setDisplayROI

    public static Object setDisplayROI(Object root,
                                       Integer x0,
                                       Integer y0,
                                       Integer z0,
                                       Integer x1,
                                       Integer y1,
                                       Integer z1,
                                       Integer t0,
                                       Integer t1,
                                       Object displayOptions)

  Populates the first OME/Image/CA/DisplayROI element.

### setPixels

    public static Object setPixels(Object root,
                                   Integer sizeX,
                                   Integer sizeY,
                                   Integer sizeZ,
                                   Integer sizeC,
                                   Integer sizeT,
                                   String pixelType,
                                   Boolean bigEndian,
                                   String dimensionOrder)

  Populates the first OME/Image/CA/Pixels element.

### setStageLabel

    public static Object setStageLabel(Object root,
                                       String name,
                                       Float x,
                                       Float y,
                                       Float z)

  Populates the first OME/Image/CA/StageLabel element.

### setImageName

    public static Object setImageName(Object root,
                                      String name)

  Populates the first OME/Image element's Name attribute.

### setCreationDate

    public static Object setCreationDate(Object root,
                                         String creationDate)

  Populates the first OME/Image element's CreationDate attribute.

### setDescription

    public static Object setDescription(Object root,
                                        String description)

  Populates the first OME/Image element's Description attribute.

### setPixelSizeX

    public static Object setPixelSizeX(Object root,
                                       float pixelSizeX)

  Populates the first OME/Image/CA/Dimensions element's PixelSizeX attribute.

### setPixelSizeY

    public static Object setPixelSizeY(Object root,
                                       float pixelSizeY)

  Populates the first OME/Image/CA/Dimensions element's PixelSizeY attribute.

### setPixelSizeZ

    public static Object setPixelSizeZ(Object root,
                                       float pixelSizeZ)

  Populates the first OME/Image/CA/Dimensions element's PixelSizeZ attribute.

### setPixelSizeC

    public static Object setPixelSizeC(Object root,
                                       float pixelSizeC)

  Populates the first OME/Image/CA/Dimensions element's PixelSizeC attribute.

### setPixelSizeT

    public static Object setPixelSizeT(Object root,
                                       float pixelSizeT)

  Populates the first OME/Image/CA/Dimensions element's PixelSizeT attribute.

### setSizeX

    public static Object setSizeX(Object root,
                                  int sizeX)

  Populates the first OME/Image/CA/Pixels element's SizeX attribute.

### setSizeY

    public static Object setSizeY(Object root,
                                  int sizeY)

  Populates the first OME/Image/CA/Pixels element's SizeY attribute.

### setSizeZ

    public static Object setSizeZ(Object root,
                                  int sizeZ)

  Populates the first OME/Image/CA/Pixels element's SizeZ attribute.

### setSizeC

    public static Object setSizeC(Object root,
                                  int sizeC)

  Populates the first OME/Image/CA/Pixels element's SizeC attribute.

### setSizeT

    public static Object setSizeT(Object root,
                                  int sizeT)

  Populates the first OME/Image/CA/Pixels element's SizeT attribute.

### setPixelType

    public static Object setPixelType(Object root,
                                      String pixelType)

  Populates the first OME/Image/CA/Pixels element's PixelType attribute.

### setBigEndian

    public static Object setBigEndian(Object root,
                                      boolean bigEndian)

  Populates the first OME/Image/CA/Pixels element's BigEndian attribute.

### setDimensionOrder

    public static Object setDimensionOrder(Object root,
                                           String dimensionOrder)

  Populates the first OME/Image/CA/Pixels element's DimensionOrder attribute.

### setStageName

    public static Object setStageName(Object root,
                                      String name)

  Populates the first OME/Image/CA/StageLabel element's Name attribute.

### setStageX

    public static Object setStageX(Object root,
                                   float x)

  Populates the first OME/Image/CA/StageLabel element's X attribute.

### setStageY

    public static Object setStageY(Object root,
                                   float y)

  Populates the first OME/Image/CA/StageLabel element's Y attribute.

### setStageZ

    public static Object setStageZ(Object root,
                                   float z)

  Populates the first OME/Image/CA/StageLabel element's Z attribute.

### getImageName

    public static String getImageName(Object root)

  Gets the first OME/Image element's Name attribute.

### getCreationDate

    public static String getCreationDate(Object root)

  Gets the first OME/Image element's CreationDate attribute.

### getDescription

    public static String getDescription(Object root,
                                        String description)

  Gets the first OME/Image element's Description attribute.

### getPixelSizeX

    public static Float getPixelSizeX(Object root)

  Gets the first OME/Image/CA/Dimensions element's PixelSizeX attribute.

### getPixelSizeY

    public static Float getPixelSizeY(Object root)

  Gets the first OME/Image/CA/Dimensions element's PixelSizeY attribute.

### getPixelSizeZ

    public static Float getPixelSizeZ(Object root)

  Gets the first OME/Image/CA/Dimensions element's PixelSizeZ attribute.

### getPixelSizeC

    public static Float getPixelSizeC(Object root)

  Gets the first OME/Image/CA/Dimensions element's PixelSizeC attribute.

### getPixelSizeT

    public static Float getPixelSizeT(Object root)

  Gets the first OME/Image/CA/Dimensions element's PixelSizeT attribute.

### getSizeX

    public static Integer getSizeX(Object root)

  Gets the first OME/Image/CA/Pixels element's SizeX attribute.

### getSizeY

    public static Integer getSizeY(Object root)

  Gets the first OME/Image/CA/Pixels element's SizeY attribute.

### getSizeZ

    public static Integer getSizeZ(Object root)

  Gets the first OME/Image/CA/Pixels element's SizeZ attribute.

### getSizeC

    public static Integer getSizeC(Object root)

  Gets the first OME/Image/CA/Pixels element's SizeC attribute.

### getSizeT

    public static Integer getSizeT(Object root)

  Gets the first OME/Image/CA/Pixels element's SizeT attribute.

### getPixelType

    public static String getPixelType(Object root)

  Gets the first OME/Image/CA/Pixels element's PixelType attribute.

### getBigEndian

    public static Boolean getBigEndian(Object root)

  Gets the first OME/Image/CA/Pixels element's BigEndian attribute.

### getDimensionOrder

    public static String getDimensionOrder(Object root)

  Gets the first OME/Image/CA/Pixels element's DimensionOrder attribute.

### getStageName

    public static String getStageName(Object root,
                                      String name)

  Gets the first OME/Image/CA/StageLabel element's Name attribute.

### getStageX

    public static Float getStageX(Object root)

  Gets the first OME/Image/CA/StageLabel element's X attribute.

### getStageY

    public static Float getStageY(Object root)

  Gets the first OME/Image/CA/StageLabel element's Y attribute.

### getStageZ

    public static Float getStageZ(Object root)

  Gets the first OME/Image/CA/StageLabel element's Z attribute.