Useful Commands

DCMTK

Command line tools for DICOM manipulation, DICOM Toolkit, (DCMTK)

SQL Database

Slicer, will create an SQL database of DICOM files to manage your project

GNU make

Use GNU make, to run multiple commands simulateously for batch processing on a single workstation. The below example will execute 4 processes.

$ make -j 4 -f parallel.makefile
echo target1 cmd1
echo target2 cmd1
echo target3 cmd1
echo target4 cmd1
target3 cmd1
target4 cmd1
target2 cmd1
target1 cmd1
echo target3 cmd2
echo target1 cmd2
echo target2 cmd2
echo target4 cmd2
target3 cmd2
target1 cmd2
echo target3 cmd3
echo target1 cmd3
target2 cmd2
target3 cmd3
echo target2 cmd3
target4 cmd2
echo target4 cmd3
target1 cmd3
target2 cmd3
target4 cmd3
The file parallel.makefile contains
all: target1 target2 target3 target4

target1:
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
target2:
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
target3:
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
target4:
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3

Rsync

rsync -avz -v --include='*/' --include='fem_stats*.e' --exclude='*' source/ target/

Permissions

to set permissions recursively on a directory

chmod -R g+=rwXs *

or

find ./some/directory/ -type f -exec chmod g+rw {} \; #files

find ./some/directory/ -type d -exec chmod g+rwx {} \; #directories

umask 0027
for -rwxr-x--- (dir) -rw-r----- (file) default permissions

PYCLEWN

PYCLEWN debug: (1) start inferior_tty (2) attach pyclewn to inferior_tty

SCRGP2$ inferior_tty.py
'inferior_tty' two characters sequence commands:
    'C-a q' exit immediately
    'C-a c' close the slave pseudo terminal and exit after the gdb
inferior has
            terminated
    'C-a a' send a 'C-a' character

/dev/pts/15 pseudo terminal has been created.
Set the tty for the program being debugged with the gdb commands:
set inferior-tty /dev/pts/1
set environment TERM = screen

SCRGP2$ pyclewn --tty=/dev/pts/1 -a '--args ./FocusUltraSoundModel -snes_monitor -da_vec_type cusp -snes_converged_reason -ksp_monitor -log_summary -pc_type jacobi -dm_mat_type seqaijcusp'



Subsections