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