public void setCutOut(ome.model.units.Length cutOut) { if (! _loaded ) errorIfUnloaded(); if (cutOut != null && cutOut.getValue() <= 0) { throw new IllegalArgumentException("values of TransmittanceRange.cutOut must be strictly positive"); } this.cutOut = cutOut; }
/** * Returns the range of the wavelength or <code>null</code>. * * @param filter The filter to handle. * @param emission Passed <code>true</code> to indicate that the filter is * an emission filter, <code>false</code> otherwise. * @return See above. */ private static Length getValueFromFilter(Filter filter, boolean emission) { if (filter == null) return null; TransmittanceRange transmittance = filter.getTransmittanceRange(); if (transmittance == null) return null; Length cutIn = transmittance.getCutIn(); if (emission) { if (cutIn == null) return null; return new Length(cutIn.getValue()+RANGE, cutIn.getUnit()); } Length cutOut = transmittance.getCutOut(); if (cutOut == null) return null; if (cutIn == null || cutIn.getValue() == 0) cutIn = new Length(cutOut.getValue()-2*RANGE, cutOut.getUnit()); // FIXME: are these in the same unit? Length v = new Length((cutIn.getValue()+cutOut.getValue()/2), cutOut.getUnit()); if (v.getValue() < 0) return new Length(0, cutOut.getUnit()); return v; }
/** * FIXME: this should likely take a default so that locations which don't * want an exception can have * * log.warn("Using new PositiveFloat(1.0)!", e); return new * PositiveFloat(1.0); * * or similar. */ public static ome.units.quantity.Length convertLength(Length t) { if (t == null) { return null; } Double v = t.getValue(); String u = t.getUnit().getSymbol(); ome.xml.model.enums.UnitsLength units = makeLengthUnitXML(u); ome.units.unit.Unit<ome.units.quantity.Length> units2 = ome.xml.model.enums.handlers.UnitsLengthEnumHandler .getBaseUnit(units); return new ome.units.quantity.Length(v, units2); }
@Override public Filterable fillObject(ReverseModelMapper mapper) { ome.model.enums.UnitsLength ut = ome.model.enums.UnitsLength.valueOf(getUnit().toString()); ome.model.units.Length t = new ome.model.units.Length(getValue(), ut); return t; }
public static Length convertLength(Length value, Unit<ome.units.quantity.Length> ul) { return convertLength(value, ul.getSymbol()); }
public static ome.units.quantity.Length makeLengthXML(double d, String unit) { ome.units.unit.Unit<ome.units.quantity.Length> units = ome.xml.model.enums.handlers.UnitsLengthEnumHandler .getBaseUnit(makeLengthUnitXML(unit)); return new ome.units.quantity.Length(d, units); }
@Override public void copyObject(Filterable model, ModelMapper mapper) { if (model instanceof ome.model.units.Length) { ome.model.units.Length t = (ome.model.units.Length) model; this.value = t.getValue(); this.unit = UnitsLength.valueOf(t.getUnit().toString()); } else { throw new IllegalArgumentException( "Length cannot copy from " + (model==null ? "null" : model.getClass().getName())); } }
public void setCutInTolerance(ome.model.units.Length cutInTolerance) { if (! _loaded ) errorIfUnloaded(); if (cutInTolerance != null && cutInTolerance.getValue() < 0) { throw new IllegalArgumentException("values of TransmittanceRange.cutInTolerance must not be negative"); } this.cutInTolerance = cutInTolerance; }
public void setPhysicalSizeX(ome.model.units.Length physicalSizeX) { if (! _loaded ) errorIfUnloaded(); if (physicalSizeX != null && physicalSizeX.getValue() <= 0) { throw new IllegalArgumentException("values of Pixels.physicalSizeX must be strictly positive"); } this.physicalSizeX = physicalSizeX; }
public void setPhysicalSizeZ(ome.model.units.Length physicalSizeZ) { if (! _loaded ) errorIfUnloaded(); if (physicalSizeZ != null && physicalSizeZ.getValue() <= 0) { throw new IllegalArgumentException("values of Pixels.physicalSizeZ must be strictly positive"); } this.physicalSizeZ = physicalSizeZ; }
public void setWavelength(ome.model.units.Length wavelength) { if (! _loaded ) errorIfUnloaded(); if (wavelength != null && wavelength.getValue() <= 0) { throw new IllegalArgumentException("values of Laser.wavelength must be strictly positive"); } this.wavelength = wavelength; }
public void setCutIn(ome.model.units.Length cutIn) { if (! _loaded ) errorIfUnloaded(); if (cutIn != null && cutIn.getValue() <= 0) { throw new IllegalArgumentException("values of TransmittanceRange.cutIn must be strictly positive"); } this.cutIn = cutIn; }
public void setCutOutTolerance(ome.model.units.Length cutOutTolerance) { if (! _loaded ) errorIfUnloaded(); if (cutOutTolerance != null && cutOutTolerance.getValue() < 0) { throw new IllegalArgumentException("values of TransmittanceRange.cutOutTolerance must not be negative"); } this.cutOutTolerance = cutOutTolerance; }
public void setEmissionWave(ome.model.units.Length emissionWave) { if (! _loaded ) errorIfUnloaded(); if (emissionWave != null && emissionWave.getValue() <= 0) { throw new IllegalArgumentException("values of LogicalChannel.emissionWave must be strictly positive"); } this.emissionWave = emissionWave; }
public void setPhysicalSizeY(ome.model.units.Length physicalSizeY) { if (! _loaded ) errorIfUnloaded(); if (physicalSizeY != null && physicalSizeY.getValue() <= 0) { throw new IllegalArgumentException("values of Pixels.physicalSizeY must be strictly positive"); } this.physicalSizeY = physicalSizeY; }
public void setWavelength(ome.model.units.Length wavelength) { if (! _loaded ) errorIfUnloaded(); if (wavelength != null && wavelength.getValue() <= 0) { throw new IllegalArgumentException("values of LightSettings.wavelength must be strictly positive"); } this.wavelength = wavelength; }
public void setExcitationWave(ome.model.units.Length excitationWave) { if (! _loaded ) errorIfUnloaded(); if (excitationWave != null && excitationWave.getValue() <= 0) { throw new IllegalArgumentException("values of LogicalChannel.excitationWave must be strictly positive"); } this.excitationWave = excitationWave; }
/** * Determines the color corresponding to the passed value. * * @param value The value to handle. * @return */ private static int[] determineColor(Length value) { if (value == null) return null; if (rangeBlue(value.getValue())) return newBlueColor(); if (rangeGreen(value.getValue())) return newGreenColor(); if (rangeRed(value.getValue())) return newRedColor(); return null; }
if (value != null) return ""+value.getValue(); if (lc.getFilterSet() != null) { Iterator<Filter> it = lc.getFilterSet().linkedEmissionFilterIterator(); Laser laser = (Laser) src; value = laser.getWavelength(); if (value != null) return ""+value.getValue(); if (value != null) return ""+value.getValue(); if (lc.getFilterSet() != null) { Iterator<Filter> it = lc.getFilterSet().linkedExcitationFilterIterator();