Back to PLS Help

importing nifti files
archived_post
Posted on 02/02/07 11:19:56
Number of posts: 100
archived_post posts:

Author: Agatha (---.csbmb.Princeton.EDU)
Date: 10-24-06 14:08

hi all ~

i am trying to analyze AFNI-analyzed files using the PLS gui. i have all runs preprocessed and concatenated into one long run (3072 TRs) - i have one such file for each subject. and these were converted to .nii format using 3dAFNItoNIFTI.

my problem - the files are multiple scan files in 1 file - which PLS doesn't like. when i tried converting it to 1 file/scan using expand_nii_scan.m matlab ran out of memory... (see below).

i analyze all my data as one concatenated run - rather than as multiple runs. can i read these .nii files into PLS in any shape or form ...or do i need to un-concatenate (i assume there is a shell command to do this?) and convert as separate runs (this is inconvenient b/c all my data and all my regressors are currently saved as single files ..but doable).


thanks in advance ~
agatha


>> expand_nii_scan('ab_allruns_mdnSm6ZR.nii')
MATLAB(24486,0xa000ed98) malloc: *** vm_allocate(size=1793069056) failed (error code=3)
MATLAB(24486,0xa000ed98) malloc: *** error: can't allocate region
MATLAB(24486,0xa000ed98) malloc: *** set a breakpoint in szone_error to debug
??? Error using ==> double
Out of memory. Type HELP MEMORY for your options.

Error in ==> load_nii_img>read_image at 246
hdr.dime.glmax = max(double(img(:)));

Error in ==> load_nii_img at 62
[img,hdr] = read_image(hdr,filetype,fileprefix,machine,img_idx,old_RGB);

Error in ==> load_nii at 66
[nii.img,nii.hdr] = ...

Error in ==> expand_nii_scan at 14
nii = load_nii(filename, img_idx);

Replies:

Re: importing nifti files
archived_post
Posted on 02/02/07 11:22:53
Number of posts: 100
archived_post replies:

Author: Agatha (---.csbmb.Princeton.EDU)
Date:   10-24-06 14:40

fyi ...i do have a work-around in the mean time... i expand the .nii files a subset of volumes at-a-time using the index option in the command...
al.


Re: importing nifti files
archived_post
Posted on 02/02/07 11:24:28
Number of posts: 100
archived_post replies:

Author: Randy (---.rotman-baycrest.on.ca)
Date:   10-31-06 09:53

Hi Agatha,

PLSgui is able to read 4D NIFTI files, and we are doing this routinely with fMRI data, so I am not sure what is happening. What is the error message you get from the GUI?

Randy


Re: importing nifti files
archived_post
Posted on 02/02/07 11:25:10
Number of posts: 100
archived_post replies:

Author: Jimmy (---.rotman-baycrest.on.ca)
Date:   11-01-06 13:33

> my problem - the files are multiple scan files in 1 file -
> which PLS doesn't like.

Are you doing PET analysis? If you are doing fMRI analysis, could you please tell me more details why PLS doesn't like multiple scans in 1 file?

> when i tried converting it to 1
> file/scan using expand_nii_scan.m matlab ran out of memory...
> (see below).

Because you were trying to load all 3072 TRs at once, you got "out of memory...". If you expand a few at a time, it will be fine.

In addition, "expand_nii_scan.m" is designed for PET only. For fMRI, you should use the .nii files with multiple scans in 1 file. This way, the PLSgui program only load whatever scans you specified in the onset fields in "Run Information" window.



Login to reply to this topic.

Contact Us:

3560 Bathurst Street
Toronto, Ontario
Canada M6A 2E1
Phone: (416) 785-2500

Baycrest is an academic health sciences centre fully affiliated with the University of Toronto