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

Home » Public Forums » archive » Re: random slice through a volume of catscan data
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: random slice through a volume of catscan data [message #34926] Fri, 02 May 2003 11:36
Sergey Koposov is currently offline  Sergey Koposov
Messages: 7
Registered: April 2003
Junior Member
Jeff ,
the keyword ANISOTROPY allow to get the slice for GRID with different
steps for X,Y & Z axes , but I talked about method ,which allow to get
the slice for the more general situation - the situation with completely
scattered points.

Cheers,
Sergey

Jeff Nettles wrote:
> Sergey,
>
> Thanks so much for the reply. I did indeed learn about the EXTRACT_SLICE
> function and am going through it now.
> I think that you can actually use the ANISOTROPY keyword and use data that
> isn't uniformly spaced (mine isn't). But if not, your strategy makes sense
> to me.
>
> So again, thanks so much!
> Jeff
>
> "Sergey Koposov" <astro@mccme.ru> wrote in message
> news:b8rp8h$kje$1@news.rol.ru...
>
>> Hello, Jeff,
>> I think , if your data volume is presented as 3-dimensinal array (i.e.
>> your data is uniformly spaced ), you can use the EXTRACT_SLICE function.
>>
>> Otherwise , (if your data is presented , for example, as 1-dimensional
>> array with x,y & z coordinates ) you can
>> 1) define the function distance(x,y,z) , which will compute the distance
>> from the point to the plane
>> function distance,x,y,z
>> common plane ,A,B,C,D ; on the assumption that A*x+B*y+C*z+D=0 return
>> ,(A*x+B*y+C*z+D)/sqrt(A^2+B^2+C^2) ;define the plane
>> end
>> 2) Select the points for the slice by using WHERE
>> indices=WHERE(dist(X,Y,Z) lt 1) ;where X,Y,Z are 1-d arrays of x,y,z
>> coordinates
>> 3) Image the necessary characteristics for X[indices],Y[indices],Z[..]
>> with some interpolation (if you need of image , not of plot of points)
>> (for example the function GRID_TPS,and others (other functions are in
>> the IDL Online Help , "gridding and interpolation"))
>>
>> You can also make the interpolation for slicing in the beginning by
>> means the GRID3 function (see also IDL Online Help , gridding and
>> interpolation) . And after that , you will can directly perform the
>> imaging.
>>
>> I hope my considerations will be useful. But I don't insist that my
>> methods are optimal :)
>> Cheers,
>> Sergey
>>
>> Jeff Nettles wrote:
>>
>>> Hi All,
>>>
>>> I have some CT data that I would be able to take randomly-oriented
>
> slices
>
>>> through. (BTW, these are scans of meteorites, not people, in case
>
> you're
>
>>> thinking that it doesn't make any sense why i'd want to do this.) My
>>> approach so far has been to randomly select 3 sets of x,y, & z
>
> coordinates
>
>>> so that i have three points that define a plane. Now I want to extract a
>
> 2D
>
>>> image that represents that plane from the 3D CT data volume. My
>
> priority
>
>>> here is to preserve the shapes of the objects in the random slice. I
>
> know
>
>>> i'm going to have to do some interpolating since the slice won't always
>
> go
>
>>> through entire pixels. What i'm hoping that i can get help with is:
>>>
>>> 1) Is there by any chance a program someone has written (or included
>
> with
>
>>> IDL) that can do this already? (I'm a relatively inexperienced IDL
>>> programmer)
>>>
>>> 2) If I'm going to have to code this myself, are there IDL functions
>
> that
>
>>> would make this easier? I've looked at the WHERE function, but haven't
>>> convinced myself that it will help. I know to try to avoid for loops as
>>> much as possible so I'm trying to do that.
>>>
>>> 3) Any suggestions about a general approach to the problem would be
>
> very
>
>>> helpful.
>>>
>>> Thanks for your time (and hopefully your help!),
>>> Jeff
>>>
>>>
>>
>
>
Re: random slice through a volume of catscan data [message #34931 is a reply to message #34926] Fri, 02 May 2003 08:45 Go to previous message
Jeff Nettles is currently offline  Jeff Nettles
Messages: 5
Registered: June 1999
Junior Member
Sergey,

Thanks so much for the reply. I did indeed learn about the EXTRACT_SLICE
function and am going through it now.
I think that you can actually use the ANISOTROPY keyword and use data that
isn't uniformly spaced (mine isn't). But if not, your strategy makes sense
to me.

So again, thanks so much!
Jeff

