FBIRN Human SRB Upload Scripts:

 

Table of Contents:

1)      Quick Start – No Database Support, No SRB Support

2)      Installation

3)      Prerequisites

4)      Usage

5)      Non-human Usage

5)      Optional arguments

6)      Upload Types

7)      Kick Starting a Previous “Local” Upload for “SRB” or “Local-SRB” Mode Uploads:

8)      Troubleshooting

 

Quick Start – No DB, No SRB:

1: Optional**: Install (if not installed already) the Oracle client libraries. These can be downloaded here

                       

2: Optional**: Install the python cx_Oracle module, available here

                       

3: Install the python PyXML module, available here

                       

4: Un-tar distribution into a temporary location

                       

            5: Run the Install.sh script. 

a: This asks you about the number of scanners you'll be using, where you want to install the scripts, your native EPI and anatomical scan formats.

            (1): Choose to install without HID database support

                        b: All scripts and configuration files will be copied to the installation directory. 

 

            6: Edit your ~/.cshrc (or bashrc) file to include your installed directory in your path statements

 

            7: Edit template configuration XML file (See README_XMLTemplate)

           

            8: Prepare local directories for uploading (See README_DirectoryOrganization) .

 

            9: Run the Upload.sh script – See Usage section below

           

            ** - Without Oracle and cx_Oracle, the script will not run as quickly, and the Oracle connection must be spelled out with the full hostname/port instead of relying on a tnsnames entry. If you don't use cx_Oracle, you will need Sun Java installed.

       

Installation:

           

1: (Optional, see above): Install (if not installed already) the Oracle client libraries. These can be downloaded here

                       

2: (Optional, see above): Install the python cx_Oracle module, available here

                       

3: Install the python PyXML module, available here

                       

            4: Un-tar distribution into a temporary location

                       

            5: Run the Install.sh script.  This asks you about the number       of scanners you'll be using, where you want to install the scripts, your native EPI and anatomical scan formats.

                        a: All scripts and configuration files will be copied to the installation directory. 

                        b: ***Note, if you don’t already have your scanning equipment information stored in your DB, make sure you follow the Prerequisite instructions below***

           

            6: Edit your ~/.cshrc file to include your installed directory in your path statements

 

7: Run ScannerInfo.sh to install a scanner for upload

 

Prerequisites:

1: Experiment and protocol information must be added to the database to support uploads if using the HID database (See README_AddExperiment2HID)

 

2: Subject visit, study, and imaging series information must be added to the database to support uploads either by using the HID GUI or by script if using database (See README_AddVisit2HID)

 

            3: Edit template configuration XML file (See README_XMLTemplate)

           

            4: Prepare local directories for uploading (See README_DirectoryOrganization) .

 

Usage:

                       

            1: Run the script:

 

            Upload.sh <ROOT_IMAGE_DIR> <XML_TEMPLATE_FILE> <TARGET_DIR> [<LOCAL_SRB_HOME_DIR>]

 

                        a: Where <ROOT_IMAGE_DIR> is assumed to contain a number of subdirectories each containing the native images for that series

                        and the EPrime *.EDAT and *.TXT files (See README_DirectoryOrganization) .

                       

                        b: Where <XML_TEMPLATE_FILE> contains the layout you have already defined for how to structure the upload.

 

                        c: Where <TARGET_DIR> is the local directory where the files will be copied reorganizing the directory structure for BIRN analysis software

 

d: Where [<LOCAL_SRB_HOME_DIR>] is an optional argument.  If the directory is different from the <TARGET_DIR> symbolic links will be created in the <LOCAL_SRB_HOME_DIR > to the data physically copied to the <TARGET_DIR>.  This can be used if your filesystem is running out of space.  FIPS analysis software looks in the <LOCAL_SRB_HOME_DIR > directory for data.

                                   

            2: The script will make a new sub-directory in your <TARGET_DIR> directory called <ProjectName>__<ProjectID> based on the

            SRB storage hierarchy designed by Morph and Functional BIRN IT groups.

 

