Print

Print


Dear Shal Hat,

I think we are now getting somewhere.

I am going to ignore everything you say about the post-stats
as you SHOULD NOT do analysis if the original images are
not labelled correctly.

So, let's start with the issue of the labelling in the original
functional data.  If you do not see sform_code or qform_code
in the fslhd output then that means that your images are
not in nifti format. This means that they will be in the ANALYZE
format.  This is not ideal, and if you can convert your images
from the scanner format directly into NIfTI format then that
would be better.  If you cannot, then you can convert the
ANALYZE to NIfTI with fslchfiletype, although it will *not*
contain orientation information, which the direct conversion
will hopefully provide.

The second thing to talk about is the use of fslswapdim.
It has not been clear for many emails that when you talk about
the R "moving" or "rotating" with the image, you are not
talking about registration, but talking about the use of fslswapdim.
So now it is clearer.

Assuming that you still have labelling errors (and maybe you
won't if you can get a direct conversion to work) then read on...

You cannot simply use fslswapdim alone to fix labelling errors.
There is one exception to this, which is swapping L and R, but
apart from that you cannot shift the labels using fslswapdim.
So if you have your image in nifti format and the labels are
wrong, then I suggest the following method to fix the labels:
  1 - remove the existing orientation information by doing:
	fslorient -deleteorient myimage
  2 - use fslswapdim with the x,y,z,-x,-y,-z options in order
	to make the image oriented the same as the standard
	template images *when viewed with FSLView*.
	e.g. fslswapdim myimage -y x -z testimage
		fslview testimage
	when you have it looking correct (and can verify that
	left and right are correct somehow - see below) then
	"testimage" is the image you should use in the following.
	You can ignore any warnings about left-right orientation
	as we already know that things are wrong and are trying
	to fix them.
  3 - restore the orientation information
	fslorient -setsformcode 1 testimage
	fslorient -forceradiological testimage
       this puts in the default radiological orientation information,
       which is appropriate for images that are the same as the
       standard template images in terms of viewing in FSLView.

Note that you should not use the above method if you can
possibly avoid it, because there is no way to know which is
Left and Right.  If your image has an image marker (e.g.
vitamin capsule) then you can do the above and be confident.
Otherwise, if the image is from the same session as an image
where you fixed the labels, then comparing with this image
will normally allow you to be confident.  However, if you do
not have a marker or a correctly labelled image from the
same session to compare with then be very, very, very
wary of using the above method as you can easily get Left
and Right confused.

So I suggest you go away and try and fix your anatomical
and functional images - to get the labels correct.  I strongly
recommend trying another conversion method from the
scanner format to nifti.  If you cannot get any of the options
to work, then try the above method and see if you can get
things to work. Note that you will need to do this for every
scan you get off the scanner unless you can find a conversion
program that goes from the scanner format to nifti and
gets the labels correct.

Once you've got the labels correct then you can try to do
some analysis.  Please email if any of the above is unclear
or if you get into trouble somehow, but please do not do
any analysis until you have got the labels fixed.

All the best,
	Mark



On 2 Dec 2009, at 20:32, Shal Hat wrote:

> After reading what I wrote again, I realized my brain was switching  
> know, now, and no.. Basically please replace
> "know success" and "now success" to "NO success".. Sorry about that..
>
> On Wed, Dec 2, 2009 at 2:38 PM, Shal Hat <[log in to unmask]> wrote:
> Please see below..
>
> On Wed, Dec 2, 2009 at 11:24 AM, Mark Jenkinson  
> <[log in to unmask]> wrote:
> Dear Shal Hat,
>
> I don't quite understand some of your statements here.
>
> You say that registration is fine with Full Search but that
> the frontal lobe is facing down - is this in the example_func2standard
> or the example_func2highres.  Does your anatomical
> scan have the frontal lobe facing down?  It isn't enough
> to know this without knowing more information about which
> image you are referring to and what the other images involved
> are like.
>
> ----
> In the post-stats the frontal lobe is facing down with R in one  
> corner of the SPM.
> For registration am using the subject's 3D "only brain" anatomical  
> as the main structural
> and MNI152 as standard space. Both example_func2standard and  
> example_func2highres
> look ok although both the registration and anatomicals appear  
> "upside down".
> The 3D anatomical scan appears to be upside down in both the  
> original and BET output. Also,
> the labeling are mismatched.
> ----
>
> Also, why are you using fslmerge with anatomicals?
> I do not understand the reason for this.  All you
> need is a single 3D image for your anatomical,
> not a 4D one.
> ----
> Sorry, I meant I used fslmerge for the functional. The anatomicals  
> were only stripped for the brain using BET.
> -----
>
>
> You also say that in your functional data, AP should be PA.
> This sounds like you have *not* got the original orientation
> of these images correct.  This is what David and I have been
> saying before.  Nothing is worth doing unless these have
> the correct orientation to start with.  If you have a capsule
> labelling the anatomical and it was taken in the same session
> as the functional, then you can normally determine left and
> right by looking careful at the images as normally there is
> some left-right asymmetry in how people lie in the scanner,
> and you can match this up.
>
> ---
> Yes, am trying to correct the AP,PA, and RL,LR issue. However, I  
> have been using fslswapdim with now success.
> The brain flips around just fine but the tagged orientation (i.e R,  
> L, etc.) flips around with the brain. I used the following
> commands but the same wrong labeling flips around with the brain.
>
> to correct for the AP, PA labeling on the functional data, I used:
> fslswapdim name x -y z outname       and       fslswapdim name RL PA  
> SI  outname     and    fslswapdim name LR PA SI outname
>
> to correct the mismatched labeling on the anatomical, I tried  
> several methods using fslswapdim but non worked. As I stated earlier  
> the brain
> flips around, but so do the labelings. In other words, the labeling  
> are always flipping around with their initial position (i.e. R is  
> always flipping around
> with the anterior side of the brain). This is true for both  
> functional and anatomical data.
>
> Also, did you check the sform_code and qform_code on
> your original *functional* images, as well as the anatomicals?
> All images need orientation information to be stored for
> things to work well.  If the information is stored but the
> labelling is wrong, then you will need to fix this labelling
> *before* doing any registrations or any other processing at all.
>
> Both the 4D nifti functional and 3D anatomical have 2 for sform_code  
> and qform_code. The functional hdr files
> don't list qform_code nor sform_code.  What does this mean anyways,  
> the 2 and 0?
> Am trying to fix the labeling, but to know success. please see my  
> previous statements.
>
> Thanks,,
>
> All the best,
>        Mark
>
>
>
>
>
>
>
>
> On 2 Dec 2009, at 15:24, Shal Hat wrote:
>
> Thanks Mark, Thanks David,
>
> So here is what I have:
>
> 1) I currently now have a vit. E capsule, so I know the right from  
> the left for the 3D anatomical. However, no Vit. E capsule is  
> present for the functional data.
>
> 2) All the registration is fine when I use Full Search. In fact it  
> is really good.
>
> 3) For the 3D anatomical nifti file derived from fslmerge -t  both  
> sform_code and qform_code are 2. This is also true for the  
> functional data. What does this mean?
>
> 4) David: Yes I have tried your protocol for fslswapdim for nifti  
> and I also used fslswapdim for the original hdr file. However the  
> issue I mentioned earlier still remains; where for example the image  
> will rotate but R is stuck to the anterior position of the brain.
>
> 5) On the functional data AP should be PA.
>
> Also, I'd like to mention again the the registration and post-stats  
> look good. However the frontal lobe is facing down, and an R is  
> placed to one side. I just
> want to make sure that R is is actually Right and is not wrong due  
> to the above concerns.
>
> Best
>
> On Wed, Dec 2, 2009 at 5:52 AM, Mark Jenkinson <[log in to unmask]>  
> wrote:
> Hi,
>
> I agree with David - you need to make sure that ALL of your images are
> correct before proceeding with any analysis.
>
> There are two other possible problems that you might be getting
> confused with:
>
> (1) It is possible to have nifti images with no orientation  
> information stored
>       in them, in which case FSL uses a default orientation, but  
> that won't
>       be preserved through any image transformations (rotations).   
> You can
>       check if this is the case by running "fslhd" and looking at  
> the sform_code
>       and qform_code.  If _both_ codes are zero, then you have no  
> orientation
>       information stored.  If either is non-zero then you do have  
> orientation
>       information stored.
>
> (2) The registration is failing, in which case the labels will be  
> taken from
>       the reference image and will be wrong.  Check the registration  
> by
>       loading both the reference image and the output from the  
> registration
>       (the transformed input image) and see if they visually are  
> aligned
>       in an anatomical way (forget the labels).
>
> So if these images are aligned well *and* there is orientation  
> information in
> your nifti images *and* you have set the labels correctly in ALL the  
> original
> images *and* you still have a problem with the labels of the  
> registration
> output, then this is a puzzling matter that we will need to look  
> into further.
> I suspect that this isn't the case though, and that you simply need to
> fix one of the above problems first.
>
> All the best,
>       Mark
>
>
>
> On 2 Dec 2009, at 06:53, David V. Smith wrote:
>
> What exactly was your command in fslswapdim? If you haven't already,  
> I would try the following on ALL of your images:
> fslswapdim invol RL PA IS outvol
>
> But, as Mark mentioned earlier, you can't be completely sure about L/ 
> R orientation without a vitamin E capsule or other orientation- 
> related information from the raw images....
>
> Some other useful documentation:
> http://www.fmrib.ox.ac.uk/fsl/avwutils/index.html
> http://www.fmrib.ox.ac.uk/fslfaq/#general_lr (see Q5-7)
>
>
> On Dec 1, 2009, at 11:52 PM, *Shal Hat* wrote:
>
> Hi,
>
> my original images are wrongly labeled in FSL. I used fslswapdim to  
> correct this. However,
> the image rotates but the labels are still mismatched (i.e. R is  
> always where A should be).
> How can I correct the mismatch of labels and the anatomy. Do I need  
> to use fslorient, if so
> I would appreciate details on the command and how I can correct this  
> issue.
>
> I also tried using another software to get the nifti file, but FSL  
> seems not to like that nifti
> file.
>
> Thanks ,
>
>
>
>