Slicing a volume [message #36903] |
Tue, 04 November 2003 08:52 |
Nuno Oliveira
Messages: 75 Registered: October 2003
|
Member |
|
|
Since I began to work with IDL one of the things that makes confuse is when
I want to make a two-dimension array from a three-dimension array (and I
often do).
For example I can create de three-dimension array vol
vol=INTARR(100,100,100)
But when I try to extract slices along different axes I get "different"
variables.
sliceX=vol(50,*,*)
sliceY=vol(*,50,*)
sliceZ=vol(*,*,50)
Then, I see that sliceX is an array [1,100,100], and the same with sliceY
but, sliceZ is an array [100,100]. sliceX and sliceY are what I am tempted
to call a false 3D array because one of the dimensions can have only one
value. My question is why they are not equal: all 2D arrays or all 3D
arrays?
I know this not very important, just bores me that I need to make a specific
code for the Z direction. I can use the function EXTRACT_SLICE, but it
really makes me sad that it doesn't work the easy way. Anyone knows why? Am
I making any mistake? Anyone had some time the same problem? Is the
EXTRACT_SLICE the only solution?
Cordially,
Nuno.
|
|
|