hi Christian:
I think you are right, to save those data into NifTI format with save_avw is a good way. But when I was doing that, an errors occurred like that:
ERROR:: Environment variable FSLOUTPUTTYPE is not set!
Please make sure that the appropriate configuration file is sourced by your shell (e.g. by putting it in .profile).
e.g. bash or sh users add the line ". ${FSLDIR}/etc/fslconf/fsl.sh"
e.g. tcsh or csh users add the line "source ${FSLDIR}/etc/fslconf/fsl.csh"
I didn't keep "${FSLDIR}/etc/fslconf/fsl.sh" in those FSL matlab files. I simply replaced every of them with the real path manually. Now, reading NifTI data with read_avw is ok, but saving is not. I checked my .bash_profile and .bashrc as the error mentioned above, and they both look fine, the "${FSLDIR}/etc/fslconf/fsl.sh" has already included.
I saw a "FSLOUTPUTTYPE" in save_avw_hdr.m, but I dont know how to deal with that. Any suggestion that I could either correctly set my envioronment or keep my current setting but give those envioronment variable a correct value?
My computer in a Mac G5, matlab is in the application folder.
Thanks a lot in advance
Xuelin
----- Original Message -----
From: Christian Beckmann <[log in to unmask]>
Date: Tuesday, July 24, 2007 1:25 am
Subject: Re: [FSL] question on data precision when reading/writing data of MELODIC results
To: [log in to unmask]
> Hi
>
> It'll depend on what you want to do with the data. If you want to
> use
> any of the FSL tools on the saved file why don't you simply use the
>
> save_avw functions that we provide? This will the save your data as
> a
> NIFTI file. You need to reshape the data back into volume or 4D
> format first in matlab, then call
>
> save_avw(data,'filename','f',[xsize,ysize, zsize,tsize])
>
> where filename is the desired name, 'f' will save the data in
> floats
> and [xsize,ysize,zsize,tsize] are the voxel dimensions and the TR,
> e.g.
> save_avw(data,'blah','f',[4 4 6 3])
>
> will save data into a file blah.nii.gz with voxel dimes of 4x4x6 mm
>
> and a tr of 3sec
>
> hope this helps
> christian
>
> On 24 Jul 2007, at 11:29, Xuelin Cui wrote:
>
> > hi all:
> >
> > I can read data(IC spatial map) from MELODIC results. Then I
> simply
> > reshaped the data into a 2D matrix with each row represent a
> single
> > spatial IC. But when I was trying to write the 2D matrix in to
> > another *.txt file, I had problem. I am not sure which data type
> > and mechine type I should choose in matlab command 'fopen(fid,
> > matrix, precision, mechinetype)', 'fwrite(fid, matrix, precision,
>
> > mechinetype)' . Namely , the last 2 parameters in these 2
> command.
> > Any suggestions?
> >
> > Or, maybe I should create a *.dat file to save the 2D matrix? or
> > any other file formats?
> >
> > Thanks
> >
> > Xuelin
> > ****************************************
> > Xuelin Cui
> > Department of Electrical Engineering
> > University of Hawaii-Manoa
> > Honolulu HI 96822
> >
> > Tel: 1-808-349-0983
> > Email: [log in to unmask]
> > ****************************************
>
> ____
> Christian F. Beckmann
> University Research Lecturer
> Oxford University Centre for Functional MRI of the Brain (FMRIB)
> John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK.
> [log in to unmask] http://www.fmrib.ox.ac.uk/~beckmann
> tel: +44 1865 222551 fax: +44 1865 222717
>
|