Package ome.xml.model

Examples of ome.xml.model.Plane


          z = i % d.sizeZ;
          t = (i / d.sizeZ) % d.sizeT;
          c = i / d.sizeT / d.sizeZ;
          break;
        }
        Plane plane = new Plane();
        plane.setTheC(new NonNegativeInteger(c));
        plane.setTheZ(new NonNegativeInteger(z));
        plane.setTheT(new NonNegativeInteger(t));
        pixels.addPlane(plane);
      }
      image.setPixels(pixels);
      sample.linkImage(image);
      ome.addImage(image);
View Full Code Here


  /* (non-Javadoc)
   * @see org.cellprofiler.imageset.MetadataExtractor#extract(java.lang.Object)
   */
  public Map<String, String> extract(ImagePlane source) {
    Plane plane = source.getOMEPlane();
    final Image image = source.getSeries().getOMEImage();
    if (image == null) return emptyMap;
    Pixels pixels = image.getPixels();
    HashMap<String, String> map = new HashMap<String, String>();
    if (plane != null) {
      putIfNotNull(map, MD_C, plane.getTheC().toString());
      putIfNotNull(map, MD_T, plane.getTheT().toString());
      putIfNotNull(map, MD_Z, plane.getTheZ().toString());
      final NonNegativeInteger c = plane.getTheC();
      if (c != null) {
        final int cidx = c.getValue().intValue();
        if (pixels.sizeOfChannelList() > cidx) {
          Channel channel = pixels.getChannel(cidx);
          if (channel != null) {
View Full Code Here

  /**
   * @return the channel index of this plane
   */
  public int theC() {
    if (! hasCZT()) return 0;
    final Plane plane = getOMEPlane();
    if (plane != null) return plane.getTheC().getValue();
    return MetadataUtils.getC(imageSeries.getOMEImage().getPixels(), index);
  }
View Full Code Here

  /**
   * @return the z-stack index of this plane
   */
  public int theZ() {
    if (! hasCZT()) return 0;
    final Plane plane = getOMEPlane();
    if (plane != null) return plane.getTheZ().getValue();
    return MetadataUtils.getZ(imageSeries.getOMEImage().getPixels(), index);
  }
View Full Code Here

  /**
   * @return the t-stack index of this plane
   */
  public int theT() {
    if (! hasCZT()) return 0;
    final Plane plane = getOMEPlane();
    if (plane != null) return plane.getTheT().getValue();
    return MetadataUtils.getT(imageSeries.getOMEImage().getPixels(), index);
  }
View Full Code Here

    Map<URI, ImageFileDetails> imageFiles = new HashMap<URI, ImageFileDetails>();
    Map<URI, Map<Integer, ImageSeriesDetails>> imageSeries = new HashMap<URI, Map<Integer,ImageSeriesDetails>>();
    final Pixels pixels = omeImage.getPixels();
    int [] coords = new int[numDimensions()];
    for (int planeIdx=0; planeIdx<pixels.sizeOfPlaneList() && planeIdx<pixels.sizeOfTiffDataList(); planeIdx++) {
      final Plane plane = pixels.getPlane(planeIdx);
      final TiffData location = pixels.getTiffData(planeIdx);
      final URI uri = new URI(location.getUUID().getFileName());
      if (! imageFiles.containsKey(uri)) {
        imageFiles.put(uri, new ImageFileDetails(new ImageFile(uri)));
      }
      final ImageFileDetails ifd = imageFiles.get(uri);
      final int series = getLongAnnotationFromPlane(plane, SERIES_ANNOTATION_DESCRIPTION, 0);
      if (! imageSeries.containsKey(uri)) {
        imageSeries.put(uri, new HashMap<Integer, ImageSeriesDetails>());
      }
      Map<Integer, ImageSeriesDetails> idx2Series = imageSeries.get(uri);
      if (! idx2Series.containsKey(series)) {
        idx2Series.put(series, new ImageSeriesDetails(new ImageSeries(ifd.getImageFile(), series), ifd));
      }
      final ImageSeriesDetails isd = idx2Series.get(series);
      final int idx = location.getIFD().getValue();
      final int channel = getLongAnnotationFromPlane(plane, CHANNEL_ANNOTATION_DESCRIPTION, ImagePlane.ALWAYS_MONOCHROME);
      final ImagePlane imagePlane = new ImagePlane(isd.getImageSeries(), idx, channel);
      final ImagePlaneDetails ipd = new ImagePlaneDetails(imagePlane, isd);
      for (int didx=0; didx<numDimensions();didx++) {
        AxisType at = axis(didx).type();
        if (at.equals(Axes.CHANNEL)) {
          coords[didx] = plane.getTheC().getValue();
        } else if (at.equals(Axes.Z)) {
          coords[didx] = plane.getTheZ().getValue();
        } else if (at.equals(Axes.TIME)) {
          coords[didx] = plane.getTheT().getValue();
        } else if (at.equals(OBJECT_PLANE_AXIS_TYPE)) {
          coords[didx] = planeIdx;
        }
      }
      add(ipd, coords);
View Full Code Here

   * @param ipd the image plane that's the source of the pixels.
   */
  private static void addOMEPlane(OME ome, final Pixels pixels,
      PositiveInteger xSize, PositiveInteger ySize, int c, int z, int t,
      final ImagePlaneDetails ipd) {
    final Plane destPlane = new Plane();
    pixels.addPlane(destPlane);
    int series = 0;
    int channel = ImagePlane.ALWAYS_MONOCHROME;
    final TiffData location = new TiffData();
    final UUID uuid = new UUID();
    location.setPlaneCount(new NonNegativeInteger(1));
    if (ipd != null) {
      final ImagePlane imagePlane = ipd.getImagePlane();
      series = imagePlane.getSeries().getSeries();
      channel = imagePlane.getChannel();
      location.setIFD(new NonNegativeInteger(imagePlane.getIndex()));
      uuid.setFileName(imagePlane.getImageFile().getURI().toString());
      final Plane omePlane = imagePlane.getOMEPlane();
      if (omePlane != null) {
        location.setFirstC(omePlane.getTheC());
        location.setFirstT(omePlane.getTheT());
        location.setFirstZ(omePlane.getTheZ());
      } else {
        location.setFirstC(NNI_ZERO);
        location.setFirstT(NNI_ZERO);
        location.setFirstZ(NNI_ZERO);
       
View Full Code Here

TOP

Related Classes of ome.xml.model.Plane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.