Overview
BAXSQL is a data management tool developed to support the management of functional magnetic resonance imaging (fMRI) data sets in the Medical Grid Project (MGP) testbed (
http://www.medgrid.org/). The package is built in-house and all written in C. It implements a client-server framework with the Ninf-G (
http://ninf.apgrid.org) middleware providing the necessary infrastructure. The client application runs in the user's local machine and can be used to interact with the server application running in MGP's remote data servers. It provides an interface for uploading data sets from the client machine to remote data servers, downloading data sets from remote data servers to the local machine, deleting existing data sets in remote data servers, visualizing remote data sets, and transforming remote data sets, among others. Users interact directly with the provided graphical user interface (GUI) built using the gtk+ library (
http://www.gtk.org/). Through this GUI, data transfer to and from the data server is made transparent and the remote data analyses are carried out as if the computations are performed locally.
The server application manages the storage of the actual fMRI data sets and employs a backend database server for storing fMRI metadata. It runs on the remote data servers. This component manages a local MySQL (
http://www.mysql.com) database used for the storage of fMRI metadata using the MySQL C API. Although MySQL is used here, extension to other database systems can be implemented. The server application is also responsible for the actual transfer of fMRI data sets from the data server to the requesting client machine and vice versa. It also supports several predefined functions that can be invoked to perform standard fMRI analysis on the stored data sets. Because it uses remote analysis servers to do the actual processing of the data, a significant reduction in processing time can be attained.
In the following sections, BAXSQL usage is detailed. If you have questions regarding BAXSQL, you can leave a comment at the end of the article. BAXSQL is a free software, PROVIDED AS IS WITHOUT WARRANTY whatsoever. Use at your own risk. It is advised to have a backup copy of your datasets aside from the one stored in the BAXSQL dataserver.
Starting BAXSQL
1. Before you run BAXSQL, be sure to generate a proxy certificate by running
grid-proxy-init. This will allow you to connect to remote resources without having to specify your password for each of them.
[user]$ grid-proxy-init
Your identity: /O=Grid/OU=MedGrid/OU=hpcc.jp/CN=Test Account
Enter GRID pass phrase for this identity: xxxxxxxxx
Creating proxy ... ... ... ... Done
Your proxy is valid until: Tue Mar 27 23:22:40 2007
2. [RECOMMENDED] Test if you can connect to the remote servers by running the following commands:
[user] globus-job-run dserver.medgrid.org /bin/hostname
dserver.medgrid.org
If the remote command succeeded, the hostname of the remote server should be returned. Otherwise, error messages will be displayed. Replace dserver.medgrid.org with the fully qualified domain name of the remote servers you want to connect.
3. If BAXSQL is in your PATH, run it by typing
baxsql in the command prompt. If not, indicate the full path.
[user]$ baxsql
or
[user]$ /opt/baxsql/bin/baxsql
4. If no errors occur, the main BAXSQL application window shown in Fig. 1 will be displayed. The window is composed of four parts: the
Menu Bar on the topmost part containing the different menus, the
Command Toolbar just below the menu bar containing the command buttons, the
List Panel shown on the left-hand side of the application window and the
Form Panel shown on the right-hand side of the application window.
 |
| Fig. 1 Main BAXSQL Application Window |
Setting up remote connections
To setup remote connections, click the
Database menu, then choose
Settings... The
Remote Database Settings dialog box will appear as shown in Fig. 2. The list of configured databases is shown in the lower box. In this box, the first column is the data server's hostname and the second column is your remote DB's password.
To add a new connection, enter the fully qualified hostname of the data server in the
Hostname entry box and your remote DB's password in this remote data server in the
Password entry box.
Click the
Test button to test if you can connect to the data server. Click the
Add button to add this data server to the configured data servers.
To delete a configured connection, select the desired entry and click the
Delete button. This will remove the entry from the list.
Click the
Save button to save any changes in the connection setting. Click the
Cancel button to ignore the changes you've made.
NOTE: Restart BAXSQL for the changes in the connection setting to take effect.
 |
| Fig. 2 Remote database setting dialog box |
Working with BAXSQL
After starting BAXSQL, all the command buttons, except for the
Connect 
and
Exit 
buttons, are disabled. You need to connect to a remote data server first before the other buttons are enabled.
Connecting to Remote Data Server
To connect to the configured data servers, click the
Connect button

. BAXSQL will try to connect to all configured data servers. Once connected, the
List Panel will show all the data stored in all remote databases where the connection succeeded. An example window is shown in Fig. 3.
 |
| Fig. 3 Populated list panel |
Clicking the small triangle on the left of each title or double clicking the title itself will expand the chosen entry showing either the sub-studies or the datasets associated to the selected study.
NOTE: Once connected, the
Connect button

is disabled, while the rest of the command buttons are activated as shown in the figure above.
Disconnecting from the Remote Data Server
To disconnect from the data server, simply click the
Disconnect 
button in the
Command Toolbar.
After disconnection, the command buttons are again disabled, while the
Connect button is re-activated.
Adding New Entries
To add new entries to the database, either a new study entry or a new dataset entry, click the
New 
button in the
Command Toolbar.
A dialog box will appear asking what entry to create. See Fig. 4.
 |
| Fig. 4 New Entry Dialog Box |
To add a new study in the database, click the
New Study button. An empty
Study Form will be displayed in the
Form Panel. Follow the steps describe in
Adding New Study subsection below to complete the process.
To add a new dataset in the database, click the
New Dataset button. And empty
Dataset Form will be displayed in the
Form Panel. Follow the steps described in
Adding New Dataset subsection below to complete the process.
To cancel the operation, click the
Cancel button.
Adding New Study
 |
| Fig. 5 New study form |
To add a new study, enter the needed information in the
Study Form, which is displayed in the
Form Panel of the application window. See Fig. 5. The description of each field in the form follows:
Data Server – this is the server where the data will be stored.
Choose a data server from the drop down menu. The information entered into this form will be stored in the chosen data server.
Parent Study ID – the ID of the parent study
Choose 0 from the drop down menu if the new study is a main study or if it has no parent study. Choose the appropriate ID of an existing main study if the new study is a sub-study of an existing study.
Study ID – this is the id of this particular study.
This field is non-editable and will be automatically assigned by the application.
Title – enter a title for this study, or a brief description
This is the title that will be displayed in the
List Panel.
Description – give the full description of this study in this field
All the necessary information related to this study must be entered in this field.
Imaging Details – describe the imaging details here, for example the TR, TE, magnetic strength, and other imaging parameters common to the study
Task Pattern – describe how the task was designed, for instance, if using block paradigm, you can specify the pattern such as RTRTRT to indicate rest block, followed by task block, etc
Task Details – more detailed description of the task can be entered here to complement the information given in the
Task Pattern field
Vector of Onsets – give the timing, in units of time or scan and separated by space, for the task onsets
Vector of Widths – specify the width, in units of time or scan, of each task block. Use 0 for event related design.
Keywords – provide appropriate keywords for this study; will be used for the search function
Related Files – specify the filenames of files containing related information to this study, for example, the detailed description of the paradigm, stimulus description, etc. in pdf format. Use the
Add button to select a file or files from the local machine and the
Clear button to remove selected files. All files specified here will be uploaded to the data server when the form is submitted.
Date Created – this is a non-editable field and is automatically filled up upon submission. This field gives the date the entry is made.
Click the
Submit button to forward the information to the remote data server for storage.
NOTE: After submitting the information, BAXSQL will try to update the information in the
List Panel. You can also update the list by clicking the
Refresh button. See also the
Refresh Listing subsection below.
Adding New Dataset
 |
| Fig. 6 New dataset form |
To add a new dataset, enter the needed information in the
Dataset Form, which is displayed in the
Form Panel of the application window. See Fig. 6. The description of each field in the form follows:
Data Server – this is the server where the data will be stored.
Choose a data server from the drop down menu. The information entered into this form will be stored in the chosen data server.
Study ID – choose the ID from the drop down menu of the study where this dataset will be associated. If a study is not available, create a new one following the steps described in
Adding New Study subsection. A study entry needs to be defined before a dataset can be added. Only study ids available in the chosen data server will appear.
Dataset ID – this is a non-editable field and will be automatically filled up when the data is submitted
Subject ID – use this field to associate this data set to a particular subject record which maybe located outside this database
Subject's Age – the age of the subject where the data set was acquired
Subject's Gender – the gender of the subject
Magnet Strength – the magnetic field strength of the MR scanner in tesla (T) used in acquiring this data set
Number of Volumes – the number of volumes in this data set
Image Format – the format of the data set, but currently only accepts Analyze-formatted images
Anatomy Files – the files containing the anatomical images associated with this data set
Click the
Add button to select files stored in the local machine or click the
Clear button to remove all selected files.
Image Files – the filenames of the functional images in this data set
Click the
Add button to select the files stored in the local machine or click the
Clear button to remove all selected files.
Date Created – this is a non-editable field and is automatically filled up after submitting the information
Click the
Submit button to forward the information to the remote data server for storage.
NOTES:
1) The selected functional images will be automatically uploaded to the data server. The upload may take some time if the connection is slow.
2) BAXSQL will try to update the list in the
List Panel to include the newly submitted entry after submitting. If the update fails, you may refresh the list by clicking the
Refresh button. See also the
Refresh Listing subsection below.
Viewing Record of Existing Entries
To view the details of an existing entry, select the desired entry from the list in the
List Panel, and then click the
Details 
button. The details will be shown in the
Form Panel. In this case, all fields are not editable. See Fig. 7.
 |
