JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for FSL Archives


FSL Archives

FSL Archives


FSL@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

FSL Home

FSL Home

FSL  December 2009

FSL December 2009

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: fslswapdim labels and orientation

From:

Mark Jenkinson <[log in to unmask]>

Reply-To:

FSL - FMRIB's Software Library <[log in to unmask]>

Date:

Wed, 2 Dec 2009 21:16:47 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (309 lines)

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 ,
>
>
>
>

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager