help > Also having problem saving mask
Showing 1-10 of 10 posts
Display:
Results per page:
Jul 2, 2013  06:07 AM | Hsiang-Yuan Lin
Also having problem saving mask
hi

I also had problem saving the mask as following

02-Jul-2013 14:38:00 | FATAL | wfu_pickatlas.m | MException thrown. Stack follows:
02-Jul-2013 14:38:00 | FATAL | create_each | Line 0029: Unable to write header for "/Users/louislin/Documents/Imaging/1.nii".
02-Jul-2013 14:38:00 | FATAL | create | Line 0015
02-Jul-2013 14:38:00 | FATAL | create_vol | Line 0162
02-Jul-2013 14:38:00 | FATAL | spm_create_vol | Line 0016
02-Jul-2013 14:38:00 | FATAL | spm_write_vol | Line 0082
02-Jul-2013 14:38:00 | FATAL | SaveMask | Line 2241
02-Jul-2013 14:38:00 | FATAL | cmdSaveMask_Callback | Line 0992
02-Jul-2013 14:38:00 | FATAL | wfu_pickatlas | Line 0110
02-Jul-2013 14:38:00 | FATAL | @(hObject,eventdata)wfu_pickatlas('cmdSaveMask_Callback',hObject,eventdata,guidata(hObject)) | Line 0000
>>

I run pickatlas on matlab2011b system. SPM8 r5236, pickatlas 3.0.4. 
I've already downloaded and replaced the patch files for matlab 2011b
But still having problem saving the images.

Please kindly help me solve the problem
Thank you very much
Jul 2, 2013  12:07 PM | Benjamin Wagner - UT Southwestern Medical Center
RE: Also having problem saving mask
Hello,

With an error that deep, I would check these items:

1)  Do you have permissions/abilities to add/create files in: /Users/louislin/Documents/Imaging
2)  Is there enough disk space at the write location?
3)  Do a 'which spm_write_vol' and 'which spm_create_vol'.  These should be files in your SPM installation and not any other toolbox.

If all of these things come up good, please let me know and I'll look into this further.

Ben
Jul 8, 2013  06:07 AM | Hsiang-Yuan Lin
RE: Also having problem saving mask
Hi, Ben,

Sorry for late reply due to short holidays. I have run which 'spm_write_vol' and 'which spm_create_vol', both were located in the folder where I installed SPM. There is no problem regarding permissions and disk space in Documents/Imaging.

Thank you for your help.

Best,
Hsiang-Yuan
Jul 8, 2013  06:07 AM | Hsiang-Yuan Lin
RE: Also having problem saving mask
BTW, I run the program on MAC OS X10.8.4 with CPU 2.7 GHz Intel core i5, and RAM 8GB
Thank you very much

Hsiang-Yuan
Jul 8, 2013  01:07 PM | Benjamin Wagner - UT Southwestern Medical Center
RE: Also having problem saving mask
The error appears to happen in write_hdr_raw (SPM8/@nifti/private).  I would suggest placing a breakpoint at the top of that function and stepping through until the "ok" variable is false.  If you could do this from your machine it would shed a lot more light on the subject.

Ben
Jul 18, 2013  06:07 AM | Hsiang-Yuan Lin
RE: Also having problem saving mask
hello Ben,

Thank you for your advice and help. I have difficulty practicing your suggestion owing to that I am not from a background of EE or computer science. Is it helpful to paste all the command line of 'write_hdr_raw' on the forum?

Best,
Hsiang-Yuan
Jul 19, 2013  04:07 PM | Chris McNorgan
RE: Also having problem saving mask
As it happens, I was just debugging this problem now. My hunch is that it is related to the fact that we just got ourselves a new computer running a more recent version of Matlab (2013a). We are using pickatlas version 3.0.3. Previously, we had been running 2010b, also with pickatlas version 3.0.3, and it works (pretty much) just fine. I just verified the process on our old computer (running matlab 2010b), and successfully saved a .nii file. However, I did note that doing so generates a warning: 

Warning: The fourth output, VERSN, of FILEPARTS will be removed in a future release.
> In fileparts at 35
In wfu_pickatlas>SaveMask at 2178
In wfu_piackatlas>cmdSaveMask_callback at 954
In wfu_pickatlas at 110

So the fix is to remove the versn output from fileparts by changing line 2178 to read:
[pathstr, name, ext] = fileparts(outfilename)

The change to FILEPARTS has wrecked many SPM toolboxes for us, so be on the lookout for this problem using other SPM plugins (e.g., marsbar) when upgrading to a newer version of MATLAB. I'd also suggest doing a grep for FILEPARTS in other pickatlas scripts.

Cheers,
Chris
Jul 23, 2013  02:07 PM | Benjamin Wagner - UT Southwestern Medical Center
RE: Also having problem saving mask
Chris,
  This is basically why 3.0.4 was released.

Best,
Ben Wagner
ANSIR Lab
Jul 23, 2013  02:07 PM | Benjamin Wagner - UT Southwestern Medical Center
RE: Also having problem saving mask
Hello again,
  Sorry for the delay, I have been away from the office.  There are some other items that may be less technical that we can try.  Please try this on the matlab commandline:

restoredefaultpath
addpath /your/path/to/SPM
addpath /your/path/to/wfu_pickatlas
wfu_pickatlas

Then try to save the file again.  Also, try saving in your home directory.

Ben
Originally posted by Hsiang-Yuan Lin:
hello Ben,

Thank you for your advice and help. I have difficulty practicing your suggestion owing to that I am not from a background of EE or computer science. Is it helpful to paste all the command line of 'write_hdr_raw' on the forum?

Best,
Hsiang-Yuan
Aug 9, 2013  04:08 AM | Hsiang-Yuan Lin
RE: Also having problem saving mask
Hi, Ben,

Sorry for late reply due to out of office. It works at your suggestion. Thank you very much

Hsiang-Yuan