Home > vbmeg > functions > device > acqdata > vb_facefile_get_mri_key.m

vb_facefile_get_mri_key

PURPOSE ^

get mri_key(MD5) from FACE-MAT file.

SYNOPSIS ^

function [mri_key] = vb_facefile_get_mri_key(face_file)

DESCRIPTION ^

 get mri_key(MD5) from FACE-MAT file.
 [USAGE]
    [mri_key] = vb_facefile_get_mri_key(<face_file>);
 [IN]
    face_file : FACE-MAT file.
 [OUT]
    mri_key : mri key(MD5 hash key made from analyze.img) [string]

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [mri_key] = vb_facefile_get_mri_key(face_file)
0002 % get mri_key(MD5) from FACE-MAT file.
0003 % [USAGE]
0004 %    [mri_key] = vb_facefile_get_mri_key(<face_file>);
0005 % [IN]
0006 %    face_file : FACE-MAT file.
0007 % [OUT]
0008 %    mri_key : mri key(MD5 hash key made from analyze.img) [string]
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('face_file', 'var') || exist(face_file, 'file') ~= 2
0018     error('face_file is a required parameter.');
0019 end
0020 
0021 %
0022 % --- Main Procedure
0023 %
0024 s = load(face_file);
0025 
0026 if ~isfield(s, 'header')
0027     version = 0;
0028 else
0029     version = s.header.version;
0030 end
0031 
0032 switch(version)
0033     case 0
0034         if isfield(s.subject, 'md5_key')
0035             mri_key = s.subject.md5_key;
0036         else
0037             mri_key = [];
0038         end
0039     otherwise
0040         mri_key = s.mri_key;
0041 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005