Home > vbmeg > demo > test_scripts > sbi > readDICOMimages.m

readDICOMimages

PURPOSE ^

readDICOMimages : Rev.1.0, 2001-11-17

SYNOPSIS ^

function [B,ier]=readDICOMimages(sqddat, data_fname)

DESCRIPTION ^

 readDICOMimages : Rev.1.0, 2001-11-17


 history
 2001-11-17 S.Kajihara
 2003-02-04 modified by T.Yoshioka

 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 [B,ier]=readDICOMimages(sqddat, data_fname)
0002 % readDICOMimages : Rev.1.0, 2001-11-17
0003 %
0004 %
0005 % history
0006 % 2001-11-17 S.Kajihara
0007 % 2003-02-04 modified by T.Yoshioka
0008 %
0009 % Copyright (C) 2011, ATR All Rights Reserved.
0010 % License : New BSD License(see VBMEG_LICENSE.txt)
0011 
0012 % initalize
0013 dsply=1;    % if 1, dispay the result
0014 ier=0;
0015 if dsply, exe_count('reset',0); end
0016 
0017 
0018 % 2005-03-20 Modified by TY
0019 % global define
0020 global vbmeg_inst; 
0021 define = vbmeg_inst.const; 
0022 
0023 if ~isempty( findstr(data_fname, define.DICOM2_EXTENSION) )% 拡張子が.tbl.mat
0024   load([sqddat, filesep, data_fname],'B');
0025 else    % 拡張子が.tbl
0026   % read DICOM files and save
0027   [mrtbl,sloc,ier]=readDICOMtbl([sqddat, filesep], data_fname);
0028   [sloc2,slix]=sort(sloc); nsl=size(sloc,2);
0029 
0030   fname = data_fname(1:findstr(data_fname, '.tbl')-1);    % 拡張子を取り除く
0031   B=[];
0032   for i=1:nsl,
0033     if dsply, exe_count('load MRI',nsl); end
0034     j=slix(nsl+1-i);
0035     
0036     [mrinf,B0,ier] = ...
0037     readDICOMfile([sqddat, filesep],sprintf('%s.%d.mri',fname,j));
0038     B(:,:,i)=B0;
0039   end
0040   clear B0;
0041   
0042   % Bを拡張子.tbl.matファイルに保存する。
0043   %save([sqddat, filesep, data_fname, '.mat'],'B');
0044   %fprintf('pixel_data save to ''%s''.\n',...
0045   %    [sqddat, filesep, data_fname, '.mat']);
0046 end

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