congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
org.dcm4che3.data
Code IndexAdd Tabnine to your IDE (free)

How to use org.dcm4che3.data

Best Java code snippets using org.dcm4che3.data (Showing top 20 results out of 441)

origin: dcm4che/dcm4che

private ValidationResult validateCode(Attributes item, Code[] validVals) {
  ValidationResult result = null;
  for (Code code : validVals) {
    result = item.validate(IOD.valueOf(code));
    if (result.isValid())
      break;
  }
  return result;
}
origin: dcm4che/dcm4che

private static String toString(DateRange range, VR vr, TimeZone tz, DatePrecision precision) {
  String start = range.getStartDate() != null
      ? (String) vr.toValue(new Date[]{range.getStartDate()}, tz,
          precision)
      : "";
  String end = range.getEndDate() != null
      ? (String) vr.toValue(new Date[]{range.getEndDate()}, tz,
          precision)
      : "";
  return toDateRangeString(start, end);
}
origin: dcm4che/dcm4che

private DateRange toDateRange(String s, VR vr) {
  String[] range = splitRange(s);
  TimeZone tz = getTimeZone();
  DatePrecision precision = new DatePrecision();
  Date start = range[0] == null ? null
      : vr.toDate(range[0], tz, 0, false, null, precision);
  Date end = range[1] == null ? null
      : vr.toDate(range[1], tz, 0, true, null, precision);
  return new DateRange(start, end);
}
origin: dcm4che/dcm4che

  private static void supplementMissingValue(Attributes metadata, int tag, String value) {
    if (!metadata.containsValue(tag))
      metadata.setString(tag, DICT.vrOf(tag), value);
  }
}
origin: dcm4che/dcm4che

public static IDWithIssuer valueOf(Attributes attrs, int idTag,
    int issuerSeqTag) {
  String id = attrs.getString(idTag);
  if (id == null)
    return null;
  return new IDWithIssuer(id,
      Issuer.valueOf(attrs.getNestedDataset(issuerSeqTag)));
}
origin: dcm4che/dcm4che

public static IDWithIssuer pidOf(Attributes attrs) {
  String id = attrs.getString(Tag.PatientID);
  if (id == null)
    return null;
  IDWithIssuer result = 
      new IDWithIssuer(id, Issuer.fromIssuerOfPatientID(attrs));
  result.setTypeOfPatientID(attrs.getString(Tag.TypeOfPatientID));
  result.setIdentifierTypeCode(identifierTypeCodeOf(attrs));
  return result;
}
origin: dcm4che/dcm4che

public static Issuer valueOf(Attributes issuerItem) {
  if (issuerItem == null)
    return null;
  String localNamespaceEntityID = issuerItem.getString(Tag.LocalNamespaceEntityID);
  String universalEntityID = issuerItem.getString(Tag.UniversalEntityID);
  String universalEntityIDType = issuerItem.getString(Tag.UniversalEntityIDType);
  return (universalEntityID != null && universalEntityIDType != null)
      ? new Issuer(localNamespaceEntityID, universalEntityID, universalEntityIDType)
      : localNamespaceEntityID != null
      ? new Issuer(localNamespaceEntityID, null, null)
      : null;
}
origin: dcm4che/dcm4che

private static void supplementMissingType2(Attributes metadata) {
  for (int tag : TYPE2_TAGS)
    if (!metadata.contains(tag))
      metadata.setNull(tag, DICT.vrOf(tag));
}
origin: dcm4che/dcm4che

public Attributes getNestedDataset(String privateCreator, int sequenceTag, int itemIndex) {
  Object value = getValue(privateCreator, sequenceTag);
  if (!(value instanceof Sequence))
    return null;
  Sequence sq = (Sequence) value;
  if (itemIndex >= sq.size())
    return null;
  return sq.get(itemIndex);
}
origin: dcm4che/dcm4che

private void set(String privateCreator, int tag, Fragments src) {
  boolean toogleEndian = src.bigEndian() != bigEndian;
  VR vr = src.vr();
  Fragments dst = newFragments(privateCreator, tag, vr, src.size());
  for (Object frag : src)
    dst.add(toggleEndian(vr, frag, toogleEndian));
}
origin: dcm4che/dcm4che

