Path: news.mathworks.com!not-for-mail
From: "Nico zanette" <zannakill@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sagittal slice from a txt file
Date: Tue, 10 Feb 2009 14:15:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 48
Message-ID: <gms257$b9t$1@fred.mathworks.com>
References: <gmrnuu$hdo$1@fred.mathworks.com> <gmrqsl$lnt$1@fred.mathworks.com> <gms0ii$qb9$1@fred.mathworks.com> <gms0q1$c6p$1@fred.mathworks.com>
Reply-To: "Nico zanette" <zannakill@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1234275303 11581 172.30.248.37 (10 Feb 2009 14:15:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 10 Feb 2009 14:15:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1707770
Xref: news.mathworks.com comp.soft-sys.matlab:517315


"David" <dave@bigcompany.com> wrote in message <gms0q1$c6p$1@fred.mathworks.com>...
> "Nico zanette" <zannakill@hotmail.com> wrote in message <gms0ii$qb9$1@fred.mathworks.com>...
> > "David" <dave@bigcompany.com> wrote in message <gmrqsl$lnt$1@fred.mathworks.com>...
> > > "Nico zanette" <zannakill@hotmail.com> wrote in message <gmrnuu$hdo$1@fred.mathworks.com>...
> > > > Hello
> > > > I'm in trouble, I need to obtain a MR image from a txt file. 
> > > > The file contains a single column of data, with each row representing a different voxel in the grid. The data file was generated using the following ordering of grid cells: 
> > > > 
> > > > for kk=1:s3 
> > > >   for jj=1:s2 
> > > >     for ii=1:s1 
> > > >       fprintf(fid,'%1.1f\n',ARRAY(ii,jj,kk)); 
> > > >     end 
> > > >   end 
> > > > end 
> > > > where the dimension of ARRAY is [s1 x s2 x s3] 
> > > > 
> > > > I need to transform this file into a 3d image. After this i need to take sagittal slices from the 3d image.
> > > > 
> > > > Somebody can help me?
> > > > 
> > > > Thanks.
> > > 
> > > well, i would guess the first step is to reverse the writing process to read the data back into the workspace.  Then its just a simple matter of displaying it however you want.
> > 
> > In the command window I load the txt file withe the LOAD command, but I don't know how to obtain the 3d image. Using the PLOT command, the mathlab give me only a 3d figure totally blank, only with the x,y,z axys. I'm sure that the txt file is really load by mathlab. 
> 
> what are the dimensions of the data when you have loaded it back into the workspace?  and exactly what plot command do you use?

>> whos
  Name         Size                            Bytes  Class

  ARRAY       20x4x2                            1280  double array
  ans          1x1                                 8  double array
  ii           1x1                                 8  double array
  index        1x1                                 8  double array
  jj           1x1                                 8  double array
  kk           1x1                                 8  double array
  mtype 27842650x1                         222741200  double array
  s1           1x1                                 8  double array
  s2           1x1                                 8  double array
  s3           1x1                                 8  double array

Grand total is 27842818 elements using 222742544 bytes

the txt file is called mtype, it is such a big file.
I try, simply, with >>plot (mtype);
i try also by plotting only x or y axys with no results.