Useful Commands


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

	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3
	echo $@ cmd1
	echo $@ cmd2
	echo $@ cmd3


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


to set permissions recursively on a directory

chmod -R g+=rwXs *


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 debug: (1) start inferior_tty (2) attach pyclewn to inferior_tty

'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
    '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'