Home > vbmeg > demo > tutorial_for_vbmeg2 > advanced > import_T1.m

import_T1

PURPOSE ^

convert T1 DICOM files to NIfTI(.nii)

SYNOPSIS ^

function import_T1(p)

DESCRIPTION ^

 convert T1 DICOM files to NIfTI(.nii)

 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 import_T1(p)
0002 % convert T1 DICOM files to NIfTI(.nii)
0003 %
0004 % Copyright (C) 2011, ATR All Rights Reserved.
0005 % License : New BSD License(see VBMEG_LICENSE.txt)
0006 
0007 disp(mfilename);
0008 
0009 % Set input file
0010 d = dir(fullfile(p.t1_dicom_dir, ['*', p.t1_dicom_extension]));
0011 input_dicom_file = fullfile(p.t1_dicom_dir, d(1).name); % set the one of files.
0012 
0013 % % Set output directory
0014  output_dir = fullfile(p.proj_root, p.t1_dirname);
0015 if exist(output_dir, 'dir') ~= 7
0016     mkdir(output_dir);
0017 end
0018 
0019 % Convert T1 DICOM files to NIfTI
0020 [t1_nifti_file] = convert_dicom_nifti(input_dicom_file, output_dir);
0021 
0022 % Rename
0023 t1_out_file = fullfile(output_dir, [p.struct_name '.nii']);
0024 movefile(t1_nifti_file, t1_out_file);
0025 
0026 disp(sprintf('T1 NIfTI file is created : %s', t1_out_file));

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