Try setting the bounding box to Nan*ones(2,3), and the voxel sizes to
[NaN NaN NaN]. This should cause the spatially normalized images to be
written with the same dimensions, voxel sizes etc as the template image.
Best regards,
-John
-----Original Message-----
From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]]
On Behalf Of burak ozkalayci
Sent: Tuesday, June 19, 2007 6:56 PM
To: [log in to unmask]
Subject: [SPM] normalise:write creates larger volumes
Dear SPMers,
I am just trying to label my subjects using a labeled template by the
help of normalization in SPM5. My procedure is like this:
1- Coregister the template subject to study subject by keeping the
labels volume remained in alignment to template subject.
2- Normalise:Estimate the template subject to study subject.
3- Normalise:Write the labels volume (and template subject to check)
using the parameters of normalise:estimate with the same bounding box
and voxel size of the study subject.
at the end I expect to have the warped labeled volume to have exactly
the same dimensions with the study subject. However the warped label
volume has different dimensions (like 222X295X276 where the study
subject is 256X256X176). In addition, the voxel sizes are same in two
volumes. The bounding box of the warped label volume seem to does not
match the one I give in the normalise:write options (given bb=
-99.3695 -113.0604 -151.4204; 90.1056 139.2178
96.7423 and the bb of the written volume = -110.6061 -118.2493
-130.9210; 167.5320 116.1662 153.7943). I also tried spm_write_sn to
warp the but it gives the same results.
More interestingly I checked registration in spm and the written
template volume seem to be normalized to subject volume. However there
exists unused black regions in the registration check due to that size
dismatch in the written volumes. I attach a pdf from the check
registration also.
I could not figured it out why the written volumes' sizes and bounding
boxes do not match with the study subject. Can anybody help me to
overcome this problem. Many thanks in advance.
Burak
I calculate bounding box of a volume by a part of the code given by John
in this maillist. I attach that part of the code:
function bb = get_bb(imgname)
% world-bb -- get bounding box in world (mm) coordinates
V = spm_vol(imgname);
d = V.dim(1:3);
% corners in voxel-space
c = [ 1 1 1 1
1 1 d(3) 1
1 d(2) 1 1
1 d(2) d(3) 1
d(1) 1 1 1
d(1) 1 d(3) 1
d(1) d(2) 1 1
d(1) d(2) d(3) 1 ]';
% corners in world-space
tc = V.mat(1:3,1:4)*c;
% reflect in x if required
if spm_flip_analyze_images; tc(1,:) = -tc(1,:); end;
% bounding box (world) min and max
mn = min(tc,[],2)';
mx = max(tc,[],2)';
bb = [mn; mx];
|