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  October 2007

FSL October 2007

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: MNI Space in MRIcro and FSL

From:

Matt Glasser <[log in to unmask]>

Reply-To:

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

Date:

Thu, 18 Oct 2007 08:02:46 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (429 lines)

Works well. 

Thanks Mark!

Matt.

-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf
Of Mark Jenkinson
Sent: Thursday, October 18, 2007 4:30 AM
To: [log in to unmask]
Subject: Re: [FSL] MNI Space in MRIcro and FSL

Dear Matt and Ged,

Sorry for not getting involved in this thread earlier but I was out of 
contact.

There is a very simple solution to this.
The script I had previous sent is now outdated and the functionality has 
been
incorporated directly into the FSL4 version of flirt with the -usesqform 
option.

So all you need to do is take your original command:
flirt -in 4X4X4mmROI -ref MNI152_T1_1mm_brain -applyxfm -init eye.mat 
-out 1X1X1mmROI
and change it to:
flirt -in 4X4X4mmROI -ref MNI152_T1_1mm_brain -applyxfm -usesqform -out 
1X1X1mmROI

This should then align the (0,0,0) mm coordinates as required, for 
either nifti or analyze
files.

All the best,
Mark



DRC SPM wrote:

>Hi Matt,
>
>Thanks for sending your data, the problem is that Mark's script
>assumes the data is NIfTI, and tries to grep the q-/s-form from the
>output of fslhd, but with Analyze images fslhd doesn't try to print
>this information. If you use `fslchfiletype NIFTI_PAIR your_ROI` then
>fslchfiletype will guess basic q-/s-forms (as I assume MRIcron, SPM,
>etc. also do) and then flirt_qsinit will work on this image.
>
>Sorry, I'd lost the scent a bit, and forgot that your original message
>asked about Analyze...
>
>The script could be changed to use fslhd -x, which prints an sform,
>even for Analyze data, though it would need re-formatting; or to use
>fslchfiletype and a temporary file, but I haven't bothered doing
>either of these things, mainly because it looks like I wouldn't be
>able to post the modified script to the list...
>
>I gather there is to be an FSL Extensions page on nitrc.org soon, so
>maybe the script should end up there? But since it's Mark's rather
>than mine, I don't think I should submit it there under my account.
>
>Anyway, at least we've worked out the problem, if not where to put the
solution!
>
>Ged.
>
>
>On 17/10/2007, Matt Glasser <[log in to unmask]> wrote:
>  
>
>>Hi Ged,
>>
>>I was running the script on ubuntu, but shell is set to bash (not dash).
>>The error it gave was "cannot find concat matrix" which made me think
there
>>was something wrong with the script.  It did that no matter what I set for
>>the s/qform settings at the end.  It did output a matrix, but this matrix
>>was not correct reduced the data in size drastically, and put it in the
>>wrong place.
>>
>>I would be happy to test your version of the script if you send it to me
>>personally, rather than through the list so it doesn't get blocked.
Perhaps
>>I made some mistake when converting the script from avw to fsl (I did it
>>with a find and replace).
>>
>>Peace,
>>
>>Matt.
>>-----Original Message-----
>>From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf
>>Of DRC SPM
>>Sent: Wednesday, October 17, 2007 8:50 AM
>>To: [log in to unmask]
>>Subject: Re: [FSL] MNI Space in MRIcro and FSL
>>
>>Sorry, jiscmail rejected the attachment for some reason...
>>
>>On 17/10/2007, DRC SPM <[log in to unmask]> wrote:
>>    
>>
>>>Hi Matt,
>>>
>>>I wonder why it didn't work? I've just run it through avw2fsl (and
>>>also changed /bin/sh to /bin/bash in the #! line for good measure, as
>>>I seem to recall Debian/Ubuntu was unhappy with sh), and tested it on
>>>a pair of images with different image dimensions and different q- and
>>>s-forms (from co-registration in SPM5) as follows, and the result
>>>looks fine.
>>>
>>>flirt_qsinit.sh src ref src2ref.mat
>>>flirt -in src -ref ref -out src2ref -init src2ref.mat -applyxfm
>>>fslview ref src2ref
>>>
>>>I've attached my copy in case it helps, if it doesn't, hopefully Mark
>>>or Steve could take a look at your data if you upload it? (Or I could,
>>>if you put it somewhere I can see it).
>>>
>>>Best,
>>>Ged
>>>
>>>
>>>On 17/10/2007, Matt Glasser <[log in to unmask]> wrote:
>>>      
>>>
>>>>Thanks Ged.
>>>>
>>>>I couldn't get the script to work, even when I changed avw to fsl, but
>>>>        
>>>>
>>the
>>    
>>
>>>>SPM method worked fine.
>>>>
>>>>Peace,
>>>>
>>>>Matt.
>>>>
>>>>-----Original Message-----
>>>>From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On
>>>>        
>>>>
>>Behalf
>>    
>>
>>>>Of Ged Ridgway
>>>>Sent: Tuesday, October 16, 2007 10:21 AM
>>>>To: [log in to unmask]
>>>>Subject: Re: [FSL] MNI Space in MRIcro and FSL
>>>>
>>>>Hi Matt,
>>>>
>>>>Mark J posted a script that can use the NIfTI header info to generate
>>>>a FLIRT transformation:
>>>>   http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind0701&L=FSL&P=R20004
>>>>I think if you apply this transformation with flirt, with the standard
>>>>as the -ref, then your FSLview results should match your MRIcron ones.
>>>>
>>>>I'm guessing MRIcron resamples a binary ROI in the space of the
>>>>standard image, with either nearest neighbour interpolation or linear
>>>>followed by re-binarisation at a threshold of 0.5 -- you might need to
>>>>find out its implementation details to exactly reproduce the results.
>>>>Possibly MRIcron has an option to write out the resampled ROI, that it
>>>>presumably stores internally for display purposes?
>>>>
>>>>Hope that works,
>>>>Ged.
>>>>
>>>>P.S. Another option, if you use SPM (sorry to mention the enemy on
>>>>this list again!), is to use "coreg"->"reslice" with the standard
>>>>image defining the space and the ROI in the "other images" (or words
>>>>to that effect). The resulting ROI images prefixed with "r" should
>>>>then overlay properly in FSLview. Check out spm_reslice if you want to
>>>>avoid using the GUI.
>>>>
>>>>
>>>>Matt Glasser wrote:
>>>>        
>>>>
>>>>>Hi Steve,
>>>>>
>>>>>How do you suggest I go about correcting for this difference?  I could
>>>>>          
>>>>>
>>>>just
>>>>        
>>>>
>>>>>do it with nudge, but I would prefer an automated way that does not
>>>>>          
>>>>>
>>have
>>    
>>
>>>>the
>>>>        
>>>>
>>>>>chance of human error.
>>>>>
>>>>>Thanks,
>>>>>
>>>>>Matt.
>>>>>
>>>>>-----Original Message-----
>>>>>From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On
>>>>>          
>>>>>
>>Behalf
>>    
>>
>>>>>Of Steve Smith
>>>>>Sent: Tuesday, October 16, 2007 8:27 AM
>>>>>To: [log in to unmask]
>>>>>Subject: Re: [FSL] MNI Space in MRIcro and FSL
>>>>>
>>>>>Hi,
>>>>>
>>>>>On 16 Oct 2007, at 12:58, Matt Glasser wrote:
>>>>>
>>>>>          
>>>>>
>>>>>>Hi Steve,
>>>>>>
>>>>>>Well okay, but why would the ROIs line up with FSL's standard brain
>>>>>>            
>>>>>>
>>in
>>    
>>
>>>>>>MRIcro, but not in FSL itself?  I used the same standard space
>>>>>>image in both
>>>>>>programs
>>>>>>            
>>>>>>
>>>>>Ah - I hadn't appreciated that - sorry...
>>>>>
>>>>>          
>>>>>
>>>>>>and it was only misaligned in one of them, so I don't know how I
>>>>>>could use a flirt transform in this case.
>>>>>>            
>>>>>>
>>>>>Right - in that case the difference presumably is because MRICRO uses
>>>>>the co-ordinate centre from the header in determining display
>>>>>centering, whereas FSLView only uses the raw voxels for working out
>>>>>display (the co-ordinate centre is only used in the reporting of the
>>>>>mm co-ordinates, not in the image display).
>>>>>
>>>>>Cheers, Steve.
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>Matt.
>>>>>>
>>>>>>-----Original Message-----
>>>>>>From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On
>>>>>>Behalf
>>>>>>Of Steve Smith
>>>>>>Sent: Tuesday, October 16, 2007 2:00 AM
>>>>>>To: [log in to unmask]
>>>>>>Subject: Re: [FSL] MNI Space in MRIcro and FSL
>>>>>>
>>>>>>HI - I presume this is because of a change in field-of-view in the
>>>>>>different standard space images. One easy way to solve that is to use
>>>>>>flirt to estimate the transform between the standard space image in
>>>>>>SPM/mricro and the FSL standard space image, and use that instead of
>>>>>>eye.mat in your call to flirt resample the ROI.
>>>>>>
>>>>>>Cheers, Steve.
>>>>>>
>>>>>>
>>>>>>On 16 Oct 2007, at 00:17, Matt Glasser wrote:
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>Hi,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>I have a set of ROIs from SPM in MNI space that I want to load into
>>>>>>>FSL.  When I take the standard FSL brain MNI152_T1_1mm_brain and
>>>>>>>load it in MRIcro and overlay the ROI, it looks fine, like the
>>>>>>>first screenshot: http://www.ma-tea.com/~Matt/MRIcroOnMNI.png
>>>>>>>However, if I resample the 4X4X4mm ROI so it can be overlayed on
>>>>>>>this brain in FSLView, using:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>flirt -in 4X4X4mmROI -ref MNI152_T1_1mm_brain -applyxfm -init
>>>>>>>eye.mat -out 1X1X1mmROI where eye.mat is the identity matrix:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>1 0 0 0
>>>>>>>
>>>>>>>0 1 0 0
>>>>>>>
>>>>>>>0 0 1 0
>>>>>>>
>>>>>>>0 0 0 1
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>The result is incorrect, shown by the second screenshot in FSLView:
>>>>>>>http://www.ma-tea.com/~Matt/FSLOnMNI.png
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>The ROI file header is the following:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>><nifti_image
>>>>>>>
>>>>>>>  nifti_type = 'ANALYZE-7.5'
>>>>>>>
>>>>>>>  image_offset = '0'
>>>>>>>
>>>>>>>  ndim = '4'
>>>>>>>
>>>>>>>  nx = '41'
>>>>>>>
>>>>>>>  ny = '48'
>>>>>>>
>>>>>>>  nz = '35'
>>>>>>>
>>>>>>>  nt = '1'
>>>>>>>
>>>>>>>  dx = '4'
>>>>>>>
>>>>>>>  dy = '4'
>>>>>>>
>>>>>>>  dz = '4'
>>>>>>>
>>>>>>>  dt = '1'
>>>>>>>
>>>>>>>  datatype = '16'
>>>>>>>
>>>>>>>  nbyper = '4'
>>>>>>>
>>>>>>>  byteorder = 'LSB_FIRST'
>>>>>>>
>>>>>>>  cal_min = '0'
>>>>>>>
>>>>>>>  cal_max = '1'
>>>>>>>
>>>>>>>  descrip = 'FSL4.0'
>>>>>>>
>>>>>>>  sform_code = '2'
>>>>>>>
>>>>>>>  sto_xyz_matrix = '-4 0 0 80 0 4 0 -112 0 0 4 -52 0 0 0 1'
>>>>>>>
>>>>>>>  num_ext = '0'
>>>>>>>
>>>>>>>/>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>I would appreciate any assistance with this as I am unfamiliar with
>>>>>>>this type of issue if it has to do with the analyze file format or
>>>>>>>header.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>Thanks,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>Matt.
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>            
>>>>>>
>>----------------------------------------------------------------------
>>    
>>
>>>>>>--
>>>>>>---
>>>>>>Stephen M. Smith, Professor of Biomedical Engineering
>>>>>>Associate Director,  Oxford University FMRIB Centre
>>>>>>
>>>>>>FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
>>>>>>+44 (0) 1865 222726  (fax 222717)
>>>>>>[log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
>>>>>>
>>>>>>            
>>>>>>
>>----------------------------------------------------------------------
>>    
>>
>>>>>>--
>>>>>>---
>>>>>>            
>>>>>>
>>>>>
>>>>>          
>>>>>
>>------------------------------------------------------------------------
>>    
>>
>>>>>---
>>>>>Stephen M. Smith, Professor of Biomedical Engineering
>>>>>Associate Director,  Oxford University FMRIB Centre
>>>>>
>>>>>FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
>>>>>+44 (0) 1865 222726  (fax 222717)
>>>>>[log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
>>>>>
>>>>>          
>>>>>
>>------------------------------------------------------------------------
>>    
>>
>>>>>---
>>>>>
>>>>>          
>>>>>
>>>      
>>>

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