Package ome.xml.model.primitives

Examples of ome.xml.model.primitives.PositiveInteger


          String transmittance = channel.filter.substring(space + 1).trim();
          String[] v = transmittance.split("-");
          try {
            Integer cutIn = new Integer(v[0].trim());
            PositiveInteger in = FormatTools.getCutIn(cutIn);
            if (in != null) {
              store.setTransmittanceRangeCutIn(in, instrument, nextFilter);
            }
          }
          catch (NumberFormatException e) { }
          if (v.length > 1) {
            try {
              Integer cutOut = new Integer(v[1].trim());
              PositiveInteger out = FormatTools.getCutOut(cutOut);
              if (out != null) {
                store.setTransmittanceRangeCutOut(out, instrument, nextFilter);
              }
            }
            catch (NumberFormatException e) { }
          }
        }

        nextFilter++;
      }
      if (channel.channelName != null) {
        String detectorID =
          MetadataTools.createLSID("Detector", instrument, nextDetector);
        store.setDetectorID(detectorID, instrument, nextDetector);
        if (channel.acquire && nextDetector < getSizeC()) {
          store.setDetectorSettingsID(detectorID, series, nextDetector);
          //store.setDetectorSettingsBinning(
          //  getBinning(binning), series, nextDetector);
        }
      }
      if (channel.amplificationGain != null) {
        store.setDetectorAmplificationGain(
          channel.amplificationGain, instrument, nextDetector);
      }
      if (channel.gain != null) {
        store.setDetectorGain(channel.gain, instrument, nextDetector);
      }
      store.setDetectorType(getDetectorType("PMT"), instrument, nextDetector);
      store.setDetectorZoom(zoom, instrument, nextDetector);
      nextDetectChannel++;
      nextDetector++;
    }
    else if (block instanceof BeamSplitter) {
      BeamSplitter beamSplitter = (BeamSplitter) block;
      if (beamSplitter.filterSet != null) {
        if (beamSplitter.filter != null) {
          String id = MetadataTools.createLSID(
            "Dichroic", instrument, nextDichroic);
          store.setDichroicID(id, instrument, nextDichroic);
          store.setDichroicModel(beamSplitter.filter, instrument, nextDichroic);
          if (nextDichroicChannel < getEffectiveSizeC()) {
            //store.setLightPathDichroicRef(id, series, nextDichroicChannel);
          }
          nextDichroic++;
        }
        nextDichroicChannel++;
      }
    }
    else if (block instanceof IlluminationChannel) {
      IlluminationChannel channel = (IlluminationChannel) block;
      if (channel.acquire && channel.wavelength != null &&
        channel.wavelength > 0)
      {
        PositiveInteger wave = FormatTools.getWavelength(channel.wavelength);
        if (wave != null) {
          store.setLaserWavelength(wave, instrument, nextIllumChannel);
        }
        if (nextIllumChannel >= nextLaser) {
          String lightSourceID = MetadataTools.createLSID(
View Full Code Here


        Channel c = new Channel();
        c.setName(MockImageDescription.DEFAULT_CHANNEL_NAMES[i]);
        pixels.addChannel(c);
        channels[i] = c;
      }
      pixels.setSizeX(new PositiveInteger(d.sizeX));
      pixels.setSizeY(new PositiveInteger(d.sizeY));
      pixels.setSizeC(new PositiveInteger(d.sizeC));
      pixels.setSizeZ(new PositiveInteger(d.sizeZ));
      pixels.setSizeT(new PositiveInteger(d.sizeT));
      pixels.setDimensionOrder(d.order);
      for (int i=0; i<d.sizeC*d.sizeZ*d.sizeT; i++) {
        int c=0, z=0, t=0;
        switch(d.order) {
        case XYCTZ:
View Full Code Here

        final int cidx = c.getValue().intValue();
        if (pixels.sizeOfChannelList() > cidx) {
          Channel channel = pixels.getChannel(cidx);
          if (channel != null) {
            putIfNotNull(map, MD_CHANNEL_NAME, channel.getName());
            final PositiveInteger samplesPerPixel = channel.getSamplesPerPixel();
            if (samplesPerPixel != null) {
              final int nSamplesPerPixel = samplesPerPixel.getValue().intValue();
              map.put(MD_COLOR_FORMAT, (nSamplesPerPixel == 1)?MD_MONOCHROME:MD_RGB);
            }
          }
        }
      }
View Full Code Here

    image.setPixels(pixels);
    ome.addImage(image);
    pixels.setID(String.format("Pixels:%s", id));
    final ImagePlaneDetails firstIPD = iterator().next();
    final Image srcImage = firstIPD.getImagePlane().getSeries().getOMEImage();
    PositiveInteger xSize = new PositiveInteger(1);
    PositiveInteger ySize = new PositiveInteger(1);
    if (srcImage != null) {
      final Pixels srcPixels = srcImage.getPixels();
      xSize = srcPixels.getSizeX();
      ySize = srcPixels.getSizeY();
    }
    pixels.setSizeX(xSize);
    pixels.setSizeY(ySize);
    setDimensionOrder(this, pixels);
    int nPlanes = 1;
    for (int axisIdx=0; axisIdx<numDimensions(); axisIdx++) {
      TypedAxis a = axis(axisIdx);
      final PositiveInteger size = new PositiveInteger(size(axisIdx));
      if (a.type().equals(Axes.Z)) {
        pixels.setSizeZ(size);
      } else if (a.type().equals(Axes.CHANNEL)) {
        pixels.setSizeC(size);
      } else {
View Full Code Here

TOP

Related Classes of ome.xml.model.primitives.PositiveInteger

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.