LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace One Color With Another in Color Table

Solved!
Go to solution

Yes, but being in two different buildings makes things a bit difficult. Especially since they are not on the same campus. To be honest, I have never met Doug in person.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 11 of 16
(718 Views)

Wow - no one has figured this out yet. I guess I am not the only one having trouble. NI engineers - can you help us here?

 

Thanks,

 

Don

0 Kudos
Message 12 of 16
(691 Views)

Don,

  I apologize about the late response. The forum seemed to have taken a left turn so perhaps the issue was resolved but this was the the case. I looked at your code and it is unclear to me what you are trying to accomplish. Are you trying to remap the color levels? 

It seems like you successfully remap the color levels but do not redraw the image. 

This cannot be done through simply editing the color table and asking it to redraw. Instead you will need to use array functions to replace any element with the color in question with the replacement color.

I gave a crude effort to try and do this with the attached file. Its acts strangely but I think it will lead you in the right direction.

-Ben

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 13 of 16
(676 Views)
Solution
Accepted by topic author DonRoth

Hello Ben -

 

1) I have already created a VI using an actual value replacement approach.

2) But the premise you pose about not being able to use the color table approach I believe to be incorrect.  Substitute the attached VI for the original 'normalize' VI I had attached.  You can see how the colors will change using the color table approach.  I think the issue is that the color ramps need to be adjusted from 1 to 254 rather than 0 to 255.  If we can confirm this, then I think we can say we have the solution.

 

front panel showing color table approach.PNG

0 Kudos
Message 14 of 16
(671 Views)

Good catch! I see that for one reason or another the indices of the color table seem to be acting strange. Simply track down the right index you need using an array indicator (I had one set at 0 and one set at 253 so I could see the relevant elements of the array) and you should be able to pull this off.

 

SS-2010.10.22-13.32.32.png

Ben J.
National Instruments
Applications Engineer
0 Kudos
Message 15 of 16
(667 Views)

Finally getting back to this.  I used my revised routine on an image containing many shades of gray today.  Seems to work fine.  So I think that the way I normalize the data to between 1 and 254 should be considered the solution allowing this type of color table manipulation.

 

Sincerely,

 

Don

0 Kudos
Message 16 of 16
(645 Views)