Friday 11 January 2013

Running a Study at CUBRIC


If you plan to perform a study using MR at CUBRIC, you need to be aware of the risks associated with working in the MR lab.  MR scanning is safe - but only if the people working in the MR area are aware of the hazards of working in high magnetic fields.

To demonstrate that you have understand these issues, there is a short on-line test on the main topics of MR safety.  On passing the MR safety test you will be granted "Probationary Approved User" status (or 'Level 1'), and will be allowed swipe card access to the MR area.

Before taking the test you need to:
Both the safety lectures and the online test are organised by Peter Hobden (hobdenp AT cf.ac.uk)


Thursday 10 January 2013

Booking the 3T MR System

Once the required approval has been granted for a project (see Access to CUBRIC), then researchers can book time on the MR scanner via the MR booking calendar (https://studies.cubric.cf.ac.uk ).

Operator Cover

•    If you need someone to operate the scanner, then bookings should only be made for your project during the hours where there is MR cover available - the "MRI Operators" calendar shows who is operating the scanner during each session.
•    Studies requiring operator cover outside the designated hours may be able to arrange this with the operators directly.
•    Bookings for more than 4 weeks in advance are considered provisional, to allow the operators to plan leave.

Advance booking limit

•    2 months for all funded studies (but see restrictions for PhD student scanning, below).

Regular bookings

•    Projects that require a regular timeslot each week (e.g. clinical populations, or large cohorts) can request this from the Directors/MR Lab Manager.
•    The timing of the regular slot will be accommodated as far as practical, subject to the limitations of radiographer provision.
•    Regular bookings may have to be changed in future to accommodate changes in radiographer provision or scanner demand.
•    Cancellations follow the same rules as for any other projects.
•    The following sessions are for specific projects, and are bookable via separate calendars on the booking system:
  • Clinical Session (Thursday PM):  For projects scanning clinical populations.
  • PhD Session (Monday AM):  Available for PhD student projects (see below).
  • TMS-MRI (Tuesday AM): For projects associated with TMS-MRI grants. 

PhD Student Scanning

PhD students who do not have external funding for their scan fees have additional restrictions on scanner bookings:
  • Students can book sessions during the PhD session (Monday 1030-1330).  This is bookable via the see the "PhD Session" calendar.
  • Students can book scanner time outside 'peak' hours (Mon-Fri 9-6pm),  i.e., early mornings, evenings, and weekends are available.
  • Students cannot book the MR scanner during 'peak' hours unless the required session is within the next 7 days (e.g. a cancellation).

Cancellations.  

Cancelled bookings are chargeable.  For any project, the first ‘chargeable’ cancellation will be overlooked, but subsequent cancellations will be charged at the following rate:
  • Bookings cancelled less than 7 days before the scan will be charged at 50% of the scan fee (excepting bookings made less than 7 days before the scan).
  • Bookings cancelled less than 24 hours before the scan will be charged at 100% of the scan fee (excepting bookings made less than 24 hours before the scan)
The researcher should inform the operator and the CUBRIC users group (CUBRIC AT jiscmail.ac.uk) that the slot has been vacated.

The following are also chargeable cancellations:
  • Researcher failing to arrive, or arriving late for the scanning session.
  • Participants not passing MR screening (contra-indications should be checked prior to the participant arriving for a scan).
  • Participants not providing full UK GP details, including the address of the practice.
  • Participants failing to meet any criteria for the experiment (e.g. failing a performance limit for a task).
Covered slots that are unbooked 24 hours beforehand will revert to ‘No Cover’.  It may be possible to provide operator cover for this slot, but the operator should be contacted directly to organise this.

Scan Timing

It is the responsibility of the researcher to ensure that the experiment can be completed within the booked scanner time.  Over-running can result in the experiment being cut short.

The researcher should ensure that the participant is ready to enter the MR scanner at least 5 minutes before the start of the exam. This includes;
  • Initial and second screening forms have been completed.
  • The participant has removed all metal from their pockets, clothes, hair etc.
  • Consent form has been completed.
  • The experiment and MR procedure has been fully discussed with the participant.

Other Equipment

If your study requires additional equipment – e.g. Physiological monitoring, MedRad, resus trolley, MR compatible EEG - please ensure that this equipment is booked as well.  This equipment is often used in other parts of the building, so a booking of the MR scanner does not imply these components are included.


Becoming an MR Operator

We encourage regular users of MR in CUBRIC to become approved operators of the MR scanner.  This not only gives users a better understanding of the way that MR data are acquired, but also allows users greater flexibility in booking scanner time, once they have completed the approval process.

Should I become an MR operator?

It will typically take approximately 20 hours of  training/experience to become an MR operator, but this will vary according to the individual.  Thus, it is not an efficient use of time to train all researchers to operate the scanner.  Whether it is worthwhile for a researcher to train to become an MR operator depends on a number of factors, such as prior experience and the number of hours of scanning you are expecting to perform.  However, PhD students (who do not have separate funding for their studies) will be required to learn to operate the scanner during their time at CUBRIC.
In general, training will take place during the researcher's first study, so it is not nescesary to become an MR operator prior to this.  
Applications for MR operator training should be made to John Evans ( evansj31 AT cf.ac.uk ), using the  MR Operator Training Application Form. Applications for students should be sent by their PhD supervisor.

Requirements

In order to become an MR operator (or 'Approved Users' in the terminology of the CUBRIC Rules and Procedures), the researcher must demonstrate that they can;
•   competently perform the safety screening of participants.
•   safely place participant in the scanner.
•   communicate the important aspects of the scan to the participant both before and during the scan.
•   test the important safety equipment, prior to scanning (e.g. squeeze ball).
•   recognise common scanner faults.
•   correctly prescribe and inspect the scans they perform
•   recognise common artefacts
•   understand the causes of alarms in MR suite
•   can safely remove an unconscious participant from the magnet room.

The minimum requirement for becoming an approved operator is;
1) Attend the MR safety lecture (Contact Peter Hobden, email: hobdenp AT cf.ac.uk )
2) Complete the MR safety test. (Contact Peter Hobden, email: hobdenp AT cf.ac.uk )
3) Observe two sessions run by an MR trainer (one of the experienced MR operators, see list below).  Contact the trainer directly to arrange this.
4) Operate the scanner for (at least) eight sessions, under the supervision of an MR trainer.
5) Complete final approval session with John Evans ( evansj31 AT cf.ac.uk )
All of these should be logged in the MR Operator Training Record

