matRad_readHLUT

Purpose ^

matRad function to read HLUT from filename

Synopsis ^

function hlut = matRad_readHLUT(filename)

Description ^

 matRad function to read HLUT from filename

 call
   hlut = matRad_readHLUT(filename)

 input
   filename: hlut filename

 output
   hlut:     lookup table

 References
   -

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Copyright 2018 the matRad development team. 
 
 This file is part of the matRad project. It is subject to the license 
 terms in the LICENSE file found in the top-level directory of this 
 distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 
 of the matRad project, including this file, may be copied, modified, 
 propagated, or distributed except according to the terms contained in the 
 LICENSE file.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function hlut = matRad_readHLUT(filename)
0002 % matRad function to read HLUT from filename
0003 %
0004 % call
0005 %   hlut = matRad_readHLUT(filename)
0006 %
0007 % input
0008 %   filename: hlut filename
0009 %
0010 % output
0011 %   hlut:     lookup table
0012 %
0013 % References
0014 %   -
0015 %
0016 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0017 %
0018 % Copyright 2018 the matRad development team.
0019 %
0020 % This file is part of the matRad project. It is subject to the license
0021 % terms in the LICENSE file found in the top-level directory of this
0022 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0023 % of the matRad project, including this file, may be copied, modified,
0024 % propagated, or distributed except according to the terms contained in the
0025 % LICENSE file.
0026 %
0027 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0028 
0029   % Check the extension
0030   [~,~,ext] = fileparts(filename);
0031   
0032   try
0033   switch ext
0034       %% Iterate through supported extensions
0035       case '.hlut'
0036           hlutFile = fopen(filename,'r');
0037           hlut = cell2mat(textscan(hlutFile,'%f %f','CollectOutput',1,'commentStyle','#'));
0038           fclose(hlutFile);
0039           
0040       otherwise 
0041             error(['HLUT extension ''' ext ''' not supported!']);
0042   end
0043   catch ME
0044       hlut = [];
0045       error(getReport(ME));      
0046   end
0047 
0048 end
0049

| Generated by m2html © 2005