public Enumeration getEnumeration(Length inUnit) throws EnumerationException { return getEnumeration(inUnit.unit().getSymbol()); }
public Enumeration getEnumeration(Length inUnit) throws EnumerationException { return getEnumeration(inUnit.unit().getSymbol()); }
public Length(ome.units.quantity.Length value) { this(value.value().doubleValue(), UnitsLength.bySymbol(value.unit().getSymbol())); }
/** * Applies the orientationMatrix to positionX, positionY, and positionZ. */ public void applyMatrix() { if (positionX == null || positionY == null || positionZ == null || orientationMatrix == null) { return; } double[] v = new double[] {positionX.value().doubleValue(), positionY.value().doubleValue(), positionZ.value().doubleValue()}; double[] newValues = new double[] {0, 0, 0}; for (int row=0; row<orientationMatrix.length; row++) { for (int col=0; col<orientationMatrix[row].length; col++) { if (col < v.length) { newValues[row] += orientationMatrix[row][col] * v[col]; } else { newValues[row] += orientationMatrix[row][col]; } } } positionX = new Length(newValues[0], positionX.unit()); positionY = new Length(newValues[1], positionY.unit()); positionZ = new Length(newValues[2], positionZ.unit()); } }
/** * Applies the orientationMatrix to positionX, positionY, and positionZ. */ public void applyMatrix() { if (positionX == null || positionY == null || positionZ == null || orientationMatrix == null) { return; } double[] v = new double[] {positionX.value().doubleValue(), positionY.value().doubleValue(), positionZ.value().doubleValue()}; double[] newValues = new double[] {0, 0, 0}; for (int row=0; row<orientationMatrix.length; row++) { for (int col=0; col<orientationMatrix[row].length; col++) { if (col < v.length) { newValues[row] += orientationMatrix[row][col] * v[col]; } else { newValues[row] += orientationMatrix[row][col]; } } } positionX = new Length(newValues[0], positionX.unit()); positionY = new Length(newValues[1], positionY.unit()); positionZ = new Length(newValues[2], positionZ.unit()); } }
/** * Convert a Bio-Formats {@link Length} to an OMERO Length. A null will be * returned if the input is null. */ public static Length convertLength(ome.units.quantity.Length value) { if (value == null) return null; String internal = xmlLengthEnumToOMERO(value.unit().getSymbol()); UnitsLength ul = UnitsLength.valueOf(internal); return new omero.model.LengthI(value.value().doubleValue(), ul); }
if (y.unit() != null) UnitsLength enumUnits = UnitsLength.fromString(y.unit().getSymbol()); StageLabel_element.setAttribute("YUnit", enumUnits.toString()); } catch (EnumerationException e) if (x.unit() != null) UnitsLength enumUnits = UnitsLength.fromString(x.unit().getSymbol()); StageLabel_element.setAttribute("XUnit", enumUnits.toString()); } catch (EnumerationException e) if (z.unit() != null) UnitsLength enumUnits = UnitsLength.fromString(z.unit().getSymbol()); StageLabel_element.setAttribute("ZUnit", enumUnits.toString()); } catch (EnumerationException e)
/** * Convert a Bio-Formats {@link Length} to an OMERO Length. */ public LengthI(ome.units.quantity.Length value) { ome.model.enums.UnitsLength internal = ome.model.enums.UnitsLength.bySymbol(value.unit().getSymbol()); UnitsLength ul = UnitsLength.valueOf(internal.toString()); setValue(value.value().doubleValue()); setUnit(ul); }
if (positionX.unit() != null) UnitsLength enumUnits = UnitsLength.fromString(positionX.unit().getSymbol()); WellSample_element.setAttribute("PositionXUnit", enumUnits.toString()); } catch (EnumerationException e) if (positionY.unit() != null) UnitsLength enumUnits = UnitsLength.fromString(positionY.unit().getSymbol()); WellSample_element.setAttribute("PositionYUnit", enumUnits.toString()); } catch (EnumerationException e)
if (xd != null && xd.unit().isConvertible(UNITS.MICROMETER)) xcal = xd.value(UNITS.MICROMETER).doubleValue(); Length yd = meta.getPixelsPhysicalSizeY(series); if (yd != null && yd.unit().isConvertible(UNITS.MICROMETER)) ycal = yd.value(UNITS.MICROMETER).doubleValue(); Length zd = meta.getPixelsPhysicalSizeZ(series); if (zd != null && zd.unit().isConvertible(UNITS.MICROMETER)) zcal = zd.value(UNITS.MICROMETER).doubleValue(); Time td = meta.getPixelsTimeIncrement(series);
ul = UnitsLength.values()[ordinal]; Length tempLength = UnitsLength.create(0, ul); returnLength = UnitsLength.create(returnLength.value(tempLength.unit()), ul);
ul = UnitsLength.values()[ordinal]; Length tempLength = UnitsLength.create(0, ul); returnLength = UnitsLength.create(returnLength.value(tempLength.unit()), ul);
if (xd != null && xd.unit().isConvertible(UNITS.MICROMETER)) xcal = xd.value(UNITS.MICROMETER).doubleValue(); Length yd = meta.getPixelsPhysicalSizeY(series); if (yd != null && yd.unit().isConvertible(UNITS.MICROMETER)) ycal = yd.value(UNITS.MICROMETER).doubleValue(); Length zd = meta.getPixelsPhysicalSizeZ(series); if (zd != null && zd.unit().isConvertible(UNITS.MICROMETER)) zcal = zd.value(UNITS.MICROMETER).doubleValue(); Time td = meta.getPixelsTimeIncrement(series);
Length physicalSizeX = src.getPixelsPhysicalSizeX(image); if (physicalSizeX != null && physicalSizeX.value() != null) { physicalSizeX = FormatTools.getPhysicalSize(physicalSizeX.value().doubleValue(), physicalSizeX.unit().getSymbol()); dest.setPixelsPhysicalSizeX(physicalSizeX, image); physicalSizeY = FormatTools.getPhysicalSize(physicalSizeY.value().doubleValue(), physicalSizeY.unit().getSymbol()); dest.setPixelsPhysicalSizeY(physicalSizeY, image); physicalSizeZ = FormatTools.getPhysicalSize(physicalSizeZ.value().doubleValue(), physicalSizeZ.unit().getSymbol()); dest.setPixelsPhysicalSizeZ(physicalSizeZ, image);
Length physicalSizeX = src.getPixelsPhysicalSizeX(image); if (physicalSizeX != null && physicalSizeX.value() != null) { physicalSizeX = FormatTools.getPhysicalSize(physicalSizeX.value().doubleValue(), physicalSizeX.unit().getSymbol()); dest.setPixelsPhysicalSizeX(physicalSizeX, image); physicalSizeY = FormatTools.getPhysicalSize(physicalSizeY.value().doubleValue(), physicalSizeY.unit().getSymbol()); dest.setPixelsPhysicalSizeY(physicalSizeY, image); physicalSizeZ = FormatTools.getPhysicalSize(physicalSizeZ.value().doubleValue(), physicalSizeZ.unit().getSymbol()); dest.setPixelsPhysicalSizeZ(physicalSizeZ, image);
String unit = pszX != null ? pszX.unit().getSymbol() : "pixels";