MR Trainers

John Evans
Peter Hobden
Derek Jones
Krish Singh
Martin Stuart
Richard Wise



Wednesday 15 August 2012

MRS Voxel Registration

This describes the process of localising the actual voxel location used during the acquisition onto the participants FSPGR scan.  The output is a binary voxel mask, in the space of the FSPGR.   This can then be combined with outputs from segmentation (Fast) to calculate the tissue composition of the voxel (wm, gm, csf)

1) Copy native FSPGR dicoms

A copy of the native dicom files (dcm) is required as these contain the position information of the slices in the FSPGR.  The step to create the nifti removes these, so first a copy of the FSPGR dicoms should be made, e.g from the directory of the scan data;
cp Series_0000n FSPGR_dcm_folder
where n is the series number of the FSPGR.

2) Create FSPGR nifti

Then you need to create the FSPGR: go into the Series_0000n folder that contains the FSPGR scan by typing;
geprepfunct 172 1 [name of FSPGR]. 
 e.g.type:  geprepfunct  172  1 Subject1_FSPGR.nii.gz


3) Run VoxelOnFSPGR

Then, in Matlab, run the following function:

VoxelOnFSPGR(pfile, ImagingDataDirectory, MRS_Rot_folder,... FSPGR_dcm_folder, FSPGR_nifti)

VoxelOnFSPGR is in the same location as Gannet, so ensure that you have Gannet in your matlab path for this to work (/cubric/software/Gannet/GannetExtras).
e.g.
 VoxelOnFSPGR( ...
'~/mrs/somato_motor/data/3143_6_P12800.7', ...
'/cubric/home/sapje1/mrs/somato_motor/3143_081007-1', ...
 'Series_00005', ...
 'Series_00004_bak', ...
'fspgr.nii.gz')
Pfile = full path to pfile (e.g. '~/mrs/somato_motor/data/3143_6_P12800.7')

