| 1 |
#!/bin/csh |
| 2 |
# |
| 3 |
# Intent: This script creates the layout for an imaging demonstration |
| 4 |
# $Revision: 1.3 $ |
| 5 |
|
| 6 |
echo This script is used to create a layout for the imaging demonstration |
| 7 |
echo with MIR software. This is not necessarily the final layout, but it |
| 8 |
echo will serve for testing purposes. This script is picky about input |
| 9 |
echo so please type carefully \(avoid extra spaces when you type\). |
| 10 |
echo "" |
| 11 |
|
| 12 |
set ROOT = /mir_ctn |
| 13 |
echo The default root directory for the MIR CTN data files is $ROOT. |
| 14 |
echo You can choose a different directory at this point by entering |
| 15 |
echo the directory name. If you wish to use the default, just hit RETURN. |
| 16 |
echo "" |
| 17 |
set a = $< |
| 18 |
if ($a != "") then |
| 19 |
echo Do you wish to use $a as the root directory "(y/n)?" |
| 20 |
set b = $< |
| 21 |
if (($b != "y") && ($b != "Y")) then |
| 22 |
echo Script exiting. Please try again. |
| 23 |
exit |
| 24 |
endif |
| 25 |
set ROOT = $a |
| 26 |
endif |
| 27 |
|
| 28 |
if (! (-e $ROOT)) then |
| 29 |
echo This script requires the directory $ROOT to exist before running. |
| 30 |
echo Please create this directory and then run this script again. |
| 31 |
exit |
| 32 |
endif |
| 33 |
|
| 34 |
umask 0 |
| 35 |
# Create several subdirectories for the imaging demonstration |
| 36 |
|
| 37 |
echo Making the imaging subdirectories starting from $ROOT |
| 38 |
set I = $ROOT/img/db |
| 39 |
if (! (-e $ROOT/img)) then |
| 40 |
mkdir $ROOT/img |
| 41 |
endif |
| 42 |
if (! (-e $ROOT/img/config)) then |
| 43 |
mkdir $ROOT/img/config |
| 44 |
endif |
| 45 |
if (! (-e $ROOT/img/db)) then |
| 46 |
mkdir $ROOT/img/db |
| 47 |
endif |
| 48 |
if (! (-e $ROOT/img/q)) then |
| 49 |
mkdir $ROOT/img/q |
| 50 |
endif |
| 51 |
|
| 52 |
# Now make the common directory and the directories for |
| 53 |
# individual vendors. |
| 54 |
|
| 55 |
echo Making the common directory. |
| 56 |
if (! (-e $I/common)) then |
| 57 |
mkdir $I/common |
| 58 |
endif |
| 59 |
|
| 60 |
echo Making public and private directories for each vendor. |
| 61 |
echo If the directories already exist, they are not recreated. |
| 62 |
echo "" |
| 63 |
|
| 64 |
foreach i (3m aaai acuson adac agfa ali atl cemax dupont gems isg kodak) |
| 65 |
echo $i $i"_prv1" $i"_prv2" $i"_pub" |
| 66 |
if (! (-e $I/$i"_prv1")) then |
| 67 |
mkdir $I/$i"_prv1" |
| 68 |
endif |
| 69 |
if (! (-e $I/$i"_prv2")) then |
| 70 |
mkdir $I/$i"_prv2" |
| 71 |
endif |
| 72 |
if (! (-e $I/$i"_pub")) then |
| 73 |
mkdir $I/$i"_pub" |
| 74 |
endif |
| 75 |
end |
| 76 |
|
| 77 |
foreach i (konica loral merge mitra philips picker siemens star) |
| 78 |
echo $i $i"_prv1" $i"_prv2" $i"_pub" |
| 79 |
if (! (-e $I/$i"_prv1")) then |
| 80 |
mkdir $I/$i"_prv1" |
| 81 |
endif |
| 82 |
if (! (-e $I/$i"_prv2")) then |
| 83 |
mkdir $I/$i"_prv2" |
| 84 |
endif |
| 85 |
if (! (-e $I/$i"_pub")) then |
| 86 |
mkdir $I/$i"_pub" |
| 87 |
endif |
| 88 |
end |
| 89 |
|
| 90 |
echo "" |
| 91 |
echo This step will now create empty databases in the directories you |
| 92 |
echo specify. This is not a mandatory step. As you send images to |
| 93 |
echo the img_server program, it will automatically create databases. |
| 94 |
echo You may choose to do this to create your database files or to create |
| 95 |
echo empty database files for other vendors. You will enter one company |
| 96 |
echo name per line. |
| 97 |
|
| 98 |
set a = "none" |
| 99 |
while ($a != "quit") |
| 100 |
echo "" |
| 101 |
echo Enter one of these company names \(or quit\) |
| 102 |
echo 3m aaai acuson adac agfa ali atl cemax dupont gems isg kodak |
| 103 |
echo konica loral merge mitra philips picker siemens star |
| 104 |
echo "" |
| 105 |
set a = $< |
| 106 |
if ((-e $I/$a"_prv1") && (-e $I/$a"_prv2") && (-e $I/$a"_pub")) then |
| 107 |
echo Now creating public and private databases for $a |
| 108 |
dbnew $I/$a"_pub"/db |
| 109 |
dbnew $I/$a"_prv1"/db |
| 110 |
dbnew $I/$a"_prv2"/db |
| 111 |
else if ($a != "quit") then |
| 112 |
echo Could not create public and private databases because one or more |
| 113 |
echo directies did not exist. Please reenter company name and/or check |
| 114 |
echo that the image directories were created properly. |
| 115 |
endif |
| 116 |
|