DeCaMino
ABOUT DOCUMENTATION DOWNLOAD LICENSING SUPPORT
DOCUMENTATION
As a plugin As a library
Get/Set attributes Storage SCP Direct write Storage SCU Storage commitment Query/Retrieve SCU Query/Retrieve SCP Worklist management File-sets (DICOMDIR) Direct encapsulation
DICOM conformance Image I/O conformance Changelog

Get/Set attributes from an object

Attributes (patient name, exam date, acquisition parameters, etc.) in DICOM objects are encoded as data elements. Manipulation of data elements is performed using class DataSet. When a DICOM object is read by the plugin, its associated stream metadata, an instance of DicomMetadata, can be used to get or set various information about the object, one being the full data set.

DicomReader reader = new DicomReader();

reader.setInput(new BufferedFileImageInputStream(new File("image.dcm")));

DicomMetadata dmd = reader.getDicomMetadata();
DataSet ds = dmd.getDataSet();
String patient_id = ds.getString(Tag.PatientID);
LocalDate date = ds.getLocalDate(Tag.StudyDate);

BufferedImage image = reader.read(0);

ds.set(Tag.PatientName, "Anonymized");

DicomReader is a subclass of the standard ImageReader. Instances can be created directly like in the example, or using the ImageIO service provider mechanism and asking for an image reader providing the "dicom" format. getDicomMetadata() is just a shortcut for (DicomMetaData) getStreamMetadata().

Tag is a dictionary class containing the numeric tags of all DICOM attributes, using the standard keywords introduced in DICOM 2009.

The value of a data element is set and get using a Java class reflecting the data element type (its DICOM Value Representation), but this restriction is loose: any element value can be read as string using getString, person names can be set with strings or with instances of specific class PersonName which can handle multi-component names, numbers are automatically converted if necessary, and so on.

DICOM is the registered trademark of the National Electrical Manufacturers Association for its standards publications relating to digital communications of medical information.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

apteryx is a registered trademark of apteryx, sarl.

DeCaMinoTM is a trademark of apteryx, sarl.

© apteryx 2024