ImagingDirectory = the directory containing imaging data, unpacked by sortdicomball.  The directory '/cubric/home/sapje1/mrs/somato_motor/3143_081007-1' in the above example should contain the Series_00001, ... directories and the nifti FSPGR.

MRS_Rot_folder = folder containing the rotator/oblique localiser scan for the voxel, path from ImagingDirectory (e.g. ‘Series_00005’)

FSPGR_dcm_folder = folder containing the FSPGR native dicom files (e.g. Series_00004_bak')

FSPGR_nifti = the name of the FSPGR you created (e.g. ‘fspgr.nii.gz’)

This will create a voxel mask, in the FSPGR space, for the MRS voxel  and place it in a created directory named MRSVoxelReg. The filename is examnumber_series_Mask.nii.gz so e.g. 3999_08_Mask.nii.gz.

Below is a the output from VoxelOnFSPGR (e.g. 3999_08_Mask.nii.gz, but from an occipital voxel in this case) overlaid on the participant's FSPGR.





Wednesday 8 August 2012

Scanner Sounds

We have recorded the sounds of a number of the most common sequences run at CUBRIC, which may be useful in acclimatising participants to the noise of a scan.

All of the WAV files are available here , and the sequences available are;

ASL-quipssIOP.wav (Perfusion, IOP)
ASSET.wav
B0map.wav (Fieldmap)
Coldhead.wav (Magnet room background noise)
DESPOT-IRSPGR.wav
DESPOT-SPGR.wav
DESPOT-SSFP.wav
DTI.wav
EPI.wav (fMRI)
FSE-B1map.wav
FSE.wav (T2 Fast Spin Echo)
FSPGR.wav
Localiser.wav
MRS-MEGAPRESS.wav (MEGA-PRESS GABA spectroscopy)
Prescan.wav (run before each separate sequence)
qMT.wav (quantitative MT)





Saturday 14 July 2012

Transferring MRI data

1) Transferring from the scanner

On the scanner console, when all images in an exam have been collected and you are removing the participant from the scanner, make sure you press the "End Exam" button. This guarantees that all the images you require have been finally written to the internal GE database. Then, from a terminal window in the console, type; copydicom The copydicom script will get run overnight by the scanner, but it is good practice to transfer the data as soon as the exam is finished.
 The script will identify any MRI exams that have not previously been transferred to the CUBRIC cluster file-system (such as the one you have just collected). Note that the exam must be finished before you press this button. Otherwise, additional copies of the exam will end up in the database - which can cause confusion (but will only lead to duplication, rather than a loss of data).
When the command has finished, your images have been packaged up and transferred to the CUBRIC cluster file-system. Note: A typical fMRI experiment may consist of several tens of thousands of images. In the standard DICOM database, each of these images are stored in a separate file. This can be very inefficient, both in terms of file transfers and load on the linux file-system. So, we have taken the decision to package up all the images from an Exam in a single archive file, which is also compressed.  In CUBRIC parlance, this is known as a dicball/tarball.

2) Unpacking Scanner DICOM data

(Note, steps 2 and 3 can be done using the Studies database https://studies.cubric.cf.ac.uk).

Log in to your normal user account on the CUBRIC  system. All dicballs are transferred to the same location, namely: /cubric/mri/direct_transfer/YYYY
where YYYY represents the year of the scan. Dicballs have fairly obscure names, which contain the name and time that the exam started. If you type the following command you will see all the  dicballs currently in the database, sorted so that the last file listed is the last one to be transferred. ls -lrt /cubric/mri/direct_transfer/2012
Here is a typical listing from our database:

2012-07-19-16-35-54-e2357712.tgz
2012-07-19-18-21-53-e2390174.tgz
2012-07-20-08-02-36-e2404155.tgz
2012-07-20-08-08-30-e2404166.tgz
2012-07-20-09-04-34-e2404178.tgz
2012-07-20-10-02-49-e2404274.tgz

To locate a dicball based on the Exam number, use  seriesinfo
e.g.
sapje1@daws15:/cubric/users/sapje1$ seriesinfo 9319
------------------------------------------------------------------

                   REL Study ID//9319 (Exam No)
             DICOM Data Tarball//2013-07-22-08-13-44-e4568456.tgz
               PAT Patient Name//dailyqa 
          PAT Patient Birthdate//
            ID Acquisition Date//20130722
            ID Acquisition Time//075619
              ACQ Protocol Name//dailyQA_2012b/1 
1 // fgre // loc
2 // fgre // ASSET cal
3 // epiRT // EPI TR=3 64x64, 360FOV,no ASSET, no FATSAT
4 // epiRT // EPI QA 10min
------------------------------------------------------------------
This lists the tarball name, time, date and participant ID, and limited information about the series run during the acquisition (pulse sequence name and series description).

3) Unpacking a dicball
 Once you have found the you file you need to unpack, you next have to decide where you want to put the unpacked and processed data. Let's suppose you are doing a project on Widget Perception and the dicball contains data from your subject 23. In your home directory, you probably want to create a directory called Widget, and then sub-directories called Subject23 etc. i.e.:
