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  March 2012

SPM March 2012

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: rotation problem

From:

Marko Wilke <[log in to unmask]>

Reply-To:

Marko Wilke <[log in to unmask]>

Date:

Thu, 29 Mar 2012 12:11:08 +0200

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (211 lines)

Hello Qasim,

> I had actually already went through the list and none of the answers
> could solve the problem. I know it was discussed before as well that now
> SPM can handle 4D but unfortunately using the GUI its not the case.

I think that it is a bit premature to give up on this.

> 1. I tried using the GUI of spm to load the 4D .hdr file. I used the
> 'Display' function for that, I only got blank images. Ofcourse there is
> no time series shown. In one of the old posts I read that by default
> there is a filter so it reads only the first volume, but I m not sure
> from where exactly to change that filter setting.

When using spm's file selector, there are two lines below the right part 
of the selection window. The first allows you to filter files by name 
(default: .*), the second by volume (default: 1). You need to change 
this second line in order to select volumes from multivolume files.

> filter setting is changed I dont expect the problem to be solved, since
> I m getting a blank image so its not even the first image of the time
> series. Point to be noted here is that; I can use Micron or my own
> MATLAB code to visualize this 4D time series.

The file selector window allows you to select files, or volumes in 
files, not timeseries. If the image comes up blank, there may be a 
problem with file conversion.

> 2. I tried to access without using GUI. I used the spm_vol function; it
> loads 2400 structure array, which is right because there were 2400 time
> series images in the 4D .hdr file. However the structure array contain
> ONLY information about those individual 3D volumes, but not the DATA
> itself. I mean I cannot find the matrix inside any of the structure
> variables, where the images are read. So I wonder if spm_vol is only for
> reading the metadata information.

Yes.

> 3. SPM re-orient: I tried using the reorient through GUI using the
> 'Dispaly' function, but it is not able to re-orient the images. The
> images I have are 90 degree out of phase; and the re-orient function
> doesnt generate any error, but at the end of the day it doesnt do what
> is required.

I cannot comment on why it does not work for you but if you make a copy 
of, say, an image from spm8's canonical directory, display that in spm8, 
and enter 1.57 (pi/2) into the "pitch" field and then click on "Apply to 
images" at the bottom of the page and select this image again, then it 
will be updated. This is also described in the spm manual, included in 
the man subfolder.

> 4. Using spm_read_vols; I get this error
> [Y,XYZ] = spm_read_vols('filename.hdr');
> ??? Attempt to reference field of non-structure array.
> Error in ==> spm_check_orientations at 19
> dims = cat(1,V.dim);
> Error in ==> spm_read_vols at 26
> spm_check_orientations(V);

This is because spm_read_vols expects the metadata (as you put it) 
generated by spm_vol. If you change your line to

data = spm_read_vols(spm_vol('filename.img'));

then data will contain your data matrix.

> 5. I m not sure if I understood well what you mean by using
> spm_get_space. When I used M = spm_get_space(filename); it only
> generated a 4X4 matrix for me; and i wonder what to do with this 4X4
> matrix. What I was expecting was one could give two input images; and
> the function reorient one image in correspondance to the other one; but
> seems like its not what this function does.

The matrix you get encodes just what you are interested in, and you can 
use spm_get_space to determine it from and apply it to an image. Try 
this on the image mentioned above before and after you reoriented it and 
you will see that the matrices differ.

> I hope this time I m more clear with the problem

I hope this time I was more clear with my answers :)

Good luck,
Marko


