<div dir="ltr">Hi Kenji, <div><br></div><div>Could you please try the attached patch? Once if works for you, I will clean it up and create a merge request. </div><div><br></div><div>Thanks,</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 11:41 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Aha... I think I know how to fix the bug.  Gradient opacity was the key. I will push a fix today. <span class="HOEnZb"><font color="#888888"><div><br></div><div>- Aashish</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 11:30 AM, Kenji Tsumura <span dir="ltr"><<a href="mailto:kenji.tsumura@neosoftmedical.com" target="_blank">kenji.tsumura@neosoftmedical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Aashish,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Adding gradient opacity to the test sample causes the same error I have seen in my application.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Please refer to the attached file.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">So my application works with IndependentComponents On after removing gradient opacity.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Kenji</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Aashish Chaudhary [mailto:<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>]
<br>
<b>Sent:</b> Tuesday, December 08, 2015 8:22 AM</span></p><div><div><br>
<b>To:</b> Kenji Tsumura<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] vtkVolumeProperty IndependentComponents On and Off</div></div><p></p><div><div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">That would be great Kenji, thanks. </p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">- Aashish</p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On Mon, Dec 7, 2015 at 5:29 PM, Kenji Tsumura <<a href="mailto:kenji.tsumura@neosoftmedical.com" target="_blank">kenji.tsumura@neosoftmedical.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Aashish,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thank you very much.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I will try to run the test example and see what happens.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If the test is ok, I will try to reproduce the problem with simpler code.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Kenji</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Aashish Chaudhary [mailto:<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>]
<br>
<b>Sent:</b> Monday, December 07, 2015 3:58 PM</span></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>To:</b> Kenji Tsumura<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] vtkVolumeProperty IndependentComponents On and Off</p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Thanks Kenji for trying out. Its not clear in the log why the build shader code crashed. </p>
<div>
<p class="MsoNormal">Also, I realized that you using Java bindings. Would it be possible to re-create this issue</p>
</div>
<div>
<p class="MsoNormal">with a small sample code and you send it to me? We do have two component and 4 component</p>
</div>
<div>
<p class="MsoNormal">test (dependent and independent). Please have a look here: <a href="https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsIndependent.cxx" target="_blank">https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsIndependent.cxx</a></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">and </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"><a href="https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependent.cxx" target="_blank">https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependent.cxx</a></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Thanks,</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On Mon, Dec 7, 2015 at 3:41 PM, Kenji Tsumura <<a href="mailto:kenji.tsumura@neosoftmedical.com" target="_blank">kenji.tsumura@neosoftmedical.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Aashish,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Thank you.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I tried with vtkGPUVolumeRayCastMapper.
</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">An error occurs without setting IndependentComponentsOff.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">It seems  the error occurs in vtkOpenGLGPUVolumeRayCastMapper::BuildShader (See the attached file).</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Kenji</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Aashish Chaudhary [mailto:<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>]
<br>
<b>Sent:</b> Monday, December 07, 2015 1:54 PM<br>
<b>To:</b> Kenji Tsumura<br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] vtkVolumeProperty IndependentComponents On and Off</span></p>
<div>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">On Mon, Dec 7, 2015 at 12:19 PM, Kenji Tsumura <<a href="mailto:kenji.tsumura@neosoftmedical.com" target="_blank">kenji.tsumura@neosoftmedical.com</a>> wrote:</p>
<div>
<div>
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I have 3D cardiac MRI data (magnitude data and velocity data), and would like to display the volume rendering of the two data.</p>
<p class="MsoNormal">I create vtkVolume with two components  (first one is velocity data and second one is magnitude data) and use vtkSmartVolumeMapper.</p>
<p class="MsoNormal">When I set IndependentComponentsOn to the volume property, I can see what I want (refer to the first figure).</p>
<p class="MsoNormal">But this setting disables GPU rendering and it is slow.</p>
</div>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">I don't remember vtkSmartVolumeMapper has this logic, I will have a look. In the old GPU raycast mapper, there was some issue with independent components so may be that is the reason that smart volume mapper switched to fixed point
 ray cast. </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Is there a particular reason you are using vtkSmartVolumeMapper?  You can directly use GPUVolume RayCastMapper</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal">My understanding is that I have to use IndependentComponentsOff to make the mapper use GPU rendering.</p>
<p class="MsoNormal">When I set IndependentComponentsOff, only one color transfer function, and only one scalar opacity function to the volume property,</p>
<p class="MsoNormal">the magnitude data (the second component) is also color-coded (refer to the second figure).</p>
<p class="MsoNormal">I thought this contradicts the method comments of IndependentComponentsOn/ IndependentComponentsOff.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">“For 2 component data, the first is passed through the first color transfer function and the second component is passed through the first opacity transfer function.”</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Am I missing something?</p>
<p class="MsoNormal">Can I make the volume rendering look the same as using two components?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thank you,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">BTY, I use v6.3.0, OpenGL2.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">-- </p>
<p class="MsoNormal">Kenji Tsumura</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">“The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you
 are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original
 message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.</p>
</div>
<p class="MsoNormal">Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient,
 you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original
 message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.
</p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" 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" 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" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
</p>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">-- </p>
<div>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| Aashish Chaudhary
<br>
| Technical Leader         <br>
| Kitware Inc.            </span></i></p>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| </span><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient,
 you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original
 message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.
</p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
</p>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">-- </p>
<div>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| Aashish Chaudhary
<br>
| Technical Leader         <br>
| Kitware Inc.            </span></i></p>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| </span><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you
 are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original
 message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.
</p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
</p>
<div>
<p class="MsoNormal"> </p>
</div>
<p class="MsoNormal">-- </p>
<div>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| Aashish Chaudhary
<br>
| Technical Leader         <br>
| Kitware Inc.            </span></i></p>
<div>
<p class="MsoNormal"><i><span style="font-family:"Trebuchet MS","sans-serif"">| </span><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></p>
</div>
</div>
</div>
</div>
</div></div></div><div><div>
Disclaimer: The information contained in this communication may be confidential, is intended only for the use of the recipient(s) named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified
 that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy
 of it from your computer system. If you have any questions concerning this message, please contact the sender.
</div></div></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><font face="trebuchet ms, sans-serif"><i>| Aashish Chaudhary <br>| Technical Leader         <br>| Kitware Inc.            <br></i></font><div><i><font face="trebuchet ms, sans-serif">| </font><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="trebuchet ms, sans-serif"><i>| Aashish Chaudhary <br>| Technical Leader         <br>| Kitware Inc.            <br></i></font><div><i><font face="trebuchet ms, sans-serif">| </font><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></div></div></div>
</div>