How To's: Difference between revisions
| Line 995: | Line 995: | ||
===HowTo: Fix a stubborn tape drive=== | ===HowTo: Fix a stubborn tape drive=== | ||
If the drive cannot be mounted, or it is not visible with | |||
then does not load the driver. | <pre> | ||
$ show device tp0 | |||
</pre> | |||
then something went wrong. For example, the server computer was booted while the tape was turned off. It then does not load the driver. | |||
You can 'force load' it - but this will disconnect the scanner for a moment, so | You can 'force load' it - but this will disconnect the scanner for a moment, so only do it while no scan is running: | ||
only do it while no scan is running | |||
as user <code>system</code>, on sc3309: | |||
<pre> | |||
$ mcr sysman io auto | $ mcr sysman io auto | ||
$ show dev tp0 | $ show dev tp0 | ||
</pre> | |||
and you should see it now (otherwise turn on the tape drive, and do again | and you should see it now (otherwise turn on the tape drive, and do again) | ||
Then you'll also have to make it available to all users: | Then you'll also have to make it available to all users: | ||
<pre> | |||
$ @sys$startup:scanco_setup_devices.com | $ @sys$startup:scanco_setup_devices.com | ||
</pre> | |||
===HowTo: Create a SAV (save set) file of your project and store on tape=== | ===HowTo: Create a SAV (save set) file of your project and store on tape=== | ||
Revision as of 04:33, 26 September 2007
HowTo Library
- In addition to this HowTo library, much information is also available at the Scanco Medical FAQ.
- users@scanco.ch
- basser5dorf
OpenVMS
HowTo: Helpful VMS commands
- UNIX to OpenVMS [1]
- Directory listing
$ dir [...]/grand_total/size $ dir [...*.aim]
- Delete
$ delete *.aim;* $ dl *.aim
- Delete a directory that is full. CAUTION!
$ SET FILE/PROT=O:RWED [.SUBDIR...]*.*;* $ DELETE [.SUBDIR...]*.*;* ! Repeat until no error messages appear. Each iteration gets rid of more sub directories. $ SET FILE/PROT=O:RWED SUBDIR.DIR $ DELETE SUBDIR.DIR;
or
$ dl disk2:[microct.projects...]*.dir ! A for all; do until sub-dirs are gone $ dl subdir.dir $ @scom:dl.com subdir.dir
- Copy
As user system you can copy files between accounts (e.g., microct and devel). There is no need to set user/priv=bypass as this is set by default as user system.
If you want to use the backup command for copying multiple subdirectories with
the three dots (e.g., disk2:[microct.data.00000034...]) then you HAVE to put an /owner=devel at the end:
$ backup/log disk2:[microct.data.00000034...] -
disk2:[devel.data.00000034...]/own=devel
- UNIX filenames on VMS with multiple '.'
The directory names would have been cvs-1.11.21.dir on Linux. However VMS doesn't allow more than 1 . in the name. If you enter
$ set process/parse=extended
in a terminal you'll be able to access these files. You could consider renaming them i.e. cvs-1_11_21.dir.
- Change hosts
$ mcr latcp show service * ! and if it shows you SCTHIN: $ set host scthin ! or $ set host scthin/lat
HowTo: Monitor system usage
$ monitor/interval=1 processes/topcpu $ monitor/interval=1 system $ show error $ show system $ @SCOM:SHOW_DISKS.COM (or simply $ DISKS)
The command show error may indicate errors. One or two errors is OK.
To see what processes are running (specific to the machine, not cluster wide).
$ show device disk2/file $ show user /full
HowTo: Control processors on multi-processor machines
For example, on the itanium there are two processors. By default, only one takes reconstruction jobs. The other is left for so that evaluations can take place without competing for the CPU.
But if a bottleneck is the reconstruction, it can be switched as user system:
$ set que sceva2_slow/job=2
so that it will do two reconstruction jobs simultaneously.
HowTo: Check current licenses on VMS system
This can be used to see what educational licenses (and other licenses) are currently on the system:
$ SHOW LICENSE
To apply for an educational license go to http://www.openvmsedu.com
HowTo: Shut down the Alpha stations and start up again
Warning: Do not do this unless absolutely necessary.
For shutdown
At the login screen, type "shutdown"/no password and hit enter. Then, you can turn the computer off at the prompt.
Then, you may turn the disk array off (unplug it as there is no power switch).
After you move the computer, power on the disk array and then the computer.
HowTo: Restart the screen server
If the monitor fails to show the login prompt and displays a blank gray screen...telnet to the computer from another computer (e.g. a PC or so) and login as user system. Run the restart command:
$ @sys$startup:decw$startup restart
confirm (answer yes) and logout.
$ logout
This will kill all programs on your screen, but it will leave all batch jobs running, so if you do a BATCH measurement, this will survive! (but interactive scan will be killed)
HowTo: Fix a computer that is running very slow and is non-responsive!
This is usually caused by people logging in via SSH multiple times. The solution involves resetting the SSH/TCPIP daemon.
- If you are local at the computer:
You will need to log in as user system. ONLY EXPERIENCED USERS SHOULD EVER LOG IN AS SYSTEM!
The system will be extremely slow (it will take 5 minutes just to get a log in prompt). This is expected.
$ set host 0 ! user name 'system' and password $ $ @sys$startup:tcpip$ssh_shutdown ! shutdown SSH $ $ set host 0 ! user name 'system' and password $ $ @sys$startup:tcpip$ssh_startup ! restart SSH
Alternatively, you can reboot the system to reset the SSH. This is not an appropriate solution and it is solving the problem by hitting it with a jack hammer. Sometimes it is the only choice though.
- If you are remotely logged in:
You will have to log in as user system and run a script called STOP_START_TCPIP.COM.
This works essentially the same as for the above method, except that since it would be impossible to restart SSH remotely once it is shut down, two separate scripts are called and submitted on SCEVAL_FAST (make sure the queue isn't clogged) separated by a 1 minute delay. The first script called is STOP_TCPIP.COM and the second is START_TCPIP.COM.
To execute this process, you must log in as system, go to the SYS$SCRATCH directory, and interactively execute the script:
$ @STOP_START_TCPIP.COM
HowTo: Fix non-responsive tape drive
This can occur if the user ejects the tape with the little button (and not with the recommended "dismount" button in the uct_backup program). This can also occur if a tape is mounted immediately after one is dismounted. You get the same error for both cases, "medium offline".
- Check all that all cables are connected.
- Check that the number on the back of the drive says "5" (use +/- to adjust if necessary)
- Check that the top connector has a cable connecting to the computer and the bottom one has a terminator.
- Try turning the tape drive on and off again.
- Log in as user
system(you will need a password from Steve):
- Log in as user
$ mcr sysman io auto/sele=mk $ @sys$startup:scanco_setup_devices.com $ show device tp0
If it's online again, then great. If not, then the last resort is to reboot the entire system. If this doesn't work, then shut down the system (see user manual for proper steps) and eject the tape. You may need to turn the computer back on before it will eject. The tape drive should be turned on first (no tape), then the server, and any other computers. Check that the drive is online ($ show device mk). If it is, then test the drive by initializing, mounting and dismounting a brand new tape. If the drive is not online, do not insert any tapes or they will likely get stuck. Log in as system and re-try the command lines shown above.
HowTo: Understand difference between mcr and run
The command mcr is the same as run, but only with mcr you can hand over 'in-line' parameters to an .exe file:
$ run ut:ctheader.exe c000124.isq
does not work, but you have to say
$ mcr ut:ctheader.exe c000124.isq
But funnily if you define a symbol in microct_setup_user.com (or login.com),
$ ctheader :== $ut:ctheader.exe
with just neither run nor mcr, but the 'funny' $ sign, then you can also hand over the ISQ name in-line.
Small detail with big effect...
HowTo: Make commands available to all users with symbols or paths
DCL$PATH is one way to do that, WE don't use it...
$ def dcl$path disk1:[microct.main],disk1:[microct.util]
then, if you type
$ uct_t
it will first try to
$ @uct_t.com
and then
$ r uct_t.exe
however, we usually define it by giving full path:
$ progx :== $disk1:[microct.main]progx.exe $ com_proc_x :== @disk1:[microct.main]procedure.com
then, you can just type the shortcut ('symbol' in VMS language)
We use the 'cd' to set the default path, you may also use this in your command procedure:
proc.com:
$ cd 'p1' $ dir *.*/size $ define COM disk1:[microct.commands] $ p :== @COM:PROC.COM
these both go into login.com
then, you can just type:
$ p disk4:[microct.data.0000007.000009]*.ISQ
HowTo: Edit a symbol set by Scanco such as AIX
Warning: Extreme caution! Explicit permission for this change or similar changes must be obtained from Dr. Steven Boyd.
Log in as user calibration
$ set proc/priv=bypass $ cdc (changes to MICROCT_COMMAND) $ sea *.com aix
Edit that file which is called MICROCT_SETUP_COMMON.COM
Another example: To make the backspace/insert keys work properly, edit the login.com and insert the line
$ set terminal/insert
Anywhere suitable.
HowTo: File do all -- apply one command to a whole set of files
$ fda ctheader dk0:[microct.data.0001234...]*.isq
to see the header of all isq files of sample 1234 (the three dots ... means all subdirectories)
Or:
$ fda aix dk0:[microct.data.0001234.00005678]*.aim
to see the processing log of all aim files of scan 5678
Wildcard "*" means multiple characters, "%" is for ONE character:
$ fda aix dk0:[microct.data...]C%%%%%%%.aim
(yes, 7 %'s)
to show the aim header of the gray-scale c0000135.aim (etc) files only, and NOT from the _seg.aims also.
Warning: CAUTION! Always test the wildcard expression first with
$ dir dk0:[xxx...]*.aim
The 'file do all' fda command can even be combined with a pipe, or an /output qualifier:
$ pipe fda aix dk0:[microct...]*.aim | search sys$pipe "Slope"
will show you all "Slopes" in a row. (but you may not see which slope belongs to which aim file anymore...)
or:
$ fda/output=sys$scratch:all_headers.log aix dk0:[microct...]*.aim
will write all the output into the .log file - which you can then either edit, or
$ search sys$scratch:all_headers.log "String"
or whatever you want.
Another example with output:
$ pipe fda type *.log | search sys$pipe "BV/TV" /output=BVTV.txt
"fda" is our self-written script, so you may have to try-n-error a bit...
$ fda command file_wildcard [Optional: further parameters]
If the command consists of multiple words with spaces inbetween (e.g. mcr ut:xxx.exe), then enclose the command in double-quotes
$ fda "mcr ut:uct_ext_header_display" dk0:[microct...]*.isq 8
NB: the further parameters may not contain wildcards - so unfortunately, the fda can NOT be used to 'adaptively' rename a whole bunch of files.
HowTo: Create a customized button in the session manager
The session manager part to enable the double-click on the AIM file: Session Manager, 'Options', 'Menu', enter new item SAP with command:
@decw$user_defaults:sap$vue
Then move that menu point into 'Applications' menu. Also: 'Options', 'File types', Create 'AIM' file type. Move 'rename', 'copy', 'purge' etc. into menu, Select 'SAP', click on 'Change double click', and also move SAP into menu.
HowTo: Export the VMS display to SUN or LINUX terminal
# - temple $ - sceval # xhost +temple.ucalgary.ca # ssh -X microct@sceval.ucalgary.ca $ set display /create /transport=tcpip /node=temple.ucalgary.ca
NOTE: Do not use xhost+. Always specific exactly which computer is being
allowed X access.
HowTo: Mount a CDROM
Device could be dqa0 or dqb0. I'm not sure which works:
$ mount/foreign dqa0:
OR
$ mount/override=id dqa0:
Then
$ dismount dqa0:
HowTo: Use Hummingbird Exceed for remote access
- Screen definition
- Server visual = PseudoColor
- Window mode = multiple
- Keyboard input
- Primary = decemus
- Alternate = us
- EVE commands
- select = "end"
- cut = "delete"
- paste = "insert"
- move forward a word = CTRL + right_arrow
- move to start of document = CTRL + up_arrow
- move to end of document = CTRL + down_arrow
HowTo: Use XWin32 for remote access
Run XWin32. Run Putty and connect to sceval.ucalgary.ca. Use the terminal normally to run programs, which should open with XWin32.
Additional terminal windows can be opened with $ dec
If you try to connect from somewhere other than the university, you will probably get the following error when trying to open a window:
Xlib: connection to "sceval.ucalgary.ca:10.0" refused by server Xlib: Can not connect to a host on a restricted network X Toolkit Error: Cannot Open Display %DWT-F-DWTABORT, xtoolkit fatal error
Type the following at the command prompt to direct the display:
$ set display/create/transport=tcpip/node=Your_IP_Address/server=0
You can find your IP address from: http://www.ip-adress.com/
HowTo: Launch an editor such as EVE
On the command line
$ edit/display=decwindows/tpu fname.txt
HowTo: Configure the EVE editor
The following file, called tpu.dat, should be installed in disk1:[microct.xdefaults]:
# # DECTPU V3.1 1993-04-22 15:50 defaults # CHANGED B.KOLLER 21-JUN-90 # # Copyright (c) 1993 Digital Equipment Corporation. All rights reserved. # # # The following are all the resource names that DECTPU supports. # Tpu.Tpu$MainWindow.Title: DECTPU Copyright © Digital Equipment Corporation 1992. All Rights Reserved. Tpu.Tpu$MainWindow.ApplicationTitle: DECTPU Tpu.Tpu$MainWindow.IconName: DECTPU Tpu.Tpu$MainWindow.X: 610 Tpu.Tpu$MainWindow.Y: 0 # # The following resource names are commented out so that users can specify # *rows and *columns and have DECTPU obey those directives. If DECTPU finds # finds no resource names governing the number of rows and columns it should # have, it uses 24 rows and 80 columns. # # Tpu.Tpu$MainWindow.Columns: 80 Tpu.Tpu$MainWindow.Rows: 56 *EVE_MENU_BAR*background: #ADADADADADAD Tpu*XmScrollBar*background: #ADADADADADAD Tpu*XmDialogShell*background: #ADADADADADAD Tpu*XmMenuShell*background: #ADADADADADAD *background: white Tpu*condensedFont: OFF Tpu*fontSetSelection: 0 # 0 = big font # 1 = little font # 2 = GS font (German Standard) # 3 = Fine font (used only for non-latin 1 fonts?)
HowTo: Use EVE Editor Commands
- mark -> ctrl-space
- delete -> remove (delete)
- insert -> insert here (insert)
- learn -> ctrl-k (ctrl-r to stop)
Note: The right 'alt' key on the PC accesses the menu for EVE.
| copy | <PF1><Remove> on VMS |
| paste | <Insert Here> on VMS or
<ctrl><insert> on PC |
| cut | <Remove> on VMS or
<delete> on PC |
| learn | <CTRL><K> |
| stop | <CTRL><R> (then give a key
sequence such as <CTRL><Q>) |
| repeat | <PF1><#><(CTRL-Q)>
(the CTRL-Q depends on the given key sequence). |
| find next | <PF3> |
| enter search string | <PF1><PF3> |
| replace string | <PF1><S> |
| margins | Mouse click bottom of window type: set
right 999 |
| kill line | <PF4> |
| kill word | - (minus key on number pad) |
| advance next line | 0 (zero on number pad) |
| select text | <CTRL><SPACE> |
Helpfull hint: To avoid having the EVE editor automatically create multiple lines from a long input sequence set the margins [FORMAT - SET MARGINS] to some high number eg. 500.
HowTo: Use EVE Editor Commands Remotely with XWin32
Default key settings:
| remove (cut) and append to previous paste buffer | 9 (nine on number pad) |
| paste | <insert> |
| learn | <CTRL><K> |
| stop | <CTRL><R> (then give a key
sequence such as <CTRL><Q>) |
| repeat | <CTRL>-Q or given key sequence |
| kill word | - (minus key on number pad) |
| advance next line | 0 (zero on number pad) |
| go to end of line | 2 (two on number pad) or <CTRL><E> |
| go to start of line | <backspace> or <CTRL><H> |
| go to start of word | 1 (one on number pad) |
| delete line to left of cursor | <CTRL><U> |
| turn on/off select text | <CTRL><SPACE> or . (on number pad) |
| select all text | <CTRL><O> |
| turn on/off overstrike | <CTRL><A> |
| save and exit | <CTRL><Z> |
| enter command | <CTRL><B> |
You may find it useful to define keys. For example, define keys to cut, copy and paste:
To Cut<CTRL><X>:<CTRL><B>(enter command) Command:define key=Ctrl/x cut
To Copy<CTRL><C>:<CTRL><B>(enter command) Command:define key=Ctrl/c copy
To Paste<CTRL><V>:<CTRL><B>(enter command) Command:define key=Ctrl/v paste
HowTo: Use terminal based editor (EVE)
$ edit file.txt
If you are using this from a remote terminal, you will need to initiate a vt100 terminal.
$ set term /vt100
Some useful commands:
- ctrl-z -> exit with save
- ctrl-y -> kill without saving
- do-key, then type 'quit' or 'exit' (what is the do key on a remote terminal?)
- PF2 -> shows special keypad functions
- GoldKey -> PF1
Scanco System and Setup
HowTo: View the online schedule
Open a web browser and go to http://hpl0.kin.ucalgary.ca/public.
Login to the relevant schedule:
1. username: vivact_view, password: vivact
2. username: uct40_view, password: uct40
3. username: skyscan_view, password: skyscan
In "public folders" click on MicroCT Schedules and the relevant calendar can be seen.
HowTo: Calculate vivaCT CTDI dose
Assuming the following settings on the vivaCT for "high mode", we will calculate the CTDI dose.
2000 projections (360 degrees) 0.109 mA 200 ms IT
I calculate the time current value as:
0.109 mA * (0.200 + 0.012) S * 2000 proj= 46.22 mAs
The 0.012 is the integration time between projections.
Taking the proportion of the 68 mAs at 55 kV resulting in 720 mGy (see the document on example dose calculation on this Wiki site), we have:
46.22 / 68 * 720 = 490 mGy
Since CTDI in air is approximately two times the weighted CTDI, and since our setup is more like in air, we get:
2 * 490 = 980 mGy per scan.
It's always a good idea to look at the time-current product in the control file to get an approximate estimate.
HowTo: vivaCT CTDI dose chart and example
We have measured the following CT dose indices (CTDI).
- CTDIw: Weighted CTDI (chart below)
- CTDIair: CTDI in air (2 times CTDIw - calculate from chart below).
The detector was placed in the center of a 35 mm PMMA cylinder which was placed in the center of rotation.
70kV 300ms 85uA Field of view 38.9mm 1000 Proj./180°: CTDI = 260 mGy 55kV 300ms 109uA Field of view 38.9mm 1000 Proj./180°: CTDI = 220 mGy 45kV 300ms 133uA Field of view 38.9mm 1000 Proj./180°: CTDI = 190 mGy 70kV 300ms 85uA Field of view 30.7mm 1000 Proj./180°: CTDI = 420 mGy 55kV 300ms 109uA Field of view 30.7mm 1000 Proj./180°: CTDI = 350 mGy 45kV 300ms 133uA Field of view 30.7mm 1000 Proj./180°: CTDI = 305 mGy 70kV 300ms 85uA Field of view 21.5mm 1000 Proj./180°: CTDI = 850 mGy 55kV 300ms 109uA Field of view 21.5mm 1000 Proj./180°: CTDI = 720 mGy 45kV 300ms 133uA Field of view 21.5mm 1000 Proj./180°: CTDI = 620 mGy
high res = 1000 Proj./180° medium = 500 Proj./180° standard = 250 Proj./180°
The CTDI scales linear with the integration time (s), with the current (uA) and number of projections. If you have different settings there, it is easy to calculate the CTDI.
CTDI Definition:
Integral from +50mm to -50mm of D(z)/NxT
- where D(z) is the dose profile along a line z which is perpendicular to the tomographic plane
- N is the number of tomographic sections produced in a single rotation
- T is the nominal tomographic section thickness
Example: How to estimate how much radiation would be incurred by a mouse scanned at 25 um resolution (medium resolution -- MR) at 55 kVp, 109 uA, 150 ms IT, for about 30 minutes?
If you take your settings you can calculate the CTDI. First thing you have to be aware is that the CTDI is something like the local dose but it takes the cone beam geometry and the not perfect collimation of the x-ray beam into account (The CTDI value is always higher than a local dose measurement with for example TLDs). It does not matter how many stacks you are scanning. The dose you have at one point which is within the volume you are scanning gets the same local dose if you are performing a 1 stack or a 4 stack measurement.
With the 55kVp/109uA HR with 300ms we have a value at the 30.7 mm position of 350 mGy. Because you have MR we can divide the values by a factor of 2; and because you have 150ms instead of 300ms there is an other factor of 2. You would get 87.5 mGy for the position 30.7 mm. Because of the cone beam the dose has a quadratic dependency to the diameter of the field of view. (30.7 mm/25 mm)2 = 1.5. The CTDI value for your settings is in the order of 87.5 mGy * 1.5 = 132 mGy.
Note that for in vivo measurements, we should multiply the result by a factor of two since we are doing the measurement in AIR, not WATER. The charts above are assuming the CTDI done in water.
HowTo: Determine the calibration drift from QC1
The QC1 analyses provide an estimate of the calibration drift by considering 'mean5' values. Use
$ uct_list
and make sure to use UU:UCT_3D_MEANS.TXT as the template. Then give the measurement numbers of the QC1 measurements (or all of them and remove what's not needed later).
HowTo: Browse the VMS files from a windows PC
Pathworks gives you the ability to mount the Alpha as an external drive on your PC. It would be mounted as an F: or G: drive, then you can navigate using windows explorer.
You can look for the vivaCT in your microsoft windows network neighborhood and see if you can find it...then log in.
HowTo: Stop and restart the printer queue
How to fix the printer queue when hung, not working or giving an error. A full printer queue can seriously affect system performance. Be sure that the queue is cleaned up from time to time.
$ show queue
to first find out the real name of your printer queue.
- Replace "hpljet" and "...dcps_hpljet..." by your own queue (i.e., PRINTER1 for XtremeCT) name below.
- First approach, as normal user
microct:
$ stop/queue/reset hpljet $ start/queue hpljet
HowTo: Stop and restart other queues (i.e., sys$slow, sys$fast)
There are three methods. First the nice method.
1. As for the printer queue, a normal user can stop and start other queues.
$ stop/que/reset sceval_slow $ start sceval_slow
This kills the current process running. If you want to let the current process complete before stopping the queue, use:
$ stop/que/next sceval_slow
2. Use the web browser Mozilla.
- Open mozilla
- 'batch queues'
- Resize the window so it occupies the right half of the screen
- Click on 'delete job' once with the MIDDLE mouse button, this will open a new window on the right half of the screen. Ensure the two windows do not overlap, if they do resize the window which contains the batch queues list. Once window locations are correct MIDDLE click on the rest of the jobs which you wish to delete (click on 'Delete Job' in the batch queue list). The reason for locating the widows is because each successive click on 'Delete Job' will open a new window and you don't want it to cover the batch queues list.
- Then Exit from mozilla, this will delete all the open windows, it may take a bit if you are deleting lots.
2. Now the harsh method.
Warning: Extreme caution! Explicit permission for this change or similar changes must be obtained from Dr. Steven Boyd.
Completely remove the queue and re-generate, as user system
$ stop/queue/reset sc3309_slow $ delete/queue sc3309_slow
Then you must restart the queue. To learn how to do this refer to:
$ eve sys$startup:dcps_hpljet_ip.com
HowTo: Show process info
- Find the process identification using
$ sh que
- Find the process identification using
$ show entry 1131 /full OR $ se 1131
HowTo: See what is currently executing
- Find the process identification using
$ sh que/all/by_job_status=executing
- Find the process identification using
$ show entry 1131 /full OR $ se 1131
HowTo: Requeue a process
- Find the process identification using
$ sh que - The process must be pending, not processing!
- Find the process identification using
$ set entry 1131 /requeue=SCEVAL_SLOW
HowTo: Extract patient name from database
$ mcr um:uct_info 1234
will show you sample-name of sample-number 1234
$ mcr um:uct_info -m 1234
will give you some (stupid) info about meas 1234
Note: If you use this function all the time, put the following into microct_setup_user.com
$ uct_info :== $um:uct_info
and then the usage info will even be correct
HowTo: Disable a patient database entry
It is not possible to delete an evaluation from the database, but it can be disabled.
Log in as user calibration, and run
$ @DISK1:[MICROCT]LOGIN.COM ! set the logicals to point to user microct $ set proc/priv=bypass $ run disk1:[calibration.util]upat_correct_valid_flag.exe
REMEMBER TO LOG OUT: This program takes the measurement number as input, and displays the current status of the valid flag in the last evaluation. To disable erroneous evaluations, select valid flag = 0 to mark the evaluation as invalid.
HowTo: Extract disk usage information
To look at the RSQs in the database
$ dir/siz dk0:[microct.data...]*.rsq
the three dots means all subdirectories.
Other useful commands:
$ ctheader xxxxxx.isq
or
$ ctheader xxxxxx.rsq
shows you header.
$ fda command file-wildcard
does a 'file do all' of the command on all the given wildcard filenames.
$ pipe xxxx | search sys$pipe "patient"
is the pipe command in VMS.
So all three combined:
$ pipe fda ctheader dk0:[microct.data...]*.rsq | search sys$pipe "patient name"
or any other field you want to search for!
Other ideas:
$ write_info
gives you a file sys$scratch:info.txt with info in it (leave defaults to get all samples ever scanned, otherwise 'zoom' in on some samples.)
Check out the search command:
$ help search
and /match=and
or /match=or
HowTo: Edit Scanco SCANCO_SUBMIT_COMMAND symbol
- Check the current setting:
$ show sym *submit*
In directory DISK2:[MICROCT]MICROCT_SETUP_USER.COM add the following line:
$ SCANCO_SUBMIT_COMMAND :== SUBMIT/NOPRINT/QUE=SYS$SLOW /NOTIFY/LOG=SYS$SCRATCH:
Then end session and log in again. Definition of the symbol in the
MICRO_SETUP_USER.COM supersedes the standard setting.
HowTo: Weekly backups with UCT_BACKUP
The WEEKLY BACKUP can be run from the UCT_BACKUP program at the bottom.
The backup captures DISK1 and DISK0 (the MICROCT and MICROCT_COMMON stuff). This includes the programs and databases.
A little helper terminal comes up and gives feedback of every file backed up.
The backup is very fast (and important).
HowTo: Manage files with UCT_BACKUP
Two possible ways to use UCT_BACKUP:
- COPY TO -> this does not update the database.
- MOVE TO -> this updates the database.
Scenario 1:
1. Use UCT_BACKUP to 'move' the RSQ to 'tape' 2. Use UCT_BACKUP to 'move' the ISQ to 'garbage' 3. Use UCT_BACKUP to 'move' the remainder (AIM/GOBJ) to 'tape'
At operation 3, the measurement directory will be deleted from the measurement disk. The directory will automatically be restored if you restore your data from tape.
Scenario 2:
1. Use UCT_BACKUP to 'move' the RSQ to 'tape' 2. Use UCT_BACKUP to 'move' the ISQ to 'garbage' 3. Move all the GOBJ/AIM/etc to a project directory. 4. Generate a .SAV file and put on the IMA tape.
Note: You will have to delete the measurement directories (using UCT_BACKUP if you like). The disadvantage of this scenario is that the image data cannot be restored using UCT_BACKUP.
HowTo: Use the new UCT_BACKUP software
New Features (i) You can now select multiple samples with the Shift and/or the Ctrl key; and (2) You can use the sample name filter field on top to display only names containing the filter string.
Start the move/copy by clicking on 'Start...'
The 'Script...' button is for advanced users.
Advanced Users:
Use of the 'Script...' button: this will generate a script,
sys$scratch:archive.com,
that you may submit in batch mode later (e.g. over night) by typing:
$ scanco_submit_command sys$scratch:archive.com/after=23:59
(In a multi-computer cluster setup, you may want to specify the exact queue name of the computer that has the tape hooked up by giving e.g. /que=sceval_fast )
Insert a tape, but do NOT mount the tape in the normal program. (If necessary: if it's a new tape, initialize it as usual). The batch job will be started one minute before midnight in the example above.
$ show entry will show you that it is holding until then.
See $ help submit /after and $ help dcl_tips date_time example for more help on this.
Little Reminder:
While the tape is running and writing to it, DO NOT LOG OUT, DO NOT INTERRUPT THE PROGRAM! This would make that tape unusable from this point on - you could still read from that tape up to this point, but could not add more scans to this tape.
What to do when tape is full? It then displays some message about continuing on another tape. Hit ctrl/c to interrupt the program, take a fresh tape, initialize it, select the remaining scans to archive again, hit 'start'.
And last but not least: WE STRONGLY URGE YOU TO DO THE WEEKLY BACKUP (SAFETY BACKUP OF USER DISK1 WITH YOUR DATABASES ON IT). Two users DID experience disk crashes last year, and without the weekly backup, you may still have all scans on the data disk (e.g. disk2), but without the databases you cannot tell which scans belong the which sample!
How to do weekly backup: insert 'special' weekly backup tape, e.g. week_a, and just hit 'Full backup to tape'.
HowTo: Move a whole directory structure with BACKUP command
$ backup disk2:[microct.projects...] disk3:[microct.projects...]/verif
- Yes, with the ... in BOTH places!
- Of course, you can leave the /verify away, your choice.
- If you want: add
/deleteat the end, and this will delete it on DISK2 after successful verify. But what I do normally: without the/delete
- If you want: add
After checking that things look good:
$ delete disk2:[microct.projects...]*.*;* $ dl disk2:[microct.projects...]*.dir ! A for all; do until sub-dirs are gone
HowTo: Fix a stubborn tape drive
If the drive cannot be mounted, or it is not visible with
$ show device tp0
then something went wrong. For example, the server computer was booted while the tape was turned off. It then does not load the driver.
You can 'force load' it - but this will disconnect the scanner for a moment, so only do it while no scan is running:
as user system, on sc3309:
$ mcr sysman io auto $ show dev tp0
and you should see it now (otherwise turn on the tape drive, and do again)
Then you'll also have to make it available to all users:
$ @sys$startup:scanco_setup_devices.com
HowTo: Create a SAV (save set) file of your project and store on tape
NOTE: SAV (save set) files must have names with less than 13 characters (including the .SAV)!
the following example will backup everything in the bern directory to tape IMA001, the three dots (...) indicate that ALL subfolders of dk0:[microct.projects.bern] will be included
$ mount/foreign tp0
$ backup/log dk0:[microct.projects.bern...]*.*;* tp0:proj_bern.sav -
/block=65534 /label=IMA001 -
/media_format=nocompaction ! NEVER use the /rewind option here
$ dismount tp0
Exclude files with /excl=*.rsq
See the COM file below to see the actual command used by the UCT_BACKUP
$ type um:uct_move_files.com
See also for more options:
$ help backup
To view contents of a saveset (SAV) on disk:
$ backup/list upat_print_list_nomatch.sav/sav
To view the savesets (SAV) on a tape:
$ mount/ov=id tp0: $ dir/date tp0:*.* $ dismount tp0:
To view contents of a saveset (SAV) on a tape:
$ mount/foreign tp0: $ backup/list tp0:*.* ! OR, backup/list tp0:*.SAV or $ backup/list=results.txt tp0:*.* ! save output in results.txt $ dismount tp0:
An idea to get the results of the backup/list into a text file: Run the procedure in a submitted script and save the resulting log file with all the output.
To extract a SAV file from tape you have two choices:
- 1. As user
calibration
$ spb (bypass priv) $ backup/log tp0:proj_davison.sav/rewind [*...]
This puts all the files back in their original directory structure.
- 2. As user
microct
$ backup/log tp0:proj_davison.sav/rewind/select=[microct.projects.davison...]
disk2:[microct.projects.davison...]
$ backup/log tp0:*.*/rewind disk3:[microct.projects.vitamink.models]
Make sure to write the same path in the /select as the output (except for the actual disk2 portion). Alternatively, you could unpack it into a slightly different root directory (i.e., TMP) by changing the output path.
The three dots infers to use the same paths in the saveset as the file structure put onto disk.
HowTo: Transfer a SAV (save set) file of your project from VivaCT to Xtreme system
You can create a SAV set of your project on the VivaCT and transfer it to the Xtreme system, or vice-versa. First, create the SAV set using the command:
For example:
$ BACKUP/LOG DISK3:[MICROCT.PROJECTS.SB.MYPROJECT...]*.*;* -
SYS$SCRATCH:MYPROJECT.SAV/SAV
This creates the MYPROJECT.SAV file in the scratch directory. Now zip the file:
$ cd sys$scratch $ zip "-V" MYPROJECT.ZIP MYPROJECT.SAV (NOTE: must use quotes and a capital V!!!!)
FTP the .ZIP file to SODOR ( in binary mode!!!), and then FTP it off onto your destination system (Viva or Xtreme). See the appropriate HowTo for FTP instructions. Once you've FTP'd it, unzip the file:
$ unzip MYPROJECT.ZIP
Finally, unpack the contents of the .SAV file:
$ BACKUP/LOG MYPROJECT.SAV/SAV DISK3:[MICROCT.PROJECTS.MYPROJECT] <--- or whatever destination directory
NOTE: transferring a .SAV directly from VMS to VMS should work, but not via any third operating system (like SODOR) - so zipping is always the safe way to make sure it works.
HowTo: Import foreign data (or correct a mistake) into the Scanco database
Only RSQ and ISQ files can be imported into the database, however it is possible to convert other types of data into ISQ files (i.e., stacks of BMPs into ISQ).
PART 1:
After transfering your data to the VMS system (use the data disk disk2, NOT the user disk disk1), use the IPL commands /import_freeformat or /read_aim function to import your data for conversion to an ISQ.
For DICOM files, start IPL and run the /dicom function to import. For DICOM, if your object is a single 3D file (-multifile false) or many many individual slice files (-multifile true, and give beginning of filenames, and –extension).
There may be requests by IPL to convert your data to signed short or signed char from other data types. Obey these requests and do it by running the /convert_unsigned function.
Then, write the ISQ file.
ipl> toisq in DK0:[MICROCT.DATA]D0000001.ISQ
-square true
-original_pos false
This writes the ISQ file. Remember, the ISQ name must be 8 characters long (1 character followed by seven digits)!!! The letters and numbers can be chosen freely.
Fill out a log sheet with the original AIM names that were imported, and the resulting ISQ names that were generated.
PART 2:
Create a sample in the database and write down the sample and measurement number. Then, run:
$ run um:uct_import ! will import both RSQ and ISQ (modify patient index, etc)
and give the new ISQ file, the new sample-number and check that the feedback is correct (i.e., that the name from the database is matching the name from the ISQ file header). If the Patient Name in the ISQ header doesn't match the measurement database Patient Name (very likely), then upon importing the RSQ/ISQ the headers will be updated to the new Patient Name.
Operator and controlfile can be left 0 if you want. However, controlfile should be set appropriately if the data being imported is for the XtremeCT patient database.
If you are also importing the RSQ, put it in the same directory as the ISQ.
Then it changes the sample and measurement number in the ISQ file, makes the correct directory on DK0, and gives you the line on the screen of how to rename the file to the correct, new directory. Take this line and use it on the command line. Done!
You can now use the normal uct_evaluation program with this file. If the control file was set properly, then the evaluation will be done correctly (i.e., for XtremeCT patient measurements).
Note: Any AIMs created from the original ISQ should be recreated. So, it is important that you re-evaluate your newly imported ISQ. It is OK to move the GOBJ from the old directory to the same directly as the newly imported ISQ (it does not have a 'registry' in the database).
HowTo: Modify the database so it knows where to find RSQ and ISQ files
Note: If you are restoring RSQ or ISQ files from tape (or other source) it might be preferable to do your analysis without resetting the database info. See the appropriate HowTo.
The database is specific to the user. So, we have to modify the database for microct, and be careful not to modify the calibration (or other users) database. However, we still need to have permissions from calibration in order to do the modification.
When we return an ISQ or RSQ to disk, the database needs to be updated to ensure it finds it. We have to change the database back to say it's on disk. To do this we need to log in as user calibration.
$ @DISK1:[MICROCT]LOGIN.COM ! set the logicals to point to user microct $ set proc/priv=bypass $ run DISK1:[CALIBRATION.UTIL]UCT_CORRECT_DIR.EXE ! with full path
Note: Only change those items which have to be changed (e.g. just hit RETURN for RAW fields if you only want to change the IMA location. Also, when specifying the directories, use DK0, not DISK2.
$ run ut:UCT_CORRECT_DIR.EXE
Measurement Nr.: 1234 MeasNr. 1234 PatientNr: 268 RAW: RAW004 TP0:00001234_RAW IMA: IMA002 TP0:00001234_IMA
RAW-Label: [ RAW004 ] RAW-Dir : [ TP0:00001234_RAW ] IMA-Label: [ IMA002 ] DISK IMA-Dir : [ TP0:00001234_IMA ] DK0:[microct.data.00000456.00001234] Measurement Nr.: 0 End of program
The IMA-label does not matter on disk - but we have to write something to get rid of the IMA002, so 'DISK' makes sense.
Using the standard backup/archiving program, you can archive (MOVE TO) that IMA again to a tape, but use a DIFFERENT TAPE than where the first instance of this scan is on.
Background: Tapes just write file after file, without any directory structure or hierarchy, so the program will always find the first instance (the old dataset) if you try to read it again from that tape.
Note One other option is to change the permissions of UCT_CORRECT_DIR.EXE so that user microct can use it directly. To do this, log in as users calibration and then:
$ set proc/priv=bypass ! as user calibration $ set prot=g:re ut:uct_correct_dir.exe $ run disk1:[calibration.util]uct_correct_dir ! as user microct
HowTo: Modify the RSQ header to account for in-air scanning
This is necessary because the beam-hardening correction factor assumes scans were done in soft tissue. It is necessary to choose calibrations of 1200 or 700, instead of the default 200.
Currently, the XtremeCT has options for 200 (standard) or 1200 calibration (in air). The vivaCT calibrations are unknown.
To do this, log in as users calibration and then:
$ set proc/priv=bypass ! as user calibration; modification of MICROCT user data $ run ut:UCT_EXT_HEADER_ADD_CALIB.EXE > Raw-Data-File []: DISK2:[MICROCT.DATA.00000401.00001495]C0001404.RSQ > ... > Add another BH-Corr from file again? (Y/N) [N]: ! Enter yes (UCTD:UCT_BH_COEFF_60KV_1200HA_3309.TXT)
Then, delete the old ISQ. It must be deleted or else the header information will not be changed. Finally, reconstruct the new ISQ and analyze...
HowTo: Use UCT_EVALUATION without importing ISQ into the database
Warning! If you don't import your data into the system (i.e., see appropriate HowTo) you cannot store your evaluation results in the measurement database. You will have to use the LOG file to access your results.
Important: Use the whole pathname
$ def uct_default_isq DISK3:[MICROCT.PROJECTS.VALIDATION.MODELS]C0000123.ISQ ! or $ def uct_default_isq DISK2:[MICROCT.DATA.00001234.00005678]C0003456.ISQ $ uct_evaluation ! or voi, evalc, cutout, etc
Hit cancel when asked files to load, and the file you just set as default will be loaded.
Warning! Only start a 3D evaluation if and only if the sample (patient) and measurement index are correct in the ISQ full path! Also, no results will be stored in the database unless the ISQ header info (samp/meas) is correct.
Note: Many of the UCT_xxx.COM scripts use the whole filename to extract the sample and measurement numbers, so it is possible that some evaluations will not run. UCT_xxx_BATCH_V4.COM is an example of an evaluation that will not run, but UCT_CUTOUT.COM will run (doesn't need any sample/meas info).
HowTo: Redirect to a temporary database
We need to temporarily redefine the logicals UPAT_EVAL_DATABASE and UPAT_SLICE_DATABASE. Normally, the definition is
UPAT_EVAL_DATABASE = UCTD:UPAT_EVAL_CALGARY.DAT UPAT_SLICE_DATABASE = UCTD:UPAT_SLICE_CALGARY.DAT
Typically, we submit our jobs to the queue with an IPL script, so within the script we'll have to redefine the name of the database by adding lines such as
$ def UPAT_EVAL_DATABASE SYS$SCRATCH:TEMP_UPAT_EVAL_CALGARY.DAT $ def UPAT_SLICE_DATABASE SYS$SCRATCH:TEMP_UPAT_SLICE_CALGARY.DAT
so that the results from the IPL evaluation are redirected to this temporary database.
Then, we need to extract the results from the database. These results are provided on a slice by slice basis (at least with the UPAT data). As user microct in a terminal window, we will again need to redefine the database and then run the program that translates the results to a text file:
$ def UPAT_EVAL_DATABASE SYS$SCRATCH:TEMP_UPAT_EVAL_CALGARY.DAT $ def UPAT_SLICE_DATABASE SYS$SCRATCH:TEMP_UPAT_SLICE_CALGARY.DAT $ run disk1:[calibration.util]upat_export_measurement.exe ! give the measurement number and output file
For an example IPL script that redirects to a temporary database, see Percy:
DISK1:[MICROCT.COMMANDS]IPL_UPAT_EVAL_AIMINPUT.COM
HowTo: Examine patient databases
This is for advanced users only!
There are two patient databases that get updated every time an evaluation is performed. Below is the name of the database, and the method used to check database values:
$ show logical UPAT_EVAL_DATABASE $ run disk1:[calibration.util]upat_export_measurement.exe ! as microct
$ show logical UPAT_SLICE_DATABASE $ set host 0 ! login as user calibration $ @disk1:[microct]login.com $ spb $ run DISK1:[CALIBRATION.UTIL]UPAT_GET_DB_INFO.EXE ! enter '1' to list records
In the slice database every evaluation is recorded, but only one is currently active at a time.
HowTo: Standard patient analysis
All values are determined on a slice-by-slice basis, then averaged over all the slices to calculate morphological results:
- BV/TV -> Sum all raw data withing the GOBJ and divide by 1200 mg/cc HA
- Tb.N -> As per standard method
- Tb.Th and Tb.Sp -> Derived from BV/TV and Tb.N above (semi-derived method)
- D100 -> Average density of entire cross section
- DTrab -> Average density of trabecular region
- Ct.Th -> Cortical area (from seg) divided by circumference (from GOBJ)
GOBJ circumference can be determined with /gobj_circum
HowTo: Use @com:reco_all and/or UCT_reconstruction_angle
These two functions rotate and reconstruct all (reco_all) or a selection of(UCT_reconstruction_angle) slices from an RSQ. Both functions are executed from the measurement directory. The following examples are for a 10 degree clockwise rotation of sample 610, measurement 2449. NB, when assigning the angle of rotation, use right-hand rule and include a single decimal place.
When reconstructing all slices, delete the ISQ file from the measurement directory.
$ @com:reco_all.com -10.0 610 2449
When reconstructing a selection of slices, a valid ISQ must exist. There is an offset of 1 slice when designating slice selection. The command line in the example below will actually result in rotation and reconstruction of slices 36:41.
$ @com:uct_reconstruction_angle.com DISK2:MICROCT.DATA.00000610.00002449]C000####.RSQ 35:40 "" "" -10.0
NB "" is used instead of [] [] for optional parameters
Project Management
HowTo: Example filled out log sheet
A log sheet, which is always kept near the scanner, must be filled out for every measurement on the system. A blank log sheet is available in the Documents section of this Wiki page.
Here is an example log sheet:
Evaluation
HowTo: Understand the morphological parameters
BV/TV -> VOX-BV/TV BS/BV -> TRI-BS/BV Tb.Th -> DT-Tb.Th Tb.Sp -> DT-Tb.Sp Tb.N -> DT-Tb.N ConnD -> Conn-Dens SMI -> TRI-SMI DA -> TRI-DA
Usually I'd use the names on the left for the plots, but these correspond to the names on the right of the arrow in the Scanco output files.
Note, if you use the TRI-Tb.Th rather than the DT-Tb.Th*, then you are using the derived (plate-model) morphological parameters. These are less accurate than the direct parameters. They are calculated by triangulating the surface (marching cubes) to get BS, and then calculate thickness Th = 2 * BV / BS, etc...
Mean Values
mean 1: mean of bone AND marrow --> 'apparent density' mean 2: mean of what was considered bone only (i.e. what was segmented) 'bone tissue density'. (so this does depend on threshold a little bit) mean 3: empty, or can be used to store mean of cortex, e.g. The function /voxgobj has -region number (zero-based) to goveren which mean value is filled, 1 - 5 (thus region 0 - 4).]
What you should also know: because of partial voluming effects, for Mean2, we are DISCARDING the 2 surface voxels of EVERY trabeculae - thus, to get meaningful Mean2, you have to do your scan with the chosen resolution high enough, such that the mean trabeculae is depicted by at the very least 5 pixels, better actually more than 6 pixels thickness. (You can do this check at the end in the XLS sheet: divide DT-Tb.Th* by el-size-mm.x, and you need to get numbers bigger than 6 or 7 or 10 or so.
For parameters such as ConnD where no GOBJ is taken as input, the TV is determined from the processing log stored in an AIM that has previously had a GOBJ applied (stored as the relative region of interest; ROI). So, it is important to apply a GOBJ prior to ConnD measurements to ensure the TV is correctly determined (and not taken as the whole AIM).
HowTo: Erode and Dilate in IPL
The erode/dilate function is available as of IPL version 501b. To redefine the ipl symbol for interactive use, type the following at the command line:
$ ipl == "$um:ipl_scanco_m_v501b.exe /int"
Note, the symbol will only be defined in that particular terminal window. For batch analyses, define the ipl symbol in your script without the /int.
The filter is called /erosion_dilat_variable and allows erosion, dilation, opening and closing operations.
HowTo: Use UCT_EVALUATION tool version 6
The new evaluation tool v6 should be used in place of the older v5. Please see the Documents section of this wiki for a manual on its use.
Known bugs:
When you are producing your own EVAL scripts, and want to call your own ipl file or such:
The 'EVAL:' keyword in the scripts has the filenames of the uct_evaluation_v6.com, then the ipl_v6_xxxx.com, then additional filenames (such as the _prs.com to print and the 3dresults_append.com)
Now, if you are in BASIC mode in the modify window, and you change any of the 3 filename fields, the last of the additional filenames is 'dropped'... ooops...
So please go to Advanced mode and check the long 'EVAL:' keyword that all wished files are still in the list, otherwise add the last again (most of the time, that's the useful _3dresult_append.com script...)
Will correct that of course in the next version.
HowTo: Start a 3D evaulation from the terminal
Warning: Do not change uct_evaulation_v4.com and ipl_fixed_batch_v4.com in .eval, but only work on your own file (i.e., eval_steve).
First, an explanation of how the normal evaluation runs by hitting the 'Start 3d' button.
$ scanco_submit_command ue:uct_evaluation_v4.com/para=(xxx,yyy,zzz,…)
There are 8 parameters:
- P1: number of print outs of our results sheet
- P2: the ISQ filename
- P3-5: start x (pos x), y, z
- P6-8: dim x, y, z
The parameters p3-p8 come from the white bounding box. The problem is that when you start from the terminal you do not have these. This problem can be overcome by using the isq_to_aim_gobjbox.exe and then give the relevant parameters. You can
$ run um: isq_to_aim_gobjbox.exe
to see what it's asking for.
By using gobjbox you do not need p3-p8. Therefore you can start the evaluation by giving:
$ scanco_submit_command ue:uct_evaluation_special_josh.com – /para=(1,dk0:[microct.data.0000275.0000245]c0000332.ISQ)
Note that you can make uct_evaluation_special_josh.com such that there is no need for P1 (change p2 to p1 in the script, etc).
[Alternatively to using the gobjbox you could use the normal isq_to_aim, but hard code the dim and pos.]
Then call whatever IPL files you want to call. Look into fixed_batch_v4 to see how we turn on the database always on the first line of every IPL part, and how we calculate parameters.
HowTo: Associate the evaluation database with an evaluation
When /db_scanco_activate is used in the IPL files, the correct association with the evaluation database is through the Index Patient and Index Measurement in the AIM header.
Index Patient 3095 Index Measurement 5962 !-------------------------------------------------------------------------------
Using IPL
$ ipl
$ read in xxx.aim
$ examine in log
$ db true {activates database}
$ dt_object {at end "writing results to database for measurement 1234"}
HowTo: Submit a job to the queue
$ submit/noprint /que=sys$slow ipl_voi_josh_m.com - /log=sys$scratch:test.log
HowTo: Extract patient results on a slice-by-slice basis
There is an executable that was specially installed by Andres. Run it as user microct:
$ RUN DISK1:[CALIBRATION.UTIL]UPAT_EXPORT_MEASUREMENT.EXE
This gives you the .txt file in scratch containing the morphological parameters determined for each slice.
HowTo: Extract your results from the 3D database
Assuming you've used the SCANCO_SUBMIT_COMMAND to initialize your evaluations (either manually or through the uct_evaluation tool) then you can get all of your results stored into a text file that can be easily imported in Excel.
$ uct_list
The output text file will be stored in sys$scratch and you can ftp this to a PC so that it can be imported into excel and further analysis can be performed.
Importing into Excel requires setting a deliminator based on the space.
Customizing the uct_list output.
The default list template is set by the logical UCT_3D_LIST_SHEET which is normally
set to point to UU:UCT_3D_LIST.TXT. See the templates by
$ dir uu:*.txt
Almost all the available keywords are in UCT_3D_LIST.TXT enclosed
by \\ and //.
Only when you use the 'show directly on screen mode':
$ uct_list 1234
then you need to do this to override the default output:
$ def/user uct_3d_single_sheet my-template_file.txt $ uct_list 1234
Some example format files are:
UCT_3D_LIST.TXT UCT_3D_SINGLE.TXT UCT_3D_LIST_W_CRH.TXT UCT_3D_MEANS.TXT --> Use this to get the 5 mean values (i.e., calibration)
A summary of all the available keywords is available in UU:UCT_3D_SINGLE_SHEET.TXT
Name :\\UCTMEASFILENAME// Sample-Name :\\SAMPLENAME// Sample-Nr :\\SAMPLENUMBER// Meas-Nr :\\UCTMEASNR// Date of Birth :\\SAMPLEDOB// Sample-Remarks :\\SAMPLEREM// Meas-Remarks :\\UCTMEASREM// Meas-NrofSlices :\\UCTMEASNUMSLI// Direct: ------------------------------------------------------------------- TV : \\VOX_TV// BV : \\VOX_BV// BV/TV : \\VOX_BV_TV// Conn.Dens.: \\UCT_CONN// SMI : \\MC_SMI// Tb.N* : \\DT_N// Tb.Th* : \\DT_TH// Tb.Sp* : \\DT_SP// Tb.1/N.SD*: \\DT_N_SD// Tb.Th.SD* : \\DT_TH_SD// Tb.Sp.SD* : \\DT_SP_SD// Lin.Att.1 : \\UCT_MU0// +-\\UCT_MU0_SD// Lin.Att.2 : \\UCT_MU1// +-\\UCT_MU1_SD// Lin.Att.3 : \\UCT_MU2// +-\\UCT_MU2_SD// Lin.Att.4 : \\UCT_MU3// +-\\UCT_MU3_SD// Lin.Att.5 : \\UCT_MU4// +-\\UCT_MU4_SD// TRI (Plate Model): -------------------------------------------------------- TV : \\MC_TV// BV : \\MC_BV// BS : \\MC_BS// BV/TV : \\MC_BV_TV// BS/BV : \\MC_BS_BV// Tb.Th : \\MC_TH// Tb.Sp : \\MC_SP// Tb.N : \\MC_N// Anisotropy: -------------------------------------------------------------- |H1| : \\MC_H1// H1x: \\MC_H1X// H1y: \\MC_H1Y// H1z: \\MC_H1Z// |H2| : \\MC_H2// H2x: \\MC_H2X// H2y: \\MC_H2Y// H2z: \\MC_H2Z// |H3| : \\MC_H3// H3x: \\MC_H3X// H3y: \\MC_H3Y// H3z: \\MC_H3Z// DA : \\MC_DA// Dim X : \\VOX_DX// Dim Y : \\VOX_DY// Dim Z : \\VOX_DZ// Pos X : \\VOX_PX// Pos Y : \\VOX_PY// Pos Z : \\VOX_PZ// El-Siz X : \\VOX_ELSX// El-Siz Y : \\VOX_ELSY// El-Siz Z : \\VOX_ELSZ//
HowTo: Tabulate your LOG file results from 3D evaluations
Only use this if you have not used the standard uct_evaluation tool to generate your 3D evaluations (in which case see the HowTo related to the 3D database).
You can tabulate the LOG files:
$ search xxxx.log "ov "
Or whatever you want to search for can be stored in a text file
$ search/output=sys$scratch:ov.txt xxxx.log "ov "
To search more than one log file, and get the output into one single file:
$ fda/output=xxx.txt search *.log "ov "
The fda means 'file do all' and is a script made by Scanco to do one command (search) on a wildcard of files (*.log). Then put all the ov.txt, tv.txt, name.txt etc. files into excel. Josh has made a .com file that does a similar job as described above.
HowTo: Compile the evaluation logs into one file
Call the UE:UCT_EVALUATION_V4_3D_RESULT.COM with the same construction
as $ eval_special. If you need help with this, see the HowTo on this
Wiki site (HowTo: Assign special 3D evaluation to the UCT_EVALUATION tool).
Edit UE:UCT_EVALUATION_V4_3D_RESULT.COM file to call a specific ipl
script as you wish.
When you run the evaluation, you will have three new files created:
- Two files in the measurement directory (on DK0!) (one with each eval 3D results in its own file, and one
APPENDED_ALL.TXTfile) - Then in sys$scratch, you will have one
SYS$SCRATCH:UCT_LIST_ALL_3D_RESULTS.LOGfile with ALL 3D evaluations of all measurements.
- Two files in the measurement directory (on DK0!) (one with each eval 3D results in its own file, and one
Note: You may need to edit the SCANCO_SUBMIT_COMMAND to specify a single queue (i.e., /que=sceval$fast)
HowTo: Do cortical midshaft evaluation with moment of inertia calculation
This explains what happens when you type
$ midshaft ! or $ eval_midshaft
Draw a rough contour around your slices: open the Contouring Sub-window, double-click on the big image, and it automatically finds the best contour. Then click on 'Selection' 'Forwards', then 'Iterate Forwards'.
Then 'cancel' the contouring sub-window, and start the 3D evaluation. Make sure you have already set the correct threshold, sigma, support in file
DISK2:[MICROCT.EVAL]IPL_FIXED_BATCH_MIDSHAFT.COM
When you type
$ show queue
you should find a job called UCT_EVALUATION_MIDSHAFT and a SYS$SCRATCH:*_MIDSHAFT_*.LOG
The IPL_FIXED_BATCH_MIDSHAFT.COM by default does not calculate the direct measurement results because you must have many more than 20 slices for these to be valid. You can uncomment these parts of the file if you contoured the whole stack (i.e., stack thickness is >> than cortex thickness).
TILDE: Note that you will see lots of tildes (~) on the result sheets. This is to tell you that, if the measurements were trabecular bone, those values would only be approximate. But now for the cortex, they are actually correct! (see below for more explanation about this) I would now use the tildes to check the 'excel' table that the operator has taken the correct script for the trab. or cort. evaluations for the respective measurements!
So what's the advantage of all this? Now, also VOX-TV is correct! So VOX-TV is the whole area, VOX-BV the doughnut, so TV - BV is the marrow area! And still, TRI-Tb.Th is the cortical thickness (TRI-TV is NOT correct, because the .gobj feature was turned off).
I say 'area' above: depending on how many slices one individual scan has, VOX-BV (and VOX-TV) might be different for different scans, so you will HAVE to convert the volumes to area again:
volume equals area times height --> Bone Area = VOX-BV / height = BV / (dim.z * el_size_mm.z)
and same for Total area, of course :-)
POROSITY: If you want porosity of the bone itself draw two contours: one around, counter-clockwise, on on the inside, clock-wise (thus a 'negative', excluding contour). Now, TV will be just that ring area, BV will be the bone within that ring area, and BV/TV will be 1 - porosity, thus BV/TV 94% means 6% porosity.
METAPHYSIS: Application of this script to metaphysis scan (with trab. in middle):
$ midshaft
Draw one contour around the cortex, and in the same slices, a NEGATIVE contour on the inside (CW contour) to exclude the trabecular bone. You may potentially work with the BP (break-point) system to be able to morph the negative contours, even though there is already an 'outer' contour around the bone in every slice.
Start 3D eval, read out the data-base with $ uct_list.
NOTE: You CANNOT give the .gobj a special name such as c0001234_cortex.gobj if you are using the automatic evaluation button on UCT_EVALUATION. Only after the eval (or midshaft eval) has finished, you may copy it to a more meaningful name, but all of the evaluations are just taking the STANDARD gobj name!
Afterwards (after renaming or copying the _seg.aim to _cortex.aim, and .gobj to _cortex.gobj), you may want to start the very normal eval with normal (inner) contours to evaluate the trabecular compartement.
Remember: the values in our 3D result database then are OVERWRITTEN.
If you have a large study, I would recommend to run the $ midshaft for ALL
samples, $ uct_list to e.g. sys$scratch:mystudy_cortex.txt,
rename/copy gobj and seg for all, and THEN run the trabecular evaluation for all samples. $ uct_list and you have two nice complete excel sheets.
NOTE ON PLATE MODEL: More explanations of why the plate model is correct
Assume a ring (cortex).
Area = thickness * 'middle line'. 'middle line' = average of outer and inner circumference --> 'middle line' = 0.5 * 'bone surface' --> thickness = bone volume * 2 / bone surface.
And this is nothing else but the 'plate model' formula for Tb.Th!
NORMAL TRABECULAR EVALUATION? And why not just run the 'normal trabecular eval'? Because in the 'normal' TRI calculation, we are EXCLUDING all surfaces that are created artificially by a gobj line that cuts through a trabecula.
However, for the midshaft, this means the whole outer (or even inner, if also inner contour is there) is SUPPRESSED, because it is touching the gobj line. So this is where that midshaft script comes in: it turns off that suppression.
MORE EXPLANATIONS: Why the direct DT-Tb.Th* is NOT correct for a scan with just 12 slices.
If we fill the structure with spheres, those spheres should be bounded by the width of the cortex, not just by the fact that we only have 12 slices (and even more so, we are always doing 'aim box' suppression with the spheres) if a sphere touches the boundary of the aim box, it is suppressed!
So this is quite crucial for Tb.Sp and Tb.N. To get meaningful Tb.Sp, you would need a LOT of slices. Also, then, you cannot have the inner contour - otherwise the negative inner contour will delete the Tb.Sp. spheres.
If you have enough slices, you may opt to turn the /dt_object on again in the
midshaft script (second half). Then DT-Tb.Th* and TRI-Tb.Th just have a slightly different behaviour if there are little pores within the cortex:
TRI: the little pore just adds a little BS, thus the influence is not that big. DT: the little pore cuts the thickness sphere in half, thus at that location, the thickness is halved.
MEAN1 and MEAN2: The script is also calculating Mean1 and Mean2 now.
Mean1: 'apparent' density, average over whole TV Mean2: 'tissue' density: average over what was segmented as bone only.
These mean values will be in mg HA/ccm if you have the calibration option for bone density installed (and activated for those scans). Remember: the bone has to have some soft-tissue (or equivalent) on the inside, and preferably also on the outside then.
HowTo: Temporarily change the evaluation for any UCT_EVALUATION
In a terminal window, we need to redefine the logical that determines which
3D evaluation is associated with the UCT_EVALUATION tool.
For example, typing VOI runs the UCT_EVALUATION tool
by executing UE:UCT_EVALUATION_VOI.COM
Type
$ show logical UCT_EVALUATION
and then you can redefine this to point to another evaluation script.
$ define UCT_EVALUATION UE:UCT_EVALUATION_CUTOUT.COM
This is only redefined in the particular terminal you are using, and it will reset to its default in a new terminal. It will also not work if you try to submit the job to a queue. It only works interactively.
HowTo: Assign special 3D evaluation to the UCT_EVALUATION tool
Warning: This is for advanced users ONLY. Do not attempt this without contacting Steve!
This will show how to set up $ eval_kyle:
It is easy to set up multiple .COM files for the 3D evalulation tool, one such set-up is already prepared on your computer:
$ eval_special
will do something similar to $ voi where the normal contour program opens, but if you start the 3D eval, the special script um:uct_evaluation_special.com is called (associated with eval_special), which then in turn calls ipl_fixed_batch_special.com, where you can specify your own set of thresholds, etc.
So it is a daisy chain of files which we will need to follow to set up a special xxx_kyle.com script, and where ever we encounter _special.com, we copy and change it to _kyle.com.
So to set up $ eval_kyle you will need to do the following:
- 1. Edit
disk1:[microct]microct_setup_user.com(double-click on file), please be careful here, it's very important! (and I hope you have done your 'weekly full backup' regularly, so you could always retrieve a good version of login.com...)
- 2. Then, towards to bottom and duplicate the line
$ eval_special :== @com:eval_var.com um:uct_evaluation_special.com
and change duplicate to
$ eval_kyle :== @com:eval_var.com um:uct_evaluation_kyle.com
This will make this command eval_kyle available after you login freshly. Save and Exit.
- 3. Then go to
disk1:[microct.eval]and copy the fileuct_evaluation_special.comto the nameuct_evaluation_kyle.com('Commands', 'Copy ...', BUT CLICK ON THE THREE DOTS and give new output name.
If you do not see the eval_special: go to terminal, $ dir ue:*special*.com and take it from the microct_common directory)
- 4. Edit the
_kyle.comfile: at the top, changeipl_......_special.comto_kyle.com
- 5. Copy
ipl_fixed_batch_special.comtoipl_fixed_batch_kyle.com
- 6. Edit
ipl_fixed_batch_kyle.comto your liking. If you want$ eval_kyleto not perform the full evaluation, but only something akin tovoi, then, in the steps above, copyuct_eval_voi.comtouct_evaluation_kyle.com, andipl_voi.comtoipl_fixed_batch_kyle.com(thus you take thevoiscript as template for the_kylescript).
- 7. Then open a new terminal ('applications', 'decterm'),
$ eval_kyleshould work now!
Notes: When you start the 3D eval, then
$ que
will show you your batch job with your name on it now!
And now a few more explanations how the whole thing works: in all eval programs, hitting 'Start 3d' just submits the logical uct_evaluation, $ show log uct_evaluation shows you that by default, this points to ue:uct_evaluation_v4.com.
Those little voi and eval_steve scripts then just temporarily redefine this logical so that a different script is submitted when you 'start 3d eval'.
About the corelut eval: Then we start a whole different eval program: the .exe_corelut. So, if you set up a eval_steve_c (or whatever you want to call it): Produce a eval_var_c.com in the directory commands (maybe copy from microct_common to [microct.commands]), and there, on the last line, instead of starting
$ uct_evaluation
(the normal program), replace by
$ evalc
which starts the .exe_corelut - and because the eval_var.com has over-ridden the uct_evaluation logical just before, then you are starting different script upon starting 3d eval.
NB: we have a logical AND a symbol called uct_evalution. Sorry for confusion. Symbol uct_evaluation starts normal eval program, so this is what you replace by symbol evalc now).
HowTo: Convert CT numbers to mg HA/ccm
The two byte numbers (short) can be converted to mu values by first dividing by mu_scaling which is probably 4096. Then apply the slope and intercept to get mg HA/ccm. A typical slope may be 2.95e+02 and intercept -1.896e+02.
These numbers are available in the AIM header, or the ISQ header ($ run ut:ctheader).
The conversion is as follows:
mg HA/ccm = (AIM/mu_scaling) * slope + intercept mg HA/ccm = (AIM/4096) * 295.494 – 189.695
!---------------------------------------------------------------------- Mu_Scaling 4096 Calibration Data 55 kVp, 200mg HA wedge, 4096 scaling Calib. default unit type 2 (Density) Density: unit mg HA/ccm Density: slope 2.95493988e+02 Density: intercept -1.89695007e+02 HU: mu water 0.58200 !----------------------------------------------------------------------
HowTo: Create a list of registered measurements
- To generate a list of measurements that are registered in the data base, to determine where backups are stored, or if the data is still on disk:
$ write_info
- It asks you for a range of measurement numbers or sample names, and creates
sys$scratch:info.txt
- It asks you for a range of measurement numbers or sample names, and creates
HowTo: View the scout views
Go to scout view directory
XtremeCT side: $ cd DISK1:[MICROCT.DATA.SCOUTS] VivaCT side: $ cd ADISK1:[VIVACT.DATA.SCOUTS]
Use the program ximage
$ x asdf.SCV
HowTo: Rotate a dataset with IPL's turn3d function
The turn3d function can be used to perform a single rotation about any axis in 3d. The turnaxis_angle input is the angle between the x, y, and z axes and the line about which the rotation will be performed. The turnangle input is the amount to be rotated about the specified line. To use this function to perform three sequential rotations about the image's original x, y, and z axes requires compensation for the previous rotations.
Further instructions can be found here: turn3d.pdf
HowTo: Fix SAP colours when green
(using the standard gray colourmap), if changing color maps doesn't help.
- Menu point 'Norm, Default is Bone = 16000.
- Take max for 32000, or 'Adapt slice'.
- Note: Do NOT take 'adapt vol' - it will be extremely slow! Every single mouse-click it re-calculates whole volume...
HowTo: Run SAP from the command line
$ sap -s myfile.aim
HowTo: Use SAP, CoreLUT or XV with XWin32 or Hummingbird Exceed
You need two things on your computer: (1) an X windows server (e.g., XWin32 or Hummingbird Exceed), and (2) an SSH client to run your X applications (e.g., Putty or SSH Secure Client).
For SAP, CoreLUT or XV to work with XWin32, the visual display must be set to 8-bit. The evaluation tool evalc can be used in place of uct_evaluation via the 8-bit display.
XWin32
In the XWin Configuration, choose the "Windows" tab, check the box for "Legacy PseudoColor Support". It may be necessary to restart Putty and Xwin32 before the settings take effect. If you want to switch back to 24-bit display, uncheck the "Legacy PseudoColor Support" and restart the programs.
Hummingbird Exceed
Under server settings, be sure to select "pseudocolor" display.
SSH Client
Make sure the X-tunneling is turned on so that X applications can be used with these SSH clients. Two SSH clients are recommended:
- putty
- SSH Secure Shell v3.2.9 http://www.ssh.com
HowTo: Fix Remove and Insert key function in Cutout or Evalc
You probably have caplocks activated. Deactivate it and the cut and paste functions of the remove and insert keys will be functional again.
Print outs and visualization
HowTo: Print out report sheets
The postscript report sheets can be generated and printed on the command line. For the XtremeCT system, use UPAT_PRINT_LIST.EXE which can be run (using the symbol):
$ UPAT_LIST
Look in the UU: directory to see options for the template files (UPAT*.TXT) and the postscript output files (*.PS).
- UU:UPAT_EVAL_FUP05_SCUSA.PS
- UU:UPAT_EVAL_BASELINE_SCUSA.PS
For reports from non-patient measurements (i.e., the vivaCT system or non-patient scans on the XtremeCT), the template files are different (UCT*.TXT) and the postscript outputs are different (UCT*.PS). To print a result sheet use:
$ RUN UM:UCT_RAY_BATCH.EXE
If you want to create a postscript file, but not send it to the printer, set the number of copies to zero (interactive). Then, find the postscript file from the SYS$SCRATCH directory and transfer it to your PC. You must transfer the postscript file in ASCII mode. The files are typically called TEMP_3D.PS or UPAT_PAT_62_RR.PS. A program such as Adobe Photoshop can convert the postscript file to a different format.
See also our custom scripts:
$ @COM:PRINT_2D.COM $ @COM:PRINT_3D.COM
Combining two volumes to create transparent image
First create your two start "seg.aim" images Start by running either the normal eval, or $ voi to get one _seg.aim file of one region
Rename it to a better name in the session manager, e.g. c0001234_all.aim
Then either by choosing different contours, or a different threshold, start the $ voi or the normal evaluation again, which will create another _seg.aim file.
Load them in the 3D viewer ('all files') to check that they look like expected.
Now we will go into IPL and concatenate those two volumes.
$ ipl /read all xx_all.aim /read trab xx_seg.aim /transparent -input_solid trab -input_transp all -output out
Note: the solid volume is OVERWRITING the transparent input volume, so usually, it is the smaller (inner) of the two.
/write out xxx_transp.aim /quit
Then load the _transp.aim file in 3D, go to 3D program FAQ to see how to change transparency levels in the Display options there.
See IPL FAQ or 3D program FAQ if you need help with these parts.
Step by Step Example: Showing your chosen trab VOI within whole bone
- $ voi, enter threshold in ipl_voi.com, start 3d eval WITHOUT contours
- WAIT UNTIL THE JOB IS FINISHED!
- Rename xxxx_seg.aim to xxxx_all.aim
- Start up normal eval program, draw trabecular contours, check threshold in ipl_fixed_batch_v4.com, start 3D eval.
- WAIT UNTIL THE JOB IS FINISHED!
- go into ipl and combine the two, see code above
- Voila, finished
Step by Step Example: Showing high-dense volume surronded by lower density volume
- Start normal 3D eval with HIGH threshold entered in ipl_fixed_batch_v4.com
- WAIT UNTIL THE JOB IS FINISHED!
- Rename xxxx_seg.aim to xxxx_high.aim
- If wished: read out 3d result database with $ uct_list
- Start normal 3D eval with LOW threshold entered in ipl_fixed_batch_v4.com
- WAIT UNTIL THE JOB IS FINISHED!
- go into ipl and combine the two, see code above
- Voila, finished
Make an animation
To calculate an Animation, two (separate) tools of the 3D program are used: the set-up of start and end point of the Animation, and the 'Auto-Print' tool that automatically creates the TIF files for every rendered image.
This is a 'step by step' guide to create an animation using TIFF files:
- Open your sample in the 3D program.
- Now, open 'options','Animation'
- Render your Image the way you want your animation to start. e.g. observer rotation -179 degrees. You may interrupt if you want. If you are satisfied with all the settings (rotation, elevation, transparency, colors etc.) the Click on 'Get Settings A'
- Then, adjust all the settings for the endpoint of your animation (with the mouse or the sliders) e.g. observer rotation +179, and start the rendering. If satisfied, click 'Get settings B'
Note: To test, put # of views to 5 or 10... You can also interrupt the build-ups for faster viewing.
- Click the START button again, wait till the build-up of the 3D image is finished.
- DO NOT HIT 'START CALCULATION' YET!
- First, you also need to set-up the 'Auto-Print' mode:
- Go to the 'Print' menu (file --> print), choose print to TIF and to File and enter THE BEGINNING OF A FILENAME, e.g. sys$scratch:test_ (the program will append 0000.TIF, 0001.TIF etc afterwards) Or enter (possibly with middle-mouse-click): "DK0:[MICROCT.DATA.00001234.00003456]ANIMATION_" to have the result go to the measurement directory.
- Click on the 'Auto-Print' box. Then 'ok'
- Adjust the number of views (e.g. 200), then click on 'Start Calculation', and it will render. This may well take a long time.
- Take those TIFF files to your PC, and combine the sequences in the program that you are using to convert the TIFF files to AVI or MOV files (like Windows Movie Maker 2, or Quick Time Pro, or Adobe Premiere etc.)
Notes/Hints:
- The order in the above list can also be reversed: You can first set up the 'Auto-Print', and then go into the 'Animation' menu, choose start and end settings, and hit 'Start Calculation'
- The positions A and B can be any: e.g. with subdim, you can first take everything (A), then slide it back to nothing (B).
- You can even slowly change the color of an object. Or slowly hiding objects: choose 'transparent' for object, but change from 0.0 (A) to 1.0 (B)
- If you want to create a movie with different sections, e.g. first rotate around, then slowly make bone transparent, then cut in: Do this in multiple sections with the 3D program, e.g. first create Auto-Print files 'rotation_0000 to rotation_0200', then 'transp_0000 to transp_0050', and then 'cut_0000 to cut_0100'. Make sure ALL the settings from the last view of the previous section match those of the first view of the next section so you get smoot transitions.
- The 'Auto-Print' box is also usable without the 'Animation' Menu: Activate it, Like above, with sys$scratch:test_ only the beginning of filename. 'ok' Then, whenever a 3D image is completely built-up (so when you are happy with a view and you do not interrupt the build-up), automatically a TIF file is generated, numbered sequentially.
Writing Scripts
HowTo: Get information about a sample or measurement from database
The following will create a sys$scratch:info.txt file.
$ write_info
HowTo: Create an MSQ image and view it
This is based on marching cubes. See IPL_UPAT_EVAL.COM for an example as per below:
/read seg C0000214_SEG.AIM /sup_divide ! careful of the order of inputs here -input seg -suppos_pixels_local -1 -1 -1 -supdim_numbers 1 2 1 -subdim_pixels -1 -1 -1 -testoff_pixels 0 0 0 /sub_pick -input seg -output segsub -subpos_numbers 0 1 0 /tri -input segsub -output tri -gobj_filename none -peel_iter 0 -ip_sigma 0.8 -ip_support 1 -ip_threshold 40 -nr_ave_iter 2 -size_image 512 512 -scale_image 0.800000 -edges false -nr_views 1 ! Important /msq_from_aim -aim_name tri -msq_filename C0000123_3D.MSQ
Then, use UCT_3D to view it. If you click on "animations" it will give you the option to read the MSQ file.
HowTo: Create your own IPL script with some tips
To make a script that would submit a job to the queue with the command as follows:
$ @um:ipl_eval_only.com 'aim_file' 'gobj_file' 'p1' 0
you need to create your own IPL file would be translated to the following command:
$ submit /noprint /que=sys$slow ue:IPL_VOI_JOSH_M.COM
- /log=sys$scratch:test.log /para=('aim_file','gobj_file','seg_file')
The IPL file would look something like this…
$ if p1 .EQS. "" $ THEN $ write sys$output "Give DK0:[xxx]C0001234_SEG.aim on the line." $ write sys$output "Or: " $ write sys$output "Type $ scanco_submit_command um:ipl_eval_autostart/para=(dk0:[xxx]c00123_seg.aim) " $ exit $ endif $ $ gobj_file = p1-F$PARSE(p1,,,"VERSION")-"_SEG.AIM" + ".GOBJ" $ aim_file = p1-F$PARSE(p1,,,"VERSION")-"_SEG.AIM" + ".AIM" $ $! $ @um:ipl_eval_only.com 'aim_file' 'gobj_file' 'p1' 0 $ exit
Some more handy IPL sequences are:
$ INPUT = F$SEARCH("UCT_MEASUREMENT_DATA:[*.*''P1']*.RSQ",1)
and then you just need to give meas. number as P1 (and maybe slice range as p2),
$ if p2 .eqs. "" then p2 := A
OR, some nice starts are:
$ IF P3 .EQS. "" $ THEN $ WRITE SYS$OUTPUT "P1: Measurement Number to duplicate" $ WRITE SYS$OUTPUT "P2: New Sample Number from Database" $ WRITE SYS$OUTPUT "P3: New Start Letter of ISQ file" $ WRITE SYS$OUTPUT "P4: Optional: Operator Number" $ WRITE SYS$OUTPUT "P5: Optional: Controlfile Number" $ EXIT $ ENDIF
where you say which parameters HAVE to be there (up to p3), and which ones are optional.
All together, the script may look like this:
$ IF P1 .EQS. ""
$ THEN
$ WRITE SYS$OUTPUT "P1: Measurement Number to reco"
$ WRITE SYS$OUTPUT "P2: Optional: Slice number N or Range M:N. Auto:All"
$ WRITE SYS$OUTPUT "P3: Optional: Queue. Auto: sys$slow"
$ EXIT
$ ENDIF
$ if p2 .eqs. "" then p2 := A
$ if p3 .eqs. "" then p3 := SYS$SLOW
$ slices = p2
$ quename = p3
$ INPUT = F$SEARCH("UCT_MEASUREMENT_DATA:[*.*''P1']*.RSQ",1)
$ INPUT = INPUT - F$PARSE(INPUT,,,"VERSION")
$ logfile = "sys$scratch:RECO_" + f$PARSE(input,,,"NAME") + ".LOG"
$ submit/noprint/queue='quename' uct_reconstruction_file -
/para=('input','slices','logfile')
$ exit
Note that uct_reconstruction_file is a logical that points to um:uct_reconstruction.com.
Logicals are preferred in scripts to make them more universal.
Errors and Fixes
HowTo: Fix "last slice" error problem when extracting AIM from ISQ
Sometimes the evaluation script (i.e., voi) converting the ISQ to an AIM fails because it tries to read one slice more than what is available in the ISQ data. The result of this failure is that the 3D analysis appears to fail and no .AIM or _SEG.AIM is created in the data directory. For example, it may have tried to read 261 slices, but there were only 260 slices available. The easiest work around is to make sure that the white bounding box in the uct_evaluation program does not include the last slice (largest Z dimension). Scanco is aware of this problem and will fix it in future software releases (V5.2).
HowTo: Fix sample data when results fail to print/list/show after evaluation
When sample information (such as patient name, DOB, remark) is changed DURING scanning, this can over write the 1st Scan measurement number, resulting in teh evaluation sheet not benig printed, and data not shown when runnign upat_list. For example, this happens when:
1) open sample program, enter name, hit save, leave program open
2) start scan (which would write correct record with 1st meas. in sample database)
3) in sample program: then only enter DOB, and hit 'save' again in the sample program --> it 'overwrites' the 1st meas. with an empty string again.
If you want to enter DOB after the scan has started, you HAVE to 'Find...' and re-load that patient first (so it correctly loads the 1st meas. entry also). It is best to just not use the sample management program whilst scanning is taking place.
However, if you do encounter this problem, use the following to fix (shown using patient 668 as an example. 1st scan measurement number was 2672):
$ set host 0 calibration xxxxx $ spb $ @[microct]microct_setup $ run [calibration.util]uct_correct_first $ r UCT_CORRECT_FIRST Patient Nr.: 668 SampleNr.: 668 First: 0 2672 Patient Nr.:
and continue with next non-working patient, give patient number 0 to exit.
$ logout
File Transfer
HowTo: SC5019 (vivaCT) files to Sodor
$ ftp hal.kin.ucalgary.ca 220 Microsoft FTP Service Connected to hal.kin.ucalgary.ca. Name (hal.kin.ucalgary.ca:microct): hpl-nt\skboyd 331 Password required for hpl-nt\skboyd. Password: 230 User hpl-nt\skboyd logged in. FTP>
Note that you can log in as either:
- hpl-nt\skboyd
- skboyd@kin.ucalgary.ca
On the HPL network, open the window file program and type:
\\hal\FTP Home
Other options for file transfer:
$ sftp ! haven't tried it much $ scp ! doesn't work well with openvms
Scanco Finite Element Analysis
Running the FE code
See the PDF file that is located in the "documents" directory for documentation.
To run as a batch job
$ fem
To run interactively
$ iplfe
The IPl file used in batch job mode is IPL_FE_VM.COM
Extracting results
Creates a total result file called .post file.
Then, by default, it extracts one parameter (e.g. von mises stress), and produces stats file
.postlist and a colorful .aim file (_fe_par_42.aim)
which you can view with uct_3d.
If you then want other parameters extracted, or other colorful images, you only need to do a very quick operation in iplfe:
$ iplfe /fe_post
give .post file and write out the resulting .aim file, and it produces also the .postlist file.