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

Help for SPM Archives


SPM Archives

SPM Archives


SPM@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

SPM Home

SPM Home

SPM  November 2011

SPM November 2011

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: query on Nii files and voxel size

From:

Bas Neggers <[log in to unmask]>

Reply-To:

Bas Neggers <[log in to unmask]>

Date:

Fri, 25 Nov 2011 20:12:00 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (281 lines)

yeah, you are right, and mat*[1 1 1 0]' is exactly the voxelsize for 
non-angulated images ;-)

But your expression indeed gives it for all angulations.

Chapeau!

Bas

On 11/25/2011 06:15 PM, Michael Erb wrote:
> Hi Han,
> you are right, what Bas calculates is not the voxelsize but the 
> position of the corner of one voxel. It is the voxel position 1 1 1 
> transformed to mm space ( by the way inv(mat)\[1 1 1 0]' is the same 
> as mat*[1 1 1 0]').
>
> you can also use:
>
>  voxelsize=sqrt(sum(mat.^2))
>
> Michael
>
> Am 25.11.2011 14:00, schrieb han zhang:
>> Hi all,
>> I try this time in my way, to orthogonize mat matrix, I use:
>> [U S V] = svd(head.mat(1:3, 1:3)), and S give me the voxel size.
>> Hope it helps for other guys.
>> Han
>> 2011/11/25 S.F.W. Neggers <[log in to unmask]
>> <mailto:[log in to unmask]>>
>>
>>     __
>>     O sorry, I made I typo I see. My reply was what I remembered from
>>     some time ago ;-)
>>     It should be inv(mat)\[1 1 1 0]' otherwise you will incorporate the
>>     translation parameters...
>>     Just checked on a few images, and the above works for me. Notice
>>     that the order of the voxel size you get is according to voxel
>>     space. That is, when you scan saggittally, the first number will be
>>     the slice thickness (from ear to ear).
>>
>>     Cheers,
>>
>>     Bas
>>
>>
>>     Op 25-11-11 13:47, han zhang schreef:
>>>     Dear Bas,
>>>     I followed your suggestion using inv(mat)\[1 1 1 1], but the
>>>     output was a 4*1 vector, containing numbers that coundn't be voxel
>>>     size:
>>>     [219
>>>     -156
>>>     19
>>>     1]
>>>
>>>     What's wrong with my script?
>>>     Han
>>>     2011/11/25 S.F.W. Neggers <[log in to unmask]
>>> <mailto:[log in to unmask]>>
>>>
>>>         No this is not wrong, both SPM and MRicron are right. The
>>>         diagonol is NOT necessarily equal to the voxel size (it only
>>>         is for an image without any angulation). This matrix is a so
>>>         called 4D affine transormation matrix, constituting the
>>>         voxel-to-world matrix in the Nifti specification from NIH.
>>>         Don't try to interpret it when you do not know what is
>>>         represents, 4D linear algebra is not for the faint at heart
>>>         ;-). See http://nifti.nimh.nih.gov/nifti-1 for more
>>>         information on the nii specs.
>>>
>>>         When applying a rotation matrix to the original matrix, the
>>>         diagonal changes, and this is correct behavior (check your
>>>         linear algebra textbooks). When you open your image in spm,
>>>         the right window will compute and display the voxel size for
>>>         you. This does not change after realignment.
>>>
>>>         When you want to compute it yourself do:
>>>
>>>         V=spm_vol(spm_select);
>>>         inv(V.mat)\[1 1 1 1]'
>>>
>>>         Good luck,
>>>
>>>         Bas
>>>
>>>
>>>         Op 25-11-11 10:56, han zhang schreef:
>>>>         Hi Helen,
>>>>         This problem is also bothering me. The voxel size as
>>>>         indicated in the diagnal of the MAT matrix was sometimes not
>>>>         in concordance with MRIcron (as seen from image 'information'
>>>>         on the menu of MRIcron).
>>>>         For example, my MAT matrix of a head-motion-corrected nifti
>>>>         image is :
>>>>         -3.4124    0           -0.72       223
>>>>         -0.033      3.4263   0.4806   -159
>>>>         -0.42        -0.27     5.94      14.7
>>>>         The voxel size should be 3.4124* 3.4263*5.94?
>>>>         However, MRIcron reported it as 3.5*3.5*7, quite different 
>>>> Huh?
>>>>         What I thought is that, maybe after realignment (motion
>>>>         correction with rigid body transformation), the MAT file had
>>>>         been changed, not as diagnal as it should be before. So the
>>>>         voxel size should not be taken from the diagnal number of the
>>>>         MAT file. Am I right?
>>>>         Han
>>>>
>>>>         2011/11/25 Helen Beaumont
>>>> <[log in to unmask]
>>>> <mailto:[log in to unmask]>>
>>>>
>>>>             Help please.
>>>>
>>>>             I am writing a Matlab matrix (read from a Phillips ParRec
>>>>             file)  out as nii data.
>>>>
>>>>             The voxel size is 3.5 x 3.5 x 5.95 mm, 64 x 64 x 20 
>>>> matrix.
>>>>
>>>>             N.mat is
>>>>
>>>>                 3.5000         0         0 -113.7500
>>>>
>>>>                      0    3.5000         0 -113.7500
>>>>
>>>>                      0         0    5.9500  -62.4750
>>>>
>>>>                      0         0         0    1.0000
>>>>
>>>>             When I use SPM to display it, the voxel size is OK, and
>>>>             origin is close to AC.
>>>>
>>>>             However, if I use MRIcroN with “re-orient on load” box
>>>>             checked in preferences,
>>>>
>>>>             voxel size is 1 x 1 x 1 mm, and origin is bottom L corner.
>>>>
>>>>             Helen Beaumont
>>>>
>>>>             ISBE
>>>>
>>>>             University of Manchester
>>>>
>>>>             Stopford Building, Oxford Rd
>>>>
>>>>             Manchester M13 9PT
>>>>
>>>>             Tel: 0161 275 1259
>>>>
>>>>
>>>>
>>>>
>>>>         --
>>>>         Han ZHANG
>>>>         http://publicationslist.org/han_zhang
>>>>         Center for Cognition and Brain Disorder, Hangzhou Normal
>>>>         University
>>>>         Addr: 7th Bldg, Affil Hosp of Hangzhou Normal Univ, Wenzhou
>>>>         Rd 126#, Hangzhou 310015
>>>>         Fax/Tel: +86-0571-88285651
>>>>         Mobile Tel: 15869174768
>>>>
>>>
>>>
>>>         --
>>>         --------------------------------------------------
>>>         Dr. S.F.W. Neggers
>>>         Division of Brain Research
>>>         Rudolf Magnus Institute for Neuroscience
>>>         Utrecht University Medical Center
>>>
>>>         Visiting : Heidelberglaan 100, 3584 CX Utrecht
>>>                     Room B.01.1.03
>>>         Mail     : Huispost B01.206, P.O. Box 85500
>>>                     3508 GA Utrecht, the Netherlands
>>>         Tel      : +31 (0)88 7559609
>>>         Fax      : +31 (0)88 7555443
>>>         E-mail   :[log in to unmask] 
>>> <mailto:[log in to unmask]>
>>>         Web      :http://www.neuromri.nl/people/bas-neggers
>>>                   :http://www.neuralnavigator.com 
>>> <http://www.neuralnavigator.com/>  (CEO)
>>>         --------------------------------------------------
>>>
>>>         
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>>         /De informatie opgenomen in dit bericht kan vertrouwelijk zijn
>>>         en is uitsluitend bestemd voor de geadresseerde. Indien u dit
>>>         bericht onterecht ontvangt, wordt u verzocht de inhoud niet te
>>>         gebruiken en de afzender direct te informeren door het bericht
>>>         te retourneren. Het Universitair Medisch Centrum Utrecht is
>>>         een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
>>>         (Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat
>>>         geregistreerd bij de Kamer van Koophandel voor
>>>         Midden-Nederland onder nr. 30244197. /
>>>
>>>         /Denk s.v.p aan het milieu voor u deze e-mail afdrukt. /
>>>
>>>         
>>> ------------------------------------------------------------------------ 
>>>
>>>
>>>         /This message may contain confidential information and is
>>>         intended exclusively for the addressee. If you receive this
>>>         message unintentionally, please do not use the contents but
>>>         notify the sender immediately by return e-mail. University
>>>         Medical Center Utrecht is a legal person by public law and is
>>>         registered at the Chamber of Commerce for Midden-Nederland
>>>         under no. 30244197. /
>>>
>>>         /Please consider the environment before printing this e-mail. /
>>>
>>>
>>>
>>>
>>>     --
>>>     Han ZHANG
>>>     http://publicationslist.org/han_zhang
>>>     Center for Cognition and Brain Disorder, Hangzhou Normal University
>>>     Addr: 7th Bldg, Affil Hosp of Hangzhou Normal Univ, Wenzhou Rd
>>>     126#, Hangzhou 310015
>>>     Fax/Tel: +86-0571-88285651
>>>     Mobile Tel: 15869174768
>>>
>>
>>
>>     --
>>     --------------------------------------------------
>>     Dr. S.F.W. Neggers
>>     Division of Brain Research
>>     Rudolf Magnus Institute for Neuroscience
>>     Utrecht University Medical Center
>>
>>     Visiting : Heidelberglaan 100, 3584 CX Utrecht
>>                 Room B.01.1.03
>>     Mail     : Huispost B01.206, P.O. Box 85500
>>                 3508 GA Utrecht, the Netherlands
>>     Tel      : +31 (0)88 7559609
>>     Fax      : +31 (0)88 7555443
>>     E-mail   :[log in to unmask] <mailto:[log in to unmask]>
>>     Web      :http://www.neuromri.nl/people/bas-neggers
>>               :http://www.neuralnavigator.com 
>> <http://www.neuralnavigator.com/>  (CEO)
>>     --------------------------------------------------
>>
>>
>>
>>
>> -- 
>> Han ZHANG
>> http://publicationslist.org/han_zhang
>> Center for Cognition and Brain Disorder, Hangzhou Normal University
>> Addr: 7th Bldg, Affil Hosp of Hangzhou Normal Univ, Wenzhou Rd 126#,
>> Hangzhou 310015
>> Fax/Tel: +86-0571-88285651
>> Mobile Tel: 15869174768
>>
>


-- 
--------------------------------------------------
Dr. S.F.W. Neggers
Division of Brain Research
Rudolf Magnus Institute for Neuroscience
Utrecht University Medical Center

Visiting : Heidelberglaan 100, 3584 CX Utrecht
           Room B.01.1.03
Mail     : Huispost B01.206, P.O. Box 85500
           3508 GA Utrecht, the Netherlands
Tel      : +31 (0)88 7559609
Fax      : +31 (0)88 7555443
E-mail   : [log in to unmask]
Web      : http://www.neuromri.nl/people/bas-neggers
          : http://www.brainsciencetools.com (CEO)
--------------------------------------------------

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

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
2000
1999
1998


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

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