I took a look at the data, and have replicated the problem that you
encountered. The reason why the problems occurred was because of the
second matrix saved in the headers of the u_*.nii file. For some
reason, this matrix was the same as that of the main matrix. It can be
resolved by copying the matrix from the rc1*.nii image to u_*.nii:
P1 = 'rc1xvolym1n.nii';
P2 = 'u_Template_6_Template_37pairsofsubjects.nii';
N1 = nifti(P1);
N2 = nifti(P2);
N2.mat0 = N1.mat0;
create(N2)
The matrix info in the u_*.nii files is usually inherited from the
rc1*.nii files, so the header appears to have changed for some reason.
I'm not sure what this reason was.
Best regards,
-John
On Fri, 2010-02-12 at 02:32 -0800, Alireza Salamy wrote:
> Dear John,
>
> I hope this does not sound bugging but we really feel this might be a
> sort of bug in the code that causes the problem.To make it easy, I put
> c1 and rc1 images of one subject beside the flow field and final
> template, on a ftp address so you could easily see that the results
> are weird!
> ftp://ftp.physiol.umu.se/fysiologi/out/Alireza/
>
> As you suggested we used the code and c1 and rc1 looks to be aligned
> to each other (so it could not be the matter of repositioning) but
> when I normalize and warp rc1 the results are quit better in alignment
> with MNI compare to the case in which c1 were normalized and wrapped!
> Obviously, in the case of one subject, it could not be the case of
> disordering the flow files and images.
>
> I also put the batch that I ran on the ftp so you can easily see how I
> ran the the analysis.
> We discuss this with some colleagues and they believe that it is
> really weird!
> Thanks a lot in advance for your help!
> /Alireza
>
>
> --- On Thu, 2/11/10, John Ashburner <[log in to unmask]> wrote:
>
>
> From: John Ashburner <[log in to unmask]>
> Subject: Re: [SPM] Dartel Normalization
> To: [log in to unmask]
> Date: Thursday, February 11, 2010, 9:16 PM
>
> Could there have been a mis-match between the order in which
> the flow
> field file names were selected, and the order that the c1
> images were
> selected? If you are using the latest version of SPM8, then
> the
> normalise to MNI space option should be working properly (as
> described
> in the manual).
>
> Best regards,
> -John
>
> On Thu, 2010-02-11 at 09:21 -0800, Alireza Salamy wrote:
> > Thanks a lot John!
> >
> > It seems that they are perfectly align. My last question
> which is
> > still unknown is why then the results is different when we
> apply
> > wrapping to rc1 compare to c1. The results when I applied
> warping to
> > rc1 (imported ) is perfectly align with MNI while the
> results is a bit
> > biased (from MNI) when I applied wrapping to c1?
> > In the attach figure,the top left figure is the result of
> wrapping and
> > normalizing to MNI (using Dartel in SPM8) applied to c1
> while the top
> > right figure is the results of wrapping and normalizing to
> MNI applied
> > to rc1. As you can clearly see, the result of the top right
> is
> > perfectly align with MNI (the bottom) but not the top left?
> This is
> > the main confusion that I got from the beginning!
> > Many thanks
> > /Alireza
> >
> > --- On Thu, 2/11/10, John Ashburner <[log in to unmask]>
> wrote:
> >
> >
> > From: John Ashburner <[log in to unmask]>
> > Subject: Re: [SPM] Dartel Normalization
> > To: [log in to unmask]
> > Date: Thursday, February 11, 2010, 7:57 PM
> >
> > There is a second matrix hidden in the headers of
> the imported
> > images.
> > If you do the following in MATLAB, it should show
> the native
> > and
> > imported images in alignment with each other:
> >
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> %%%%%%%%%%
> > %%%%%
> > % Select images (native first, imported second)
> > P = spm_select(2,'.*c1.*\.nii','Select native,
> then
> > imported');
> >
> > % Show the two images together
> > spm_check_registration(P)
> >
> > % Get the secret information used by
> spm_check_registration
> > global st
> >
> > % Make the hidden matrix the one that
> spm_check_registration
> > uses.
> > st.vols{2}.mat = st.vols{2}.private.mat0;
> >
> > % Something to update the view
> > spm_orthviews('maxbb')
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> %%%%%%%%%%
> > %%%%%
> >
> > If it does not, then it would suggest that one of
> the images
> > has had its
> > header changed.
> >
> > Best regards,
> > -John
> >
> >
> > On Thu, 2010-02-11 at 07:12 -0800, Alireza Salamy
> wrote:
> > >
> > > Thank you John for the reply!
> > >
> > > But neither of those cases are hold here. I used
> new Seg
> > algorithm
> > > which writes both native and imported c1 images at
> the same
> > time.
> > > Looking at c1 and rc1, reflects that they are a
> bit rotated
> > (see
> > > attach c1 and rc1). In the first figure, the top
> row reflect
> > c1t1
> > > while the lower row reflects imported
> image(rc1t1). There is
> > about 20
> > > mm differences (in the transformation matrix)
> between two
> > image.
> > > In the second figure, the top row reflects applied
> > normalization and
> > > warp to the native images while the bottom row
> reflects
> > applied the
> > > same normalization and warp to imported images.You
> can
> > obviously see
> > > that they are not align properely. Further more
> the one the
> > one in the
> > > bottom (swrt1) is perfectly align with MNI.
> > > Is it wrong to apply the warp to imported
> data(rc1) not to?
> > > Any suggestion would be highly appreciated!
> > >
> > > Alireza
> > >
> > > --- On Thu, 2/11/10, John Ashburner
> <[log in to unmask]>
> > wrote:
> > >
> > >
> > > From: John Ashburner
> <[log in to unmask]>
> > > Subject: Re: [SPM] Dartel Normalization
> > > To: "Alireza Salamy"
> <[log in to unmask]>
> > > Cc: [log in to unmask]
> > > Date: Thursday, February 11, 2010, 6:06 PM
> > >
> > > The manual is correct in stating that the
> original
> > images can
> > > be aligned
> > > using deformations estimated from the
> imported
> > scans. There
> > > are however
> > > some exceptions. In particular, if the
> original
> > scans are
> > > repositioned
> > > after their segmentation. For example, if
> their
> > origin is
> > > changed then
> > > they would no longer align with the
> imported scans.
> > Another
> > > cause may
> > > be if the scans are coregistered so that
> they match
> > some other
> > > data. If
> > > coregistering after segmenting, then the
> other
> > images should
> > > be moved
> > > into alignment with the anatomicals -
> rather than
> > move the
> > > anatomicals.
> > >
> > > Best regards,
> > > -John
> > >
> > > On Thu, 2010-02-11 at 06:14 -0800, Alireza
> Salamy
> > wrote:
> > > > Dear John and others,
> > > >
> > > > I read in the mailing list that John has
> suggested
> > to apply
> > > warping to
> > > > the native space of c1 images (using
> SPM8
> > Normalize to MNI
> > > button)
> > > > rather than imported rc1 images, but he
> said that
> > he didn't
> > > know how
> > > > much differnce it makes in practice:
> > > >
> > >
> >
> (https://www.jiscmail.ac.uk/cgi-bin/wa.exe?A2=ind0904&L=SPM&P=R7426)
> > > >
> > > > In my exprience, when I used normalize
> to MNI
> > using dartel
> > > in SPM8 and
> > > > apply the warps to native c1 images, the
> result is
> > biased
> > > from tpm
> > > > gray matter (MNI template) but when I
> apply the
> > warps(using
> > > normalize
> > > > to MNI in SPM8) to imported rc1, it is
> nicely
> > inline with
> > > MNI (see
> > > > attach).I have even checked c1 before
> applying
> > warp and it
> > > seems not
> > > > to be far from MNI and even if I
> normalize it
> > using new seg,
> > > normalize
> > > > Gray matter option, it will be nicely
> inline with
> > MNI.
> > > >
> > > > Could it be something that needs to be
> further
> > investigated
> > > or the
> > > > manual is mistakenly written?
> > > > If this is true than I guess the con*
> images need
> > to be
> > > imported to
> > > > Dartel and then one can use normalize to
> MNI
> > option using
> > > dartel in
> > > > SPM8 for warping and normalization?
> > > >
> > > > Thanks
> > > > /Alireza
> > > >
> > >
> > >
> > > --
> > > John Ashburner <[log in to unmask]>
> > >
> > >
> > >
> >
> >
> > --
> > John Ashburner <[log in to unmask]>
> >
> >
>
>
> --
> John Ashburner <[log in to unmask]>
>
>
--
John Ashburner <[log in to unmask]>
|