Are you using Matlab 6.5? I have a vague recollection of there being some
kind of a glitch that may cause similar problems. If you use Matlab 6.1,
then the problem may go away.
Alternatively, if there are any .mat files associated with
your images, make sure that there isn't anything that could represent a
large translation in the y direction. This could cause a lot of the data
to be masked out.
Best regards,
-John
> I have written the following snippet to normalize a structural image and
> then apply the same transformation to any other image which is in the same
> coregistered space. However, the procedure seems to leave out part of the
> frontal lobe in the rest of the images (PF,PO -- see below) but not the
> structural image (PG). Any suggestions are welcome.
> Output image:
>
> http://www.cns.bu.edu/~satra/pub/missingfront.jpg
>
> Code snippet:
> Calling program:
> roi_fullnormalize_subject(PG,PF);
> roi_fullnormalize_subject(PG,P);
>
> Called program:
> function roi_fullnormalize_subject(PF,PO)
> % ROI_FULLNORMALIZE_SUBJECT Performs affine normalization Structural
> % images
> % ROI_FULLNORMALIZE_SUBJECT(PF) Takes the analyze filename and
> % normalizes it to the template T1.mnc and writes the normalized file and
> % the parameters in the same directory as original data
> %
> % ROI_FULLNORMALIZE_SUBJECT(PF,PO) applies the same transformation to
> % all the remaining images specified in PO
> %
> % If the normalized image exists, then no normalization is performed, but
> % for any image brought along a normalized version of that image is
> % written.
>
> % Satrajit Ghosh, SpeechLab, Boston University. (c)2001
>
> spm_defaults;
> defs = defaults.normalise;
> clear defaults;
>
> roi_write_log('roi_normalize: Performing Full Normalization');
> VG = fullfile(spm('dir'),'templates','T1.mnc');
> matname = [spm_str_manip(PF,'sd') '_fullsn.mat'];
> if ~exist(matname,'file'),
> VWG ='';
> VWF ='';
> flags = defs.estimate;
> spm_normalise(VG,PF,matname,VWG,VWF,flags);
>
> flags = defs.write;
> % Write the structural image with a high resolution
> flags.vox = [1 1 1];
> spm_write_sn(PF,matname,flags);
> end;
>
> if nargin==2,
> flags = defs.write;
> % Assuming the PO generally contains the hires and functional images,
> they
> % are written with a lower resolution.
> spm_write_sn(PO,matname,flags);
> end;
>
> roi_write_log('roi_normalize: Done');
--
Dr John Ashburner.
Functional Imaging Lab., 12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420 http://www.fil.ion.ucl.ac.uk/~john
|