LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP: How can I change the color map of an intensity graph to gray scale!!?

No, I just made the loop. Thanks very much for the hint!

0 Kudos
Message 11 of 18
(2,372 Views)

Here are some alternatives... 😉

 

 

0 Kudos
Message 12 of 18
(2,365 Views)

I have a follow-up question. After I changed the Z-scale to grayscale, I cannot disable the autoscale of Z-scale. It looks like the minimum and maximum are always changing when I deliver different light on the camera. Is there a way to fix the min and max value ? I have tried the node properties ZScale.Minimum and ZScale.Maximum but it does not work (I mean the VI can run successfully but the scale did not change).

Thanks.

 

1.png

0 Kudos
Message 13 of 18
(1,966 Views)

You should be able to disable autoscaling for the z axis. (e.g. right-click the z-scale and uncheck autoscale or go to the properties page, "scales" tab, select the z-scale, and uncheck autoscale. Try again and report back if you still have problems.

 

Also since you normalize the data using the min/max values, the range should always be the same. Are you re-running the shown scaling code whenever the data changes?

 

It typically helps to attach the entire code instead of a fragment. Sometimes the context and execution order  is important.

Message 14 of 18
(1,951 Views)

Hi altenbach

Thanks so much for your reply. That's just the problem I encountered. I have uncheck the autoscale. and without setting min/max value, z-scale will change automatically (I have check it after each run), even I set an initial values for them. After I set the min/max at the program panel, each time I run, it looks like the image twinking (It's changing fast so I cannot tell it exactly but from the scale bar I can see that it will first show min/max I set, then change to automatic value). I have attached the code I am using. Stil do not know why the min/max value will change when uncheck the autoscale.

0 Kudos
Message 15 of 18
(1,935 Views)
  • First of all, you VI seems to be full of race conditions, for example there is no way to tell in what order the numeric and numeric5 indicators are written and their local variables read, but the outcome critically depends on it. You can eliminate all the local variables easily.
  • Also please remove the stacked sequence, it is very bad form. Execution order is fully determined by the error wire. 😉 (see also)
  • You can combine all your property nodes into one, just resize and select properties. Pick a good order (currently, they all execute in parallel so order is not deterministic). Property nodes execute top to bottom.
  • It seems that you could define marker values that are outside min and max. not sure what should happen in that case. Is that really what you want?
  • Try to avoid all the datatype mismatches and coercion dots, e.g. there is a "=0" primitive.
  • A FOR loop that only iterates once can be deleted. It makes no difference here.
  • Can you display an image in the intensity graph, stop the VI, then make its value the default, save the VI under a new name and attach the VI once more so we have some data to play with.
  • Since you never change the max and min, that belongs before the loop. You only need to write the properties once.
  • Instead of transposing, you could just right-click the graph and transpose there. Seems simpler.
Message 16 of 18
(1,928 Views)

Hi altenbach

Thanks so so much for your comments and suggestions. I wll revise the whole program to make it work more efficiently. Regarding the problem I mentioned, I think I found the reason. The Z-scale setting part (for loop and its inputs ) I use was copied from on-line example. In there, the original author chooses min and max of each data array and sents them to the cluster inside the loop, that's why Z-scale is always in autoscale!  I removed that part and send constants to the Build Array Function to set the min and max, and it works! I know there must be easier way to achieve this. Such as, delete the for loop and just use the node properties to set it. I will paly more with that. But thanks a lot for the help.

 

0 Kudos
Message 17 of 18
(1,918 Views)

Set the property nodes as mentioned in a previous post as below and ignore the color array.

 

Jim12345678_0-1744389402877.png

 

Jim12345678_2-1744389573210.png

 

 

0 Kudos
Message 18 of 18
(35 Views)