Examples of TiffData


Examples of ome.xml.model.TiffData

    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();
View Full Code Here

Examples of ome.xml.model.TiffData

      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);
       
      }
    } else {
      // A missing plane.
      // This retrieves a URI placeholder for it.
      uuid.setFileName(new ImageFile(xSize.getValue(), ySize.getValue()).getURI().toString());
      location.setIFD(NNI_ZERO);
      location.setFirstC(NNI_ZERO);
      location.setFirstT(NNI_ZERO);
      location.setFirstZ(NNI_ZERO);
    }
    location.setUUID(uuid);
    pixels.addTiffData(location);
    destPlane.setTheC(new NonNegativeInteger(c));
    destPlane.setTheZ(new NonNegativeInteger(z));
    destPlane.setTheT(new NonNegativeInteger(t));
    if (series > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.