Installing dcm4chee an Open Source PACS under Windows 7 with MySQL Database

dcm4chee logo


dcm4chee is an open source PACS software that can be used for storing, managing and retrieving medical images  It fully implements the DICOM protocol designed for healthcare. It is written in Java programming language for versatility and performance. It can run under Windows, Mac OS, and Linux. It supports different databases such as: PostgreSQL, MySQL, Oracle, SQL Server..etc


dcm4chee can be integrated with PACS workstation software or viewers such as: OsiriX, K-PACS, ClearCanvas…etc

Since many dental professionals use Windows as their primary operating system it would be easier to install dcm4chee under Windows. In addition, compression libraries such as JPEG 2000 LS are still not available under Windows 64 bit and Mac OS. So we will use 32bit version of Windows as our server’s operating system. We will be using Windows 7  since it is going to be the main stream operating system ; however, the tutorial should also work for Windows Vista or XP.
MySQL database is an open source database and it is used by millions of users. In fact, Marcilan is powered by MySQL database. So we will use MySQL as our main database. Enough talk and take me to the tutorial! !


In this tutorial we will go in details and step by step installation of dcm4chee under Windows 7 Professional 32 bit and using MySQL database.

Note: For full more detailed information for  installation  dcm4chee for different operating system and databases, please refer to the link here


Minimum System Requirements:

JDK 6 or higher
512 MB RAM
200 MB hard disk space (additional to archive storage disk space)
400 MHz CPU


Download:

  1. Download the latest binary of dcm4chee (currently v 2.14.7) from dcm4chee Source Forge repository. Select the version that matches the database we will be using dcm4chee-mysql-2.14.7.zip

    dcm4chee-mysql

  2. Download the binary distribution of JBoss Application Server 4.2.3.GA from their website (Do NOT download v5 as it is incompatible!)


    After clicking the download button, select jboss-4.2.3.GA-jdk6 which is compatible with Java Development Kit v6 (JDK6)

    JBoss-4.2.3.GA

  3. Download the latest binary distribution for MySQL from MySQL website. The current GA (Stable) version for production use is 5.1. Click on the link. Select Windows MSI installer.


    You can register if you are interested in receiving updates or you can skip the registration process.

  4. Download Java Development Kit 6 (JDK6) from Sun website. Download JDK 6 update 17 under Java SE Development Kit.

    JDK 6 update 17

    You can register to receive latest updates or skip the registration process.

  5. Download the Audit Record Repository (ARR). The ARR maintains an audit log of all transactions within the archive. This is necessary for HIPAA and IHE. (If your country does not require HIPAA, you might want to skip this step). We will need to download the version that matches our database option (mysql). Download dcm4chee-arr-mysql-3.0.8.zip.

    Selecting correct type of dcm4chee arr


Installation:

1. Extracting the downloaded files and setting up the directories

Create a new folder in C:\ and rename it to apps. The directory path should look like this C:\apps

Copy jboss-4.2.3.GA-jdk6.zip, dcm4chee-mysql-2.14.7.zip and dcm4chee-arr-mysql-3.0.8.zip (if you have HIPAA or want to maintain ARR see step 5 of downloads above).

Extract all of them into separate categories. Do them one by one.


After you finish extraction all of them, go into each folder, select the folder you see, right click>Cut or CTRL+X and hit Backspace or move to the previous directory and right click>paste or CTRL+V. Windows will complain that the same folder name exist. Click Yes to proceed. This will save us time navigating in the command prompt (avoid double directories). Do this for jboss-4.2.3.GA-jdk6.zip, dcm4chee-mysql-2.14.7.zip and dcm4chee-arr-mysql-3.0.8.zip (if you require HIPAA or want to maintain ARR see step 5 of downloads above).


The final folder structure should look like this
Final folder structure

2. Copy files from JBoss to DCM4CHEE

Copy files from JBoss to dcm4chee. Dcm4chee consists of components that run within the JBoss application server platform. This step will copy the JBoss runtime files to the dcm4chee directory. Make sure that the JBoss folder name in ‘C:\apps’ is ‘jboss-4.2.3.GA’ before you continue.
Navigate to: ‘C:\apps\dcm4chee-mysql-2.14.7\bin’

Type:
install_jboss.bat c:\apps\jboss-4.2.3.GA

Copying dcm4chee files to JBoss

3. Installing MySQL database and creating dcm4chee database

Install MySQL database and create dcm4chee database (Follow the screenshots)
MySQL setup




You can select Standard Configuration or Detailed Configuration. For easier setup follow the Standard or select Detailed if you know what you are doing.
Configuration type
Check Install As Windows Service. This will allow MySQL to start automatically when Windows starts. Check also Include Bin Directory in Windows Path.


Put your root (administrator) password. Save this in a secure place! If you check Enable root access from remote machines, it will allow your IT admin or PACS admin to access the database remotely.


If you decide to go for Detailed Configuration. You will get the following screens. (Skip if you followed the Standard Configuration)
Since we will be running JBoss server and MySQL, we select: Server Machine
Setting type of mysql server

Setting type of database

installation path
Select the option based on your concurrent number of users
setting number of users


If you are going to use non-latin characters like: Japanese, Chinese, Farsi…etc, select Best support for multilingualism otherwise select Standard Character set.
Selecting mysql character set
The rest is the same as in Standard installation.


Now we need to create a database for dcm4chee. To do so we initiate the pacsdb database instance using  dcm4chee-mysql-2.14.7/sql/create.mysql

Go to command prompt and type:

mysql -uroot -p

Input your MySQL root password. Now you will get: mysql>

Type the following  line by line including the ; at the end and press Enter key at the end of each line.

create database pacsdb;
grant all on pacsdb.* to 'pacs'@'localhost' identified by 'pacs';
\q

Then type:
mysql -upacs -ppacs pacsdb < c:/apps/dcm4chee-mysql-2.14.7/sql/create.mysql 

Creating dcm4chee mysql database
For more information, refer to dcm4chee MySQL database setup here

4. Deploy the Audit Record Repository (ARR)

Execute the command install_arr.bat   in the command prompt in the bin directory of dcm4chee and include the path to dcm4chee-arr-3.0.8 as seen in the screenshot.

Deploying dcm4chee auditory records repository

5. Installing Java Development Kit and Setting up the environment variable for JAVA_HOME to JDK location

Installing Java JDK 6


To set up the environment variable to JDK location, right click on my computer>Properties>Advanced System Settings> Environment Variables





Here we are referring to the installed version of JDK 6 update 17. If you are using a different version go and check your program files under Java.
Setting the environment variable JAVA_HOME for Java JDK6

Click Ok. Now Reboot your Windows for changes (Environment variables) to take effect.

6. Launching DCM4CHEE

We are ready to test all the work we did previously. Go to command prompt again and navigate to dcm4chee-mysql-2.14.7/bin then execute run.bat
Launching dcm4chee

Allow access for Java through Windows Firewall


In the command prompt you will notice lines moving up quickly. (It might take a minute or two to finish loading).  You shouldn’t see any errors like access denied or couldn’t create connection. Otherwise, something has gone wrong from the previous steps.

dcm4chee started

If everything is right you will see a window similar to this:

dcm4chee cmd started

Check the last line. Started!!

7. Login into the web interface

Now keep the command prompt open. Open your web browser and  go to  http://localhost:8080/dcm4chee-web/

You should get dcm4chee web interface
dcm4chee web interface

 

Now for the username type: admin
and the password is also: admin
Click Log in.

Cross your fingers!
dcm4chee web interface control panel
Congratulations! you just managed to install a web server, setup a database, and deploy a fully functional  free PACS that can be used to interface with your Cone Beam CT (CBCT) machine, CT, MRI, ..etc and your viewing software in your imaging center or dental school for all your imaging needs.

