org.dcm4che3.data.Attributes.setFloat()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.dcm4che3.data.Attributes.setFloat()方法的一些代码示例,展示了Attributes.setFloat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.setFloat()方法的具体详情如下:
包路径:org.dcm4che3.data.Attributes
类名称:Attributes
方法名:setFloat

Attributes.setFloat介绍

暂无

代码示例

代码示例来源:origin: dcm4che/dcm4che

public Object setFloat(int tag, VR vr, float... fs) {
  return setFloat(null, tag, vr, fs);
}

代码示例来源:origin: nroduit/Weasis

private static Attributes bluildLabelAndAnchor(AnnotationGraphic g) {
  Rectangle2D bound = g.getLabelBounds();
  Point2D anchor = g.getAnchorPoint();
  String text = Arrays.stream(g.getLabels()).collect(Collectors.joining("\r\n")); //$NON-NLS-1$
  Attributes attributes = new Attributes(7);
  attributes.setString(Tag.BoundingBoxAnnotationUnits, VR.CS, PIXEL);
  attributes.setFloat(Tag.AnchorPoint, VR.FL, (float) anchor.getX(), (float) anchor.getY());
  attributes.setString(Tag.AnchorPointVisibility, VR.CS, "Y"); //$NON-NLS-1$
  Sequence style = attributes.newSequence(Tag.LineStyleSequence, 1);
  Attributes styles = new Attributes();
  styles.setFloat(Tag.LineThickness, VR.FL, g.getLineThickness());
  if (g.getColorPaint() instanceof Color) {
    Color color = (Color) g.getColorPaint();
    float[] rgb = PresentationStateReader.colorToLAB(color);
    if (rgb != null) {
      styles.setInt(Tag.PatternOnColorCIELabValue, VR.US, CIELab.convertToDicomLab(rgb));
    }
  }
  style.add(styles);
  attributes.setDouble(Tag.BoundingBoxTopLeftHandCorner, VR.FL,
    new double[] { bound.getMinX(), bound.getMinY() });
  attributes.setDouble(Tag.BoundingBoxBottomRightHandCorner, VR.FL,
    new double[] { bound.getMaxX(), bound.getMaxY() });
  // In text strings (value representation ST, LT, or UT) a new line shall be represented as CR LF.
  // see http://dicom.nema.org/medical/dicom/current/output/chtml/part05/chapter_6.html
  attributes.setString(Tag.UnformattedTextValue, VR.ST, text);
  return attributes;
}

代码示例来源:origin: nroduit/Weasis

private static Attributes getBasicGraphic(Graphic graphic) {
  Attributes dcm = new Attributes(5);
  dcm.setString(Tag.GraphicAnnotationUnits, VR.CS, PIXEL);
  dcm.setInt(Tag.GraphicDimensions, VR.US, 2);
  dcm.setString(Tag.GraphicFilled, VR.CS, graphic.getFilled() ? "Y" : "N"); //$NON-NLS-1$ //$NON-NLS-2$
  Sequence style = dcm.newSequence(Tag.LineStyleSequence, 1);
  Attributes styles = new Attributes();
  styles.setFloat(Tag.LineThickness, VR.FL, graphic.getLineThickness());
  if (graphic.getColorPaint() instanceof Color) {
    Color color = (Color) graphic.getColorPaint();
    float[] rgb = PresentationStateReader.colorToLAB(color);
    if (rgb != null) {
      styles.setInt(Tag.PatternOnColorCIELabValue, VR.US, CIELab.convertToDicomLab(rgb));
    }
  }
  style.add(styles);
  return dcm;
}

代码示例来源:origin: nroduit/Weasis

dataset.setFloat(id, dic.vrOf(id), (Float) val);
} else if (val instanceof float[]) {
  dataset.setFloat(id, dic.vrOf(id), (float[]) val);

代码示例来源:origin: dcm4che/dcm4che

int frameRate2 = (frameRate - 1) << 1;
attrs.setInt(Tag.CineRate, VR.IS, FPS[frameRate2]);
attrs.setFloat(Tag.FrameTime, VR.DS, ((float) FPS[frameRate2 + 1]) / FPS[frameRate2]);
if (bitRate > 0)
  numFrames = (int) (20 * length * FPS[frameRate2] / FPS[frameRate2 + 1] / bitRate);

相关文章

微信公众号

最新文章

更多