Rank: 1740 based on 34 downloads (last 30 days) and 2 files submitted
photo

Kris De Gussem

E-mail
Company/University
Ghent University

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Kris View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
22 Aug 2009 Screenshot Biodata toolbox Database system coupled to chemometric algorithms that consequently stores spectra and related data Author: Kris De Gussem 7 0
19 Aug 2009 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem 27 11
  • 4.88889
4.9 | 10 ratings
Comments and Ratings on Kris' Files View all
Updated File Comment by Comments Rating
28 Apr 2011 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem Weber, Larry

I found an error in GSSpcWrite.m . It outputs the xtype, ytype, and ztype to the header as a string instead of the correct single byte binary format. This is especially bad if the string has more than one byte since the rest of the header will get messed up.

The fix is to change lines 578 through 592 to the following code which simply converts the string to a single binary byte.

Thanks to Kris for making this very helpful set of routines available to us.

if isfield (spectra, 'xtype')
    ThisSpcHdr.fxtype = uint8(str2double(LocateItem (spectra.xtype, Types.X, 2))); %%std%%%BYTE: Type of X units
else
    ThisSpcHdr.fxtype = 13; %%std%%%BYTE: Type of X units
end
if isfield (spectra, 'ytype')
    ThisSpcHdr.fytype = uint8(str2double(LocateItem (spectra.ytype, Types.Y, 2))); %%std%%%BYTE: Type of Y units
else
    ThisSpcHdr.fytype = 0; %%std%%%BYTE: Type of Y units
end
if isfield (spectra, 'ztype')
    ThisSpcHdr.fztype = uint8(str2double(LocateItem (spectra.ztype, Types.X, 2))); %%std%%%BYTE: Type of z units
else
    ThisSpcHdr.fztype = 0; %%std%%%BYTE: Type of Z units
end

15 Dec 2010 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem Joseph

Oops, I'm sorry. I was inputting the wrong compatibility. Never mind.

15 Dec 2010 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem Joseph

This is exactly what I was looking for! Unfortunately, when I try to import multiple files, I get the following error:

EDU>> GSImportspec()
Warning: Multifile flag is set. But SPC-file does not contain multiple spectra.
> In GSSpcRead at 236
  In GSImportspec at 245
??? Subscripted assignment between dissimilar structures.

Error in ==> GSImportspec at 245
            spectra(i) = GSSpcRead (spcfiles(i).name, -1, 0);

26 Oct 2009 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem Bowles, Cameron

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

26 Oct 2009 GSTools A set of matlab functions to read, write and deal with .spc spectra and spectral descriptions Author: Kris De Gussem Bowles, Cameron

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.

Contact us at files@mathworks.com