Design a DICOM Viewer by Using GUIDE in Matlab
Contents
I. Introduction 2
II. Theory 2
1. DICOM Standard 2
2. GUIDE in Matlab 2
III. Design 3
1. Interface 3
2. Functions 3
2.1. Choose directory to open DICOM file 3
2.2. Display directory into edit text box 4
2.3. Display DICOM image into axes 4
2.4. Display DICOM information into listbox 4
2.5. Display some important information 5
2.6. Crop image 6
IV. Final Result 6
V. Limitation 7
Final Report Design a DICOM Viewer by Using GUIDE in Matlab Student: Nguyễn Trung Hiếu Class: BME K54 Contents Introduction DICOM stands for Digital Imaging and Communication in Medicine. The DICOM standard addresses the basic connectivity between different imaging devices, and also the workflow in a medical imaging department. The DICOM standard was created by the National Electrical Manufacturers Association (NEMA), and it also addresses distribution and viewing of medical images. To help doctor in diagnosis with DICOM Image easier, I use GUIDE in Matlab to design a software to view DICOM files include DICOM image and DICOM information, segment to zoom out concern region. Theory DICOM Standard The contents of the DICOM standard go far beyond a definition of an exchange format for medical image data. DICOM defines: Data structures (formats) for medical images and related data, Network oriented services Image transmission, Query of an image archive (PACS), Print (hardcopy) RIS - PACS - modality integration Formats for storage media exchange Requirements for conforming devices and programs. A DICOM image consists of a list of data elements which contain a multitude of image related information: Patient information (name, sex, identification number), Modality and imaging procedure information (device parameters, calibration, radiation dose, contrast media), and Image information (resolution, windowing). For each modality, DICOM precisely defines the data elements that are required, optional or required under certain circumstances. This powerful flexibility is at the same time, however, one crucial weakness of the DICOM standard because practical experience shows that image objects are frequently incomplete. In such objects, required fields are missing or contain incorrect values. These problems can lead to subsequent problems when exchanging data. GUIDE in Matlab GUIDE, the MATLAB Graphical User Interface Development Environment, provides a set of tools for creating graphical user interfaces (GUIs). These tools greatly simplify the process of laying out and programming GUIs. GUIs provide point-and-click control of software applications, eliminating the need to learn a language or type commands in order to run the application. MATLAB apps are self-contained MATLAB programs with GUI front ends that automate a task or calculation. The GUI typically contains controls such as menus, toolbars, buttons, and sliders. Many MATLAB products, such as Curve Fitting Toolbox, Signal Processing Toolbox, and Control System Toolbox, include apps with custom user interfaces. You can also create your own custom apps, including their corresponding UIs, for others to use. Design Interface Program include: Two axes to display DICOM image and segment image A listbox to display information of DICOM image Two push button to perform functions: select file and segment image An edit text box to display directory to DICOM folder Eight pair of static text and edit text boxs to display some important information of image Functions Choose directory to open DICOM file DICOM file has .dcm tag, so in ChooseFile_Callback , I use [FileName PathName] = uigetfile('*.dcm'); Windows will Open standard dialog box to choose directory to .dcm files Display directory into edit text box After choosing DICOM file, I will display this directory into edit text box by use Path = strcat(PathName,FileName) will horizontally concatenates strings set(handles.directory,'string',Path) will display Path into textbox “directory” Display DICOM image into axes We gave a axes in GUI interface to display DICOM image. handles.I=dicomread(Path); axes(handles.axes1); imshow(handles.I,[]) Display DICOM information into listbox I set DICOM information of Path into metadata by use metadata = dicominfo(Path); Because DICOM information is structure, so I will convert this structure into character array fields=char(fieldnames(metadata)); fieldnames is field names of DICOM structure len=1:size(fields,1) is length of fields by row id=0 is count variable for k=len, estr=eval(['metadata.' fields(k,:)]); if ischar(estr) str=[fields(k,:) ' : ' estr]; elseif isnumeric(estr) str=[fields(k,:) ' : ' num2str(estr(1:min(1,end))')]; end id = id+1; list{id}=sprintf('%3d %s',k,str); end Finally, I update list into DICOM information listbox set(handles.HeaderList,'String',list); Display some important information With above listbox, I have all information of DICOM image. But when doctor use DICOM image to diagnose, he only concern about some important information. That are PatientID, PatientSex, PatientAge, PatienBirthDate, PatientWeight, Width, Height and Date Modified. So I will display these information into other edit text boxs To set these information into each edit text box, I use command iminfo=dicominfo([PathName,FileName]); set(handles.id, 'String', iminfo.PatientID); set(handles.birthdate, 'String', iminfo.PatientBirthDate); set(handles.sex, 'String', iminfo.PatientSex); set(handles.age, 'String', iminfo.PatientAge); set(handles.weight, 'String', iminfo.PatientWeight); set(handles.width, 'String', iminfo.Width); set(handles.height, 'String', iminfo.Height); set(handles.date, 'String', iminfo.FileModDate); And finally, use guidata(hObject, handles) to update above action. Crop image To crop DICOM image displayed in axes1, I gave a “Crop Image” button and axes2 to displayed croped image. I2=imcrop(handles.I); axes(handles.axes2); imshow(I2,[]) guidata(hObject, handles); Final Result Finally, I run program and have result: Limitation Program is simple, no more function. Displaying DICOM infomation in listbox is confusion. Don’t display mutiply images.
File đính kèm:
- design_a_dicom_viewer_by_using_guide_in_matlab.doc