comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Rotate 3D matrix
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Rotate 3D matrix [message #27525] Mon, 29 October 2001 03:13 Go to next message
bente is currently offline  bente
Messages: 13
Registered: October 2001
Junior Member
Hi,

I guess you think about the one using the FOR loops and the one with
the t3d?
The one with the for loop is too slow and the other says "not enough
memory to create arrays".

The problem is, that i have to rotate a 256x256x128 floating point
array round about 150 times around the z-achsis (to simulate a forward
projection)
Re: Rotate 3D matrix [message #27571 is a reply to message #27525] Fri, 26 October 2001 05:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kay (bente@uni-wuppertal.de) writes:

> have again an annoying problem.
> Why does the Rot/Rotate functions work only on 2D-Array.
> I want to rotate a 3D-Array around the z-Axis (3D-Tomographic data).
> There must be a faster way than to use a FOR Loop to rotate each
> slice!!

There was a whole series of articles on this topic
a couple of weeks ago. Search Google for "Rotate Volume".

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Rotate 3D matrix [message #27642 is a reply to message #27525] Tue, 30 October 2001 03:36 Go to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
Kay,
I think you must have only
read the first messages, as we addressed and solved the memory problems,
in fact the later code ran at a resepectible rate and in a small memory
size. If all you want is
a specialised z axis rotation, then use Marc's method, if you want a general
transformation, then use transform_image3d

code is at
http://homepage.ntlworld.com/martin.downing/idl/transform_im age3d.pro


Eg for your 256x256x128 FLOAT block:
IDL> test_ti3d, [256,256,128],/stats, /deb, rot = [0,0,15], /interp
VOL FLOAT = Array[256, 256, 128]
buffer= 128
transform_image3d: done in 9.8950000 sec
rot Z...
ms_transform_image3d: done in 3.9050000 sec
Vol: n_el = 8388608 max = 180.837 min= 0.000000
max abs diff 127.932
median abs diff 5.34058e-005
n_elements gt 0.01 diff 29440.0 0.350952 %


- hope this clears your problem up

Martin
--
----------------------------------------
Martin Downing,
Clinical Research Physicist,
Grampian Orthopaedic RSA Research Centre,
Woodend Hospital, Aberdeen, AB15 6LS.
m.downing@abdn.ac.uk

"Kay" <bente@uni-wuppertal.de> wrote in message
news:e143e8bc.0110290313.9ce515c@posting.google.com...
> Hi,
>
> I guess you think about the one using the FOR loops and the one with
> the t3d?
> The one with the for loop is too slow and the other says "not enough
> memory to create arrays".
>
> The problem is, that i have to rotate a 256x256x128 floating point
> array round about 150 times around the z-achsis (to simulate a forward
> projection)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Resolution
Next Topic: which *nix will RSI nix next?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:26:38 PDT 2025

Total time taken to generate the page: 0.00477 seconds