Project

General

Profile

Dicompyler installation and code modification » History » Version 1

Peter Qian, 01/04/2021 09:18 AM

1 1 Peter Qian
h1. Dicompyler Installation and Code Modification
2
3
h2. Dicompyler Installation
4
5
*1. Download dicompyler source code from github*
6
Current version: 0.5.0
7
<pre>
8
git clone https://github.com/didymo/dicompyler.git
9
</pre>
10
11
*2. Install the dependencies of dicompyler*
12
Note: wxPython cannot be installed correctly with requirements.txt. We will install wxPython later.
13
Then run this command:
14
<pre>
15
pip3 install -r requirements.txt
16
</pre>
17
Next, we are going to install wxPython.
18
Run:
19
<pre>
20
sudo apt install make gcc libgtk-3-dev libwebkitgtk-dev libwebkitgtk-3.0-dev libgstreamer-gl1.0-0 freeglut3 freeglut3-dev python-gst-1.0 python3-gst-1.0 libglib2.0-dev ubuntu-restricted-extras libgstreamer-plugins-base1.0-dev
21
</pre>
22
and
23
<pre>
24
sudo pip3 install wxpython
25
</pre>
26
Note: It will take a long time in a virtual machine for the step installing wxpython. (It's normal to take 1 - 2 hrs.)
27
28
*3. Run dicompyler*
29
<pre>
30
python3 dicompyler_app.py
31
</pre>
32
33
*4. (Optional) To enable running dicompyler with 'dicompyler' command in terminal, run this command in 'dicompyler' directory:*
34
<pre>
35
sudo python3 setup.py install
36
</pre>
37
38
h2. Code Modification
39
40
There are two existing bugs in the source code.
41
One happens when loading RT Structure Set. The variable for setting value to the progress bar, 'percentDone', has been given an unexpected value 800, which is out of range.
42
To solve this,
43
Open dicompyler/dicompyler/guiutil.py, in the function OnUpdateProgress(). 
44
Modify:
45
<pre>
46
self.gaugeProgress.setValue(percentDone)
47
</pre>
48
to
49
<pre>
50
self.gaugeProgress.setValue(1)
51
</pre>
52
53
The other happens when displaying the table of RT Structure Set. There is no column for showing attribute name of DICOM file. The column widths need to be adjusted as well.
54
To solve this,
55
Open dicompyler/dicompyler/baseplugins/treeview.py,
56
in the function AddItemTree(),
57
Modify:
58
<pre>
59
self.tlcTreeView.SetItemText(item, 1, value)
60
</pre>
61
to
62
<pre>
63
self.tlcTreeView.SetItemText(item, 2, value)
64
</pre>
65
Alter the code under comment '# Fill in the rest of the data_element properties' with:
66
<pre>
67
self.tlcTreeView.SetItemText(item, 1, str(data_element.name))
68
self.tlcTreeView.SetItemText(item, 3, str(data_element.tag))
69
self.tlcTreeView.SetItemText(item, 4, str(data_element.VM))
70
self.tlcTreeView.SetItemText(item, 5, str(data_element.VR))
71
</pre>
72
Modify the lines under '#self.SetMainColumn(0)':
73
<pre>
74
self.SetColumnWidth(0, 200)
75
self.SetColumnWidth(1, 200)
76
self.SetColumnWidth(2, 200)
77
self.SetColumnWidth(3, 200)
78
self.SetColumnWidth(4, 200)
79
</pre>
80
81
*Then dicompyler will be able to run!*