<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello Álvaro,<div class=""><br class=""></div><div class="">It works! </div><div class="">Rendering multiple overlapping data volumes with the same grid is possible with vtkGPUVolumeRayCastMapper.</div><div class="">Using numpy arrays was easy to gather the different 3-dimensional data arrays together by adding a 4th index to the combined array. </div><div class="">The volume properties can be set independently for each one of the components.</div><div class="">Thanks for the help!</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Alberto</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Aug 2016, at 15:55, amdelaossa <<a href="mailto:adelaossa@gmail.com" class="">adelaossa@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">On 26 Aug 2016, at 15:43, Alvaro Sanchez <<a href="mailto:alvaro.sanchez@kitware.com" class="">alvaro.sanchez@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class=""><div class=""><div class="">It is great to read that you are working on this feature for future releases of VTK. </div><div class="">I think that it will be very useful for many people. </div><div class="">In the mean time I would like to try your proposed approach of defining multiple components in one volume. </div><div class="">Let me ask you something:</div><div class="">If data1, data2, data3 are my three independent three-dimensional data arrays, should I merge them first in a four-dimensional array where the first index is the component index?</div><div class=""><br class=""></div><span class=""></span></div></div></div></blockquote></div><div class=""><br class=""></div><div class="">You should merge them in a three-dimensional array (each component being dataN). Checkout TestGPURayCastTwoComponentsIndependent, that could serve you as an example. Going back to your initial question though, as Elvis pointed out, if your volumes are not overlapping you could create instead several vtkVolumes (each with its own mapper), this should also work.</div></div></div></blockquote><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">My volumes are overlapping but they are defined in the same (regular) grid. </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">So I need to use the multi-component trick. </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">However I still do not understand the format…</div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Lets say that I have two 3D arrays data1 and data2 with identical number of components in each direction, i.e. data1(Nx,Ny,Nz) and data2(Nx,Ny,Nz).</div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Should merge them into another array which would look like this: </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">data(2 * Nx, Ny, Nz) </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">with data(i,j,k) = data1(i,j,k) for i<Nx and </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">data(i,j,k) = data2(i-Nx,j,k) for i>=Nx </div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Is that right?</div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Thanks!</div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Alberto</div><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class=""><div class="">Could you give an rough estimation of when multiple volumes rendering with vtkGPUVolumeRayCastMapper will be available in VTK?<br class=""></div></div><div class=""><br class=""></div></div></blockquote></div><div class=""><br class=""></div><div class="">My best guess would be VTK 8.</div><br class=""><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Aug 26, 2016 at 6:39 AM, amdelaossa<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:adelaossa@gmail.com" target="_blank" class="">adelaossa@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word;">Hi Álvaro,<div class=""><br class=""></div><div class="">Thanks a lot for your prompt answer!</div><div class="">See my comments below. </div><div class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">as you have noticed, multi-volume rendering is currently not supported in the vtkGPUVolumeRayCastMapper. If you are building VTK with OpenGL2 however, it supports independent components so (depending on your use case) you might be able to render up to 4 volumes (one per component), provided you can arrange them in a four component array (this has the limitation that each component will need to have the same dimensions). That said, we are working on giving support for multiple volumes in the next VTK release.</div></blockquote><div class=""><br class=""></div></span><div class="">It is great to read that you are working on this feature for future releases of VTK. </div><div class="">I think that it will be very useful for many people. </div><div class="">In the mean time I would like to try your proposed approach of defining multiple components in one volume. </div><div class="">Let me ask you something:</div><div class="">If data1, data2, data3 are my three independent three-dimensional data arrays, should I merge them first in a four-dimensional array where the first index is the component index?</div><span class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div dir="ltr" class=""><div class="">With regards to the solution you mentioned (<a href="https://github.com/bozorgi/VTKMultiVolumeRayCaster" target="_blank" class="">https://github.com/bozorgi/<wbr class="">VTKMultiVolumeRayCaster</a>), you could use it temporarily if it would solve your problem better than fitting the volumes as independent components. It seems to implement a similar approach as we would do (connecting various inputs/ properties to the mapper) so it should not be extremely difficult to migrate to the official implementation in the future. I have not tried it myself but please do let us know if you have any remarks once you try it. As far as I know, if the python bindings are not explicitly disabled for these new classes then they should be also wrapped.</div></div></blockquote><div class=""><br class=""></div></span><div class="">Alright. However this solution is currently not useful to me since it was implemented for VTK 5 (I think) and it fails to compile against VTK 7. </div><div class="">So I am temporarily stuck here. I’d like to try your approach with the multi-components…</div><div class=""><br class=""></div><div class="">Could you give an rough estimation of when multiple volumes rendering with vtkGPUVolumeRayCastMapper will be available in VTK?</div><div class=""><br class=""></div><div class="">Thanks a lot!</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Alberto</div><div class=""><div class="h5"><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Regads,</div><div class="">Álvaro</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="" style="font-family: verdana, sans-serif; font-size: small; color: rgb(11, 83, 148);"><br class=""></div><div class="gmail_quote">---------- Forwarded message ----------<br class="">From:<span class="Apple-converted-space"> </span><b class="gmail_sendername">amdelaossa</b><span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:adelaossa@gmail.com" target="_blank" class="">adelaossa@gmail.com</a>></span><br class="">Date: Thu, Aug 25, 2016 at 10:00 AM<br class="">Subject: [vtkusers] Multiple volumes rendering with vtkGPUVolumeRayCastMapper or similar<br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:vtkusers@vtk.org" target="_blank" class="">vtkusers@vtk.org</a><br class=""><br class=""><br class=""><div class="" style="word-wrap: break-word;">Dear all, <div class="">we (a <a href="http://plasma.desy.de/research/simulation_and_theory/index_eng.html" target="_blank" class="">research team</a> in DESY, Germany) are strongly interested in rendering multiple data volumes in the same view with VTK. </div><div class="">We chose VTK for our 3D visualisation project on beam-plasma interactions due to its extended functionality and features, </div><div class="">its open source character and because it is written in C++ with bindings for python.<br class="">However, we will require to show multiple volumes in the same view (representing the data of different particle species in our simulations).<br class="">We are currently using a vtkGPUVolumeRayCastMapper object for each data set, which is then connected to a vtkVolume. </div><div class="">The different vtkVolume objects are then added to the vtkRenderer.<br class="">We have tried to use different vtkRenderer objects for the different vtkVolumes, </div><div class="">but still only the first volume on the first vtkRenderer is displayed. <br class=""><br class="">Searching in the web, we have found the following (potential) solution:<br class=""><a href="https://github.com/bozorgi/VTKMultiVolumeRayCaster" target="_blank" class="">https://github.com/bozorgi/VTK<wbr class="">MultiVolumeRayCaster</a><br class="">which is published here:<br class=""><a href="http://www.ncbi.nlm.nih.gov/pubmed/24841148" target="_blank" class="">http://www.ncbi.nlm.nih.gov/pu<wbr class="">bmed/24841148</a><br class=""><br class="">It consists on new vtk classes to handle multiple volumes rendering.<br class="">As it might work well for our purposes, we would like to ask your opinion about this new classes.<br class="">Are you planning to incorporate something like this in the official VTK distribution soon?<br class="">If not, we will be interested in incorporating this new class into our personal VTK installation.<br class="">Then the question is: Will be the python bindings automatically generated for these new classes?<br class=""><br class="">Thanks a lot for your support!</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Alberto</div><div class=""><br class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensou<wbr class="">rce/opensource.html</a><br class=""><br class="">Please keep messages on-topic and check the VTK FAQ at:<span class="Apple-converted-space"> </span><a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank" class="">http://www.vtk.org/Wiki/VTK_FA<wbr class="">Q</a><br class=""><br class="">Search the list archives at:<span class="Apple-converted-space"> </span><a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=<wbr class="">vtkusers</a><br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class=""><a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mail<wbr class="">man/listinfo/vtkusers</a><br class=""><br class=""></div><br class=""></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div data-smartmail="gmail_signature" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Alvaro Sanchez</div><div class="">Kitware, Inc.</div><div class=""><span class="" style="font-family: Arial; font-size: 14.6667px; line-height: 20.24px; white-space: pre-wrap;">Senior </span>R&D Engineer</div><div class="">21 Corporate Drive</div><div class="">Clifton Park, NY 12065-8662</div><div class="">Phone:<span class="Apple-converted-space"> </span><a href="tel:518-881-4901" value="+15188814901" target="_blank" class="">518-881-4901</a></div></div></div></div></div></div></div></blockquote></div></div></div><br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Alvaro Sanchez</div><div class="">Kitware, Inc.</div><div class=""><span class="" style="font-family: Arial; font-size: 14.6667px; line-height: 20.24px; white-space: pre-wrap;">Senior </span>R&D Engineer</div><div class="">21 Corporate Drive</div><div class="">Clifton Park, NY 12065-8662</div><div class="">Phone: 518-881-4901</div></div></div></div></div></div></div></div></blockquote></div></blockquote></div><br class=""></div></body></html>