Mini PACS – A free PACS server project Beta

Mini PACS – A free PACS server project (Beta). I ‘ve try to develop my own PACS server. After research and development ,PACS retriever and PACS storage manager and PACS database were succeed. This “Mini PACS” be able to work on Raspberry pi and Cubie Board.


Sponsor Link.

– Ubuntu server 12.04 with LAMP installed. – How to install LAMP on Ubuntu
DCMTK (The OFFIS DICOM toolkit)
pydicom
PHP-web pacs viewer from previous post

How To set it up.
Suppose you ‘ve had Ubuntu server with LAMP install already. if not – How to install LAMP on Ubuntu.

1. Install Python-dev and python-pip with Linux command line
sudo apt-get install python-dev python-pip

2. Install DCMTK with Linux command line
sudo apt-get install dcmtk

3. Install pydicom
sudo pip install pydicom

4. Install Python-MySQLdb
sudo apt-get install python2.7-mysqldb

5. Create database (import .sql dump file to your MySQL server)

[wpdm_file id=3]

upacs_user study series

6. Create pacsserver.sh to retrieve DICOM  on /home/your-name directory.
sudo nano pacsserver.sh
Then add this line to the .sh file
storescp +xa -aet yourAEtitle -dhl -od /home/xxxx/bbbbb 104
yourAEtitle = name of AE Title you want to use.
xxxx = your user name on /Home directory
bbbb = DICOM incoming directory (Don’t forget to set permission directory to 0777 )

So you will have “pacsserver.sh” on your /home/xxxx

7. Config “pacsserver.sh” to run at start up with crontab
sudo crontab -e
Then add this line to the end of file.
@reboot /home/xxxx/pacsserver.sh

After reboot you will get “store scp” and ready to retrieve any DICOM file from Modality or other PACS server (Any DICOM file will temporarily stored on this directory). Please  test this step until work before next.

8. Create directory /home/xxxx/cccc to permanently keep DICOM file
sudo mkdir /home/xxxx/cccc  (Don’t forget to set permission directory to 0777 )

9. Create Python script to handle DICOM file that stored on /home/xxxx/bbbbb
Some path of “read-dicom.py” need to change.
db = MySQLdb.connect(host=”localhost”, port=3306, user=”root”, passwd=”your-root-password”, db=”pacsserver”)
source_dir = “/home/xxxx/bbbbb”
dest_dir = “/home/xxxx/cccc”

/home/xxxx/bbbbb = DICOM incoming directory
/home/xxxx/cccc = DICOM will be read and classified by study date, seriesUID,StudyUID then save to this diretory.


Sponsor Link.


[wpdm_file id=4]
Download and put it to /home/xxxx, then test with command “sudo python read-dicom.py”

10. Config “read-dicom.py” to run at start up.
sudo crontab -e
Then add this line to the end of file.
@reboot /home/xxxx/read-dicom.py

After reboot your server ready to work as PACS server

How it work.
pacs
(Next post “PACS viewer”)

StoreSCP command line with DICOM OFFIS Toolkit (DCMTK)

DCMTK is a open source collection of libraries and applications implementing large parts the DICOM standard,can be compiled under Windows and a wide range of Unix operating systems including Linux, Solaris, HP-UX, IRIX, FreeBSD, OpenBSD and MacOS X. All necessary configuration scripts and project makefiles are supplied.


Sponsor Link.

DCMTK can be downloaded as a gzip compressed tar archive or as a ZIP archive. The contents of the two archives are identical. Click here to visit and download DCMTK

1. Download DCMTK 3.6.0 – executable binaries zip file
2. Extract the zip file to your drive eg. d:\dcmtk
3. Create new .bat file with Notepad and add below line

d:\dcmtk\storescp +xa -dhl –aetitle TESTAEX -od “D:\pacstest” -uf 104

4. save and run your .bat file to act as DICOM storage server.
note :
d:\dcmtk\storescp = path to your “storescp.exe”
TESTAEX = your ae title
“D:\pacstest” = folder to store incoming DICOM files
104 = DICOM port

DICOM viewer is the essence of the digital medical image system.

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera