本文整理汇总了Java中org.dcm4che2.data.DicomElement.vr方法的典型用法代码示例。如果您正苦于以下问题:Java DicomElement.vr方法的具体用法?Java DicomElement.vr怎么用?Java DicomElement.vr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dcm4che2.data.DicomElement
的用法示例。
在下文中一共展示了DicomElement.vr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTag
import org.dcm4che2.data.DicomElement; //导入方法依赖的package包/类
/**
* Write integer or other short value. Auto converts to actual VR type
*
* @throws Exception
*/
public void setTag(int tagNr, int intValue) throws Exception
{
if (this.canModify == false)
throw new Exception("Unmodifyable Dicom");
DicomElement el = this.dicom.get(tagNr);
VR vr;
if (el != null)
vr = el.vr();
else
vr = DicomUtil.getVRofTag(tagNr);
dicom.putInt(tagNr, vr, intValue);
this.isModified = true;
}
示例2: setDateValue
import org.dcm4che2.data.DicomElement; //导入方法依赖的package包/类
public void setDateValue(int tagNr, Date date) throws Exception
{
if (this.canModify == false)
throw new Exception("Unmodifyable Dicom");
// check float ?
DicomElement el = this.dicom.get(tagNr);
VR vr;
if (el != null)
vr = el.vr();
else
vr = DicomUtil.getVRofTag(tagNr);
// Assert Date/Time ?
dicom.putDate(tagNr, vr, date);
this.isModified = true;
}
示例3: doClearTag
import org.dcm4che2.data.DicomElement; //导入方法依赖的package包/类
protected void doClearTag(DicomElement el) throws Exception
{
logger.debugPrintf("Clearing element:%s\n", el);
VR vr = el.vr();
VRType vrType = VRType.valueOf(vr);
switch (vrType.getValueType())
{
case INTEGER:
{
dicom.setTag(el.tag(), 0);
break;
}
case DOUBLE:
{
dicom.setTag(el.tag(), (double) 0);
break;
}
case STRING:
{
dicom.setTag(el.tag(), "");
break;
}
case BYTES:
{
dicom.setTag(el.tag(), new byte[]
{});
break;
}
case TIME:
{
dicom.setTag(el.tag(), new byte[]
{});
break;
}
case DATETIME:
{
dicom.setTag(el.tag(), new byte[]
{});
break;
}
case UID:
{
// This might break the standards.
logger.warnPrintf("Clearing UID value of element:%s\n", el);
dicom.setTag(el.tag(), "");
break;
}
case UNKNOWN:
{
dicom.setTag(el.tag(), new byte[]
{});
break;
}
}
}