Friday, 2 March 2012

Gannet Quick Start Guide

0.   Get Matlab with Optimisation and Statistics Toolboxes


1.       Get the code from github and add these files to your matlab path
Assuming familiarity with Matlab, make sure all the files downloaded from github are in your matlab path; (i.e.use “add with subfolders”). If you are not familiar with matlab, someone else in your group probably is.

2.       What do I type?
Gannet is currently run from two commands – GannetLoad and GannetFit.  This section will cover the load and processing of a single data file. Replace the filename with the actual name of your file.
2.1.    GE data
P files contain a water reference internally, so:
MRS_struct  = GannetLoad({‘GE_data1.7’});
MRS_struct  = GannetFit(MRS_struct);

2.2.    Philips .sdat files
If no water reference data have been collected:
MRS_struct  = GannetLoad({‘Philips1.sdat’});
MRS_struct  = GannetFit(MRS_struct);
If water reference data have been collected:
MRS_struct  = GannetLoad({‘Philips1.sdat’},{‘Philips1_water.sdat’});
MRS_struct  = GannetFit(MRS_struct);

2.3.    Philips .data files
If no water reference data have been collected:
MRS_struct  = GannetLoad({‘Philips1.data’});
MRS_struct  = GannetFit(MRS_struct);
If water reference data have been collected:
MRS_struct  = GannetLoad({‘Philips1.data’},{‘Philips1_water.data’});
MRS_struct  = GannetFit(MRS_struct);

2.4.    Siemens .rda files (saved as OFF and ON rda files separately)
MRS_struct  = GannetLoad({'Siemens1_OFF.rda' 'Siemens1_ON.rda'});
MRS_struct  = GannetFit(MRS_struct);
If water reference data have been collected:
MRS_struct  = GannetLoad({ 'Siemens1_OFF.rda' 'Siemens1_ON.rda' },{'Siemens_water.rda'});
MRS_struct  = GannetFit(MRS_struct);

3.       Data Formats
GE, Philips and Siemens data formats are supported. Vendor is chosen according to file endings, so make sure your data files end .7 .rda .sdat or .data.


4.       Assumptions
The formatting of data within the data files is assumed to be the  same as for ‘our’ implementations on Philips and GE, whereas we handle Siemens outputted data that have already been processed into a single data file.  If you are using this software to process your own implementation of GABA-edited MRS, please contact us.

Wednesday, 22 February 2012

Gannet Beta version available through github

Gannet is now freely available through this link to github.Click on the GANNETMaster BETA Download.zip link. (This link allows me to log downloads).

Gannet:

  • analyses GABA-edited MRS data saved as GE P-file, Philips .data or .sdat, or Siemens .rda.
  • is designed for batch analysis of entire study datasets
  • is matlab-based 
  • saves pdf output showing each dataset.

This software is provided without warranty.

We are managing version control of the code through github which also allows downloads.  It may be possible to dowmload without signing in, but it might be worth getting an account if you intend to use Gannet, so you can watch the repository richardedden/GannetMASTER.


I will post soon about how to get started and will add some example data files.  The analysis code pulls a lot of information about acquisitions from the file headers, but some assumptions are made (based on our own defaults), for example about the ordering of OFF and ON within the data.

Monday, 20 February 2012

GABA phantom recipe

It seems that there is some value in a standardized GABA phantom for cross-platform testing etc... This recipe is also a reasonable place to start if you want a 'will-work-without-much-thought' option.  Everything is available form Sigma Aldrich.

  • Container: 1 liter Nalgene bottle style 2125
  • Buffer: One PBS sachet P5368
  • GABA: 1.03 g (RMM 103.1) A2129 

Make up to 1 liter with deionized water.  pH can be adjusted using NaOH/HCl (but to a first approximation does not need to be).

Wednesday, 15 February 2012

Setting up a MEGA-PRESS scan with the Philips patch

***These instructions are no longer current 9/2014***

These instructions are intended to help anyone with our patch get things set up for GABA editing. They are Philips- and patch-specific.


  1. Start with a short-TE PRESS scan
  2. In Initial, increase the TE to 68 ms.
  3. In Geometry, change the voxel size to ~3x3x3 cm^3.
  4. In Contrast:
    • Change Gradient mode to Maximum and PNS mode to high.
    • Select MEGA basic in BASING pulse options.
    • Pulse duration 14ms, freq1 7.46 ppm, freq2 1.9 ppm. [OFF first, edit 8/19/12]
  5. In Motion, set phase cycles and averages to 8, startup acquisitions 0 and turn off frequency correction.
  6. In Dyn/ang, Dynamic study individual, 40 dynamic scans.
  7. In Postproc, turn off spectral correction.
  8. Set up a separate non-water-suppressed PRESS scan for quantification relative to water.

Wednesday, 11 January 2012

Beta versions of Gannet on the way

Over the Christmas period, John and Nick have ironed out some remaining discrepancies between Cardiff code and the master Gannet version, including handling transatlantic differences such as default units for output figures.

We anticipate that this will lead to a beta version of Gannet that will be made available here by the end of January, which will be publicised to our current collaborators and freely downloadable.

Sunday, 18 December 2011

Co-registering the MRS voxel to an image

This is 'the problem that will not die', and at various times, I have spent weeks on the problem without much to show for it. This document outlines the route for a solution.
As a taster, here is a triply rotate MRS voxel on a triply rotated T1 image. First the scanner screenshot:
 
And now the reconstructed voxel (overlaid on the image):
 
We may be nearly there.

Monday, 12 December 2011

Anonymizing Siemens .rda files

In working towards a useful distribution version with example data files, we need to make sure that all files are de-identified. This script does the trick (matlab):


a=dir('*.rda');
for number=1:size(a)
    a(number).name
    fid = fopen(a(number).name,'r+');
    tline = fgets(fid);
    position=ftell(fid);
    tline = fgets(fid);
    magic=tline;
    size(magic)
    for ii=14:(size(magic,2)-2)
      magic(ii)='*';
    end
    fseek(fid,position,'bof');
    fwrite(fid,magic,'char');
    fclose(fid);
end