I think I've figured out the cause of the problem. In spm5/src/spm_mapping.c,
the code uses:
dim[0]*dim[1]*dim[2]*dsize/8
Because multiplication is done from left-to-right and the largest allowable 32
bit signed integer is 2^31-1, this results in problems if the size of a
volume is greater than (2^31-1)/8/1024^2 Mbytes (ie 256 Mbytes). I have now
changed the source code (for the next SPM release) so that it uses:
dim[0]*dim[1]*dim[2]*(dsize/8)
This should fix the problem (after a re-compilation) and allow volumes of up
to 2048 Mbytes. The changed file is attached to this email.
Best regards,
-John
On Friday 29 August 2008 09:39, Lucas Eggert wrote:
> It is strange: Here is the test that I did with one of the structual images
> of the spm-sample datasets and two structurals of two studies of our own
> lab:
>
> original
> bias corrected
>
> spm-sample 256*256*54 int16 6.8MB -1*1*3 256*256*54
> float32 13.5MB -1*1*3 viewable
>
> test1
> 320*512*512 int16 160MB -0.5*0.5*0.5 320*512*512 float32 320MB -0.5*0.5*0
>.5 not viewable
>
> test2
> 512*512*320 int16 160MB -0.5*0.5*0.5 512*512*320 float32 320MB -0.5*0.5*0.
>5 not viewable
>
> Is it possible that SPM can simply not handle images of this size? Because
> it is no problem e.g. to open all images with freesurfers tkmedit.
>
> All the best,
> - Lucas
>
> > -----Ursprüngliche Nachricht-----
> > Von: "John Ashburner" <[log in to unmask]>
> > Gesendet: 28.08.08 12:18:02
> > An: [log in to unmask]
> > Betreff: Re: [SPM] Problems viewing bias corrected image
> >
> >
> > I'm not sure what the cause of this problem is. If the dimensions are
> > 512*512*320, then the size of the file seems to be correct (for a
> > floating point image, requireing 4 bytes per voxel). Is it possible that
> > you may have tried to display the bias corrected image before SPM had
> > finished writing it?
> >
> > Best regards,
> > -John
> >
> > On Thursday 28 August 2008 09:53, Lu Eggert wrote:
> > > Dear List,
> > >
> > > I segmented a T1 image with SPM5 default settings. I can view the
> > > resulting gray matter and white matter images with SPM-Display without
> > > any problem. Trying the same with the bias corrected image gives the
> > > following error message:
> > >
> > > ****************************
> > >
> > > mt1_huntington_example.img" can not be resampled
> > > ??? Error using ==> spm_sample_vol
> > > File too small.
> > >
> > > Error in ==> spm_orthviews>cm_pos at 1843
> > >
> > > set(findobj(st.vols{i}.ax{1}.cm,'UserData','v_value'),...
> > >
> > > Error in ==> spm_orthviews at 258cm_pos;
> > >
> > > Error in ==> spm_orthviews>addcontexts at 762
> > > spm_orthviews('reposition',spm_orthviews('pos'));
> > >
> > > Error in ==> spm_orthviews at 395 addcontexts(handles);
> > >
> > > Error in ==> spm_check_registration at 44
> > > spm_orthviews('AddContext',handle(ij));
> > >
> > > Error in ==> spm_config_checkreg>dispims at 45
> > > spm_check_registration(job);
> > >
> > > Error in ==> spm_jobman>run_struct1 at 1474 feval(prog,val);
> > >
> > > Error in ==> spm_jobman>run_struct1 at 1482 run_struct1(c.val{i});
> > >
> > > Error in ==> spm_jobman>run_struct1 at 1482 run_struct1(c.val{i});
> > >
> > > Error in ==> spm_jobman>run_job at 417 run_struct1(c);
> > >
> > > Error in ==> spm_jobman>serial at 2039 run_job(jobs);
> > >
> > > Error in ==> spm_jobman at 70 serial(varargin{2:nargin});
> > >
> > > ??? Error while evaluating uicontrol Callback
> > >
> > >
> > >
> > > ****************************
> > >
> > > The dimensions of the raw, as well as of the bias corrected image is
> > > 512*512*320.
> > >
> > > Trying "spm_slice_vol" gives:
> > >
> > > ??? Error using ==> spm_slice_vol
> > > Incorrect usage.
> > >
> > > The raw file is 160MB, the bias corrected 320MB.
> > >
> > >
> > > Thank you very much for your help!
> > >
> > > Lucas
> > >
> > >
> > > _______________________________________________________________________
> > > Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
> > > kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
>
> ________________________________________________________________________
> Schon gehört? Bei WEB.DE gibt' s viele kostenlose Spiele:
> http://games.entertainment.web.de/de/entertainment/games/free/index.html
|