Project

General

Profile

Actions

Dicompyler Installation and Code Modification

Dicompyler Installation

1. Download dicompyler source code from github
Current version: 0.5.0

git clone https://github.com/didymo/dicompyler.git

2. Install the dependencies of dicompyler
Note: wxPython cannot be installed correctly with requirements.txt. We will install wxPython later.
Then run this command:

pip3 install -r requirements.txt

Next, we are going to install wxPython.
Run:
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

and
sudo pip3 install wxpython

Note: It will take a long time in a virtual machine for the step installing wxpython. (It's normal to take 1 - 2 hrs.)

3. Run dicompyler

python3 dicompyler_app.py

4. (Optional) To enable running dicompyler with 'dicompyler' command in terminal, run this command in 'dicompyler' directory:

sudo python3 setup.py install

Code Modification

There are two existing bugs in the source code.
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.
To solve this,
Open dicompyler/dicompyler/guiutil.py, in the function OnUpdateProgress().
Modify:

self.gaugeProgress.setValue(percentDone)

to
self.gaugeProgress.setValue(1)

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.
To solve this,
Open dicompyler/dicompyler/baseplugins/treeview.py,
in the function AddItemTree(),
Modify:

self.tlcTreeView.SetItemText(item, 1, value)

to
self.tlcTreeView.SetItemText(item, 2, value)

Alter the code under comment '# Fill in the rest of the data_element properties' with:
self.tlcTreeView.SetItemText(item, 1, str(data_element.name))
self.tlcTreeView.SetItemText(item, 3, str(data_element.tag))
self.tlcTreeView.SetItemText(item, 4, str(data_element.VM))
self.tlcTreeView.SetItemText(item, 5, str(data_element.VR))

Modify the lines under '#self.SetMainColumn(0)':
self.SetColumnWidth(0, 200)
self.SetColumnWidth(1, 200)
self.SetColumnWidth(2, 200)
self.SetColumnWidth(3, 200)
self.SetColumnWidth(4, 200)

Then dicompyler will be able to run!

Updated by Peter Qian about 4 years ago · 1 revisions