>  > Date: Wed, 28 Mar 2012 17:51:28 +0200
>  > From: [log in to unmask]
>  > Subject: Re: [SPM] rotation problem
>  > To: [log in to unmask]
>  >
>  > Hi Qasim,
>  >
>  > two remarks (three, actually): one, spm8 can use 4D images, so what you
>  > want to do may not even be necessary. Two, spm8 is able to rotate images
>  > in any way you like, using either the "reorient images" field when
>  > displaying images or by employing functionality provided by
>  > spm_get_space. And three, these points have been brought up before on
>  > the list: I get 30 hits for "spm8 4D" and >200 hits for "reorient
>  > images" (and 34 hits for "search list archives" :)
>  >
>  > Good luck,
>  > Marko
>  >
>  > PS: Please don't take this personal: I keep on telling this to people as
>  > for me, the archives at
>  > https://www.jiscmail.ac.uk/cgi-bin/webadmin?S1=spm are a treasure trove
>  > of information.
>  >
>  > Qasim Bukhari wrote:
>  > > Dear all,
>  > > I m using SPM 8 and since it cannot deal with the 4D Analyze format
>  > > images i.e. 3D time series; I wrote my own little code to convert it in
>  > > to many 3D images. The problem is for some reason the files that I
>  > > generate as output are 90 degree rotated. I tried using several
>  > > techniques in order to re-orient the output files as it were before but
>  > > nothing seems to work. One of the things I tried was a simple MATLAB
>  > > function imrotate. I converted the 3D image in to 2D and then
> rotated it
>  > > and then back to 3D; but when I try to write this as .img and then read
>  > > again with analyze75info, it says that the image is corrupted. I can
>  > > image the reason that its because I have manually altered the .img file
>  > > without any changes in to .hdr
>  > > Does anybody has a solution to rotate Analyze7.5 images ? Can SPM be
>  > > used to rotate images in bulk ??
>  > >
>  > > Best regards,
>  > > Qasim
>  > >
>  > >
>  > > Qasim Bukhari
>  > >
>  > > Research Assistant and Doctoral Candidate
>  > >
>  > > Institute for Biomedical Engineering
>  > >
>  > > ETH and University Zurich
>  > >
>  > > Wolfgang-Pauli-Strasse 27, HIT E22
>  > >
>  > > webpage: http://www.micro.biol.ethz.ch/people/sybukhar/index
>  > >
>  > >
>  >
>  > --
>  > ____________________________________________________
>  > PD Dr. med. Marko Wilke
>  > Facharzt für Kinder- und Jugendmedizin
>  > Leiter, Experimentelle Pädiatrische Neurobildgebung
>  > Universitäts-Kinderklinik
>  > Abt. III (Neuropädiatrie)
>  >
>  >
>  > Marko Wilke, MD, PhD
>  > Pediatrician
>  > Head, Experimental Pediatric Neuroimaging
>  > University Children's Hospital
>  > Dept. III (Pediatric Neurology)
>  >
>  >
>  > Hoppe-Seyler-Str. 1
>  > D - 72076 Tübingen, Germany
>  > Tel. +49 7071 29-83416
>  > Fax +49 7071 29-5473
>  > [log in to unmask]
>  >
>  > http://www.medizin.uni-tuebingen.de/kinder/epn
>  > ____________________________________________________
>  >
>  > This email is intended only for the use of the individual or entity
> to which it is addressed and may contain information that is privileged
> and confidential. If the reader of this email message is not the
> intended recipient, you are hereby notified that any dissemination,
> distribution, or copying of this communication is prohibited. If you
> have received this email in error, please notify the sender and
> destroy/delete all copies of the transmittal. Thank you.
>  >
>  >
>  > This email is intended only for the use of the individual or entity
> to which it is addressed and may contain information that is privileged
> and confidential. If the reader of this email message is not the
> intended recipient, you are hereby notified that any dissemination,
> distribution, or copying of this communication is prohibited. If you
> have received this email in error, please notify the sender and
> destroy/delete all copies of the transmittal. Thank you.

-- 
____________________________________________________
PD Dr. med. Marko Wilke
  Facharzt für Kinder- und Jugendmedizin
  Leiter, Experimentelle Pädiatrische Neurobildgebung
  Universitäts-Kinderklinik
  Abt. III (Neuropädiatrie)


Marko Wilke, MD, PhD
  Pediatrician
  Head, Experimental Pediatric Neuroimaging
  University Children's Hospital
  Dept. III (Pediatric Neurology)


Hoppe-Seyler-Str. 1
  D - 72076 Tübingen, Germany
  Tel. +49 7071 29-83416
  Fax  +49 7071 29-5473
  [log in to unmask]

  http://www.medizin.uni-tuebingen.de/kinder/epn
____________________________________________________

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

May 2024
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
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

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