This brings a new common API for applying specific changes to attributes in a DICOM object or object-like type. This has been implemented for all DICOM object types, namely InMemDicomObject, FileDicomObject and FileMetaTable.
Example of use:
use dicom_encoding::ops::{ApplyOp, AttributeAction, AttributeOp};
// given some DICOM object
let mut obj = open_file("I_00001.dcm")?;
// apply patient name change
obj.apply(AttributeOp {
tag: tags::PATIENT_NAME,
action: AttributeAction::ReplaceStr("Patient^Anonymous".into())
})?;
assert_eq!(
obj.get(tags::PATIENT_NAME).unwrap().value().to_str().unwrap(),
"Patient^Anonymous",
);
Summary
[core] Add DataElement::into_parts
[core] Add more PrimitiveValue::extend_* methods for other data types
[encoding] New attribute operations module ops, with AttributeOp, AttributeAction, and ApplyOp
[object] impl ApplyOp for current object types
[object] add infallible methods get and take for InMemDicomObject, return an option instead of a result.
This brings a new common API for applying specific changes to attributes in a DICOM object or object-like type. This has been implemented for all DICOM object types, namely
InMemDicomObject
,FileDicomObject
andFileMetaTable
.Example of use:
Summary
DataElement::into_parts
PrimitiveValue::extend_*
methods for other data typesops
, withAttributeOp
,AttributeAction
, andApplyOp
ApplyOp
for current object typesget
andtake
forInMemDicomObject
, return an option instead of a result.