Cant map view of file

362 views
Skip to first unread message

George Christopoulos

unread,
Jun 9, 2008, 9:57:29 AM6/9/08
to mvpa-t...@googlegroups.com

Hi,


No matter what I tried, I keep receiving this error:


??? Cant map view of file.  It may be locked by another program.

 Error in ==> spm_read_vols at 34

            Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0);

 Error in ==> load_analyze_pattern at 155

     [Vdata] = spm_read_vols(curvol);

 Error in ==> tutorial_easy_spm_yorgos_real at 66

subj = load_analyze_pattern(subj,'epi','bigmac',raw_filenames);

I tried all the usual suspets, such as restarting matlab, rebooting, changing image names, changing image location , changing folder location or even trying another computer and the outcome was the same

Any clues?

George

Greg Detre

unread,
Jun 9, 2008, 10:36:18 AM6/9/08
to mvpa-t...@googlegroups.com
can you read the file in spm?

g


--


---
Greg Detre
cell: 617 642 3902
email: gr...@gregdetre.co.uk
web: http://www.princeton.edu/~gdetre/

George Christopoulos

unread,
Jun 9, 2008, 5:32:56 PM6/9/08
to mvpa-t...@googlegroups.com
I re-downloaded everything (mvpa toolboxes etc.) and now it works fine.

George Christopoulos

unread,
Jun 11, 2008, 8:51:26 AM6/11/08
to mvpa-t...@googlegroups.com
Hi,

unfortunately and very annoyingly  this error


??? Cant map view of file.  It may be locked by another program.

 Error in ==> spm_read_vols at 34

            Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0);

 Error in ==> load_analyze_pattern at 155

     [Vdata] = spm_read_vols(curvol);

 Error in ==> tutorial_easy_spm_yorgos_real at 66

subj = load_analyze_pattern(subj,'epi','ofc',raw_filenames);


 keeps appearing.

This is a strange error because I have not been able to find a pattern on when it appears. I can run exactly the same script one or two times and in the next time I run it, it produces the error.

I have figured out a solution, which might make the things easier to diagnose the problem. After the run is produced, the script runs smoothly if I change the mask (at load_analyze_mask). Notice that I have to introduce a totally NEW mask - if I just rename the old one then the problem remains. This holds even if I restart the computer.

Hope you can help

Thanks

George

2008/6/9 George Christopoulos <georc...@googlemail.com>:

georc...@googlemail.com

unread,
Jun 11, 2008, 10:18:53 AM6/11/08
to Princeton MVPA Toolbox for Matlab
Ah and yes I can view the files at spm

georc...@googlemail.com

unread,
Jun 11, 2008, 10:51:43 AM6/11/08
to Princeton MVPA Toolbox for Matlab
Actually the solution I described also does not work most of the
times. I do not know what the error could be.

Greg Detre

unread,
Jun 11, 2008, 10:55:12 AM6/11/08
to mvpa-t...@googlegroups.com
garrett and i were discussing this, and we're not sure what could be
causing this. the problem is in a low-level SPM mex file that we think
does some kind of memory mapping of the file. we don't know why the
locking would break when using load_analyze_pattern.m, and why this
isn't a more widespread problem. has anybody else on the list
experienced this too?

is it possible that you're using SPM at the same time to access the
file, or some anti-virus program?

what version of windows are you running?

we may have to contact the SPM list to see if they have any ideas

g


georc...@googlemail.com wrote:
> Actually the solution I described also does not work most of the
> times. I do not know what the error could be.
> >
>

George Christopoulos

unread,
Jun 11, 2008, 3:55:29 PM6/11/08
to mvpa-t...@googlegroups.com
It seems that everything depends on the mask. Some masks are good, i.e. the error never appears, whereas others always produce the error. I attach a 'good' (rINSULA.img) and a 'bad' mask (rINF_OPER_TRI_ORB.img) to check it out if you can, cause I could not spot any differences.

I recall having a similar problem many months ago in SPM5 (not SPM2), but it was solved by downloading the new SPM. SPM is off, so I do not think that it is the one that is locking it. I tried a 2nd computer and the problems still remains.

I am using Windows XP.

g

2008/6/11 Greg Detre <gde...@princeton.edu>:
rINSULA.hdr
rINSULA.img
rINF_OPER_TRI_ORB.hdr
rINF_OPER_TRI_ORB.img

Greg Detre

unread,
Jun 11, 2008, 4:38:10 PM6/11/08
to mvpa-t...@googlegroups.com
is there a difference in the way you generated the masks?

g


