LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

poor quality CW 3d graphs

I followed the examples posted on this forum to create a 3d graph with CW (code basically from this, colormap stuff added based on this, and summary here), but I get really bad looking graphs. It must be something I'm doing wrong, because you guys get awesome graphs but mine look terrible even when graphing something as simple as a sphere.

 

The picture below shows the smaller sphere at left (21x21x21), the larger sphere at right (201x201x201), and how each one looks in labview (top) and matlab (bottom).

compare.png

 

Alternatively, I'm aware of the '3d parametric surface.vi' but haven't tried it yet because it takes three 2d arrays as inputs, while I have one 3d array. All the usage examples (torus, ribbon, and this) generate the figures mathematically, which I could probably do with the sphere but need to work directly from the 3d array because equations will not always be available. However, this would involve transforming the 3d array into three 2d arrays somehow, and I don't have the slightest idea how that would be done. Suggestions on any of these approaches would be greatly appreciated.

 

Also you might notice the matlab script node, that works fine for the spheres but the graphing command gives up on a larger array of the size I will need later. So that's why I went back to trying CW.

Download All
0 Kudos
Message 1 of 15
(5,042 Views)

The first thing to check for graphic related issues is your video interface.

 

Reducing acceleration may help.

 

Make sure you are using the latest version of the driver available for the interface.

 

Your comparison of the two does not look to be an apples to apples compare. Are they?

 

Transparency can be achieved using "NaN" for point that you do not want to plot. Some of my best images where achieved by me scanning the datat set and replacing the values below some threshold with NaN. That should get rid of the yellow.

 

Few people have worked with the 3D plots since computers were not fast enough to use them for anything but trivial displays. So I recomend you start another thread that does NOT mention 3D at all but rather ask for help learning to manipulate your data into the form you need. There are plenty of people that can help with that.

 

After you learn how to manipulate your data set, return the 3D and see what you get.

 

Q:

I am curious about the "steps" in the CW version. Does your data really "step" like that?

 

Once you get a handle on masaging your data, (if you are like me) you will have a good time examing data and "seeing what no person has seen before."

 

Have fun!

 

Ben

 

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 15
(5,015 Views)

Thanks for your responses. You seem to think it's an issue with the computer itself, I will look into that, however I'm not sure that's the issue because I ran your sample '3-d surface.vi' and it looks exactly like the pictures you posted, really beautiful.

 

"Your comparison of the two does not look to be an apples to apples compare. Are they?"

The only thing that differs is the data. (bin files that are read in)
I don't mind the yellow, I'll try the NaN thing though, I mind that it doesn't look like a sphere. The matlab figures are from ancient matlab (7.5.0), and at least they look like spheres. Granted, they are not that great but I'd be satisfied if the CW version looked like that.

 

"I recomend [sic] you start another thread that does NOT mention 3D at all"
Not sure about that, because being 3D is kind of the whole point. The spheres themselves are only practice for the real dataset which is a bigger 3d array.

 

"I am curious about the "steps" in the CW version. Does your data really "step" like that?"
It is a bin file consisting of a bunch of images put together in a stack. I think that's the reason it shows up like that, but matlab doesn't show that. It isn't particularly desirable or undesirable. All I care is that the sphere shows up as a sphere.

0 Kudos
Message 3 of 15
(5,008 Views)

Ok you ruled outhe machine etc.

 

Apples and oranges

 

I think you are going to hve to bite the bullet and go with a parameteric plot so that you can let the 3d graph create the surface on the surface of the sphere. Doing so will take most of the edges off. The 3D car is an example where I have a single 2d array that defines the "sheet" that covers the frame described by the rest of the data. In your case the frame will be a sphere.

 

If you are trying to extract that surface from your data set, you are asking something I never did quite gt figured out and in fact I paid another developer here on the forums to write that code. It was based on that ubiquitous gif you see everywhere of a a guys head sliced by MRI imaging. I really wanted to see his face.

 

Unfortunately my copy of the code was lost in a hard-drive crash before I got a chance to run it.

 

Richard,

 

Are you listeneing? Do you still have that code?

 

If Richard does not help us out then all is not lost. I think it was somewhere in the BIO Tool kit in the LV community there was code that did something that looked similar. Try looking there to see if that thing will help. No it is not the CW version. It is based on the new 3d graphs.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 15
(5,005 Views)

If by "Apples and oranges" you mean labview and matlab, then yes that is the case. The point of posting those pictures is to show that the data actually do depict a sphere, so it's not because of faulty data. The rougher looking sphere is a much smaller array (21*21*21 vs 201*201*201). I was just trying different data sizes.

 

"I think you are going to hve [sic] to bite the bullet and go with a parameteric [sic] plot" - but the point is not to create the sphere, that is just test data that depict a known object. So I know what the results are supposed to look like. But that is not really the goal. 

 

