Home > functions > gui > brain_file_maker > brain_file_maker_make_mask_file.m

brain_file_maker_make_mask_file

PURPOSE ^

brain_file_maker_make_mask_file One-line description here, please.

SYNOPSIS ^

function [result, cancelled] = brain_file_maker_make_mask_file(obj, spm_norm_file, standard_mask_file, mask_file)

DESCRIPTION ^

 brain_file_maker_make_mask_file  One-line description here, please.
 [USAGE]
    [output] = brain_file_maker_make_mask_file(<obj>)
 [IN]
                   obj : brain_file_maker object
         spm_norm_file : <<in>>personal spm normalization file(fullpath)
    standard_mask_file : <<in>>standard mask map file         (fullpath)
             mask_file : <<out>>output mask_file              (fullpath)
 [OUT]
       result : make result of subject mask file. (SUCCESS or FAILURE)
    cancelled : cancelled to make mask file.      (true or false)

 Author: rhayashi
 Created: 2007-07-12

 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 [result, cancelled] = brain_file_maker_make_mask_file(...
0002                         obj, spm_norm_file, standard_mask_file, mask_file)
0003 % brain_file_maker_make_mask_file  One-line description here, please.
0004 % [USAGE]
0005 %    [output] = brain_file_maker_make_mask_file(<obj>)
0006 % [IN]
0007 %                   obj : brain_file_maker object
0008 %         spm_norm_file : <<in>>personal spm normalization file(fullpath)
0009 %    standard_mask_file : <<in>>standard mask map file         (fullpath)
0010 %             mask_file : <<out>>output mask_file              (fullpath)
0011 % [OUT]
0012 %       result : make result of subject mask file. (SUCCESS or FAILURE)
0013 %    cancelled : cancelled to make mask file.      (true or false)
0014 %
0015 % Author: rhayashi
0016 % Created: 2007-07-12
0017 %
0018 % Copyright (C) 2011, ATR All Rights Reserved.
0019 % License : New BSD License(see VBMEG_LICENSE.txt)
0020 
0021 %
0022 % --- Previous check
0023 %
0024 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0025 if ~exist('spm_norm_file', 'var') || isempty(spm_norm_file)
0026     error('spm_norm_file is a required parameter.');
0027 end
0028 if ~exist('standard_mask_file', 'var') || isempty(standard_mask_file)
0029     error('standard_mask_file is a required parameter.');
0030 end
0031 if ~exist('mask_file', 'var') || isempty(mask_file)
0032     error('mask_file is a required parameter.');
0033 end
0034 
0035 %
0036 % --- Main Procedure
0037 %
0038 result = SUCCESS;
0039 cancelled = false;
0040 
0041 if exist(mask_file, 'file') == 2
0042     res = questdlg('Mask file already exists, recreate it?', ...
0043                 'confirm', 'Yes', 'No', 'Yes');
0044     if strcmp(res, 'No')
0045         cancelled = true;
0046         return;
0047     end
0048 end
0049 % try
0050     analyze_file = [vb_analyze_info_get_file_prefix(obj.analyze_info), '.hdr'];
0051     h = brain_file_maker_show_wait_dialog;
0052     [avw, XYZspm] = vb_map_mask_image(...
0053                         analyze_file, ...
0054                         standard_mask_file, ...
0055                         spm_norm_file);
0056     vb_fsave(mask_file, 'avw', 'XYZspm');
0057     brain_file_maker_delete_wait_dialog(h);
0058 % catch
0059 %     result = FAILURE;
0060 % end

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005