Are you changing the matrices in the image headers as well as the
seg8.mat ?
If I was to to segment anatomical data before coregistering it with EPI,
I would suggest that the coregistration moves the EPI to align with the
anatomical data, rather than the other way around. It's a lot easier.
Best regards,
-John
On Wed, 2009-09-02 at 16:42 +0200, Marko Wilke wrote:
> Hi John,
>
> thanks for the reply. However, I still seem to be doing something
> wrong... within the framework of standard "unified segmentation", I used
> to do
>
> x = spm_coreg(epi,gm);
> M = inv(spm_matrix(x));
> % then apply to T1, gm, wm, csf..., then update seg_sn.mat
>
> sn_file = fullfile(p, [nm '_seg_sn.mat']);
> load(sn_file);
> VF.mat = M * VF.mat; % order matters!
> save(sn_file,'VG','VF','Tr','Affine','flags');
>
> but if I now try the same in seg8, neither
>
> res.image.mat = M * res.image.mat;
>
> nor
> res.image.mat = res.image.mat * M;
>
> works: when I save and use the resulting y_... to warp the gm partition,
> it is very off (mainly shifted anteriorly) while it was ok before I
> fiddled with it. As always, any advice is appreciated!
>
> Best,
> Marko
>
>
> > Yep. You can modify the image.mat field to update the positional
> > information to keep the information in the seg8.mat in alignment with
> > the original images after they've been moved.
> >
> > All the best,
> > -John
> >
> >
> > On Sat, 2009-08-29 at 02:47 +0200, Marko Wilke wrote:
> >> Dear All,
> >>
> >> I would like to apply a transformation matrix to an image after it has
> >> been segmented. As I then want to use the seg8-file to warp the image, I
> >> guess that I will have to update the positional information in the
> >> seg8-file such that ensuing warping "knows" that the original images
> >> were moved.
> >>
> >> I used to be able to coregister my gray matter partition and use that
> >> transformation to update VF.mat in seg_sn.mat. However, within seg8, I
> >> am not sure which matrix to update, as there is Affine, MT, image.mat,
> >> or tpm(:).mat. I realize I could systematically try these, so I guess I
> >> have to freely admit I am being lazy about this :) Would anyone still be
> >> able to point me in the right direction?
> >>
> >> Thanks in advance,
> >> Marko
> >>
>
--
John Ashburner <[log in to unmask]>
|