How To's: Difference between revisions

From bone.wiki
Jump to navigation Jump to search
Scanco (talk | contribs)
Redirecting to Main Page
 
(402 intermediate revisions by 12 users not shown)
Line 1: Line 1:
__TOC__
#REDIRECT [[Main Page]]
 
 
 
 
=HowTo Library=
 
:In addition to this HowTo library, much information is also available at the [http://www.scanco.ch/cgi-bin/scanco.pl?menu=support&site=faq Scanco Medical FAQ].
:*users@scanco.ch
:*basser5dorf
 
==OpenVMS==
 
===HowTo: Helpful VMS commands===
 
:*UNIX to OpenVMS [http://seqaxp.bio.caltech.edu/www/vms_sheet.html]
*Delete
<pre>
$ delete *.aim;*
$ dl *.aim
</pre>
*Delete a directory
<pre>
$ SET FILE/PROT=O:RWED [.SUBDIR...]*.*;*
$ DELETE [.SUBDIR...]*.*;* Issue this command until no error messages appear.
$ SET FILE/PROT=O:RWED SUBDIR.DIR
$ DELETE SUBDIR.DIR;
</pre>
or
<pre>
$ dl subdir.dir
$ @scom:dl.com subdir.dir
</pre>
 
===HowTo: Shut down the Alpha stations and start up again===
 
<b>Warning:</b> 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: Understand difference between <code>mcr</code> and <code>run</code>===
 
The command <code>mcr</code> is the same as <code>run</code>, but only with mcr you can hand over 'in-line' parameters to an .exe file:
 
<pre>$ run ut:ctheader.exe c000124.isq</pre>
does not work, but you  have to say
<pre>$ mcr ut:ctheader.exe c000124.isq</pre>
 
But funnily if you define a symbol in <code>microct_setup_user.com</code> (or <code>login.com</code>),
 
<pre>$ ctheader :== $ut:ctheader.exe</pre>
 
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...
<pre>
$ def dcl$path disk1:[microct.main],disk1:[microct.util]
</pre>
then, if you type
<code>
$ uct_t
</code>
it will first try to
 
<code>
$ @uct_t.com
</code>
and then
<code>
$ r uct_t.exe
</code>
 
however, we usually define it by giving full path:
 
<pre>
$ progx :== $disk1:[microct.main]progx.exe
$ com_proc_x :== @disk1:[microct.main]procedure.com
</pre>
 
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:
 
<code>proc.com</code>:
 
<pre>
$ cd 'p1'
$ dir *.*/size
 
$ define COM disk1:[microct.commands]
$ p :== @COM:PROC.COM
</pre>
 
these both go into <code>login.com</code>
 
then, you can just type:
 
<pre>
$ p disk4:[microct.data.0000007.000009]*.ISQ
</pre>
 
===HowTo: Launch an editor such as EVE===
 
On the command line
<pre>$ edit/display=decwindows/tpu fname.txt</pre>
 
===HowTo: Edit a symbol set by Scanco such as AIX===
 
[[Image:Bones2.jpg|picture_position,left]] <b>Warning:</b> Extreme caution!  Explicit permission for this change or similar changes <b>must</b> be obtained from Dr. Steven Boyd.
 
Log in as user calibration
<pre>
$ set proc/priv=bypass
$ cdc (changes to MICROCT_COMMAND)
$ sea *.com aix
</pre>
Edit that file which is called <code>MICROCT_SETUP_COMMON.COM</code>
 
''Another example'': To make the backspace/insert keys work properly, edit the <code>login.com</code> and insert the line
<pre>
$ set terminal/insert
</pre>
Anywhere suitable.
 
===HowTo: File do all -- apply one command to a whole set of files===
 
<code>$ fda ctheader dk0:[microct.data.0001234...]*.isq </code>
 
to see the header of all isq files of sample 1234 (the three dots ... means all subdirectories)
 
Or:
 
<code>$ fda aix dk0:[microct.data.0001234.00005678]*.aim</code>
 
to see the processing log of all aim files of scan 5678
 
Wildcard "*" means multiple characters, "%" is for ONE character:
 
<code>$ fda aix dk0:[microct.data...]C%%%%%%%.aim</code>
 
(yes, 7 %'s)
 
to show the aim header of the gray-scale c0000135.aim (etc) files only, and NOT from the _seg.aims also.
 
<b>Warning: CAUTION! </b> Always test the wildcard expression first with
 
<code>$ dir dk0:[xxx...]*.aim </code>
 
 
 
 
The 'file do all' fda command can even be combined with a pipe, or an /output qualifier:
 
 
<code>$ pipe fda aix dk0:[microct...]*.aim | search sys$pipe "Slope" </code>
 
will show you all "Slopes" in a row. (but you may not see which slope belongs to which aim file anymore...)
 
 
or:
 
<code>$ fda/output=sys$scratch:all_headers.log aix dk0:[microct...]*.aim</code>
 
 
will write all the output into the .log file - which you can then either edit, or
<code>$ search sys$scratch:all_headers.log "String"
or whatever you want.
 
 
 
"fda" is our self-written script, so you may have to try-n-error a bit...
 
<code>$ fda command file_wildcard [Optional: further parameters]</code>
 
If the command consists of multiple words with spaces inbetween (e.g. mcr ut:xxx.exe), then enclose the command in double-quotes
 
<code>$ fda "mcr ut:uct_ext_header_display" dk0:[microct...]*.isq 8</code>
 
 
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:
<pre>
@decw$user_defaults:sap$vue
</pre>
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===
 
<pre>
# - temple
$ - sceval
# xhost +temple.ucalgary.ca
# ssh -X microct@sceval.ucalgary.ca
$ set display /create /transport=tcpip /node=temple.ucalgary.ca
</pre>
 
<b>NOTE:</b> Do not use <code>xhost+</code>.  Always specific exactly which computer is being
allowed X access.
 
===HowTo: Mount a CDROM===
 
Device could be <code>dqa0</code> or <code>dqb0</code>.  I'm not sure which works:
<pre>
$ mount/foreign dqa0:
</pre>
OR
<pre>
$ mount/override=id dqa0:
</pre>
Then
<pre>
$ dismount dqa0:
</pre>
 
===HowTo: Monitor system usage===
 
<pre>
$ monitor/interval=1 processes/topcpu
$ monitor/interval=1 system
$ show error
$ show system
$ @SCOM:SHOW_DISKS.COM (or simply DISKS)
</pre>
 
The command <code>show error</code> may indicate errors.  One or two errors is OK.
 
===HowTo: Configure the EVE editor===
 
The following file, called <code>tpu.dat</code>, should be installed in <code>disk1:[microct.xdefaults]:</code>
<pre>
#
# 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?)
</pre>
 
 
===HowTo: Use EVE Editor Commands===
 
<table border="1" cellspacing="1" cellpadding="1">
<tr>
<td valign="top" width="200">gold key</td>
<td valign="top" width="500"><code>&lt;PF1&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">copy</td>
<td valign="top" width="500"><code>&lt;PF1&gt;&lt;Remove&gt;</code> on VMS</td>
</tr>
<tr>
<td valign="top" width="200">paste</td>
<td valign="top" width="500"><code><Insert Here&gt;</code> on VMS <i>or
</i> <code> <ctrl&gt;&lt;insert&gt;</code> on PC</td>
</tr>
<tr>
<td valign="top" width="200">cut</td>
<td valign="top" width="500"><code>&lt;Remove&gt; </code> on VMS <i>or
</i><code>&lt;delete&gt; </code> on PC</td>
</tr>
<tr>
<td valign="top" width="200">learn</td>
<td valign="top" width="500"><code>&lt;CTRL&gt;&lt;K&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">stop</td>
<td valign="top" width="500"><code>&lt;CTRL&gt;&lt;R&gt; </code> (then give a key
sequence such as <code>&lt;CTRL&gt;&lt;Q&gt;</code>)</td>
</tr>
<tr>
<td valign="top" width="200">repeat</td>
<td valign="top" width="500"><code>&lt;PF1&gt;&lt;#&gt;&lt;(CTRL-Q)&gt; </code>
(the <code>CTRL-Q </code> depends on the given key sequence).</td>
</tr>
<tr>
<td valign="top" width="200">find next</td>
<td valign="top" width="500"><code>&lt;PF3&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">enter search string</td>
<td valign="top" width="500"><code>&lt;PF1&gt;&lt;PF3&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">replace string</td>
<td valign="top" width="500"><code>&lt;PF1&gt;&lt;S&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">margins</td>
<td valign="top" width="500">Mouse click bottom of window type: <code>set
right 999</code></td>
</tr>
<tr>
<td valign="top" width="200">kill line</td>
<td valign="top" width="500"><code>&lt;PF4&gt;</code></td>
</tr>
<tr>
<td valign="top" width="200">kill word</td>
<td valign="top" width="500">- (minus key on number pad)</td>
</tr>
<tr>
<td valign="top" width="200">advance next line</td>
<td valign="top" width="500"><code>0</code> (zero on number pad)</td>
</tr>
<tr>
<td valign="top" width="200">select text</td>
<td valign="top" width="500"><code>&lt;CTRL&gt;&lt;SPACE&gt;</code></td>
</tr>
</table>
 
==Scanco System and Setup==
 
===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.
 
<pre>
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
</pre>
 
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:
<pre>
Integral from +50mm to -50mm of D(z)/NxT
</pre>
:*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
<pre>
$ uct_list
</pre>
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.
 
<pre> $ show queue </pre>
 
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 <code>microct</code>:
<pre>
$ stop/que/reset hpljet
$ start/que hpljet
</pre>
 
* Completely remove the queue and re-generate, as user <code>system</code>
[[Image:Bones2.jpg|picture_position,left]] <b>Warning:</b> Extreme caution!  Explicit permission for this change or similar changes <b>must</b> be obtained from Dr. Steven Boyd.
<pre>
$ stop/que/reset hpljet
$ dele/que hpljet
$ @sys$startup:dcps_hpljet_ip
</pre>
 
For other types of queues (i.e., <code>SCEVAL_SLOW</code>) you can also start/stop.  However, if you use
<pre>$ stop/que/reset xxx</pre>
it kills the current process running.  It is nicer to use
<pre>$ stop/que/next xxx</pre>
to wait for the finishing of the currently executing job first, only then stop the queue.
 
===HowTo: Requeue a process===
 
:* Find the process identification using <code>see</code>
:* The process must be <I>pending</I>, '''not''' <I>processing</I>!
:* <code>set entry 1131 /requeue=SCEVAL_SLOW </code>.
 
===HowTo: Extract patient name from database===
 
<pre>
$ mcr um:uct_info 1234
</pre>
will show you sample-name of sample-number 1234
<pre>
$ mcr um:uct_info -m 1234
</pre>
will give you some (stupid) info about meas 1234
 
'''Note:''' If you use this function all the time, put the following into <code>microct_setup_user.com</code>
<pre>
$ uct_info  :== $um:uct_info
</pre>
and then the usage info will even be correct
 
===HowTo: Extract disk usage information===
 
To look at the RSQs in the database
<pre>
$ dir/siz dk0:[microct.data...]*.rsq
</pre>
the three dots means all subdirectories.
 
Other useful commands:
 
<code>$ ctheader xxxxxx.isq</code>
 
or
 
<code>$ ctheader xxxxxx.rsq</code>
 
shows you header.
<pre>
$ fda command file-wildcard
</pre>
does a 'file do all' of the command on all the given wildcard filenames.
<pre>
$ pipe xxxx | search sys$pipe "patient"
</pre>
is the pipe command in VMS.
 
So all three combined:
<pre>
$ pipe fda ctheader dk0:[microct.data...]*.rsq | search sys$pipe "patient name"
</pre>
or any other field you want to search for!
 
'''Other ideas''':
 
<pre>$ write_info</pre>
 
gives you a file <code>sys$scratch:info.txt</code> with info in it (leave defaults to get all samples ever scanned, otherwise 'zoom' in on some samples.)
 
Check out the <code>search</code> command:
<pre>
$ help search
</pre>
and <code>/match=and</code>
or <code>/match=or</code>
 
===HowTo: Edit Scanco <code>SCANCO_SUBMIT_COMMAND</code> symbol===
 
*Check the current setting:
<pre>
$ show sym *submit*
</pre>
 
In directory <code>DISK2:[MICROCT]MICROCT_SETUP_USER.COM</code> add the following line:
<pre>
$ SCANCO_SUBMIT_COMMAND :== SUBMIT/NOPRINT/QUE=SYS$SLOW /NOTIFY/LOG=SYS$SCRATCH:
</pre>
Then end session and log in again.  Definition of the symbol in the
<code>MICRO_SETUP_USER.COM</code> supersedes the standard setting.
 
===HowTo: Weekly backups with <code>UCT_BACKUP</code>===
 
The WEEKLY BACKUP can be run from the <code>UCT_BACKUP</code> 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 <code>UCT_BACKUP</code>===
 
Two possible ways to use <code>UCT_BACKUP</code>:
:* COPY TO -> this does not update the database.
:* MOVE TO -> this updates the database.
 
Scenario 1:
<pre>
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'
</pre>
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:
<pre>
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.
</pre>
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 <code>UCT_BACKUP</code> 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 <code>'Start...'</code>
The <code>'Script...'</code> button is for advanced users.
 
<b>Advanced Users:</b>
Use of the 'Script...' button: this will generate a script,
<code>sys$scratch:archive.com</code>,
that you may submit in batch mode later (e.g. over night) by typing:
<pre>$ scanco_submit_command sys$scratch:archive.com/after=23:59</pre>
 
(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. <code>/que=sceval_fast</code> )
 
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.
<code>$ show entry</code> will show you that it is holding until then.
See <code>$ help submit /after</code> and <code>$ help dcl_tips date_time example</code> for more help on this.
 
<b>Little Reminder:</b>
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 <code>ctrl/c</code> to interrupt the program, take a fresh tape, initialize it, select the remaining scans to archive again, hit <code>'start'</code>.
 
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: Create a SAV (save set) file of your project and store on tape===
 
<pre>
$ mount/for tp0
 
$ backup/log dk0:[microct.projects.bern]*.* tp0:proj_bern.sav -
        /block=65534/label=give_the_correct_label/media_form=nocompact
</pre>
 
The above command puts all files in [.bern] in the save set.  If you want all the
subdirectories too, use
 
<pre>
$ backup/log dk0:[microct.projects.bern...]*.* tp0:proj_bern.sav -
        /block=65534/label=give_the_correct_label/media_form=nocompact
</pre>
 
Exclude files with /excl=*.rsq
 
See the COM file below to see the actual command used by the <code>UCT_BACKUP</code>
<pre>
$ type um:uct_move_files.com
</pre>
 
See also for more options:
<pre>
$ help backup
</pre>
 
To extract a SAV file on disk:
<pre>
$ backup/log upat_print_list_nomatch.sav/sav []
</pre>
 
===HowTo: Import foreign data into the Scanco database on the VMS system===
 
Only 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).
 
<b>PART 1:</b>
 
After transfering your data to the VMS system (use the data disk <code>disk2</code>, NOT the user disk <code>disk1</code>), use the IPL commands <code>/import_freeformat</code> or <code>/read_aim function</code> to import your data for conversion to an ISQ.
 
For DICOM files, start IPL and run the <code>/dicom</code> 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 <code>signed short</code> or <code>signed char</code> from other data types. Obey these requests and do it by running the <code>/convert_unsigned</code> function.
 
Then, write the ISQ file.
<pre>ipl> toisq in DK0:[MICROCT.DATA]D0000001.ISQ
    -square          true
    -original_pos    false</pre>
 
This writes the ISQ file.
<b>Remember</b>, 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.
 
<b>PART 2: </b>
 
Create a sample in the database and write down the sample and measurement number. Then, run:
<pre>$ run um:uct_import</pre>
 
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, then upon importing the ISQ the header will be updated.
 
Operator and controlfile can be left 0 if you want.
 
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 <code>DK0</code>, 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 <code>uct_evaluation</code> program with this file.
 
<b>Note</b>, if you were importing an AIM file, delete the original file as it will have the wrong measurement indexes in its log header. You will have to produce the AIM file again from the ISQ so our database writes the evaluation results into the correct sample fields.
 
===HowTo: Use <code>UCT_EVALUATION</code> without importing ISQ into the database===
 
<b>Warning!</b> It is strongly suggested to properly import that ISQ into the database before you run a full 3D evaluation!  See the appropriate HowTo.
 
In a terminal, <code>$ def uct_default_isq xxxxxxxx.isq</code>
 
Then start the <code>uct_evaluation</code> tool (or <code>voi</code>, <code>evalc</code>).
 
Hit cancel when asked for a file to read and the default ISQ that was set will be read.
 
<b>Warning!</b> Only start a 3D evaluation if and only if the sample (patient) and measurement
index are <b>correct</b> in the ISQ header!
 
==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:
 
::[[Image:Herzog_pic.jpg]]
 
==Evaluation==
 
===HowTo: Understand the morphological parameters===
 
<pre>
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
</pre>
 
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.
 
<b>Note</b>, 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'''
<pre>
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).]
</pre>
<b>What you should also know</b>: 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.
 
===HowTo: Start a 3D evaulation from the terminal===
 
Warning: Do not change <code>uct_evaulation_v4.com</code> and <code>ipl_fixed_batch_v4.com</code> 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.
<pre>$ scanco_submit_command ue:uct_evaluation_v4.com/para=(xxx,yyy,zzz,…)</pre>
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 <code>isq_to_aim_gobjbox.exe</code> and then give the relevant parameters. You can
<code>$ run um: isq_to_aim_gobjbox.exe </code>
to see what it's asking for.
By using gobjbox you do not need p3-p8. Therefore you can start the evaluation by giving:
<pre>$ scanco_submit_command ue:uct_evaluation_special_josh.com –
/para=(1,dk0:[microct.data.0000275.0000245]c0000332.ISQ)</pre>
Note that you can make <code>uct_evaluation_special_josh.com</code> 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 <code>fixed_batch_v4</code> 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 <code>/db_scanco_activate</code> 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.
 
<pre>
Index Patient                                    3095
Index Measurement                                5962
!-------------------------------------------------------------------------------
</pre>
 
Using IPL
<pre>
$ ipl
$ read in xxx.aim
$ examine in log
$ db true          {activates database}
$ dt_object        {at end "writing results to database for measurement 1234"}
</pre>
 
 
 
===HowTo: Submit a job to the queue===
 
<pre>
$ submit/noprint /que=sys$slow ipl_voi_josh_m.com
  - /log=sys$scratch:test.log
</pre>
 
===HowTo: Extract your results from the 3D database===
 
Assuming you've used the <code>SCANCO_SUBMIT_COMMAND</code> to initialize your evaluations (either manually or through the <code>uct_evaluation</code> tool) then you can get all of your results stored into a text file that can be easily imported in Excel.
<pre>$ uct_list</pre>
The output text file will be stored in <code>sys$scratch</code> 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.
 
<b>Customizing</b> the <code>uct_list</code> output.
 
The default list template is set by the logical <code>UCT_3D_LIST_SHEET</code> which is normally
set to point to <code>UU:UCT_3D_LIST.TXT</code>.  See the templates by
 
<pre>$ dir uu:*.txt</pre>
 
Almost all the available keywords are in <code>UCT_3D_LIST.TXT</code> enclosed
by \\ and //.
 
Only when you use the 'show directly on screen mode':
<pre>$ uct_list 1234</pre>
then you need to do this to override the default output:
<pre>
$ def/user uct_3d_single_sheet  my-template_file.txt
$ uct_list 1234
</pre>
 
Some example format files are:
<pre>
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)
</pre>
 
A summary of all the available keywords is available in <code>UU:UCT_3D_SINGLE_SHEET.TXT</code>
<pre>
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// 
</pre>
 
===HowTo: Print out report sheets===
 
The postscript report sheets can be generated and printed on the command line.  For the XtremeCT system, use <code>UPAT_PRINT_LIST.EXE</code> which can be run (using the symbol):
<pre>
$ UPAT_LIST
</pre>
 
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:
<pre>
$ RUN UM:UCT_RAY_BATCH.EXE
</pre>
 
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 <code>SYS$SCRATCH</code> 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.
 
===HowTo: Tabulate your LOG file results from 3D evaluations===
 
Only use this if you have not used the standard <code>uct_evaluation</code> tool to generate your 3D evaluations (in which case see the HowTo related to the 3D database).
You can tabulate the LOG files:
<pre>$ search xxxx.log "ov "</pre>
Or whatever you want to search for can be stored in a text file
<pre>$ search/output=sys$scratch:ov.txt xxxx.log "ov "</pre>
To search more than one log file, and get the output into one single file:
<pre>$ fda/output=xxx.txt search *.log "ov "</pre>
 
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 <code>UE:UCT_EVALUATION_V4_3D_RESULT.COM</code> with the same construction
as <code>$ eval_special</code>.  If you need help with this, see the HowTo on this
Wiki site (HowTo: Assign special 3D evaluation to the UCT_EVALUATION tool).
 
Edit <code>UE:UCT_EVALUATION_V4_3D_RESULT.COM</code> 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 <code>APPENDED_ALL.TXT</code> file)
:*Then in sys$scratch, you will have one <code>SYS$SCRATCH:UCT_LIST_ALL_3D_RESULTS.LOG</code> file with ALL 3D evaluations of all measurements.
 
<b>Note:</b> You may need to edit the <code>SCANCO_SUBMIT_COMMAND</code> 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
 
<code> $ midshaft or $ eval_midshaft </code>
 
 
Draw a rough contour in the first of your 20 (or 12 or whatever) 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', and it finds the best contour for every of your (about) 20 slices.
 
Then 'cancel' the contouring sub-window, and start the 3D evaluation.
 
FIRST: set the correct threshold, sigma, support in the file:
[microct.main]ipl_fixed_batch_midshaft.com (or in [microct.eval])!
 
 
(Save contours when it asks you). Exit the program.
 
When you now type $ que in the terminal, you will see some job called
'uct_evaluation_midshaft'
(or similar), whereas the trabecular evaluations were called
'uct_evaluation_v4'.
Also the .log file in Scratch has the _midshaft name.
 
I now only calculate the TRI values (Plate Model), and not the direct stuff
anymore, since for only 20 slices, the truly 3D Tb.Th might be quite off.
Also, you will see lots of tildes on the result sheets. This is to tell
you that, if the meas. were trab. bone, those values would only be approximate.
But now for the cortex, they are actually correct ! (see below for more explan about this)
 
So 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 :-)
 
All clear ???
 
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.
 
*****************
 
Application of this script to metaphysis scan (with trab. in middle):
 
$ midshaft
draw one contour around the cortex, and in same slices, a NEGATIVE contour on
the inside (CW contour) to exclude the trab.
(potentially work with the BP (brake-point) system to be able to morph the
negative contours, even though there is already a 'outer' contour around the
bone in every slice.)
 
Start 3D eval, read out the data-base with uct_list.
 
NB: you CANNOT give that used .gobj a special name such as c0001234_cortex.gobj!
Only after the eval (or midshaft eval) has finished, you may copy it to a more
meaningful name - but all of our evaluations are just taking the STANDARD gobj name!
 
Then 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 whole 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 trab. eval for all samples, $ ust_list and you
have two nice complete xls sheets.)
 
**********************
 
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!
 
nice, no ?
 
 
And why not just run the 'normal trabecular eval'?
in the 'normal' TRI calculation, we are EXCLUDING all surfaces that are created
artificially by a gobj line that cuts through a trab.
 
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.
 
***************
 
and some explanations, why the direct DT-Tb.Th* is NOT correct for a scan with
just e.g. 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.
 
**************
 
 
 
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 <code>UCT_EVALUATION</code>===
 
In a terminal window, we need to redefine the logical that determines which
3D evaluation is associated with the <code>UCT_EVALUATION</code> tool.
 
For example, typing <code>VOI</code> runs the <code>UCT_EVALUATION</code> tool
by executing <code>UE:UCT_EVALUATION_VOI.COM</code>
 
Type
<pre>$ show logical UCT_EVALUATION</pre>
and then you can redefine this to point to another evaluation script.
<pre>$ define UCT_EVALUATION UE:UCT_EVALUATION_CUTOUT.COM</pre>
 
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 <code>UCT_EVALUATION</code> tool===
 
'''Warning''': This is for advanced users ONLY.  Do not attempt this without contacting Steve!
 
This will show how to set up <code>$ eval_kyle</code>:
It is easy to set up multiple .COM files for the 3D evalulation tool, one such set-up is already prepared on your computer:
<pre>
$ eval_special
</pre>
will do something similar to <code>$ voi</code> where the normal contour program opens, but if you start the 3D eval, the special script <code>um:uct_evaluation_special.com</code> is called (associated with eval_special), which then in turn calls <code>ipl_fixed_batch_special.com</code>, 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 <code>xxx_kyle.com</code> script, and where ever we encounter <code>_special.com</code>, we copy and change it to <code>_kyle.com</code>.
 
So to set up <code>$ eval_kyle</code> you will need to do the following:
 
*1. Edit <code>disk1:[microct]microct_setup_user.com</code> (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
<code>$ eval_special :== @com:eval_var.com um:uct_evaluation_special.com</code>
and change duplicate to
<code>$ eval_kyle    :== @com:eval_var.com um:uct_evaluation_kyle.com</code>
 
This will make this command <code>eval_kyle</code> available after you login freshly. Save and Exit.
 
*3. Then go to <code>disk1:[microct.eval]</code> and copy the file <code>uct_evaluation_special.com</code> to the name <code>uct_evaluation_kyle.com</code> ('Commands', 'Copy ...', BUT CLICK ON THE THREE DOTS and give new output name.
If you do not see the <code>eval_special:</code> go to terminal, <code>$ dir ue:*special*.com</code> and take it from the <code>microct_common</code> directory)
 
*4. Edit the <code>_kyle.com</code> file: at the top, change <code>ipl_......_special.com</code> to <code>_kyle.com</code>
 
*5. Copy <code>ipl_fixed_batch_special.com</code> to <code>ipl_fixed_batch_kyle.com</code>
 
*6. Edit <code>ipl_fixed_batch_kyle.com</code> to your liking. If you want <code>$ eval_kyle</code> to not perform the full evaluation, but only something akin to <code>voi</code>, then, in the steps above, copy <code>uct_eval_voi.com</code> to <code>uct_evaluation_kyle.com</code>, and <code>ipl_voi.com</code> to <code>ipl_fixed_batch_kyle.com</code> (thus you take the <code>voi</code> script as template for the <code>_kyle</code> script).
 
*7. Then open a new terminal ('applications', 'decterm'), <code>$ eval_kyle</code> should work now!
 
'''Notes''': When you start the 3D eval, then
<code>$ que</code>
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 <code>uct_evaluation</code>, <code>$ show log uct_evaluation</code> shows you that by default, this points to <code>ue:uct_evaluation_v4.com</code>.
 
Those little <code>voi</code> and <code>eval_steve</code> scripts then just temporarily redefine this logical so that a different script is submitted when you <code>'start 3d eval'</code>.
 
About the '''corelut eval''': Then we start a whole different eval program: the <code>.exe_corelut</code>. So, if you set up a <code>eval_steve_c</code> (or whatever you want to call it): Produce a <code>eval_var_c.com</code> in the directory commands (maybe copy from microct_common to [microct.commands]), and there, on the last line, instead of starting
<code>$ uct_evaluation</code>
(the normal program), replace by
<code>$ evalc</code>
which starts the <code>.exe_corelut</code> - and because the <code>eval_var.com</code> has over-ridden the <code>uct_evaluation</code> logical just before, then you are starting different script upon starting 3d eval.
NB: we have a logical AND a symbol called <code>uct_evalution</code>. Sorry for confusion. Symbol <code>uct_evaluation</code> starts normal <code>eval</code> program, so this is what you replace by symbol <code>evalc</code> 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 (<code>$ run ut:ctheader</code>).
The conversion is as follows:
<pre>
mg HA/ccm = (AIM/mu_scaling) * slope + intercept
mg HA/ccm = (AIM/4096) * 295.494 – 189.695
</pre>
<pre>
!----------------------------------------------------------------------
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
!----------------------------------------------------------------------
</pre>
 
===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:
 
::<code>$ write_info</code>
 
:*It asks you for a range of measurement numbers or sample names, and creates <code> sys$scratch:info.txt</code>
 
 
===HowTo: View the scout views===
 
Use the program ximage
<pre>$ x asdf.SCV</pre>
 
 
===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...
 
==Writing Scripts==
 
===HowTo: Get information about a sample or measurement from database===
 
The following will create a <code>sys$scratch:info.txt</code> file.
<pre>$ write_info</pre>
 
===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:
<pre>
$ @um:ipl_eval_only.com 'aim_file' 'gobj_file' 'p1' 0
</pre>
 
you need to create your own IPL file would be translated to the following command:
<pre>
$ submit /noprint /que=sys$slow ue:IPL_VOI_JOSH_M.COM
  - /log=sys$scratch:test.log /para=('aim_file','gobj_file','seg_file')
</pre>
The IPL file would look something like this…
<pre>
$  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
</pre>
 
Some more handy IPL sequences are:
<pre>
$    INPUT = F$SEARCH("UCT_MEASUREMENT_DATA:[*.*''P1']*.RSQ",1)
</pre>
 
and then you just need to give meas. number as P1 (and maybe slice range as p2),
<pre>
$ if p2 .eqs. "" then p2 := A
</pre>
OR, some nice starts are:
<pre>
$    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
</pre>
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:
<pre>
$    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
</pre>
Note that <code>uct_reconstruction_file</code> is a logical that points to <code>um:uct_reconstruction.com</code>.
 
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).

Latest revision as of 15:48, 16 September 2010

Redirect to: