[vtkusers] Re versing Color
David Doria
daviddoria+vtk at gmail.com
Fri Jan 22 11:58:39 EST 2010
On Fri, Jan 22, 2010 at 11:53 AM, KS Jothybasu <jothybasu at gmail.com> wrote:
> Have a look David, let me know if I need to change any style to comply with
> the wiki.
>
> Another thing you can add these points in how to contribute ,otherwise
> python users may struggle adding examples.
>
> 1) Create a login/user for the wiki (maybe you have already done this?)
> *you may insert "click Learning VTK then Examples"*
> 2) Click [edit] in the section you want to add something to
> 3) Create a new page and a link to the new page by adding:
> * [[VTK/Examples/NewPageName | What you want to display as the link]]
> 4) when you save these changes, there will now be a red link. When you
> click this link, it immediately brings you to the "edit" page of the new
> page
> 5) add the content and save it
> 6) the link automatically turns blue (so it now goes to the "page" page
> instead of the "edit" page)
>
> Thanks
>
> Jothy
>
>
>
>
> On Fri, Jan 22, 2010 at 4:43 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> > wrote:
>
>> On Fri, Jan 22, 2010 at 11:39 AM, KS Jothybasu <jothybasu at gmail.com>wrote:
>>
>>> Wierd problem with page editor!
>>>
>>> David, I have managed to add the content but the problem is, all '#' are
>>> converted to '1' and the formatting has also changed
>>> .
>>>
>>> See the screenshot
>>>
>>> I copied the code from python editor, I even tried from MSWord
>>>
>>> Jothy
>>>
>>>
>>> On Fri, Jan 22, 2010 at 4:00 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
>>> > wrote:
>>>
>>>>
>>>> On Fri, Jan 22, 2010 at 10:53 AM, KS Jothybasu <jothybasu at gmail.com>wrote:
>>>>
>>>>> Sure by the way I had converter 2 of the c++ examples to python how to
>>>>> add that to wiki?
>>>>>
>>>>> Slowly ,down the line I will convert all the c++ to python!
>>>>>
>>>>> Thanks
>>>>>
>>>>> Jothy
>>>>>
>>>>>
>>>>> On Fri, Jan 22, 2010 at 3:46 PM, David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
>>>>> > wrote:
>>>>>
>>>>>> On Fri, Jan 22, 2010 at 10:42 AM, circass <circass at gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> I Gonna try to implement that to my code.
>>>>>>> Thanx,
>>>>>>> Circass
>>>>>>>
>>>>>>>
>>>>>>> KS Jothybasu wrote:
>>>>>>> >
>>>>>>> > In vtkLookupTable. Are you using vtkLookupTable if not here is a
>>>>>>> part of
>>>>>>> > the
>>>>>>> > code which might help you.
>>>>>>> >
>>>>>>> > * # Create a greyscale lookup table
>>>>>>> > table = vtk.vtkLookupTable()
>>>>>>> > table.SetRange(grayscale) # image intensity range
>>>>>>> > table.SetValueRange(1,0) # from black to white
>>>>>>> > table.SetSaturationRange(0.0, 0.0) # no color saturation
>>>>>>> > table.SetRampToSCurve()
>>>>>>> > table.SetNumberOfTableValues(402)
>>>>>>> > table.Build()
>>>>>>> >
>>>>>>> > # Map the image through the lookup table
>>>>>>> > color = vtk.vtkImageMapToColors()
>>>>>>> > color.SetLookupTable(table)
>>>>>>> > color.SetInputConnection(reslice.GetOutputPort())
>>>>>>> >
>>>>>>> > # Display the image
>>>>>>> > actor = vtk.vtkImageActor()
>>>>>>> > actor.SetInput(color.GetOutput())
>>>>>>> > *
>>>>>>> > Jothy
>>>>>>> >
>>>>>>> > On Fri, Jan 22, 2010 at 3:36 PM, circass <circass at gmail.com>
>>>>>>> wrote:
>>>>>>> >
>>>>>>> >>
>>>>>>> >> Where should i use that function ?
>>>>>>> >> is there a specific filter or what ?
>>>>>>> >>
>>>>>>> >> Thanx
>>>>>>> >> Circass
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> KS Jothybasu wrote:
>>>>>>> >> >
>>>>>>> >> > Could you please try SetValueRange(1,0).
>>>>>>> >> >
>>>>>>> >> > Regards
>>>>>>> >> >
>>>>>>> >> > Jothy
>>>>>>> >> >
>>>>>>> >> > On Fri, Jan 22, 2010 at 2:06 PM, circass <circass at gmail.com>
>>>>>>> wrote:
>>>>>>> >> >
>>>>>>> >> >>
>>>>>>> >> >> I think Alessandro understood me wrong, so i m trying to
>>>>>>> explain what
>>>>>>> >> i
>>>>>>> >> >> want
>>>>>>> >> >> more clearly.
>>>>>>> >> >>
>>>>>>> >> >> I have dicom files that i read with itk and vtk.
>>>>>>> >> >>
>>>>>>> >> >> my images are already greyscale, i want to change the blacks
>>>>>>> with
>>>>>>> >> whites
>>>>>>> >> >> and
>>>>>>> >> >> vice versa.
>>>>>>> >> >>
>>>>>>> >> >> Thanx.
>>>>>>> >> >> Circass
>>>>>>> >> >> --
>>>>>>> >> >> View this message in context:
>>>>>>> >> >> http://old.nabble.com/Reversing-Color-tp27272638p27273652.html
>>>>>>> >> >> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>>>>> >> >>
>>>>>>> >> >> _______________________________________________
>>>>>>> >> >> Powered by www.kitware.com
>>>>>>> >> >>
>>>>>>> >> >> Visit other Kitware open-source projects at
>>>>>>> >> >> http://www.kitware.com/opensource/opensource.html
>>>>>>> >> >>
>>>>>>> >> >> Please keep messages on-topic and check the VTK FAQ at:
>>>>>>> >> >> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>> >> >>
>>>>>>> >> >> Follow this link to subscribe/unsubscribe:
>>>>>>> >> >> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>>> >> >>
>>>>>>> >> >
>>>>>>> >> > _______________________________________________
>>>>>>> >> > Powered by www.kitware.com
>>>>>>> >> >
>>>>>>> >> > Visit other Kitware open-source projects at
>>>>>>> >> > http://www.kitware.com/opensource/opensource.html
>>>>>>> >> >
>>>>>>> >> > Please keep messages on-topic and check the VTK FAQ at:
>>>>>>> >> > http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>> >> >
>>>>>>> >> > Follow this link to subscribe/unsubscribe:
>>>>>>> >> > http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>>> >> >
>>>>>>> >> >
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> View this message in context:
>>>>>>> >> http://old.nabble.com/Reversing-Color-tp27272638p27275052.html
>>>>>>> >> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>>>>> >>
>>>>>>> >> _______________________________________________
>>>>>>> >> Powered by www.kitware.com
>>>>>>> >>
>>>>>>> >> Visit other Kitware open-source projects at
>>>>>>> >> http://www.kitware.com/opensource/opensource.html
>>>>>>> >>
>>>>>>> >> Please keep messages on-topic and check the VTK FAQ at:
>>>>>>> >> http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>> >>
>>>>>>> >> Follow this link to subscribe/unsubscribe:
>>>>>>> >> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>>>> >>
>>>>>>> >
>>>>>>> > _______________________________________________
>>>>>>> > Powered by www.kitware.com
>>>>>>> >
>>>>>>> > Visit other Kitware open-source projects at
>>>>>>> > http://www.kitware.com/opensource/opensource.html
>>>>>>> >
>>>>>>> > Please keep messages on-topic and check the VTK FAQ at:
>>>>>>> > http://www.vtk.org/Wiki/VTK_FAQ
>>>>>>> >
>>>>>>> > Follow this link to subscribe/unsubscribe:
>>>>>>>
>>>>>>>
>>>>>> Jothy,
>>>>>>
>>>>>> I don't see an example about vtkImageMapToColors on the wiki. Care to
>>>>>> add one :) ?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> David
>>>>>>
>>>>>>
>>>>>>
>>>> Great, thanks! You'll need to do the following:
>>>>
>>>> 1) Create a login/user for the wiki (maybe you have already done this?)
>>>> 2) Click [edit] in the section you want to add something to
>>>> 3) Create a new page and a link to the new page by adding:
>>>> * [[VTK/Examples/NewPageName | What you want to display as the link]]
>>>> 4) when you save these changes, there will now be a red link. When you
>>>> click this link, it immediately brings you to the "edit" page of the new
>>>> page
>>>> 5) add the content and save it
>>>> 6) the link automatically turns blue (so it now goes to the "page" page
>>>> instead of the "edit" page)
>>>>
>>>> Let me know if you have any problems - if you do, lets modify this set
>>>> of instructions so it is followable by a new wiki contributor and I'll add
>>>> it as a "how to contribute" section. Also, let me know when you do the first
>>>> one and I'll check it out for style, etc.
>>>>
>>>> Thanks,
>>>>
>>>> David
>>>>
>>>>
>>>>
>> You need to put code inside of these tags:
>>
>> <source lang="python">
>> // your code here
>> </source>
>>
>> Also, you can use this to make a title:
>> ==vtkCutter.py==
>>
>> Another thing - the "show preview" button at the bottom next to "save
>> page" is a good idea - it will let you play around with things and see what
>> they look like without actually uploading them to the wiki. When you are
>> satisfied, you can then click "save page".
>>
>> Thanks,
>>
>> David
>>
>>
Looks good to me. I don't know if there is a very strict VTK python coding
style to follow like there is c++. Maybe another python user can take a look
and let us know if anything sticks out as "wrong" or "weird":
http://www.vtk.org/Wiki/VTK/Examples/Python/vtkCompassWidget
Also, I added
* Contributed by Jothy
at the top of the page.
Thanks again for helping with this!
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100122/7ac27ed5/attachment.htm>
More information about the vtkusers
mailing list