qlearner的个人博客分享 http://blog.sciencenet.cn/u/qlearner

博文

OpenDX显示鼠标所取点的坐标(来自mail-archive)

已有 2873 次阅读 2014-2-12 15:43 |个人分类:专业学习|系统分类:科研笔记

[opendx-users] coordinate selecting protocol

 Thu, 25 Nov 2004 21:44:16 -0800 (PST)

Hello,     I have a dx file that creates the image of a brain.  In order to findthe coordinates of specific points of interest, I use the probe tool.However, when I search the actual text in the dx file for those outputcoordinates, the don't exist.  Does anyone know how I can prevent this fromhappening?  Also, the data is 4-d (three coordinates and the four is a brainmeasure); Is there a way to output all 4 coordinates, and not just the first3?thanks for your time,dave

 Fri, 26 Nov 2004 06:41:35 -0800 (PST)

Use "Pick" not "Probe".
I usually turn on the 'interpolate' option within Pick which allows the 'pick ray' to intersect the nearest actual data rather than requiring you to hit it precisely. (Actually, there are 3 'interpolate' states described in the docs for Pick, so read up on it and see which applies to you.)

Then the Pick will contain both the actual coordinate and any data attached to it.

Probe's main utility is in creating a starting point in 3-space for things like a bounds box (Construct) or a streamline start (and lots of other things, but not what you are doing). The name is misleading in that regard (I know: I used to poke at brains in a former life, as a neurobiology student).
<x-tad-bigger>____________________________
Chris Pelkie
Vice President
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850</x-tad-bigger><x-tad-bigger>

 Fri, 26 Nov 2004 20:58:53 -0800 (PST)

In addition to Chris' advice, you can display the coords (as found with {Pick}) using {Caption}.Regards, Allen H. NugentGraduate School of Biomedical EngineeringUniversity of New South WalesSydney NSW 2052 AustraliaTel: +61 2 9385 3916 Fax: +61 2 9663 2108

 Wed, 1 Dec 2004 08:08:00 -0800 (PST)Hello,Thank you for your replies.  I'm still having a little trouble working it out.Details:What I have are brain images, 30,000 pts on each hemisphere.  The points areimported to dx from a file in which the points are rendered in loops fromfront to back like you were tracing the outline of a brain that was slicedfrom front to back. Questions:1) despite reading the manual on pick, I can't seem to figure out how toconnect the pick tool.  I was able to have the output of image (imagerenderable) connect to the input of pick, but when I try to output theresult of the pick to caption, I get the error "output parameter type andinput parameter type do not match".   Does anyone know how I can get theoutput displayed (that is, the 3 coordinates and the 4th data variable), andalso how I can save them to a text file? 2)  when I look in the locations bar in pick, I see that when I click on apoint, it's adds to it 2 numbers.  Any idea what these are?  The data isn't2-d, it's 4-d (x,y,z,data). 3)  I'm try to select the actual points that make EXACTLY with the inputcoordinates from the actual data file.  I can't seem to figure out whichoption in pick to make sure I get these values. 4)  some one mentioned used map,  would this be better? Thank sooo much for your help,Davep.s. I'm obviously new to data explorer, so please excuse my confusion.Thanks!Pick is 'weird' in the world of DX modules. It works as follows:
1. Pick doesn't actually have to connect to anything, it just has to be in the net somewhere.
2. The modules that create the object(s) to be picked are upstream of Image in the net.
3. There is no necessary 'ordering' of Pick and those other modules (it can come before or after).
4. There is no necessary connection to the input(s) of Pick from any other module.
5. It is illegal (in data-flow) to connect the output of Image to the input of Pick (or to any other module upstream of Image).

So how does Pick get an answer from Image?
It's a secret trap-door arrangement.

1. By virtue of at least one Pick module in a net, the Image View Controls will light up the "Pick" menu with the user-specified or default names of each Pick module. Choose the one you want.
2. Click on an object in the Image. Presumably, as a beginner, you have NOT constrained the Pick to be permitted on a subset of the Image scene (though this is an option). Thus, by clicking on the object, you will have made a successful Pick.
3. The result of Pick is now internally passed back from Image to the named Pick module. Technically, it WILL be passed back on the NEXT execution of the net. So if you are in Execute Once mode, you Pick and nothing happens. But if you are in Execute on Change mode, your pick is returned immediately back up to the corresponding Pick module.*
4. The way to get the creamy goodness out of Pick is to attach a Print("rd"). This will reveal the internal structure of the Pick'ed result.
5. To do something useful with that mess, unhook the Print, and connect and Extract("positions") or ("data") or ("closest vertex") or whatever part you want to see or export. You can have multiple Extracts side-by-side all fed by different outputs of the same Pick.

*Because initially there is no Pick, asking for the output of Pick (with Print for example) before making the pick creates a whiny error message "there is no pick". Ignore it; make a pick, error gone. There is a more elegant way to deal with this: later.

6. I usually put a Select(0) right after each Extract to guarantee I get the first (or only) value returned in each Extract array.
7. Feed the outputs of the Select's to a Format to construct a readable string, then send that to Caption and Collect the Caption with the objects you are picking on, and send to Image.
8. Now, in Execute On Change mode, as you make each pick, the Caption will update to show the result of the most current pick.

9. I almost always set Pick(interpolate=1). I believe Pick(interpolate=0) means you must hit an object precisely (often difficult with points or lines). interpolate=1 means DX will take your sloppy pick, magnetically snap to the nearest real position in the object, then report the uninterpolated value(s) at the real position ('closest vertex'), as well as the sloppy actual pick position (garbage usually) and the uninterpolated real data values found at closest vertex. interpolate=2 will map the data from nearby vertices to your sloppy pick point. This is usually not desirable.

 Thu, 2 Dec 2004 12:26:06 -0800 (PST)

Thank you so much for your comprehensive reply!

I think I got most of it figured out now, but I has just another question.

 

I have this connection

Pick_1 à extract ("data") à select à format à caption à collect (which also has the objects collecting here) àimage, image, image (three branches to image views)

 

When I run it, I get this error "FORMAT: Bad parameter: template must be a string"

 

I didn't make any changes to any of the tools, expect pick_1, in which I checked the interpolate box, and set it to 1.

 

Any ideas?

 

Thanks soo much,

Dave

p.s. do you know hwo to get rid of the previous picks? Once I want to select a different pick, the last one doesn't go away.

 Thu, 2 Dec 2004 14:26:58 -0800 (PST)

1. Users Reference Guide and/or Context-sensitive Help (click the ? on the Format module) should point you to the proper format. The template comes first (first input, or hard-coded inside the configuration dialog box), followed by arguments, like the extracted value. It's like C's printf function, more or less.

2. Pick anywhere NOT on the scene objects to clear the Pick.

3. Now you'll be needing that extra bonus trick I mentioned.
Add Inquire("is not empty") (or "is not null")--I can never remember which it is until I hook it up and run it.
Feed the Pick to Inquire. Also feed the same Pick to the second input of Route.
Feed the output of Inquire to the 1st input of the same Route.
Then take the output of Route to Extract, disconnecting the output of Pick that you have now.
In other words, Inquire determines if there is a Pick or not, then Route either shuts it off if no pick (Inquire returns 0), or passes it if there is a Pick (Inquire = 1). No pesky error messages when the Pick is empty (or null, whatever).

来源: <https://www.mail-archive.com/opendx2-users@lists.berlios.de/msg05079.html>




http://blog.sciencenet.cn/blog-441611-766844.html

上一篇:OpenDX Paths to Visualization 学习笔记之第8、10章
下一篇:火车上偶遇

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2021-10-18 03:45

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部