CTN Installation Guide

CTN stands for Central Test Node, it is used to transfer and receive DICOM images for diagnosis. This guide will show you how to install this software on a linux server

Prerequisites

Install mysql-server

1. Download and untar CTN package in /usr/local/src/

  	wget http://www.anandhacorp.co.uk/download/ctn-3.0.6.tar.Z 
  	tar zxvf ctn-3.0.0 -C /usr/local/src/  

2. Set up environment variables

The bash shell does not recognise ‘setenv’ as a system defined variable.Switch to c-shell (csh) to compile ctn as csh has defined setenv. Otherwise sticking to bash shell, make the following changes to ctn environment file for mysql:
 	vim /usr/local/src/ctn/environments/linux/linux.mysql.lesstif.noopt.env 
Set an alias for setenv so it points to export command, and make changes to the file as shown below
 
	alias setenv='export'
	setenv CTN_TARGET=/usr/local/ctn
	setenv DICOM_ROOT=`pwd`
	setenv DICOM_BIN=$CTN_TARGET/bin
	setenv DICOM_LIB=$DICOM_ROOT/lib/linux.mysql
	setenv DICOM_LIBSRC=$DICOM_ROOT/libsrc
	setenv DICOM_INCLUDE=$DICOM_ROOT/include
	setenv DICOM_MAKE=$DICOM_ROOT/environments/linux/ctnmake.linux.mysql.lesstif.noopt
	setenv MYSQL_LIB=/usr/local/mysql/lib/mysql
	setenv MYSQL_INCLUDE=/usr/local/mysql/include/mysql
	setenv ARCHITECTURE=LITTLE_ENDIAN_ARCHITECTURE
	setenv OS=LINUX
	setenv CC=gcc
	setenv XCC=gcc
	setenv DBLINK=gcc
	setenv INSTALL=install
	setenv INSTALLUID="install -m 4775"
	setenv INSTALLINCLUDE="install -C -m 444 "
	setenv CI="echo Use ci on a sun"
	setenv CO="echo Use co on a sun"
	setenv INDENT="Use indent on a sun"
	setenv LINTOPTIONS=$DICOM_ROOT/lint/minimal.lnt
	setenv RANLIB=ranlib
	setenv LEX=flex

3. Install CTN

Run ‘make’ then `make install` from the source ctn directory
Debugging errors:
  	/usr/bin/ld: cannot find libXext
The files should be in the following location, ensure the locate command can find them.
 

	/usr/X11R6/lib/libXext.so
	/usr/X11R6/lib/libXext.a
	/usr/X11R6/lib/libXext.so.6

4. Running CTN

Two main daemons that need to be started to enable image transfer: simple_storage and archive_storage
Debugging problems with archive_server
 	ctn archive_server: error while loading shared libraries: libmysqlclient.so.14 file or directory not found.
This means the library directory has not been set properly for mysql.Enter the library path of mysql in /etc/ld.so.conf and then run ldconfig
Archive server should start up without any problems. Options to run simple storage and archive_server are given in the command line.

5. Set up database
You need controlCTN database where you define Ae titles and storage and security matrix
FIS AND IDB table for the peers that images will be sent and retrieved from. The scripts to create database can be found in.
 
	/usr/local/src/ctn/cfg_scripts/mysql/
5. Fill Images

fillImageDB is a utility program that is provided to place data in the image server database for a set of existing files. This is somewhat easier to use than configuring the image_server program to accept data from an application and have it store the data in a file.

fillImageDB does no sorting and little verification. It also assumes the data is already stored in the files in "CTN" format (not Part 10 compliant). Invoke fillImageDB as follows:
 	fillImageDB [-o owner] database file [file...]
We use the -o switch to set the owner attribute at the Patient, Study, Series and Image levels in our database. We use this for sorting. database is the database name (not the AE title that one would use when connecting to the image_server). You can specify one or more files to be placed in the database (e.g., we typically use .../images/vendor/*/*). You will want to specify a full pathname for image files so that the images can be "moved" when the time comes. The one warning is that the underlying IDB functions may try to delete image files that have already been loaded into the database. This means that if you get part way through loading the images and fail, you should probably clear the database first before retrying. Otherwise, when you rerun your script to load all of the images, the files which have already been loaded may be deleted.

We also have a script which assumes that files are stored as follows:
 
	..../vendor/study/images
	.../vendor/study/images

The fillImageDB script will go through a set of directories and repeatedly call fillImageDB with the -o switch to load the database. The same warning about failure and repeat applies to this script as it uses fillImageDB. 6. Send Images
Images are sent using send_image.
 	send_image -a [Ae_title] -c {Ae-title} {hostname} {port number}


Back to Resources