igt2img

PURPOSE ^

IGT2IMG constructs an EIDORS IMG struct from an IGT frames-by-912 matrix.

SYNOPSIS ^

function img = igt2img(igt)

DESCRIPTION ^

IGT2IMG constructs an EIDORS IMG struct from an IGT frames-by-912 matrix. 
 IMG = IGT2IMG(IGT)
 
 See also IMG2IGT, EIDORS_READIMG, EIDORS_SAVEIMG.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function img = igt2img(igt)
0002 %IGT2IMG constructs an EIDORS IMG struct from an IGT frames-by-912 matrix.
0003 % IMG = IGT2IMG(IGT)
0004 %
0005 % See also IMG2IGT, EIDORS_READIMG, EIDORS_SAVEIMG.
0006 
0007 % (C) 2009 by Bartlomiej Grychtol. Licensed under GPL v2 or v3
0008 % $Id: igt2img.m 4050 2013-05-23 11:44:07Z bgrychtol $
0009 
0010 
0011 img.name = 'Read in from an igt file';
0012 img.type = 'image';
0013 img.elem_data = 1:912;
0014 tempmdl = mk_common_gridmdl('b2d','backproj');
0015 img.fwd_model = tempmdl.fwd_model;
0016 
0017 % render the image on a 32-by-32 grid
0018 img.calc_colours.npoints=32;
0019 greit_m = calc_slices(img);
0020 greit_m(isnan(greit_m)) = 0;
0021 
0022 % create an IGT mask
0023 ind=[8:25,39:58,70:91,101:124,132:157,163:190,194:223,225:800, ...
0024         802:831,835:862,868:893,901:924,934:955,967:986,1000:1017];
0025 igt_m = zeros(1,1024);
0026 igt_m(ind) = 1:912;
0027 igt_m = reshape(igt_m,32,32)';
0028 
0029 % create data vector
0030 data=zeros(size(igt,1),912);
0031 for i = 1:32
0032     for j = 1:32
0033         if igt_m(i,j)>0 
0034             data(:,greit_m(i,j)) = igt(:,igt_m(i,j));
0035         end
0036     end
0037 end
0038 
0039 img.elem_data = data';

Generated on Wed 21-Jun-2017 09:29:07 by m2html © 2005