George Christopoulos wrote:
> It seems that everything depends on the mask. Some masks are good,
> i.e. the error never appears, whereas others always produce the error.
> I attach a 'good' (rINSULA.img) and a 'bad' mask
> (rINF_OPER_TRI_ORB.img) to check it out if you can, cause I could not
> spot any differences.
>
> I recall having a similar problem many months ago in SPM5 (not SPM2),
> but it was solved by downloading the new SPM. SPM is off, so I do not
> think that it is the one that is locking it. I tried a 2nd computer
> and the problems still remains.
>
> I am using Windows XP.
>
> g
>

> 2008/6/11 Greg Detre <gde...@princeton.edu <mailto:gde...@princeton.edu>>:


>
>
> garrett and i were discussing this, and we're not sure what could be
> causing this. the problem is in a low-level SPM mex file that we think
> does some kind of memory mapping of the file. we don't know why the
> locking would break when using load_analyze_pattern.m, and why this
> isn't a more widespread problem. has anybody else on the list
> experienced this too?
>
> is it possible that you're using SPM at the same time to access the
> file, or some anti-virus program?
>
> what version of windows are you running?
>
> we may have to contact the SPM list to see if they have any ideas
>
> g
>
>

> georc...@googlemail.com <mailto:georc...@googlemail.com> wrote:
> > Actually the solution I described also does not work most of the
> > times. I do not know what the error could be.
> > >
> >
>
>
> --
>
>
> ---
> Greg Detre
> cell: 617 642 3902

> email: gr...@gregdetre.co.uk <mailto:gr...@gregdetre.co.uk>
> web: http://www.princeton.edu/~gdetre/
> <http://www.princeton.edu/%7Egdetre/>

George Christopoulos

unread,
Jun 11, 2008, 4:47:58 PM6/11/08
to mvpa-t...@googlegroups.com
No, I generated both in the same way, using Pickatlas

Greg Detre

unread,
Jun 11, 2008, 5:01:34 PM6/11/08
to mvpa-t...@googlegroups.com
ok. if you regenerate a problematic mask and it still causes a problem,
then it's possible it's an SPM bug...

g


George Christopoulos wrote:
> No, I generated both in the same way, using Pickatlas
>
>

Garrett McGrath

unread,
Jun 11, 2008, 5:16:40 PM6/11/08
to Princeton MVPA Toolbox for Matlab
Ok, having talked this over with Greg a bit we are going to recommend
you post the question over to the SPM toolset forums as the failure
appears to be happening inside on of their mex files. The version of
SPM that you should be using is the SPM2 package as we are heavily
dependent on the for actually opening the files (load_analyze_pattern
is just a wrapper of the spm load functions to give things an MVPA
context.) The first step here is probobly going to be to update your
SPM install to make sure you have the most recent version. If that
doesn't help I think they will be the best equipped to handle
questions about the internals of their system, I'll be following along
on the mailing list to figure out what's going on as well.

On Jun 11, 4:47 pm, "George Christopoulos" <georchr...@googlemail.com>
wrote:

Garrett McGrath

unread,
Jun 11, 2008, 5:27:45 PM6/11/08
to Greg Detre, Mvpa_support_list

Ack, it is spm5. My apologies.

Greg Detre wrote:
> did you mean SPM2? SPM5 is the latest version
>
> g

George Christopoulos

unread,
Jun 11, 2008, 5:30:26 PM6/11/08
to mvpa-t...@googlegroups.com
Till now I have used SPM5, which was fine except from the error above. If I use SPM2, the following error appears

??? Invalid MEX-file 'C:\Documents and Settings\George\My Documents\Downloads\spm2lats11june\spm2\spm_slice_vol.dll': The specified procedure could not be found.

.

Error in ==> spm_read_vols at 35

    Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0);

Error in ==> load_analyze_mask at 50
V = spm_read_vols(vol);

Error in ==> tutorial_easy_spm_yorgos_realsubj1 at 23
subj = load_analyze_mask(subj,'bigmac18', 'rINSULA.img');%prosexe to r

Garrett McGrath

unread,
Jun 12, 2008, 10:59:59 AM6/12/08
to Princeton MVPA Toolbox for Matlab
Yea, I mistyped it's SPM5 that we are using both for testing in unix
and windows.

>any ideas what I should write? Shall I write them that I tried to use your toolbox? Maybe some more specifications on where you assume that the error might be would be helpful for them

>Thanks
>George

I would just explain what you are doing and copy them the error
documentation above. The 'error in spm_read_vols at 34' seems to be
the really critical part.

??? Cant map view of file. It may be locked by another program.

Error in ==> spm_read_vols at 34

Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0
p]),V(i).dim(1:2),0);

Error in ==> load_analyze_pattern at 155

[Vdata] = spm_read_vols(curvol);

Error in ==> tutorial_easy_spm_yorgos_real at 66

subj = load_analyze_pattern(subj,'epi','ofc',raw_filenames);


On Jun 11, 5:30 pm, "George Christopoulos" <georchr...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages