Coronavirus (Covid-19) Information



Partial Volume Correction


This software is for use in calculating the location and partial volume makeup of a MRS voxel acquired on a Philips system. It uses the SDAT/SPAR format for voxel information and a T1 weighted nifti image of your subject for registration. A few points:


1. The code requires Matlab, SPM and the imaging toolbox. (It has been designed for SPM8). It requires a T1 weighted image for segmentation and localisation of the voxel. The T1 image should be in NIfTI format (use dcm2nii, mcverter or your favourite conversion software to convert your dicom images to *.nii format) and you need access to the SPAR files. Currently this tool only works for 2.6.+ SPAR files and not older formats, nor Dicom formats of the spectroscopy data. The code has been tested by us on Mac OS X 10.6+ and OS X 10.7, we have not tested it with Mavericks, but as it is matlab based we do not foresee to many problems with it's use on windows or linux based systems. If you do encounter a problem please let me know at While we will endeavour to make the code work for you, we do not offer formal support. It will be on a "as we can" basis.


2. Click here to download the file. Untar the file (tar –xf Partial_Volume_181013.gz). Add the folder to your matlab path, then type partial_volume_correction_nifti_newsegment. This should cause a file window to pop up asking for the T1 image, select the T1 for the subject you want the voxel composition of, followed by a window for the SPAR file (this should also be from the same subject), and the location of your SPM folder. If you look at the code, you will see this comes from line 5. If you feel comfortable enough to edit the code your self you could set the SPMPath for your system in this line instead of having this be a call to ask for the folder. This is up to you.


3. The code will generate a grey matter, white matter and CSF image, as well as a mask of the voxel location. You can use FSLView or some other display software to check that the voxel mask is in the right place. The code will also print out the GM, WM and CSF percentages for your voxel. You can then use these in a formula to correct for partial volume effects and relaxation if you want as described by Charles Gasparovic in: Gasparovic C, Song T, Devier D, Bockholt HJ, Caprihan A, Mullins PG, Posse S, Jung RE, Morrison LA. Use of tissue water as a concentration reference for proton spectroscopic imaging. Magn Reson Med. 2006 Jun;55(6):1219-26. PubMed PMID: 16688703. We do have a spreadhseet in excel that will take the GM, WM and CSF fractions and do the corrections for you, which we can also make available along with a spreadsheet of T2 and T1 relaxation values with citations.


4. This code is distributed under the following Creative commons license. Creative Commons Attribution-ShareAlike 3.0 Unported License. All we ask is that you acknowledge Dr. Nia Goulden and Dr. Paul Mullins of Bangor University in the first paper or papers you use this in and reference Chucks paper at the very least. If we ever come up with a proper reference for the code and it's use we will let you know (most likely by the list serve). If you make improvements to the code, that's cool as well, all we ask is that let us know what you did and why, and let us and others use it. You could also cite the URL of this page when you mention the method for partial volume segmentation.


Partial Volume code for Philips MRS data by Nia Goulden and Paul Mullins is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.



Staff Wiki


There is a new WIKI for information regarding policy and proceddures as well as data issues. We encourage all users to engage with this WIKI and add content as they see fit.