4.85714

4.9 | 7 ratings Rate this file 51 downloads (last 30 days) File Size: 222.88 KB File ID: #9938

GSTools

by Kris De Gussem

 

09 Feb 2006 (Updated 19 Aug 2009)

Code covered by BSD License  

A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions

Download Now | Watch this File

File Information
Description

GSTools v0.4.3

This toolbox is an implementation to open and save SPC-spectra in matlab.

Additional routines are supplied as well: e.g.:
- GSImportspec: loads all SPC-files in a map
- GSDendrogram: this is to be used as a supplement to the matlab's toolbox function Dendrogram. GSDendrogram allows the user to put coloured labels with the samples names under the dendrogram. properly are added.
- BTree class: a binary tree implementation, which offers the user to easily inspect the different items in a list, as well as the positions of these different items. This combined approach makes it easy to work with numeric arrays and stringlists, such as spectral descriptions.

A PDF with detailed information on the usage (including some sample code) is supplied in the zip-archive.

GSTools is also included in the Biodata toolbox (doi: 10.1016/j.chemolab.2008.08.003).

Required Products Statistics Toolbox
MATLAB release MATLAB 6.5 (R13)
Other requirements Statistics toolbox is only required in order to make dendrograms.
Zip File Content  
HTML Files GSTools/history.html
Other Files
GSTools/@BTree/About.m,
GSTools/@BTree/Add.m,
GSTools/@BTree/BTree.m,
GSTools/@BTree/Count.m,
GSTools/@BTree/display.m,
GSTools/@BTree/getitem.m,
GSTools/@BTree/GetItems.m,
GSTools/@BTree/GetItemWithMostValues.m,
GSTools/@BTree/GetSortedItemsList.m,
GSTools/@BTree/history.txt,
GSTools/@BTree/isitem.m,
GSTools/@BTree/Plot.m,
GSTools/@BTree/private/ConvertToBTree.m,
GSTools/@BTree/private/DoCompare.m,
GSTools/@BTree/private/GetThem.m,
GSTools/@BTree/private/searchitem.m,
GSTools/@BTree/subsasgn.m,
GSTools/@BTree/subsref.m,
GSTools/@BTree/version.txt,
GSTools/@BTree/WriteContentsToFile.m,
GSTools/Additional/CatBlank.m,
GSTools/Additional/loadcell.m,
GSTools/Additional/LocateItem.m,
GSTools/Additional/MakeVector.m,
GSTools/Additional/mystrcmp.m,
GSTools/Additional/str.m,
GSTools/Additional/str2.m,
GSTools/Additional/trimleft.m,
GSTools/Additional/trimright.m,
GSTools/Additional/trimstr.m,
GSTools/Contents.m,
GSTools/DetermineClusters.m,
GSTools/GetSPCAxisTypes.m,
GSTools/GetTechniques.m,
GSTools/gpl-3.0.pdf,
GSTools/GSDendrogram.m,
GSTools/GSImportspec.m,
GSTools/GSSpcRead.m,
GSTools/GSSpcReadStructure.m,
GSTools/GSSpcWrite.m,
GSTools/GSTools 0.4.3 manual.pdf,
GSTools/GSToolsAbout.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
12 Apr 2006 Rachel Rohde

I have only used this for reading in an .spc file. It worked great. It even plots the spectra so you know it was loaded properly.

06 Sep 2006 Rich Williams

Haven't used it for .spc files, but it includes an easy to use BTree class. Note that the @BTree\private\DoCompare.m method will fail upon unsigned types unless you replace the line

     tmp = item - value;

with

     tmp = (item > value) - (item < value);

13 Nov 2006 Dominique Bertrand

I needed to import SPC files and it works immediately.

05 Sep 2007 Gerbe van Dreumel

Use it for importing multi-dimensional spectra: and it works perfect!

03 Feb 2008 Pall Thordarson

Just downloaded it to convert SPC Raman data and it works perfectly! Noted a small error in the manual on page 2: plot (SData.xaxis, data);
doesn't work, just change to:
plot (SData.xaxis, Sdata.data); and it works fine.

20 Jun 2008 matt o'brien

fantastic bit of code, works better than the old GRAMS converter ive been using until now!

26 Oct 2009 Cameron Bowles

fixed-point signed fractions,

I ran into one last problem, the exponent values in the headers/subheaders are in char form, meaning that if they are between 129 - 255, then they are actually between -127 to -1, or at least they are in the files I am reading in.

this causes the Y-axis to be incorrectly scaled, the fix I put in for this is in GSSpcRead; line 689, I inserted the following check loop at 689;

if YScalingExp > 128
      YScalingExp = YScalingExp-256;
end
 then the file should continue
CurrSpec = ........

I assume the process would be the same for the 16 bit input integers, in which case you would have to also put that check into line 675.

26 Oct 2009 Cameron Bowles

I found an error for opening multifiles using GSSpcRead.m.

line 437 is;
data = zeros (l,Specdata.spectra(1).data);

and it should be;
data = zeros (l,length(Specdata.spectra(1).data));

Other then that I have had no problems, a great piece of code, good work Kris

Please login to add a comment or rating.
Updates
13 Feb 2006

license added in zip-file

15 May 2006

Important bugs in GSSpcRead and GSSpcWrite are fixed. Functions now correctly interprete flags in the headers of the SPC-files.

20 Jun 2006

bug fixes, code optimisation and support for old SPC-file format

10 Jul 2006

User can now set the axis types in GSSpcWrite

19 Sep 2006

fixed a small bug in BTree when using unsigned data types (thanks to Richard Williams)

11 Oct 2006

code cleaning

30 Jul 2007

Support for multi-dimensional spectra

06 Aug 2007

minor update / code improvement

19 Aug 2009

dual licensed: added BSD license

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com