<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-04-15 16:36 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">2016-04-15 16:09 GMT+02:00 Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Elvis,<br>
<br>
Have a look at<br>
<br>
<a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx" rel="noreferrer" target="_blank">http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Charts/Core/Testing/Cxx/TestScalarsToColors.cxx</a><br>
<br>
for an example of how to set up the transfer function editors used in ParaView.<br>
<br>
You can eliminate the check at the end for vtkOpenGL2ContextDevice2D -<br>
make sure to initialize and start the interactor, though.<br>
<br>
I don't see anything in this example that won't work in Python - if<br>
there is, please report back any problems you encounter.<br></blockquote><div><br></div></span><div>Excellent, thanks a lot. I'll report back how it went.<span class=""><font color="#888888"><br></font></span></div></div></div></div></blockquote><div><br></div><div>Worked like a charm :) It's not quite the same as the editors in ParaView though. In ParaView, the opacity and color transfer functions are edited separately, like this:<br><br>    <a href="https://blog.kitware.com/blog/files/48_1536770536.png">https://blog.kitware.com/blog/files/48_1536770536.png</a><br><br></div><div>Do you know if it's possible to get that kind of editing through VTK classes, with the color transfer function edited using a gradient editor below and the X/Y editor only for the the opacity transfer function, or is ParaView doing something custom here?<br><br></div><div>(I the class vtkCompositeTransferFunctionItem has "composite" in its name precisely because it provides editing of both color/opacity in the same editor, while I would like the separated approach that ParaView has.)<br></div><div><br></div><div>Elvis<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span class=""><font color="#888888"><br></font></span></div><span class=""><font color="#888888"><div>Elvis<br> <br></div></font></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
HTH,<br>
Cory<br>
<div><div><br>
On Fri, Apr 15, 2016 at 8:54 AM, Elvis Stansvik<br>
<<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'd like to use the transfer function editors that VTK seems to provide<br>
> (used by e.g. Paraview) from Python. Is it possible?<br>
><br>
> Looking at<br>
><br>
>    <a href="http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html" rel="noreferrer" target="_blank">http://www.vtk.org/pipermail/vtkusers/2013-December/082410.html</a><br>
><br>
> I read the slightly worrying:<br>
><br>
>     "[...] Save/restore state and python interface are not working as<br>
> expected. [...]"<br>
><br>
> Though that was an old message when the new editors were first introduced in<br>
> 2013. Is it still the case that the Python interface for the editor classes<br>
> is not working as expected?<br>
><br>
> Does anyone know of a Python application/example that makes use of the<br>
> editors? (I'm using VTK 6.2 and PyQt 5.5.1).<br>
><br>
> Thanks,<br>
> Elvis<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
><br>
<span><font color="#888888"><br>
<br>
<br>
--<br>
Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.<br>
</font></span></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>