"Sergey Koposov" <astro@mccme.ru> wrote in message
news:b8rp8h$kje$1@news.rol.ru...
> Hello, Jeff,
> I think , if your data volume is presented as 3-dimensinal array (i.e.
> your data is uniformly spaced ), you can use the EXTRACT_SLICE function.
>
> Otherwise , (if your data is presented , for example, as 1-dimensional
> array with x,y & z coordinates ) you can
> 1) define the function distance(x,y,z) , which will compute the distance
> from the point to the plane
> function distance,x,y,z
> common plane ,A,B,C,D ; on the assumption that A*x+B*y+C*z+D=0 return
> ,(A*x+B*y+C*z+D)/sqrt(A^2+B^2+C^2) ;define the plane
> end
> 2) Select the points for the slice by using WHERE
> indices=WHERE(dist(X,Y,Z) lt 1) ;where X,Y,Z are 1-d arrays of x,y,z
> coordinates
> 3) Image the necessary characteristics for X[indices],Y[indices],Z[..]
> with some interpolation (if you need of image , not of plot of points)
> (for example the function GRID_TPS,and others (other functions are in
> the IDL Online Help , "gridding and interpolation"))
>
> You can also make the interpolation for slicing in the beginning by
> means the GRID3 function (see also IDL Online Help , gridding and
> interpolation) . And after that , you will can directly perform the
> imaging.
>
> I hope my considerations will be useful. But I don't insist that my
> methods are optimal :)
> Cheers,
> Sergey
>
> Jeff Nettles wrote:
>> Hi All,
>>
>> I have some CT data that I would be able to take randomly-oriented
slices
>> through. (BTW, these are scans of meteorites, not people, in case
you're
>> thinking that it doesn't make any sense why i'd want to do this.) My
>> approach so far has been to randomly select 3 sets of x,y, & z
coordinates
>> so that i have three points that define a plane. Now I want to extract a
2D
>> image that represents that plane from the 3D CT data volume. My
priority
>> here is to preserve the shapes of the objects in the random slice. I
know
>> i'm going to have to do some interpolating since the slice won't always
go
>> through entire pixels. What i'm hoping that i can get help with is:
>>
>> 1) Is there by any chance a program someone has written (or included
with
>> IDL) that can do this already? (I'm a relatively inexperienced IDL
>> programmer)
>>
>> 2) If I'm going to have to code this myself, are there IDL functions
that
>> would make this easier? I've looked at the WHERE function, but haven't
>> convinced myself that it will help. I know to try to avoid for loops as
>> much as possible so I'm trying to do that.
>>
>> 3) Any suggestions about a general approach to the problem would be
very
>> helpful.
>>
>> Thanks for your time (and hopefully your help!),
>> Jeff
>>
>>
>
Re: random slice through a volume of catscan data [message #34940 is a reply to message #34931] Thu, 01 May 2003 14:29 Go to previous message
Chris[1] is currently offline  Chris[1]
Messages: 23
Registered: January 2003
Junior Member
"Sergey Koposov" <astro@mccme.ru> wrote in message
news:b8rp8h$kje$1@news.rol.ru...
> Hello, Jeff,
> I think , if your data volume is presented as 3-dimensinal array (i.e.
> your data is uniformly spaced ), you can use the EXTRACT_SLICE function.
>

Sergey - I'm not Jeff but thanks for the post, I happened to be puzzling
over a similar problem (slicing up temperature distributions on the Scotian
Shelf) when I saw your post. Saved me a good deal of aspirin :)

Chris
Re: random slice through a volume of catscan data [message #34942 is a reply to message #34940] Thu, 01 May 2003 11:32 Go to previous message
Sergey Koposov is currently offline  Sergey Koposov
Messages: 7
Registered: April 2003
Junior Member
Hello, Jeff,
I think , if your data volume is presented as 3-dimensinal array (i.e.
your data is uniformly spaced ), you can use the EXTRACT_SLICE function.

Otherwise , (if your data is presented , for example, as 1-dimensional
array with x,y & z coordinates ) you can
1) define the function distance(x,y,z) , which will compute the distance
from the point to the plane
function distance,x,y,z
common plane ,A,B,C,D ; on the assumption that A*x+B*y+C*z+D=0 return
,(A*x+B*y+C*z+D)/sqrt(A^2+B^2+C^2) ;define the plane
end
2) Select the points for the slice by using WHERE
indices=WHERE(dist(X,Y,Z) lt 1) ;where X,Y,Z are 1-d arrays of x,y,z
coordinates
3) Image the necessary characteristics for X[indices],Y[indices],Z[..]
with some interpolation (if you need of image , not of plot of points)
(for example the function GRID_TPS,and others (other functions are in
the IDL Online Help , "gridding and interpolation"))

You can also make the interpolation for slicing in the beginning by
means the GRID3 function (see also IDL Online Help , gridding and
interpolation) . And after that , you will can directly perform the
imaging.

I hope my considerations will be useful. But I don't insist that my
methods are optimal :)
Cheers,
Sergey

Jeff Nettles wrote:
> Hi All,
>
> I have some CT data that I would be able to take randomly-oriented slices
> through. (BTW, these are scans of meteorites, not people, in case you're
> thinking that it doesn't make any sense why i'd want to do this.) My
> approach so far has been to randomly select 3 sets of x,y, & z coordinates
> so that i have three points that define a plane. Now I want to extract a 2D
> image that represents that plane from the 3D CT data volume. My priority
> here is to preserve the shapes of the objects in the random slice. I know
> i'm going to have to do some interpolating since the slice won't always go
> through entire pixels. What i'm hoping that i can get help with is:
>
> 1) Is there by any chance a program someone has written (or included with
> IDL) that can do this already? (I'm a relatively inexperienced IDL
> programmer)
>
> 2) If I'm going to have to code this myself, are there IDL functions that
> would make this easier? I've looked at the WHERE function, but haven't
> convinced myself that it will help. I know to try to avoid for loops as
> much as possible so I'm trying to do that.
>
> 3) Any suggestions about a general approach to the problem would be very
> helpful.
>
> Thanks for your time (and hopefully your help!),
> Jeff
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: sec : U Re: Parameters in event_pro
Next Topic: Threshold value from histogram plot

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

Current Time: Fri Oct 10 10:00:56 PDT 2025

Total time taken to generate the page: 1.28271 seconds