Sie sind auf Seite 1von 5

Labwork3

Biomedical informatics
University of Ljubljana, Faculty of Electrical
Engineering

Autor:
dr. Tomaž Vrtovec Koldo Eizmendi Gallastegui
Laboratory of Imaging Technologies Registration number: 70081273
Academic year: 2018/2019
University of Ljubljana, Faculty of Electrical Engineering Koldo Eizmendi Gallastegui
Laboratory of Imaging Technologies
Biomedical informatics 2018/2019

LabWork3: THE DICOM STANDARD


The main purpose of this lab is to work with a DICOM file and understand the way data is stored in it.
Using Maltab, some questions regarding DICOM file data will be answered.

Question 1
This first question asks to enclose the picture of the image stored in the DICOM file. In this case, the file I had to
analyse was image06. Using the same code as in the lecture Figure1 can be obtained.
dcmData= loadDicomFile('image06.dcm');

Figure 1. Image stored in the DICOM file.

Question 2
This quesrion asks to create a function named getDicomTagName() that gives the desription of the data
element.

The code used has been:


function [oGroupName, oElementName] = getDicomTagName (iTag)

1
University of Ljubljana, Faculty of Electrical Engineering Koldo Eizmendi Gallastegui
Laboratory of Imaging Technologies
Biomedical informatics 2018/2019
iDataG=load('dcmGroups');
length (iDataG.code)
for k=1:length(iDataG.code)
if str2num(iDataG.code{k})==str2num(iTag(1:4))
break;
end
end
oGroupName=iDataG.desc{k};

iDataG=load('dcmElements');
for k=1:length(iDataG.code)
if str2num(iDataG.code{k})==str2num(iTag(1:4))
break;
end
end
oElementName=iDataG.desc{k};

end

Question 3

This question asks to write some information about some data elements. The procedure followed has
been:
1.- With the help of the ppt presentation achieve the (gggg,eeee) of each element manually.
2.- Run the programme made in the lab substituting the (gggg,eeee) used in the lab by the one that is
required.
dcmPatientName= getDicomDataElement(dcmData,'0010,0010')

3.- Take out some » ; » of the getDicomDataElement() of the function made in the lab:
if strcmp (tag,iTag)
oElement.idx=
oElement.tag=tag
oElement.VR=[char(iData(i+4)),char(iData(i+5))]
oElement.VL=iData(i+6)+iData(i+7)*256
oElement.value=iData(i+8:i+8+oElement.VL-1)
oElement.value=convertDicomValue(oElement.value,oElement.VR)
break;
end

2
University of Ljubljana, Faculty of Electrical Engineering Koldo Eizmendi Gallastegui
Laboratory of Imaging Technologies
Biomedical informatics 2018/2019

4.- Run the programme, and see what we get.


The results can be seen in the Table1.
Table 1. The results of Question 3

(gggg, eeee) Start Index VR VL Value

Study
Information, 0008, 0023 527 DA 8 20060408
Image Date

Study
Information, 0008, 0033 585 TM 6 134441
Image Time

Patient
Information, 0010, 0010 1295 PN 14 Anonymous1939
Patient’s name

Patient
Information, 0010, 1010 1359 AS 4 075Y
Age

Image
Information, 0028, 0010 4957 US 2 512
Rows

Image
Information, 0028, 1051 5085 DS 4 1785
Window Width

Question 4

What is the size (in bytes) of the selected DICOM file?


Using the next commad, we can directly see the size of the selected DICOM file.
out = dir('image06.dcm')

After compiling it the size we get is: 535194bytes.


What is the size (in bytes) of the image data, i.e. only without the header data and data elements?
Using the command imageinfo('image06.dcm') we get the next window:

3
University of Ljubljana, Faculty of Electrical Engineering Koldo Eizmendi Gallastegui
Laboratory of Imaging Technologies
Biomedical informatics 2018/2019

We can see that the Width and Height are 512 pixels and the BitDepth is 16bits. With these three
values the image size can be calculated:

This gives a total of


524800 bytes
What is the size (in bytes) of all data except the image data?
The size in bytes of all data except the image data can be obtained by a simple substraction.
535194 bytes – 524288 bytes= 10906 bytes
What is the size (in bytes) of all a elements?
A DICOM file is composed of a Preamble, data elements and Data.
We have seen that the size of the DICOM file is 535194 bytes and that the image data’s size is
524288bytes. Therefore preamble+data elements should be 10906 bytes. To calculate the size of all
data elements the size of the Preamble has to be substracted.
We know that Preamble consists of the blind part which is 128 bytes and an extra part with the
definition of file format of 4 bytes. This makes a total of 132 bytes for the Preamble.
We then have that:
10906 bytes- 132 bytes = 10774 bytes

Question 5

Write down the text that is stored between byte 129 and byte 132 in the DICOM file. What can you
conclude on the basis of the obtained text?
These four bytes contain the character string DICM. The purpose of this prefix is to recognize that the
file is or is not a DICOM file.
The text stored between these bytes is:
'DEFGHIJKLM'

Das könnte Ihnen auch gefallen