[vtkusers] Clarification and help using vtkLookupTable
Andras Lasso
lasso at queensu.ca
Sat Nov 3 13:14:34 EDT 2018
Probably the most efficient way of learning exact behavior of simple classes is to read their source code.
vtkLookupTable is a really simple one and its source code is available here:
https://github.com/Kitware/VTK/blob/master/Common/Core/vtkLookupTable.cxx
Andras
-----Original Message-----
From: vtkusers <vtkusers-bounces at public.kitware.com> On Behalf Of Franks
Sent: Friday, November 2, 2018 11:29 PM
To: vtkusers at vtk.org
Subject: Re: [vtkusers] Clarification and help using vtkLookupTable
I have the same problem as Neel. I read your answer, but still don't understand why it works like that. Could you do me a favour to have a look and tell me what does *SetRange()* work.
Thank you, and I look forward to hearing from you.
Best regards,
Frank
David E DeMarle wrote
> Take out the calls to set ramp and especially build. Build replaces
> all of the value:colors you've set with automatically generated ones.
>
> On Aug 7, 2017 8:04 PM, "Neel Patel 0-0-0" <
> siva.yedithi@
> > wrote:
>
>> Hi All,
>>
>> I'm trying to use vtkLookupTable to add color in my image,
>> something like what they show on the weather forecasts. From what I
>> understand,
>> SetRange(0,255) means that any pixel value in the image that is in
>> between the min and max, will be assigned a value that has been set
>> by SetTableValue(0, 0, 0, 0, 0) and SetTableValue(255, 255, 255, 255,
>> 1). To test this out I made a simple lookupTable where everything
>> except for 0 was given a rgb value of 255, 0, 0;
>>
>> vtkLookupTable table = vtkLookupTable.New();
>> table.SetRange(0, 255);
>> table.SetTableValue(0, 0, 0, 0, 0);
>>
>> for (int i = 1; i < 255; i++)
>> {
>> table.SetTableValue(i, 255, 0, 0, 0.3);
>> }
>> table.SetRampToLinear();
>> table.Build();
>>
>> This however still gives me and image with red, green, and blue
>> showing up instead of just red. Also just to note this is on top of a
>> black/white image, so there aren't any other places from which the
>> colors could come from. Any help would be appreciated. Thanks.
>>
>> Regards,
>> Neel Patel
>>
>>
>>
>>
>>
>> --
>> View this message in context: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=Gr5TWFZL9U8pp5Dt9OtA0h%2BqhjqtFJcgOPZkFPtTmu4%3D&reserved=0.
>> com/Clarification-and-help-using-vtkLookupTable-tp5744313.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by
>> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&am
>> p;data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720
>> f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&
>> ;sdata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%3D&reserved=0
>>
>> Visit other Kitware open-source projects at
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k
>> itware.com%2F&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448
>> c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768
>> 125213390066&sdata=K5Sha9ew1zZ3uimPY0L%2BDk1JPv9Zf1GdYut0SHaMw4E%
>> 3D&reserved=0
>> opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.v
>> tk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cf443d
>> 9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C
>> 0%7C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY
>> %2BTrblTrFA%3D&reserved=0
>>
>> Search the list archives at:
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkm
>> ail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu
>> .ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b
>> 925c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2F
>> rq61WKKj3r3q131nGNMY%3D&reserved=0
>>
>> Follow this link to subscribe/unsubscribe:
>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpubli
>> c.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Class
>> o%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d58
>> 2c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=JFhq5aqab5TP%2
>> BVA5dZWvbVXD6tLY4x0gJ9oTJn5sf%2Bk%3D&reserved=0
>>
>
> _______________________________________________
> Powered by
> https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&
> ;data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%
> 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sd
> ata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%3D&reserved=0
>
> Visit other Kitware open-source projects at
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ki
> tware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40qu
> eensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2
> 838b925c%7C1%7C0%7C636768125213390066&sdata=zSv2RJkpcvZInQHLsgnHK2
> xF5Mbj8dAHD2piThqfAVo%3D&reserved=0
>
> Please keep messages on-topic and check the VTK FAQ at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vt
> k.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cf443d90
> 33aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7
> C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY%2BT
> rblTrFA%3D&reserved=0
>
> Search the list archives at:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkma
> il.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.c
> a%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925
> c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2Frq61
> WKKj3r3q131nGNMY%3D&reserved=0
>
> Follow this link to subscribe/unsubscribe:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic
> .kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%
> 40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4
> efb2838b925c%7C1%7C0%7C636768125213390066&sdata=JFhq5aqab5TP%2BVA5
> dZWvbVXD6tLY4x0gJ9oTJn5sf%2Bk%3D&reserved=0
--
Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=cFaWLyy1Ofe82rlhMqKaG7hKoKXkSU69%2BUYIcvTX7Nw%3D&reserved=0
_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=xKCvyP7b1fzlB7CY14vKNEMzZ57wfNnfn3IokUb0GRY%3D&reserved=0
Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=zSv2RJkpcvZInQHLsgnHK2xF5Mbj8dAHD2piThqfAVo%3D&reserved=0
Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=rT3yPFdComh%2BWQFBOgo8vYgfSgKvIUozhY%2BTrblTrFA%3D&reserved=0
Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=3CK1X5hAIJCIn6Lu0NjX6i%2Frq61WKKj3r3q131nGNMY%3D&reserved=0
Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cf443d9033aaf448c833408d6413c720f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636768125213390066&sdata=DnXjuCp5k%2Fv89Vn7jM5QZ3HfyiVzINHqlLU8TnnNwJI%3D&reserved=0
More information about the vtkusers
mailing list