DICOM Tag presentation different Between IJ1 reader, SCIFIO and Bioformat - Issue with DicomTools



Hi there,

I have a problem with reading DICOM tags.

Here the problem, the way the DICOM tags are presented are different either the DICOM is opened by SCIFIO, IJ1 or BioFormat

Here an IJ1 Tag
0008,0020 Study Date: 20131021

Here a SCIFIO Tag
0008,0020 Study Date = 20131021

Here a BIOFormat tag
0008,0020 Study Date #1 = 20121019

In our app we are using
DicomTools.getTag(imp, “0008,0020”) to get the DICOM tag value of our choice.

Problem the getTag rely on a “:” separator which not exist in BioFormat / Scifio (the separator is “=”)

here is the DicomTools code :

private static String getTag(String hdr, String tag) {
		if (hdr==null) return null;
		int index1 = hdr.indexOf(tag);
		if (index1==-1) return null;
		//IJ.log(hdr.charAt(index1+11)+"   "+hdr.substring(index1,index1+20));
		if (hdr.charAt(index1+11)=='>') {
			// ignore tags in sequences
			index1 = hdr.indexOf(tag, index1+10);
			if (index1==-1) return null;
		index1 = hdr.indexOf(":", index1);
		if (index1==-1) return null;
		int index2 = hdr.indexOf("\n", index1);
		String value = hdr.substring(index1+1, index2);
		return value;

Also the tag sequence is managed differently
in IJ1 it is using > and intricated with it’s parent
0054,0304 Radiopharmaceutical Code Sequence:
0008,0100 >Code Value: C-B1031
0008,0102 >Coding Scheme Designator: SNM3
0008,0104 >Code Meaning: FDG – fluorodeoxyglucose
0054,0081 Number of Slices: 335
0054,0202 Type of Detector Motion: NONE
0054,0410 Patient Orientation Code Sequence:
0008,0100 >Code Value: F-10450
0008,0102 >Coding Scheme Designator: SNM3
0008,0104 >Code Meaning: recumbent
0054,0412 Patient Orientation Modifier Code Sequence:
0008,0100 >Code Value: F-10340
0008,0102 >Coding Scheme Designator: SNM3
0008,0104 >Code Meaning: supine
0054,0414 Patient Gantry Relationship Code Sequence:
0008,0100 >Code Value: F-10470
0008,0102 >Coding Scheme Designator: SNM3
0008,0104 >Code Meaning: headfirst

And in bioFormat is rely in # index and each value isolated form it’s parent
0008,0104 Code Meaning #1 = F^18^ [^18^Fluorine]
0008,0104 Code Meaning #2 = Intravenous route
0008,0104 Code Meaning #3 = Fluorodeoxyglucose F^18^
0008,0104 Code Meaning #4 = recumbent
0008,0104 Code Meaning #5 = supine
0008,0104 Code Meaning #6 = headfirst

In Scifio it is in an array
0008,0104 Code Meaning = [[[[18F, FDG – fluorodeoxyglucose], recumbent], supine], headfirst]

Is there a hope that readers can standardize the DICOM tag presentation ?
Or maybe DICOMTools can handle data presentation heterogeneity ?
For non sequence tag changing the splitter from : to = should be ok
But it would be nice also for a way to standardize sequence ordering and accession

The problem is when you write a plugin you don’t know how the user had opened the image from ImageJ/Fiji so depending on used reader the tag accession will be broken.

Best regards,