/** * Returns the abbreviation of the unit. * * @return the abbreviation of the unit */ @Override public String toString() { return unit.getAbbreviation(); }
public String getRealPositionText() { if (position == null || pixelSpacingUnit == null || pixelSize == null) { return getPixelPositionText(); } StringBuilder text = new StringBuilder("("); //$NON-NLS-1$ text.append(DecFormater.twoDecimal(pixelSize * position.x)); text.append(pixelSpacingUnit.getAbbreviation()); text.append(",");//$NON-NLS-1$ text.append(DecFormater.twoDecimal(pixelSize * position.y)); text.append(pixelSpacingUnit.getAbbreviation()); text.append(")");//$NON-NLS-1$ return text.toString(); } }
String hlength = DecFormater .oneDecimal(Unit.MILLIMETER.getConversionRatio(monitor.getRealScaleFactor()) * horizontalLength) + " " + Unit.MILLIMETER.getAbbreviation(); //$NON-NLS-1$ String vlength = DecFormater .oneDecimal(Unit.MILLIMETER.getConversionRatio(monitor.getRealScaleFactor()) * verticalLength) + " " //$NON-NLS-1$ + Unit.MILLIMETER.getAbbreviation(); g2d.drawString(hlength, x2 - 70, y2 + 15); g2d.drawString(vlength, xv1 + 10, yv2 - 5);
(int) Math.round(mb.height * Unit.MILLIMETER.getConversionRatio(monitor.getRealScaleFactor()))); buf.append(" "); //$NON-NLS-1$ buf.append(Unit.MILLIMETER.getAbbreviation()); buf.append(")"); //$NON-NLS-1$
private void getThickness(final JSliderW sliderThickness) { StringBuilder buf = new StringBuilder(MipView.MIP_THICKNESS.getTitle()); buf.append(StringUtil.COLON_AND_SPACE); int val = sliderThickness.getValue(); buf.append(val); MediaSeries<DicomImageElement> series = view.getSeries(); if (series != null) { int slice = frameSlider.getValue() - 1; SeriesComparator sort = (SeriesComparator) view.getActionValue(ActionW.SORTSTACK.cmd()); Boolean reverse = (Boolean) view.getActionValue(ActionW.INVERSESTACK.cmd()); Comparator sortFilter = (reverse != null && reverse) ? sort.getReversOrderComparator() : sort; Filter filter = (Filter) view.getActionValue(ActionW.FILTERED_SERIES.cmd()); int min = Math.max(0, slice - val); int max = Math.min(series.size(filter) - 1, slice + val); DicomImageElement fimg = series.getMedia(min, filter, sortFilter); DicomImageElement limg = series.getMedia(max, filter, sortFilter); if (fimg != null && limg != null) { buf.append(" ("); //$NON-NLS-1$ buf.append(DecFormater.oneDecimal(SeriesBuilder.getThickness(fimg, limg))); buf.append(" "); //$NON-NLS-1$ buf.append(fimg.getPixelSpacingUnit().getAbbreviation()); buf.append(")"); //$NON-NLS-1$ } } updateSliderProoperties(sliderThickness, buf.toString()); }
this.baseline = 0.0; this.amplitudeUnit = new Unit(org.weasis.core.api.image.util.Unit.PIXEL.getFullName(), org.weasis.core.api.image.util.Unit.PIXEL.getAbbreviation(), 1.0); } else { this.baseline = DicomMediaUtils.getDoubleFromDicomElement(dcm, Tag.ChannelBaseline, 0.0); Attributes chs = Objects.requireNonNull(dcm.getNestedDataset(Tag.ChannelSensitivityUnitsSequence), "no ChannelSensitivityUnitsSequence found"); //$NON-NLS-1$ String unit = chs.getString(Tag.CodeValue, org.weasis.core.api.image.util.Unit.PIXEL.getAbbreviation()); String unitDesc = chs.getString(Tag.CodeMeaning, org.weasis.core.api.image.util.Unit.PIXEL.getFullName()); double factorUnit = "mV".equals(unit) ? 1000 : 1; //$NON-NLS-1$
public MeasurementsAdapter getMeasurementAdapter(Unit displayUnit, Point offset) { Unit unit = displayUnit; if (unit == null || pixelSpacingUnit == null || pixelSpacingUnit.equals(Unit.PIXEL)) { unit = Unit.PIXEL; } double unitRatio; if (unit.equals(Unit.PIXEL)) { unitRatio = 1.0; } else { unitRatio = getPixelSize() * unit.getConversionRatio(pixelSpacingUnit.getConvFactor()); } int offsetx = offset == null ? 0 : -offset.x; int offsety = offset == null ? 0 : -offset.y; return new MeasurementsAdapter(unitRatio, offsetx, offsety, false, 0, unit.getAbbreviation()); }
adapter.getUnit())); String unit = Unit.PIXEL.getAbbreviation(); if (!unit.equals(adapter.getUnit())) { if (ANCHOR_POINT_X.getComputed()) {
(float) posy - fontHeight); str += " " + unit[0].getAbbreviation(); //$NON-NLS-1$ AbstractGraphicLabel.paintFontOutline(g2d, str, (float) (posx + scaleSizex + 5), (float) posy); AbstractGraphicLabel.paintFontOutline(g2d, str + " " + unit[0].getAbbreviation(), (int) posx, //$NON-NLS-1$ (int) (posy - 5 * strokeWidth));