June 02, 2010

SPM99 Gem 7: Reorienting images

Subject: Re: AC-PC positions
From: John Ashburner <john@fil.ion.ucl.ac.uk>
Date: Fri, 27 Oct 2000 15:00:05 +0100 (BST)
To: spm@mailbase.ac.uk, spm@fil.ion.ucl.ac.uk

[...]

The best that I can suggest is you try manually reorienting your
images via the <Display&gt button.  Try different rotations and
translations until the image is displayed how you want it.  The
attached Matlab function can then be used for reslicing the image(s)
in the transverse orientation, with 1mm isotropic resolution.

Best regards,
-John

Attached file: .reorient.m~
Error in c matrix fixed, June 6, 2001 -TEN

Subsequently, John offered modifications to use the native voxel size, which have been incorporated...

See also SPM5 Gem2 & Gem3

Subject: Re: reorient.m
From: John Ashburner <john@FIL.ION.UCL.AC.UK>
Date: Thu, 14 Dec 2000 17:04:38 +0000
To: SPM@JISCMAIL.AC.UK

| I would like to reorient some images in two ways,
| using the usefull function reorient() of John Ashburner.
|
|   - first is to keep the voxel size intact,
| but still reorienting in the transverse plane

Without testing the code, and without too much thought, I think
the modification to do this is involves something like changing from:
        mat = spm_matrix([mn-1]);
        dim = (mat\[mx 1]')';
to something like:
        vox = spm_imatrix(V.mat);
        vox = vox(7:9);
        mat = spm_matrix([0 0 0  0 0 0  vox])*spm_matrix([mn-1]);
        dim = (mat\[mx 1]')';

|
|   - second is to reorient in the coronal plane,
|     with 1x1x1 mm resol.

I think this is involves something like changing from:
        mat = spm_matrix([mn-1]);
to something like:
        mat = spm_matrix([0 0 0 pi/2])*spm_matrix([mn-1]);
or maybe:
        mat = spm_matrix([0 0 0 -pi/2])*spm_matrix([mn-1]);

|
| In the two cases, the final image should have no .mat file
| and be resliced using sinc ...

To reslice using sinc interpolation, you change from:
                img = spm_slice_vol(V,M,dim(1:2),1);
to something like:
                img = spm_slice_vol(V,M,dim(1:2),-6);

I hopehese suggestions work.
Best regards,
-John
  

If you want to set arbitrary voxel size, just setvoxas desired in the fix above, but then be sure to forcedimto be an integer.

For example, I wanted to increase the resolution of my images by a factor of three, so I did

        vox = spm_imatrix(V.mat);
        vox = vox(7:9)/3;
        mat = spm_matrix([0 0 0  0 0 0  vox])*spm_matrix([mn-1]);
        dim = ceil(mat\[mx 1]')');


- No comments Not publicly viewable


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Search this blog

Tags

Most recent comments

  • Hi, Folks, conversion to HTML still works for PPT 2011 under OS 10.10 (as on my computer), with coup… by Andrew Fisher on this entry
  • HTML pages are different from PPT. It is possible to convert PPT in HTML page but it will create a p… by Ramjas on this entry
  • Hi This doesn't really address the issue at hand (powerpoint to html), but an alternative and very e… by Rose on this entry
  • @Michael. You are a SAINT. BLESS. by emma riley on this entry
  • I look this up every couple of years, and always struggle with it, so here are some notes for improv… by johann beda on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXIX