Editing
Scanco Administration
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Results= ==Extract Results== ===UPAT_LIST command=== *Refer to Scanco specification document on using the [[Media:Specification_upat_print_list_V2.0.pdf | '''Upat_print_list V2.0''']] on XCT2. *Refer to [[Media:Using_upat.docx |'''Using upat_list Additional Notes''']]. upat_list (version 1.9 on XCT1) is identical to 2.0 except: :* there is no option for using group codes :* there is no option for using evaluation types For all of the available parameters for generating results using upat_list command: $ upat_list -h Program: upat_print_list V1.9 Use the following modes to run upat_print_list: upat_print_list -list for export to spreadsheet, default mode upat_print_list -print for PostScript output upat_print_list -show for text output upat_print_list -advanced to access advanced options interactively Standard Command-Line Arguments: -b=<pat_nr> First patient, default = 1 -e=<pat_nr> Last patient In list & show modes, default = last patient in database In print mode, default = first patient -s=<site_code> Site code In list & show modes, RL RR R* TL TR T* CU *, default = * In print mode, RL RR TL TR CU, default = RL -mb=<date> Begin of measurement period, default = 1st measurement date -me=<date> End of measurement period, default = current date Dates must be given in VMS format, e.g. 01-JAN-2000 -f=<#_followups> Maximum number of follow-ups to match, default = 19 -t=<file_name> Name of template file In list mode, default = UPAT_LIST_SHEET In print mode, default = UPAT_EVAL_SHEETxx In show mode, default = UPAT_SINGLE -o=<file_name> Name of output file (in SYS$SCRATCH by default) In list & print modes, stored in SYS$SCRATCH In show mode, written to SYS$OUTPUT -c=<number> Number of Print copies if in print mode. default = 1 -v=<level> Verbosity from 0 (silent) to 2 (verbose), default = 1 -h Print this help and exit Advanced Command-Line Arguments: -et=<eval_type> Type code of evaluation, default = 2 -eb=<date> Begin of evaluation period, default = 1st measurement date -ee=<date> End of evaluation period, default = current date -tb=<date> Begin of matching period, default = 1st measurement date -te=<date> End of matching period, default = current date Dates must be given in VMS format, e.g. 01-JAN-2000 -sk=<#_to_skip> Number of measurements to skip, default = 0 -m=<meas_list> Numbered List of measurements to take, e.g. 0,1,2,5,8 -nomatch Do not match follow up measurement, just take all slices -sb Begin of Slice Range in % to be evaluated -se End of Slice Range in % to be evaluated -q Only take evaluations with quality better than (and including) this. If positive number: all scans of better quality (incl. this) as well as all non-graded scans are taken. If negative number: non-graded scans are NOT taken. -qs Only take Structural evaluations with quality better than (and including) this. Thus: between -qd and -q: only Density results are printed. Parameter is disregarded if -qs >= -q. -ut=<unit_type> 0->default unit, 1->linatt, 2->mg HA/ccm, 3->HU, default = 0 -cd=<density> Value of compact density to use, default = 1200.000000 If no command line arguments are specified, upat_print_list runs interactively. Note that using "TB" and "TE", you can pull out exact measurements in the specified date range, while using "MB" and "ME", all you get is the latest measurement no matter what date range provided. For results of all time points for a single site and sample # without matching to Baseline, use: I.e. the common region will be 100% for all measurements. $ upat_list -nomatch From these options, you can write out your own command (vs. using prompts) to give you the specifics you are looking for. By specifying the CAMOS template of “UPAT_EVAL_CAMOS.PS”, you will get the “Camos” report style. For example: $ upat_list -nomatch -b=1000 -e=1000 -s=TL -tb=01-MAY-2000 -te=01-AUG-2018 -t=DISK1:[MICROCT.COMMANDS]UPAT_EVAL_CAMOS.PS -c=0 -o=sys$scratch:upat_pat_1000_tl_camos.ps Note that there are actually many kinds of report templates. These can be found via: $ dir UU:*.PS “SCUSA” is a short form for Scanco USA templates. I.e. templates that fit on an 8.5” X 11” page. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Sometimes _UPAT_XT2_POST.PDF verses _UPAT_XT2.PDF=== The _UPAT_XT2.PDFs are generated by the standard XTII evaluation scripts (not cluster version) that process the UPAT part on the same node as the IPL part. All the scripts that use UE:UCT_EVALUATION_V6_UPAT_FILL_E5E6.COM produce the above PDFs. The _UPAT_XT2_POST.PDFs are generate by the cluster version of the XTII evaluation scripts that process the UPAT part on the same node for every evaluation and the IPL part on different nodes. All the scripts that use: UE:STARTER_UPAT_POSTPROCESS.COM produce the _UPAT_XT2_POST.PDFs. You can change the name of the PDF in the <code>UE:STARTER_UPAT_POSTPROCESS.COM</code> if you want (and have permission!). [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Create XtremeCT II patient report manually=== These are instructions on how to create a PDF report for XtremeCT II. However, before you dive into this, please try using script 118 (Standard Radius/Tibia Patient Post Processing) as it does exactly the steps below, but is automated and much easier. If that still doesn't work, then follow these instructions. The basic concept is that a template PS file has the trabecular results (Eval_Type 5) and the cortical results (Eval_Type 6) combined into a single PS file. That PS file is then converted to PDF. These instructions are based on the script <code>UE:UCT_EVALUATION_V6_UPAT_PRINT_E5E6.COM</code> We use patient number 2870 and measurement number 15313 as an example. The picture number is D0013335 and this is a RL scan. The participant is CABHS_0001_RL_M00. We assume a TIF image of the bone was already created. Check to see if it exists: $ dir IDISK1:[XTREMECT2.DATA.UPAT_VIEWS]PAT00002870_MEAS00015315_3D_1.TIF If it doesn't exist, you'll have to create it using the scripts defined in UE:UCT_EVALUATION_V6_CREATE_TIF.COM. See section below titled Create 3D image for XtremeCT II patient report manually. We define this image as a logical: $ DEFINE TIF_FILELOGICAL IDISK1:[XTREMECT2.DATA.UPAT_VIEWS]PAT00002870_MEAS00015315_3D_1.TIF We define any of the possible template report sheets we might use. Rarely we'd use anything but the "baseline" version, but sometimes it might be helpful to have reports with follow-up. $ DEFINE UPAT_EVAL_E5_SHEET_BASELINE UU:UPAT_EVAL_E5E6_BASELINE_DYNAMIC_LETTER.PS $ DEFINE UPAT_EVAL_E5_SHEET05 UU:UPAT_EVAL_E5E6_FUP05_DYNAMIC_LETTER.PS $ DEFINE UPAT_EVAL_E5_SHEET10 UU:UPAT_EVAL_E5E6_FUP10_DYNAMIC_LETTER.PS $ DEFINE UPAT_EVAL_E5_SHEET15 UU:UPAT_EVAL_E5E6_FUP15_DYNAMIC_LETTER.PS $ DEFINE UPAT_EVAL_E5_SHEET20 UU:UPAT_EVAL_E5E6_FUP20_DYNAMIC_LETTER.PS Since we fill out the template first with E5 (trabecular) results, we want to ensure we can subsequently fill out the report with E6 (cortical) results. So, we need to avoid the place holders in the report from being overwritting by setting this logical: $ DEF/USER PRS_KEEP_KEYWORDS TRUE Now we run UPAT_LIST once for E5 and create a temporary output, then again for E6 for the final output: <pre> $ UPAT_LIST Program: upat_print_list V2.0 Started: 1-JUN-2022 16:35:08.24 Mode (1 = list, 2 = print, 3 = show) [1]: 2 Mode: Print mode Patient # (1-2900) [1]: 2870 Site (found RL TR) [TR]: RL Evaluation type (1-6) [4]: 5 Group Code [0]: Maximum # of follow-ups (0-19) [19]: Template file [default]: Output filename [SYS$SCRATCH:UPAT_PAT_E5_2870_RL.PS]: SYS$SCRATCH:TEMP_D0013333_UPAT_XT2.PS # copies [1]: 0 $ UPAT_LIST Program: upat_print_list V2.0 Started: 1-JUN-2022 16:36:12.49 Mode (1 = list, 2 = print, 3 = show) [1]: 2 Mode: Print mode Patient # (1-2900) [1]: 2870 Site (found RL TR) [TR]: RL Evaluation type (1-6) [4]: 6 Group Code [0]: Maximum # of follow-ups (0-19) [19]: Template file [default]: SYS$SCRATCH:TEMP_D0013333_UPAT_XT2.PS Output filename [SYS$SCRATCH:UPAT_PAT_E6_2870_RL.PS]: SYS$SCRATCH:D0013333_UPAT_XT2.PS # copies [1]: 0 </pre> We convert the PS to a PDF and clean up temporary files. $ @SCOM:PS_TO_PDF.COM DELETE SYS$SCRATCH:D0013333_UPAT_XT2.PS $ DELETE SYS$SCRATCH:TEMP_D0013333_UPAT_XT2.PS;* Lastly, we rename the file appropriately $ rename D0013333_UPAT_XT2.PDF CABHS_0001_RL_M00_UPAT_XT2.PDF [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] === Create 3D image for XtremeCT II patient report manually === Here we create the 3D image used in XtremeCT II patient reports manually. You'll need to set an appropriate preset for the visualization first (i.e. based on skeletal site): <pre> $ SETUP_FILE = "UU:3D_PRESET_UPAT_RL_1.DAT" $ SETUP_FILE = "UU:3D_PRESET_UPAT_RR_1.DAT" $ SETUP_FILE = "UU:3D_PRESET_UPAT_TL_1.DAT" $ SETUP_FILE = "UU:3D_PRESET_UPAT_TR_1.DAT" </pre> Then we define which segmented aim file to use: <pre> $ EVAL_SEGAIM = "DISK2:[XTREMECT2.DATA.00002891.00015311]D0013333_SEG.AIM" </pre> Now define the name of the output file using the standardized format that has patient and measurement number: <pre> $ PRINT_FILE = "IDISK1:[XTREMECT2.DATA.UPAT_VIEWS]PAT00002870_MEAS00015315_3D_1.TIF" </pre> Then run UCT_3D_BATCH (as opposed to UCT_3D which does not take the setup file in the command line): <pre> $ UCT_3D_BATCH 'SETUP_FILE' 'EVAL_SEGAIM' 'PRINT_FILE' </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Extract followup data without slice matching=== Use: <pre> $ upat_list -advanced </pre> *Choose 'disable slice matching:' -> y. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Extract patient results on a slice-by-slice basis=== There is an executable that was specially installed by Andres. Run it as user <code>microct</code>: <pre> $ RUN ut:UPAT_EXPORT_MEASUREMENT.EXE </pre> Choose from "Style: 0 = default, 1 = raw". Default gives standard patient parameters. This gives you the .txt file in scratch containing the morphological parameters determined for each slice. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===UCT_LIST Extract results=== 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> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Tabulate LOG 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. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Compile 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) [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ==Database== ===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: <pre> $ show logical UPAT_EVAL_DATABASE $ run disk1:[calibration.util]upat_export_measurement.exe ! as microct </pre> <pre> $ 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 </pre> In the slice database every evaluation is recorded, but only one is currently active at a time. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Looking at a database file=== <code>WARNING</code>: Advanced users only! Databases are stored in a VMS specific binary format, so it's not possible to dump these files to text. Nevertheless, some part of the files you can probably read if you open these in a text editor. If you for example type: $ ed/int=decw UCTD:UCT_EVALSCRIPTS_CALGARY_XT2.DAT you can actually see all the script names and parameters in the file. It is not easy readable but you can recognize it if you know the general parameters of a script. Please make sure that you do not edit the script with the editor because this will make the file unusable. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Manipulate scan sequence=== Upat_list reports the baseline scan and then the percentage change of follow-up scans from the baseline scan. The order of scans in upat_list is determined from the measurement number (not the measurement date). In the case you need to manipulate the baseline and follow-up sequence, you will need to: [[Image:Bones2.jpg|20px]] <b>Warning:</b> Use this with caution, and as little as possible!! even if the operation is reversible. Database manipulation is sensitive after all. 1. Log in as the "calibration" user (beware which calibration account to use for the different scanners). How to proceed in the terminal: $ SPB $ @DISK1:[MICROCT]LOGIN.COM or $ @DISK1:[XTREMECT2]LOGIN.COM !! don't miss that line, otherwise you would modify the CALIBRATION databases 2. Use the following command to modify the measurement number: $ RUN DISK1:[CALIBRATION.UTIL]UCT_CORRECT_SAMPLE_FIRST.EXE !! To redefine the very first measurement in the sequence :* I do mean "First" measurement in the sequence, and not "baseline" measurement. You may have 2 baseline scans, one for radius and one for the tibia, but only one of them is the very "first in the sequence". $ RUN DISK1:[CALIBRATION.UTIL]UCT_CORRECT_MEAS_PREV_NEXT.EXE !! To redefine the follow-up sequence beyond the first measure :* The PREV_NEXT utility is a bit tricky to use, as for each measurement you will have to define its "chronological" previous and its next. It is not related to any anatomical site: one might think for example of defining the Radius follow-up sequence for example. It is not the case. The PREV_NEXT sequence will alternate between different anatomical sites, that is how it should be. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Add placeholders for missing follow-up scans=== If there is NO scan at a certain time point in a series (i.e. patient did not show up), the program ut:upat_create_meas_placehoder.exe and upat_create_eval_placeholder can insert fake records, so the slice matching and timepoints/visits are still all in order. The attached file describes how to create an manage placeholders in the case of missing follow-up visits in longitudinal studies. [[Media:SOP_Create_Placeholders_draft.pdf|'''SOP Create Placeholders''']] [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Disable a database measurement=== It is not possible to delete an evaluation from the database, but it can be disabled. NOTE: QC results are stored in the UCT database, and there is no tool to disable a UCT database result. Log in as the normal user (e.g. XTREMECT2). Then in a terminal you may use this simple utility program: $ RUN UT:UPAT_CORRECT_VALID_FLAG See below a typical prompt to deactivate an entry: <pre> UPAT_CORRECT_VALID_FLAG V2.0 Measurement No. (0 to stop): 1 Evaluation type [2]: 5 ! E5 for trabecular bone; enter 6 for E6 for cortical bone (run the command twice) Group code [0]: 0 Found evaluation 57 for patient 4: ID003 Value for valid flag (0=invalid, 1=valid) [1]: 0 Value for placeholder flag (0=write results, 1=placeholder) [0]: 0 Measurement No. (0 to stop): 0 </pre> You can always re-activate the entry, by switching the valid flag from 0 to 1. Or, to make a scan invalid, you can also login as calibration user. Point to microct user $ @DISK1:[MICROCT]LOGIN.COM Set priviledges to bypass. $ SPB Run Correction File $ run DISK1:[CALIBRATION.UTIL]UPAT_CORRECT_VALID_FLAG.EXE [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Disable a uct_list database measurement=== You cannot really disable data in the UCT_LIST output. What you can do using IPL is to clear the complete result entry for a given measurement, for example: $ ipl /read -name in -filename default_file_name /db_scanco_activate -write true /db_clear_eval -input in Then UCT_LIST might still report the "disabled" measurement, leaving only the few first meta-data columns non empty. The rest would be cleared. I must bring your attention to the fact that this sequence is used a lot on XtremeCT I scripts, for the cortical porosity for example. This means that on XT-I, the UCT_LIST content is highly unstable, as it was used back then while UPAT_LIST was not able to handle those results. In the future, when new applications come they may delete/overwrite the UCT_LIST entry for a measurement. That is the rationale for using the TXT output in the RESULTS directory, that at least keeps track of past analyses. As long as you have a single application on XT-II going through UCT_LIST, calling results on demand with it is fine. Later it might come complicated. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Troubleshoot UPAT database=== If there is an error ('inconsistent key change or duplicate key!') in the log file during 'upat_filldb', this is likely caused by too many servers doing UPAT evaluations: Basically, the UPAT database can not be accessed by 2 evaluation jobs "at the same time", and works on a "1st arrived 1st served" basis. It is actually one reason to have only 1 evaluation at a time running on a single workstation (the usual setup). In your case (and in mine as well), when you have several workstations clustered together, you can technically run several evaluation jobs at the same time which will eventually access the very same database. So what happens is that a 1st job executes the /upat_fill_db, and accesses the database for a short amount of time. During this time, any unfortunate evaluation job trying to access the database will end up in the exact same error as you reported, as their access to the database is restricted. Even though the time window is short, this kind of thing is unavoidable in setup such as ours, and when lots of evaluation are started at the same time. Here you have no other choice than restarting the evaluation job, in order to update the database (or ultimately you could write a small script just to run the /upat_fill_db command, but I do not think it makes sense). [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Redirect to a temporary database=== We need to temporarily redefine the logicals UPAT_EVAL_DATABASE and UPAT_SLICE_DATABASE. Normally, the definition is <pre> UPAT_EVAL_DATABASE = UCTD:UPAT_EVAL_CALGARY.DAT UPAT_SLICE_DATABASE = UCTD:UPAT_SLICE_CALGARY.DAT </pre> 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 <pre> $ def UPAT_EVAL_DATABASE SYS$SCRATCH:TEMP_UPAT_EVAL_CALGARY.DAT $ def UPAT_SLICE_DATABASE SYS$SCRATCH:TEMP_UPAT_SLICE_CALGARY.DAT </pre> 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 <code>microct</code> 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: <pre> $ 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 </pre> Or extract the results from the temporary database with: <pre> $ def UPAT_EVAL_DATABASE SYS$SCRATCH:TEMP_UPAT_EVAL_CALGARY.DAT $ def UPAT_SLICE_DATABASE SYS$SCRATCH:TEMP_UPAT_SLICE_CALGARY.DAT $ def UCT_MEASUREMENT_DATABASE SYS$SCRATCH:UCT_MEASUREMENTS_TORONTOXT.DAT ! only necessary if data came from another system $ def UCT_SAMPLE_DATABASE SYS$SCRATCH:UCT_SAMPLES_TORONTOXT.DAT ! only necessary if data came from another system $ upat_list ! choose option [3]show, give the patient number and output file, e.g. sys$scratch:myvalues.txt </pre> For an example IPL script that redirects to a temporary database, see Percy: <pre> DISK1:[MICROCT.COMMANDS]IPL_UPAT_EVAL_AIMINPUT.COM </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Import from a foreign database=== IF MEASUREMENTS COME FROM A TOTALLY DIFFERENT DATABASE (such as Toronto's XCT): You will need to redefine the logicals UCT_MEASUREMENT_DATABASE and UCT_SAMPLE_DATABASE <pre> def UCT_MEASUREMENT_DATABASE SYS$SCRATCH:UCT_MEASUREMENTS_TORONTOXT.DAT def UCT_SAMPLE_DATABASE SYS$SCRATCH:UCT_SAMPLES_TORONTOXT.DAT </pre> However, it is quite possible that you won't have a copy of the foreign MEASUREMENT and SAMPLE databases. If this is the case, then you <b>must</b> import the ISQ files into our own database. Then, by setting <pre> $ define UCT_EVALUATION_DATABASE SYS$SCRATCH:TEMP_EVALUATIONS_CALGARY.DAT </pre> you could redirect the results to a temporary database (but normally, if you already imported the data, why not use our own database now). [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Import ISQ=== When you import, please note that the sample number AND measurement number are updated, so meas 10907 is now 10908. Suppose you have a sample 3000, meas 10000, C0001234.isq, and want to import this into sample 3001, this is what I would do: To make a copy of the scan (i.e., keep it in sample 3000 and make another copy in 3001) <pre> $ cd *3000*10000 $ copy C0001234.isq D0001234.isq, also copy any other files you want imported (RSQ, GOBJs, etc) $ import UCT_IMPORT V1.2 --------------- ISQ-file []: D0001234.ISQ Sample number [0]: 3001 Change File Header name [Y]: Y Optional: Operator Measurement [0]: 1 (1 = bonelab) Site 20 Radius L Optional: Controlfile Nr. [0]: (change if desired) Execute Rename Command [Y]: Y </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Duplicate as new import to database=== You will need to copy ISQ and GOBJ files to a new designated location. This is done when a screening study is completed to look for potential subjects and then a main longitudinal study is completed under a different study name.<br> 1. Make a new patient/subject ID <br> 2. Make a copy of the ISQ. For example: <br> <pre> $ copy DISK2:[microct.DATA.00002584.00008992]*.isq - DISK2:[microct.DATA.00002696.00009345]*.isq </pre> 3. Import ISQ into new patient/subject ID number by typing: <pre> $ import </pre> 4. Follow the prompts for the ISQ file names, changing of control file # etc. <br> 5. Check the data directory to see if ISQ and GOBJ files have been copied properly <br> 2. In uct_evaluation, open new .ISQ and copied .GOBJ and re-run the evaluation to create .AIM, _SEG.AIM, _CORTEX.AIM, _LHTH_DTH.AIM <br> <br> 3. Copy Scout Views so scanning program will load baseline scout view for followup scans <br> In DISK1:[MICROCT.DATA.SCOUTS], you'll see two series of scout views: one series with the PATIENT # followed by 020 or 021 or 038 or 039, the site code (radius or tibia, left or right respectively)<br> Copy the old patient scouts to the new patient #s For example (using the same old and new #s as above): <br> <pre> $ copy DISK1:[MICROCT.DATA.SCOUTS]00002584021.SCV - DISK1:[MICROCT.DATA.SCOUTS]00002696021.SCV </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Recover a disappeared due to import=== If you need duplicate a measurement in both the original and new directories, but you forgot copying the measurement before importing as a new. The original measurement will be automatically removed from the original directory. This can be fixed! You will need to copy the measurement back and then fix the header information, as the header will no longer match the original directory. 1. Manually copy all of the associated files for the measurement from the new directory to the original directory: <pre> $ copy DISK2:[xtremect2.data.00001234.00001234]*.*;* DISK2:[xtremect2.data.00004321.00004321] /log </pre> 2. Change the header information of the measurement files to those of the original directory. To do this, you will need special software. The use of this software is RESTRICTED. Users must seek special permission to use the software from Steve, Ying, or Anne BEFORE using. Once you have permission, the software can be found here: DISK1:[MICROCT.COMMANDS.FORBIDDEN]. 3. Run the software:<pre> $ run [software] </pre> 4. The software will ask for: a) the ISQ file b) the new sample # you would like to give it (i.e. the original directory sample #) c) the new measurement # you would like to give it (i.e. the original directory measurement #) c) the new sample name you would like to give it (i.e. the original Study ID) You can view the header information for a file by using the command: <pre> $ ctheader [ISQ file] </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Move to fix wrong Study_ID/Sample_No=== If a person was scanned under the incorrect sample number, perform the following steps. For the example, let’s assume that patient Jane Smith should have been scanned with patient record #106. Unfortunately she has actually been scanned under patient record #104, which has been defined for John Doe. #<b>Prepare patient record</b>. It is assumed patient record #106 for Jane Smith already exists. If this is not the case, one needs to create it. Create it like you normally would on the system prior to any scan. #<b>Perform the import</b> process by typing <code>$ import</code>. Provide the full pathname of the scan (e.g., <code>DK0:[MICROCT.DATA.00000104.00000218]C0001824.RSQ</code>). All information in header of the RSQ and ISQ (if it exists) file will automatically be updated, and reset accordingly to the new patient record destination. Hence the information will now indicate patient "106 – Jane Smith" information and not “104 – John Doe” anymore. The measurement number <b>will be changed</b>, although the scan “C-number” will not. The original measurement number was 218 when it has been scanned. But during the import process the scan will be attributed a new measurement number, i.e. the very first one available in the database (here 221). The program will move not only the RSQ and ISQ file, but all files related to it as well (GOBJ, AIM, PDF, TXT…) which respect the C-number filename format. Other files will not be moved. #<b>Invalidate the wrong evaluation</b>. If the scan from Jane Smith has been evaluated before importing it to the proper patient directory, it is necessary to invalidate the evaluation for measurement #218 as it will mess with previous scans from John Doe. Run <code>$ RUN UT:UPAT_CORRECT_VALID_FLAG.EXE</code>. You will need to run the program twice. Once to invalidate the trabecular results (Evaluation Type 5) and once to invalidate the cortical results (Evaluation Type 6). Make sure to invalidate the results for the appropriate Group Codes. #<b>Evaluate the newly corrected data</b>. The reimported measurement of Jane Smith (measurement #221) will need to be (re-)evaluated. If the contour had already been drawn under John Doe, there is no need to redraw it. Starting the evaluation task will be sufficient. #<b>Clean up</b>. Now the scan files have been moved, the initial directory still stands there. Using the backup program it is possible to completely erase the initial folder 104/218. Just proceed as if you were to Move the scan to the Trash bin. #<b>Check the header</b>. In the newly corrected ISQ or RSQ files run <code>$ ctheader C1234567.ISQ</code> and ensure the Patient Name, Sample Number, Measurement Number and Site are all as expected. Remember that site code 20 is for Radius Left, 21 for Radius Right, 38 Tibia Left, 39 Tibia Right. If the site code is incorrect you will need to fix it using another set of instructions. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Move to fix wrong account used for scanning=== Xtremect2 (on disk2) and xt2recalib (on disk6) accounts share the same databases. However, the definition of DK0 is account specific, ie. the scans are stored on different disks. So when scanning under Xtremect2 account instead of Xt2recalib account, to correct the wrong measurement location you will need to: #Create the patient directory on disk6:[xtremect2.data], if needed; #Create the same measurement directory on disk6:[xtremect2.data]; #Create a save set of the measurement folder on disk2:[xtremect2.data] with the isq, rsq, rad and scv files included; #Unzip the save set in the measurement directory on disk6:[xtremect2.data]; #Delete the measurement directory on disk2:[xtremect2.data] using delete command in the terminal. Caution: Do NOT use the backup program. [[Image:Bones2.jpg|20px]] <b>Warning:</b> This procedure is specific to this situation between Xtremect2 and Xt2recalib accounts, Microct and Xt1recalib accounts, and vice versa, but not applicable between any other accounts! [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Update database after RSQ/ISQ restoration=== 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. The database is specific to the user. So, we have to modify the database for <code>microct</code>, and be careful not to modify the <code>calibration</code> (or other users) database. However, we still need to have permissions from <code>calibration</code> in order to do the modification. When we restore 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 <code>calibration</code>. <pre> $ set host 0 login as calibXXXX where XXXX is the scanner id (5019 for VivaCT or 2339 for uCT35) or calib3309 or calib3401 (for the XtremeCT and XtremeCTII system, respectively). password from Steve $ @ADISK1:[BONELAB]microct_setup_XXXX.com ! XXXX=scanner id, sets the logicals to point to bonelab data for SB group or $ @ADISK1:[VIVACT]LOGIN.COM ! sets the logicals to point to microct data for BH group or $ @DISK1:[MICROCT]LOGIN.COM ! sets the logicals to point to microct data on the XtremeCT system or $ @IDISK1:[XTREMECT2]MICROCT_SETUP.COM ! sets the logicals to point to xtremect2 data on the XtremeCT2 system $ set proc/priv=bypass or $ spb $ run DISK1:[CALIBRATION.UTIL]UCT_CORRECT_DIR ! make sure to include the full path to the executable as shown here. $ run DISK1:[CALIBRATION.UTIL]UCT_CORRECT_MEAS_DIR.EXE ! on xtremect2 system, use this program </pre> <b>Note:</b> 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. <pre> $ run ut:UCT_CORRECT_DIR.EXE </pre> <pre> Measurement Nr.: 1234 MeasNr. 1234 PatientNr: 268 RAW: RAW004 TP0:00001234_RAW IMA: IMA002 TP0:00001234_IMA </pre> <pre> 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 </pre> 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. <b>Note</b> One other option is to change the permissions of UCT_CORRECT_DIR.EXE so that user <code>microct</code> can use it directly. To do this, log in as users <code>calibration</code> and then: <pre> $ 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 </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ==Other FAQ== ===View Sample info=== <pre> $ mcr um:uct_info 1234 </pre> will show you sample-name and date-of-birth 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. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===List measurements for data and backup location=== *To generate a list of measurements that are registered in the database, to determine where backups are stored, or if the data is still on disk: ::<code>$ write_info</code> *Ask you for a range of measurement numbers or sample names. *Create a <code> sys$scratch:info.txt</code> file. <pre> $ write_info UCT_WRITE_INFO.EXE V1.2 ----------------------- Sample Index from [0]: Sample Index to [0]: 1000000 Sample Name from [ ]: DRF Sample Name to [ ]: DRF Extended Info ? [T]: F 1383 DRF_001 1383 DRF_001 1385 DRF_002 1385 DRF_002 1383 DRF_001 1383 DRF_001 1383 DRF_001 </pre> [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Anonymize patient name and DOB=== Here is the link to [[Media:SOP_Anonymize_patient_name_dob.pdf | Scanco's SOP]] to change a long list of patient's name and/or DOB to de-identify the data. As of 2025 it seems that the executable proposed to be used in the SOP is no longer available. Instead, the DOB and Patient Name can be updated manually by running <code>uct_sample</code> to update patient information. This does not affect the headers of past RSQ, ISQ or AIM files. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Fix a wrong scan site code=== This is done if accidentally scanned using the wrong control file. For example scan site RR is scanned mistakenly under RL, or TL scanned by mistake using the control file for TR ect. To see our site codes, e.g. 20 = RL, 21 = RR etc using <pre>$ show log *eval*</pre> ;Scenario 1: If the correction commands (<code>uct_correct_meas_site</code> and <code>updh_site</code>) are already in your account (which is the case for the xtremect2 and xt2recalib accounts on the XtremeCT cluster) $ cd util $ dir *site* and you see two programs (<code>uct_correct_meas_site</code> and <code>updh_site</code>). Set priviledge to bypass first $ run ut:uct_correct_meas_site and enter the meas. number to be corrected and then enter in the correct site code (20 = RL, 21 = RR, 38 = TL, 39 = TR). *This modifies the database, so the correct site is displayed in the eval program. *Enter meas. number 0 to exit program. Then we must also correct the ISQ and RSQ files (has to be restored from tape if not on disk): $ run ut:updh_site !'updh' = update header</pre> *Enter the <b>full (i.e. pathname included)</b> ISQ or RSQ filename. For DISK6 data should use DISK6:[xtremect2.data....]. *Then enter the correct site number. ;Scenario 2: Normally the correction commands (uct_correct_meas_site and updh_site ect.) are only provided in a calibration account to prevent from misusage. We have to login as user calibration to make the change. $ set host 0 $ username: [enter calibration account, e.g. calib3401] Then we use the same steps in <b>Scenario 1</b> to change the site code in both database and ISQ and RSQ files. *Make sure to <code>logout</code> from user calibration afterwards. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Fix a wrong sample, measurement or patient name=== Sometimes the ISQ or RSQ might have incorrect information: Patient Name : DRF_053 Patient Index : 2751 Measurement Index : 13990 You can modify the measurement index, etc, in the ISQ/RSQ header. As a regular user, use the utility: $ run IDISK1:[CALIBRATION.UTIL]UPDH_SAMPLE_MEAS_NAME.EXE <b>NOTE:</b> Running this program will not affect the database, only the file. If you want to move a measurement to another sample number, use the <code>import</code> function. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ===Fix for results fail to print/list/show after evaluation=== There are a number of reasons the results may not print: ====Incorrect first measurement number==== When sample information (such as patient name, DOB, remark) is changed DURING scanning, this can over write the 1st Scan measurement number, resulting in the evaluation sheet not being printed, and data not shown when running 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): <pre> $ 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.: </pre> and continue with next non-working patient, give patient number 0 to exit. $ logout [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ====Evaluation completed with results not written to database==== If the first measurement number and DOB are correct... check the .log file of the evaluation... However, if there is no upat*.log file available for that scan, use: upat_list -v=2 and you will see (for eg sample 594): <pre> Found sample 594, CAMOS_0018 Found measurement 2536 made 19-MAR-2007 12:52:58.48 Measurement site RL found in list at index 0 Measurement 2536 within measurement period ERROR finding evaluation for measurement 2536 No valid evaluation found for measurement 2536 </pre> So it seems the 3D upat eval never wrote anything to the database for that scan. In this case, you can run: <pre> $ @ue:ipl_upat_eval_again_quick.com </pre> and let it run for the missing data. '''NOTE''' it will only need the aim files and gobj files that you still have in your 'models' directory. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ====Incorrect sequence of measurement numbers==== Finally, if none of these options work... check the order of measurement numbers: especially if an import has occured, first check the first measurement number is correct (as above). Then run sys$Scratch:uct_correct_prev_next.exe and correct the order of the measurements: The database keeps a 'daisy' chain of meas. numbers, each meas. knows which one was the previous meas and the next meas. 0 means: no prev. meas (or no next meas) So corrected the order for you like this: <pre> $ r UCT_CORRECT_prev_next Measurement No. (0 to stop) [0]: 2821 MeasNo.: 2821 PatientNo: 723 Previous [0]: <-- leave 0 Next [0]: 2828 <-- give next meas number Measurement No. (0 to stop) [2828]: MeasNo.: 2828 PatientNo: 723 Previous [0]: 2821 <-- give prev. meas number Next [0]: <-- leave 0 for very last meas. </pre> Please note: the series of meas. numbers per patient is NOT separate per meas. site, thus radius and tibia meas. are linking to each other. '''Do not mess up!''' [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']] ====Strategies for finding correct measurement numbers==== If <code>upat_list</code> does not output anything I normally check if the database entry for the corresponding measurement is ok. In this case $ uct_list 13918 This showed a wrong sample name and number. Then you could do <code>uct_list</code> (and enter all default) of the complete database and search for the patient string CSI_0051. Then you would figure out the possible measurement numbers: 13986,13987,13988,13989. In this example, the only one missing was 13986. This case example was difficult because the ISQ file was not in the standard directory. I figured out that the corresponding AIM file was not generated by the current evaluation. So I check the procedure log of the aim file with <code>aix -l</code>. There you can see the original ISQ file Original file dk0:[xtremect2.data.00002750.00013986]d0012143.isq; [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']]
Summary:
Please note that all contributions to bone.wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BoneWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Documents
Recent changes
Help
Tools
What links here
Related changes
Page information