Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Wednesday, January 6, 2010

DICOM Multiframe playback using dcm4che 2

Hello visitors,

First of all I'd like to thank you all for every email, tips, comments and mainly the valuable knowledge we have been sharing since I started this simple blog. This time I want to write a tutorial that takes a multiframe DICOM image and then playback it frame by frame. The final result is a Swing Java application where we can watch such file as it was a video file. If you feel it sounds nice so let's go!

If it's your first time here, please I strongly recommend that you read my DICOM to JPEG Conversion post so you can learn how to setup Eclipse and dcm4che toolkit. Then come back to this post and continue to this example tutorial. Let's start! Open your Eclipse IDE and choose File > New > Java Project. Name it DicomExamples. The next step is to create a new class, so right-click the src package and select New > Class. Enter DicomMultiframePlayer for class name and select the main method option. You'll get something like this:


Thursday, March 26, 2009

SAMUCS Web DICOM Viewer

Hello Visitors,

I present you the Samucs Web DICOM Viewer approach. This is a software designed for DICOM image visualization. Since it's a web based program it runs entirely inside your web browser and also makes use of the power of Ajax and Java technologies that increase performance and portability, enhancing flawlessly the user experience.

It's the result of several days of hard work. Here I post the first version of the application for testing and feedback. In addition this software uses the powerful dcm4che toolkit - a collection of open source applications and utilities for the healthcare enterprise. These applications have been also developed in the Java programming, supporting deployment on JDK 1.4 and up.

Features included in this version:
- Remote AE title setup (PACS communication);
- Perform queries on Study, Series and Instance levels;
- Query by filter;
- Query and retrieve images for visualization (C-GET, C-MOVE);
- DICOM header viewer;
- Tools for zooming and image adjustments;
- Different layout views;

To start viewing images right now, first download Samucs Web DICOM Viewer. Then extract the samucs-web.rar to get a WAR file that must be deployed to a Web Server. So download the great Web Server Apache Tomcat. Also, the Java Runtime Environment (JRE) should be running properly on your computer. This application was tested only on Windows Vista environment using Internet Explorer 7 and Firefox 3.0, JRE 6 and Tomcat 6. I strongly recommend Firefox. Linux users I'll try this OS soon :)

The Tomcat install is quite intuitive, just follow the instructions and be sure to set port 8080 for Http. In the end you'll be asked to run Tomcat. Then open your web browser and access http://localhost:8080. If everything is ok you'll see the Tomcat management page. Then click the link Tomcat Manager on the top left corner below the Cat and enter the username and password saved during the installation. Now you are able to deploy the Web application to the server. Scroll down the page until you find the box WAR file to deploy and then select the downloaded WAR file. Finally click the button Deploy. It may be necessary to restart Tomcat before running the application.

That's it! Access http://localhost:8080/samucs-web to begin the new DICOM visualization experience. The default username and password is samucs/samucs. I appreciate your feedback.

Screenshots:






Enjoy :)

Kindly regards,

Samuel.

Wednesday, January 16, 2008

Setting Up dcm4chee for Oracle Database

Hi Folks!

I'm starting my masters degree this year and I wrote an interesting research project to build a complete medical image processing server which works together with dcm4chee: a DICOM clinical data manager system. In this post I will show you how to setup dcm4chee properly using the great and free Oracle Express Database. This tutorial is for Windows.

Firstly, download OracleXE and launch it. The installation is quite simple and intuitive. When asked create the system account that will manage the database, so type system for username and manager for password. Wait copying its files and then finish the wizard. On the Windows command prompt access the directory:

oraclexe\app\oracle\product\10.2.0\server\BIN

...and execute the sqlplus.exe program. You will be asked for entering an username and password, which is system and manager. If no problems occurred you are now connected to Oracle and will get the C:\SQL> command line.




The Oracle Express brings a clear web interface where you may perform the database management, however, it uses the Jetty server that works on HTTP port 8080. If you try to run any other server like JBoss you'll get stuck at errors because port 8080 wont't be available. To overcome this issue you must change the HTTP port for Oracle. On SqlPlus type the following SQL commands:

SQL> begin
2 dbms_xdb.sethttpport('18080');
3 end;
4 /

After execute these lines you'll change Oracle HTTP port from 8080 to 18080. We must do it because dcm4chee works under JBoss server that also uses port 8080 for web access. Meanwhile, we're done with Oracle!

Download dcm4chee binaries for Oracle and also get the amazing JBoss application server. I chose version 2.13.0 of dcm4chee and the JBoss 4.2.2.GA release. Extract dcm4chee files at the root directory "C:\". Avoid using a directory that has a name which contains spaces as installation directory. So make it simple, just rename the extracted folder
to dcm4chee.

The next step is to extract JBoss files to the root directory and then rename the new folder to jboss. When finished, you have to copy some files from JBoss to dcm4chee by executing install_jboss.bat with the path of your JBoss installation directory as parameter. Access the Windows command prompt to execute the script. Eg. C:\dcm4chee\bin>intall_jboss.bat C:\jboss.




That's it, dcm4chee is almost done! Come back to Oracle for creating your PACS database. Again, access the SqlPlus with your system account and execute the commands below. They create a new Oracle tablespace named pacsdb and a new database user pacs. Every dcm4chee data will be stored based on these configurations.

CREATE TABLESPACE pacsdb
DATAFILE 'C:\xxx\pacsdb.ORA' SIZE 5M
AUTOEXTEND ON NEXT 5120K
DEFAULT STORAGE (INITIAL 10K NEXT 50K MINEXTENTS 1 MAXEXTENTS 121 PCTINCREASE 10) ONLINE;

CREATE USER pacs IDENTIFIED BY pacs
DEFAULT TABLESPACE pacsdb TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED ON pacsdb;

GRANT DBA TO pacs WITH ADMIN OPTION;

Reopen the Windows command prompt and execute SqlPlus. Now you have to establish connection with Oracle through your new user pacs and password pacs for generating all tables, primary keys, indexes, and so on. Therefore, type the following command and wait:

SQL> @C:\dcm4chee\sql\create.ora;

If no errors occurred your dcm4chee database is complete!

Important Notes:

1) dcm4chee doesn't contain an appropriate Jdbc driver for Oracle, so you need to download this driver and copy it to dcm4chee\server\default\lib\.

2)Use OCI connection for OracleXE. Change de Jdbc url connection in dcm4chee\server\default\deploy\pacs-oracle-ds.xml. Locate the tag <connection-url> and change its content to jdbc:oracle:oci:@xe.

3) Search Oracle installation directory for ocijdbc10g.dll and copy this file to dcm4chee\bin\native\.

Mission accomplished! Open the Windows command prompt, access dcm4chee\bin directory and execute run.bat to startup JBoss server. Finally, open your preffered web browser and go to localhost:8080/dcm4chee-web to see dcm4chee in action!




If you have any problems with this tutorial just let me know.
See you on the next post :)