Upload Modes:

            The scripts are designed to operate in 3 modes, Local, Local-SRB, Local-In-Place, and SRB.  These modes are configured in the <XML_TEMPLATE_FILE> (See README_XMLTemplate).X The Local mode does some image wrapping and conversion to NIfTI 1.0 and Analyze 7.5 image formats and reorganizes the directory structure storing the output data in the <TARGET_DIR>.X Local mode does not copy the data to the SRB nor link it into your local HID database.X Local-SRB mode operates in the same was as the Local upload but does the transfer of the data to the SRB and updates your local HID database.X Local-In-Place is like Local mode, except that the new data is put in the same tree as the data instead of being copied to a parallel tree.X The SRB is the same as Local-SRB mode except the local copy that was put into <TARGET_DIR> is deleted after the upload.

 

Kick Starting a Previous “Local” Upload for “SRB” or “Local-SRB” Mode Uploads:

 

1: Assuming your initial run in “Local” mode was:

Upload.sh </tmp/ROOT_IMAGE_DIR> <XML_TEMPLATE_FILE> </tmp2/MY_TARGET_DIR> </tmp2/MY_TARGET_DIR>

 

a: After running the above command you will find a number of directories under /tmp2/MY_TARGET_DIR/.

            1) If you were doing a Phase II upload, you’d find /tmp2/MY_TARGET_DIR/fBIRNPhaseII__0010/<BIRNID>/….

 

2: Now, to kick start the upload

            a: Edit your <FileSystem> tag in your <XML_CONFIG_FILE> used in the command in 1: above changing the tag from “Local” to either “Local-SRB” or “SRB”.

            b: Run the following upload command, notice that the <ROOT_IMAGE_DIR> has now changed to the target directory from your initial run on part 1: above and your output directories have changed to another path:

Upload.sh </tmp2/MY_TARGET_DIR/<ProjectName>__<ProjectID>> <XML_TEMPLATE_FILE> </tmp2/MY_TARGET_DIR> </tmp2/MY_TARGET_DIR>

 

 

Troubleshooting:

1: Run script and capture output to a log:

a: script error.log

b: Upload.sh <ROOT_IMAGE_DIR> <XML_TEMPLATE_FILE> <TARGET_DIR> [<LOCAL_SRB_HOME_DIR>]

c: exit

            (1): This closes the error.log script file

d: dos2unix error.log

            (1): This cleans up some of the nasty characters in the error.log file

 

            2: Then look in the error.log file for problems….or, you could try to bribe one of the contacts below to help… J

 

Non-human Usage:

Calling the nonhuman side of the upload script is simpler. Simply pass Upload.sh the --nonhuman flag followed by a protocol description file, the native image directory and, optionally, a k-Space directory. It will ask two questions: whether the phantoms are geometric or stability, and whether you wish to perform Q/A analysis on them.

The protocol description file is a simple xml file whose only contents are bounded by a single Protocol tag, and whose elements may include UploadPath and QAAnalysis tags. See Phantom2007 for an example.

 

 

 

Optional arguments:

Global arguments:

            -scanner <PATH>: Specify the scanner configuration file you wish to use.

            -uploadPath <PATH>: Specify the absolute path to use as the base directory for uploads.

Nonhuman-specific arguments:

            -phantomType <geometric | stability>: Specify whether or not to conduct QA analysis.

            -qaAnalysis <Y | N>: Specify whether or not to conduct QA analysis.

            -project <PATH>: Specify the project name, as it will appear in the SRB path of the uploaded data. Is overridden by -uploadPath.

            -phantomID <ID>: Specify the phantom ID -- should be SITEID_NUM (such as 0010_001)

 

 

 

Authors/Contacts List:

 

David Keator - UCI (dbkeator@uci.edu)

Syam Gadde - Duke (gadde@biac.duke.edu)

Steve Chen - UCI

Zhiyu He - UCI (zhe@uci.edu)

Dingying Wei - UCI (dywei@uci.edu)

Doug Greve - MGH (greve@nmr.mgh.harvard.edu)

Karen Pease - UIowa (karen-pease@uiowa.edu)