"If you are trying to extract that surface from your data set" - not really, I'm trying to graph the volume, but that code to see the guy's face still sounds really interesting. I'd like to look at it too.  I'm sure you know this but if you remember Richard's username by any chance, sending him a pm would probably be more likely to get results. Or I can send the message if you want, but you're the one that has claim to the code.

 

Toolkit - you're talking about the 3d image reconstructor, right? I had previously looked at it but abandoned it because couldn't find where it installed, but since you mentioned it, I tried installing it again, found it this time. It works with a set of images, like many programs; this is non-ideal as it takes up a lot more space versus working directly from the bin, but that may be the only way. However, I loaded an image set and it just gives a black screen. Right now I'm having better luck with external programs, so future questions will probably have to do with integrating these with labview.  But I'd still really like to see the MRI thing you were talking about. That sounds really cool. 

 

I really appreciate your enthusiasm for this topic. I knew you were the go-to person.

0 Kudos
Message 5 of 15
(4,995 Views)

i just tried it your v ersion in 2011 and it is completely hosed.

 

Transparency no work.

 

get Axes ref no work.

 

Preview while adjust properties completelty hosed.

 

NI will have to fix.

 

All I can suggest is try it in an eralier version.

 

Note:

THe game is complicated by your data being only 0 an 100 but the other stuff should still work,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 15
(4,988 Views)

OK thanks for trying it. I'm also using 2011. So you're saying it's an issue with labview. But the graphs you're getting look as lousy as mine, right?

Anyway, I'll try something else for now, appreciate your help.

 

"NI will have to fix" - or make the new vi so it takes a 3d array as input.

0 Kudos
Message 7 of 15
(4,977 Views)

@count3r5tr1ke wrote:

OK thanks for trying it. I'm also using 2011. So you're saying it's an issue with labview. But the graphs you're getting look as lousy as mine, right?

Anyway, I'll try something else for now, appreciate your help.

 

"NI will have to fix" - or make the new vi so it takes a 3d array as input.


 

I want to retract that previous post. It was a quick look before bed and sleeping on it I think I may have been too hasty.

 

1) There are errors being reported in the error cluster that we have to fix.

 

A) The errors did not have a english translation like they did in previous versions. But I have seen the errors in earlier versions so I suspect the first issue has to do with the color ramp. The color ramp requires we have the same numbr of colors as values and the sub-VI that develops the ramps was not written for a data set that only had two values (0, 100). So I suspect the first error is due to a mismatch in the number of values in the ramp. That error ripples down stream and srews with what happens down the wire.

 

Note: SInce I don't have access to 2011 while here at work, I will not be able to look further until tomorow morning at the earliest (I have a neighborhood surival meeting this evening). If you gather up all of the sub-VIs along with your code and post it as a 2010 zip I may be able to take another peak.

 

2) I am not sure if the transparency issue is due to the color ramp error. I reserve judgement on that issue.

 

3) THe errors trying to get a ref to the axes is what woke me up last night. Is there a possibility you have wire the plot ref to the set axes range sub-VI instead of the Graph? The Axes is a property of the graph no the plot. The axes range was the big factor preventing what I was seeing last nigth from looking like a sphere. THe preview as acting very funky last night but it was late and maybe it was just me.

 

SO the CW 3D graph may be OK and it just a matter of using it correctly.

 

As to your data set.

 

Most of the data is zero. Looking at the data I can see where the jagged edges are coming from. With enough data points and slices and the axes ranges set correctly you may still get the sphere you were after.

 

So see if you can work out some of the erros yourself. I'll see if I can squeeze in another look this week-end if I can find the time between the all of the other activites I have scheduled.

 

Again please forgive me for the hasty post from last night.

 

Ben

 

PS I sent a PM message to see if that other code I mentioned still exists.

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 15
(4,972 Views)

Re the other code...

 

I just a got a PM reply and he will look to see if he can find it. I can not say at this point if he will allow it to be posted publicly so don't get your hopes up.

 

Take care,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 15
(4,963 Views)

Hi all,

 

I've been advised some of my old code might be useful here, so I'm attaching it to this post:

1. 3D Modeller.zip - the LabVIEW project

2. Images1.zip - the first set of slice images (in a follow up post hopefully because I hit the post attachment limit)

3. Images2.zip - the remainder of the slice images (in a follow up post hopefully because I hit the post attachment limit)

 

It's from 2009, written in a terrible hurry and before I became CLA, so the code is a mess! Smiley Embarassed

 

There's a readme included which instructs how to use it, I haven't looked at it in over 3 years so I have no idea how to use it myself anymore, but hopefully it'll prove useful to someone...

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
Message 10 of 15
(4,959 Views)