In part 2 of the tutorial we will see how to make dcm4chee starts automatically with Windows to avoid the console window all together.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

48 thoughts on “Installing dcm4chee an Open Source PACS under Windows 7 with MySQL Database

  1. Well, I asked Wisam if it was possible to do this installatin steps in a windows 7 64 bit based system. He told me he hadn’t tried it, but if I like to do it to post my results here. Here they are:

    I installed dcm4chee following these intructions but using 64 bit versions of mysql in a 64bit windows 7 computer. I used JDK 6 32 bit version, crossing my fingers that WOW (Windows on Windows) would work, in order to get JPEG2000 compression. The result: PERFECT! I have dcm4chee in a windows 7 64bit system working flaweslly, with compression of the images, which is just great. Hope this is useful information for any of you guys.

    Thanks Wisam for this great guide!

  2. thanks for yours guide bat i have ani problem for installation,
    (Now we need to create a database for dcm4chee. Per fare ciò si avvia l’istanza pacsdb database utilizzando dcm4chee-mysql-2.14.7/sql/create.mysql To do so we initiate the pacsdb database instance using dcm4chee-mysql-2.14.7/sql/create.mysql)

    wrong command
    What can I do?

  3. Hi Salvo, you need to login to MySQL in order to use that command. You can’t do it directly from the command prompt. Start from here:
    Go to command prompt and type:

    mysql -uroot -p

    Input your MySQL root password. Then enter the following commands:

    create database pacsdb;
    grant all on pacsdb.* to ‘pacs’@'localhost’ identified by ‘pacs’;
    \q

    Then type:
    mysql -upacs -ppacs pacsdb < c:/apps/dcm4chee-mysql-2.14.7/sql/create.mysql

    Good luck!

  4. I have tried installing DCM4CHEE and now I am unable to login ( URL: http://localhost:8080/dcm4chee-web ).
    In installation document on DCM4CHEE website, the username and password is mentioned ?admin? and ?admin?; which however is not working in my scenario.
    I think, there is something wrong with configuration which I might have changed unintentionally.I have already checked the file login-config.xml at C:\apps\dcm4chee-mysql-2.14.7\server\default\conf .

    • This happened to me too when I first tried to install dcm4chee. The issue was the database for dcm4chee was not setup properly. If you check the console window (DOS or Command window) you will see error messages that can explain to you what went wrong. However, in my case, when I did the database steps it worked and the console window stopped showing error messages. So far many people managed to install dcm4chee successfully following the tutorial on this page.

    • Hi, I know, this is exactly what happened to me. The page will load but when you put the default username and password they wont be accepted. The main reason for that is that the data base for dcm4chee is not setup properly so it doesn’t have the default username and password in the database. Please try to do the database setup again and test.
      Read below:
      Now we need to create a database for dcm4chee. To do so we initiate the pacsdb database instance using dcm4chee-mysql-2.14.7/sql/create.mysql

      Go to command prompt and type:

      mysql -uroot -p

      Input your MySQL root password. Now you will get: mysql>

      Type the following line by line including the ; at the end and press Enter key at the end of each line.

      create database pacsdb;
      grant all on pacsdb.* to ‘pacs’@'localhost’ identified by ‘pacs’;
      \q

      Then type:
      mysql -upacs -ppacs pacsdb < c:/apps/dcm4chee-mysql-2.14.7/sql/create.mysql

      Just make sure that in the line above you are referring to the correct path if you are using version other than 2.14.7 !

  5. @Wisam Al-Rawi
    i have done this step accurately and also check the database .
    but after this step
    mysql -upacs -ppacs pacsdb < c:/apps/dcm4chee-mysql-2.14.7/sql/create.mysql
    i m seeing this error (although the path is valid).
    The system cannot find the path specified.
    please guide

    • Ok that’s good! Now we know what’s the problem and again it has to do with the database creation. The error message you’re getting tells you that the path is not correct. It is easy to find the path. Just go to Computer (or My computer in Windows XP) and navigate to C drive> then apps folder> then dcm4chee-mysql-2.14.7>then sql> now you should see a file called create.mysql. Since the path is not correct then one of those folders will have a different name. Once you get to creat.mysql file, copy the path from the top of the window by clicking on the empty space in the address bar to reveal the full path, then paste the path in the command window by right clicking and selecting Paste. Good luck.

  6. hi, i am having trobles to install dcm4chee.
    when i type: grant all on pacsdb.* to ‘pacs’@’localhost’ identified by ‘pacs’;
    i have gotten a error:
    >[Error] Script lines: 1-1 ————————–
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘‘pacs’@’localhost’ identified by ‘pacs’’ at line 1 

    Warnings: —>
    W (1): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘�pacs�@’localhost� identified by �pacs�’ at line 1
    <—
    [Executed: 23/06/10 9h23min22s BRT ] [Execution: 0/ms]

    can anybody help me?

    thanks .

  7. Here are some instructions from Damien Evans (gunterze@gmail.com)

    Changes (1)

    h3. Adjust DB configuration if necessary
    The database configuration information is contained within {{dcm4chee-mysql-2.13.6/server/default/deploy/pacs-mysql-ds.xml}}. {{dcm4chee-mysql-2.14.8/server/default/deploy/pacs-mysql-ds.xml}}. If you’re using a different database name, user name, etc., you’ll need to update this file.
    Full Content
    JDBC Driver

    The MySQL JDBC driver is one of the ones included with the dcm4chee distributions. Feel free to update it if you need/want to.
    Create the database

    Initiate the pacsdb database instance using the DDL in dcm4chee-mysql-2.14.8/sql/create.mysql.

    > mysql -uroot
    mysql> create database pacsdb;
    mysql> grant all on pacsdb.* to ‘pacs’@'localhost’ identified by ‘pacs’;
    mysql> \q
    > mysql -upacs -ppacs pacsdb < dcm4chee-mysql-2.14.8/sql/create.mysql

    Adjust DB configuration if necessary

    The database configuration information is contained within dcm4chee-mysql-2.14.8/server/default/deploy/pacs-mysql-ds.xml. If you’re using a different database name, user name, etc., you’ll need to update this file.

  8. or Changes (2)

    h3. Create the database
    Initiate the {{pacsdb}} database instance using the DDL in {{dcm4chee-mysql-2.13.6/sql/create.mysql}}. {{dcm4chee-mysql-2.14.8/sql/create.mysql}}.

    {noformat}

    mysql> grant all on pacsdb.* to ‘pacs’@'localhost’ identified by ‘pacs’;
    mysql> \q
    > mysql -upacs -ppacs pacsdb < dcm4chee-mysql-2.13.6/sql/create.mysql dcm4chee-mysql-2.14.8/sql/create.mysql
    {noformat}
    ...
    Full Content
    JDBC Driver

    The MySQL JDBC driver is one of the ones included with the dcm4chee distributions. Feel free to update it if you need/want to.
    Create the database

    Initiate the pacsdb database instance using the DDL in dcm4chee-mysql-2.14.8/sql/create.mysql.

    > mysql -uroot
    mysql> create database pacsdb;
    mysql> grant all on pacsdb.* to ‘pacs’@'localhost’ identified by ‘pacs’;
    mysql> \q
    > mysql -upacs -ppacs pacsdb < dcm4chee-mysql-2.14.8/sql/create.mysql

    Adjust DB configuration if necessary

    The database configuration information is contained within dcm4chee-mysql-2.13.6/server/default/deploy/pacs-mysql-ds.xml. If you’re using a different database name, user name, etc., you’ll need to update this file.

  9. hi there, thanks for the post! Please gimme a hand, I’m stucked on the final step, i step on the C:appsdcm4chee-mysql-2.14.7bin directory and execute the run.bat, but my run.jar seems to be missing. Here’s the line and message:
    C:appsdcm4chee-mysql-2.14.7binrun.bat
    Could not locate C:appsdcm4chee-mysql-2.14.7binrun.jar. Please check that you are in the bin directory when running this script.
    Press any key to continue . . .
    C:appsdcm4chee-mysql-2.14.7bin>
    Can you help me?

  10. Wifinet,
    Ok, go to http://localhost:8080
    It will open the Welcome to JBoss window
    Under JBoss Management>JMX Console.
    Put the default username and password. Now scroll down to dcm4chee.archive. Here you have all the settings for dcm4chee
    Check service=AE for AE TITLE options
    Check service=DcmServer for TCP port settings. (TCPPort will be the first option and it is set to 11112)
    There are many other options to configure to your pleasure
    :)

  11. Hi,

    Is it possible to install DC4CHEE directly on Mac OS X snow without Windows 7 ? and if so, is there anyway to auto launch it ?
    Thanx

  12. Hi,
    I have one strange problem….the installation seems that all ok…but when i connect to
    http://localhost:8080/dcm4chee-web the browser show me this messagge Bad request (invalid name).
    I have follow this tutorial and the forum support web-site dcm4chee…but don’t find the solution.
    can you help me?

  13. hi, thanks for the post! Please gimme a hand, i am also getting the same error which pachomouse reported earlier, i step on the C:appsdcm4chee-mysql-2.14.7bin directory and execute the run.bat, but my run.jar seems to be missing. Here’s the line and message:
    C:appsdcm4chee-mysql-2.14.7binrun.bat
    Could not locate C:appsdcm4chee-mysql-2.14.7binrun.jar. Please check that you are in the bin directory when running this script.
    Press any key to continue . . .
    C:appsdcm4chee-mysql-2.14.7bin>

    I treid downloading it again but same result. Any idea?

  14. I am having an issue with the install. same as previous member
    ……..but after this step
    mysql -upacs -ppacs pacsdb < c:/apps/dcm4chee/sql/create.mysql
    i m seeing this error (although the path is valid).
    The system cannot find the path specified.
    the path i am using is correct as i can see the file in its location.
    i can see the database created in mysql workbench. but there are no tables in the database.

    how can i restore the database to new. ???

  15. Dear sir
    I am student of mca 6th sem.i am working with dicom Image.
    Sir how can i access dicom image from another location and how to send dicom image to another location using dicom protocol not using http protocol. tell me full steps of working.
    i have a applet viewer now i want to open an image in web by giving patient id
    I put all image in a c:\new . By giving a proper patient id in jsp page it will show me the details of that patient in web page. now i want to open this image in web through applet viewer from c:\new. So is it necessary to use dicom protocol or not. If yes then tell me the Details Step what is necessary

  16. hi, again, thanks for this complete manual. I just installed the DCM correctly by following the manual. Now I have a problem when adding IMACS running osirix on the ADD AET menu. I fill the AET, PORT, IP, and DESCRIPTION, i try the echo test but there is no reply. I get this error:
    Echo dicom://DR.PACHO@172.20.189.3:3002 failed: java.net.SocketTimeoutException: Read timed out
    On the OSIRIX I get the following error when trying to send studies:
    Error al Envíar DICOM
    Operación DICOM StoreSCU falló.
    DICOM Network Failure (storescu)
    Association Rejected 0006:0301 DUL Association Rejected

    My config looks like this:

    SERVER: (default)
    AET: DCM4CHEE hostname:pacsweb port:11112 cypher: (no cypher set/blank) issuer:DCM4CHEE user id:(no user id set/blank) FS Group: (no FS Group ID set blank) Description: This DCM4CHEE archive instance

    OSIRIX:
    AET: DR.PACHO hostname:172.20.189.3 port:3002 cypher: (no cypher set/blank) issuer:DR:PACHO user id:(no user id set/blank) FS Group: (no FS Group ID set blank) Description: Estac. Dr Pacho

    But AETs are set correctly, same as port, and IP. I´m using the IP instead of the hostname.
    When using the NET VIEW command on windows I cannot see the IMAC running OSIRIX, just the windows machines.
    Does anyone have any idea? I´m stucked here!

  17. Hi,

    Are you doing the same extremely well explained guide to install dcm4chee on Mac OS X ? Because there is no simply explication for installation on Mac and you have the best ever explanation for Windows.
    I think that it could be very helpfull for many users!

  18. hello, install the system and everything works fine, but I have a problem.
    1) when I send one study, the pacs has receive ok.
    2) but when I send another study, my study is on hold.
    3) I have to delete the first patient, so that recently the second study can be viewed on the PACS.
    how to fix this, please ask for help
    thanks

    • Here is a quick guide mode
      thank you for helping improve m
      I apologize for the imperfect English
      I eventually put in French

      DCM4CHEE install on MAC (Lion)

      1-MySQL already installedin Osx,
      Go to Preferences System and MySQL
      In System Preferences go into MySQL and connected
      Create a password the first connection type “admin”

      2-Download JBoss Application Server
      http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.2.GA/
      Download dcm4chee (www.dcm4che.org)
      http://sourceforge.net/projects/dcm4che/files/dcm4chee/2.17.1/dcm4chee-2.17.1-mysql.zip/download

      3-unzip the two files to create in home a file apps, rename the folder dcm4Chee 2.17.1 on dcm4chee
      Open Terminal and type:
      cd / Users/xxxx/apps/dcm4chee/bin
      . / Install_Jboss.sh / Users/xxxx/apps/jboss-4.2.3.GA. /

      4-Initiate the archive database instance.

      go to
      cd / usr / local / mysql / bin
       . / Mysql-u root-p
      Enter password: admin

      mysql> create database pacsdb;
      mysql> grant all on pacsdb .* to ‘pacs’ @ ‘localhost’ identified by ‘pacs’;
      mysql> \ q
      . / Mysql-UPAC-AEXDP pacsdb create database arrdb;
      mysql> grant all on arrdb .* to ‘arr’ @ ‘localhost’ identified by ‘arr’;
      mysql> \ q

      deploy arr
      cd / Users/xxxx/apps/dcm4chee/bin
      . / Install_arr.sh / Users/xxxx/apps/dcm4chee-arr-3.0.11-mysql

      6-change the file “Wado-dcm4chee xmbean.xml” it is in DCM4CHEE_HOME/server/default/conf/xmdesc /
      replace the line by: line 180 with free software such as “CotEditor”
      ImageWriterClass
      java.lang.String

      -
      +

      7-run.sh is going to change the line of memory:
      ulimit-n $ max_fds
      in
      ulimit-n 5000

      8-edit the hosts file (/ etc /host) by the IP address of the computer

      9-Go to terminal
      cd / Users/xxxx/apps/dcm4chee/bin
      . / Run.sh
      Then in your browser
      http://localhost:8080/dcm4chee-web3

  19. ok I’m stuck on step 2! When I go to copy files from jboss to dcm4chee I am told
    install_jboss.bat is not recognized as an internal or external command????
    Any ideas? Windows XP btw

  20. i just hope the instructions work well ,shud have seen them earlier ,tried quite a few pacs installer’s. you guide only showed up when i searched google for windows 7 pacs!T for Thank you.

  21. 2011-10-18 01:29:51,236 ERROR RadServer1->DCM4CHEE (TCPServer-1) [org.dcm4cheri.net.ActiveAssociationImpl] org.dcm4che.data.DcmParseException: rPos:23179 (69D3,ECB7) UN #-1322105057, value length [2972862239] exceeds maximal supported length[2^31-1]

    got it working but when i try to send to push a study to the server this error occurs can u help me

  22. Hi,
    this is a wonderful step-by-step instruction. But for the stupid one and newbie, is there a batch file, that does all of this by it’s own?
    Best regards,
    Georg