public SpecificCharacterSet getSpecificCharacterSet() {
  if (cs != null)
    return cs;
  if (containsSpecificCharacterSet)
    cs = SpecificCharacterSet.valueOf(
        getStrings(null, Tag.SpecificCharacterSet, VR.CS));
  else if (parent != null)
    return parent.getSpecificCharacterSet();
  else
    cs = SpecificCharacterSet.getDefaultCharacterSet();
  return cs;
}
origin: dcm4che/dcm4che

@Override
protected IOD queryKeysIOD(QueryRetrieveLevel rootLevel,
    boolean relational) {
  IOD iod = new IOD();
  iod.add(new IOD.DataElement(Tag.StudyInstanceUID, VR.UI,
          IOD.DataElementType.TYPE_0, -1, -1, 0));
  iod.add(new IOD.DataElement(Tag.SeriesInstanceUID, VR.UI,
      IOD.DataElementType.TYPE_0, -1, -1, 0));
  iod.add(new IOD.DataElement(Tag.SOPInstanceUID, VR.UI,
      IOD.DataElementType.TYPE_0, -1, -1, 0));
  return iod;
}
origin: dcm4che/dcm4che

public Date getDate(String privateCreator, int tag, VR vr, int valueIndex,
    Date defVal) {
  return getDate(privateCreator, tag, vr, valueIndex, defVal,
      new DatePrecision());
}
origin: dcm4che/dcm4che

public static SpecificCharacterSet valueOf(String... codes) {
  if (codes == null || codes.length == 0)
    return DEFAULT;
  if (codes.length > 1)
    codes = checkISO2022(codes);
  Codec[] infos = new Codec[codes.length];
  for (int i = 0; i < codes.length; i++)
    infos[i] = Codec.forCode(codes[i]);
  return codes.length > 1 ? new ISO2022(infos,codes)
      : new SpecificCharacterSet(infos, codes);
}
origin: dcm4che/dcm4che

public Fragments newFragments(String privateCreator, int tag, VR vr,
    int initialCapacity) {
  Fragments frags = new Fragments(vr, bigEndian, initialCapacity);
  set(privateCreator, tag, vr, frags);
  return frags;
}
origin: dcm4che/dcm4che

public Sequence newSequence(String privateCreator, int tag, int initialCapacity) {
  Sequence seq = new Sequence(this, initialCapacity);
  set(privateCreator, tag, VR.SQ, seq);
  return seq;
}
origin: dcm4che/dcm4che

public Sequence getSequence(String privateCreator, int tag) {
  int index = indexOf(privateCreator, tag);
  if (index < 0)
    return null;
  
  Object value = values[index];
  if (value == Value.NULL)
    return (Sequence) (values[index] = new Sequence(this, 0));
  return value instanceof Sequence ? (Sequence) value : null;
}
origin: dcm4che/dcm4che

@Override
public boolean equals(Object o) {
  if (o == this)
    return true;
  if (!(o instanceof Key))
    return false;
  Key other = (Key) o;
  return outer().equalsIgnoreMeaning(other.outer());
}
origin: dcm4che/dcm4che

@Override
public byte[] toBytes(Object val, SpecificCharacterSet cs) {
  if (val instanceof double[])
    val = toStrings((double[]) val);
  return super.toBytes(val, cs);
} 
origin: dcm4che/dcm4che

  @Override
  public boolean prompt(Object val, boolean bigEndian,
      SpecificCharacterSet cs, int maxChars, StringBuilder sb) {
    if (val instanceof int[])
      val = toStrings((int[]) val);
    return super.prompt(val, bigEndian, cs, maxChars, sb);
  }
};
org.dcm4che3.data

Most used classes

  • Attributes
  • Sequence
  • ElementDictionary
  • BulkData
  • Code
  • VR$Holder,
  • VR,
  • Issuer,
  • IOD,
  • ValidationResult,
  • UID,
  • AttributesCoercion,
  • DatePrecision,
  • IDWithIssuer,
  • IOD$DataElement,
  • Implementation,
  • PersonName$Group,
  • PersonName,
  • SpecificCharacterSet
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now