mkdir Widget
cd Widget
mkdir Subject23
cd Subject23

Now you are in the new directory, you can unpack the dicball using the sortdicomball command. sortdicomball  e.g.
sortdicomball /gpfs/mri/direct_transfer/2007/2007-12-11-10-38-33-e99743.tgz .  
(don't forget the trailing full stop)

This will unpack the selected dicball archive into the current directory. It will create a new sub-directory based on the patient and exam id. If you cd into this, you will see a set of subdirectories e.g.: Series_00001    
Series_00002    
Series_00003 .......

Remember : you need to give the full path to the location of the dicball! 

Alternatively, you can use  tarball.unpackdicom
e.g.
tarball.unpackdicom /cubric/mri/direct_transfer/2013/2013-07-29-15-54-26-e5048388.tgz
(note this unpacks to current directory, and no trailing full stop)
This names the series directory according to the series number + pulse sequence.
e.g. 
1_fgre
2_fgre
3_efgre3d
403_epi2cje032
4_epi2cje032

 4) Converting Dicom data to NIFTI/Analyze format

Each of the above sub-directories contains the Dicom files for one of your series, which you now need to convert into NIFTI files for analysis. Let's suppose Series_00003 contains the data for a functional experiment in which there are 37 anatomical slices collected every TR for 200 volumes.
Here's how you would convert the data using the command geprepfunct:
cd Series_00003
geprepfunct 37 200 widget_sub23_run1
This will create a 4D NIFTI file, called widget_sub23_run1.nii.gz , suitable for analysis with FSL or CUBRIC's other software packages.
You need to change the 3 parameters on the geprepfunct command line to match your data. 
Alternatively, if you can't do the sums to work out number of slices/volumes, use dcm.geprepauto which gets the number of slices from the dicom header, and calculates the number of volumes based on the total number of images in the directory.
e.g.
dcm.geprepauto widget_sub23_run1

5) Converting Structural (FSPGR) data for MEG or FreeSurfer 

Note that, for the analysis of anatomical data to be used for MEG or , we no longer recommend the use of geprepfunct. If your data is a MEG anatomical scan (i.e. one volume) you should instead use the dic2mri command. Note that the dicom files for the series will be packed up into an archive called sorted.tar.gz in the Series_XXXXX sub-directory. Note that these are a copy of the original dicom files stored in the dicball. As such you can go ahead and delete sorted.tar.gz, when you feel ready and comfortable!
One data management strategy that seems to work well is to create a directory, at the same level as the Series_XXXX directories, to hold all your NIFTI files. You can then move all the NIFTIs to this subdirectory using the following:
mkdir NIFTI
mv Series_*/*.nii.gz NIFTI/
Importantly, the NIFTI files must all have different filenames, or they will overwrite each other. Now you are ready to do your analysis...
Note: geprepfunct only generates NIFTI files if this is the default output type for FSL. If the FSLOUTPUTTYPE environment variable is set to ANALYZE, then this is the type of file that will be created. CUBRIC users have NIFTI set to be the default. Converting to Anatomical scans for MEG Follow the Instructions above on using sortdicomball/whodicball Find the dicom series with about 170 .dcm files..this is probably the anatomical scan.
Then run the dic2mri command in that directory. If you have queries about the commands mentioned here, you should contact the authors: copydicom.sh : Spiro lastdicball: Krish whodicball: Krish sortdicomball: Krish geprepfunct: Krish dic2mri: Krish