| Fig. 7 Dataset form showing the details of the entry |
Editing Existing Entries
To edit an existing entry, select the desired entry from the list in the
List Panel, and then click the
Edit 
button. The details will be displayed in the
Form Panel with editable fields. Change the relevant information and then click the
Update button at the bottom of the form to save the applied changes. See Fig. 7.
Refresh Listing
After adding a new study or dataset entry in the database, it maybe necessary to refresh the list in the
List Panel. To do so, click the
Refresh 
button and BAXSQL will retrieve the information from the data servers.
Downloading Datasets
To download a dataset, select the desired dataset from the list, and then click the
Download 
button.
The progress of the download will be displayed in a dialog box shown below.
 |
| Fig. 8 Download progress dialog box |
Click the
Cancel button to cancel the operation.
The dataset will be saved in a directory named after the data set ID. This directory can be found in the baxsql subdirectory under the user's home directory ($HOME/baxsql/hostname/DATASET ID/).
Deleting Entries
To delete an entry (a study or a dataset), select the entry from the list in the
List Panel, and then click the
Delete 
button.
NOTES:
1) If a dataset is selected, the operation will delete all the images, related files and database entry of the chosen dataset in the remote data server.
2) If a study is selected, the operation will delete the selected study AND all the datasets associated with the study.
3) If the study has also sub-studies, the operation will delete all the sub-studies associated with the main study, and all the datasets associated with all the sub-studies. So be careful with this operation!
Changing Remote DB Password
To change the remote DB password, click the
Database menu, then choose
Change DB password. The
Change Remote DB Password dialog box will appear as shown in Fig 9. Select from the drop down menu the data server whose DB password you want to change. Enter the current password in the
Current password entry box. Specify the new password in the
New password entry box. Type again the new password in the
Confirm new password entry box.
Click the
OK button to submit the changes or the
Cancel button to cancel the operation.
 |
| Fig. 9 Changing remote DB password |
Processing Remote Datasets
To be updated!
Exiting BAXSQL
Click the
Exit 
button to disconnect from the remote data server and to close the application.
Summary of Command Buttons
| ICON | NAME | DESCRIPTION |
 | Connect | Connect to the remote data server |
 | Disconnect | Disconnect from the remote data server |
 | New | Create new entry, either new study entry or data set entry |
 | Details | Show the details of the selected entry |
 | Edit | Entry the selected entry |
 | Refresh | Refresh the listing in the List Panel |
 | Download | Download the selected data set |
 | Delete | Delete the selected entry |
 | Exit | Disconnect from the remote data server and quits the application |
Command Toolbar Buttons And Menu Items
| Command Toolbar Button | Menu Item |
| ICON | NAME | |
 | Connect | Database/Connect |
 | Disconnect | Database/Disconnect |
 | New | Record/New/Study,Dataset |
 | Details | Record/View |
 | Edit | Record/Edit |
 | Refresh | View/Refresh |
 | Download | Record/Download |
 | Delete | Record/Delete |
 | Exit | Record/Quit |