<div dir="ltr"><div class="markdown-here-wrapper" style="font-family:"Lucida Sans",Cantarell,Verdana,sans-serif;color:rgb(11,83,148)"><p style="margin:0px 0px 1.2em!important">Hi Sophonet,</p>
<p style="margin:0px 0px 1.2em!important">Try setting the scalar opacity function over the whole range of scalar values.</p>
<p style="margin:0px 0px 1.2em!important">Something like:</p>
<pre style="font-size:0.95em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-cpp" style="font-size:0.95em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(218,218,218);background-color:rgb(232,232,232);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;background:rgb(240,240,240);color:black"><span class="hljs-keyword" style="font-weight:bold">double</span> * range = data->GetScalarRange();
vtkNew<vtkPiecewiseFunction> f;
f->AddPoint(range[<span class="hljs-number" style="color:rgb(0,136,0)">0</span>], <span class="hljs-number" style="color:rgb(0,136,0)">0.1</span>);
f->AddPoint(range[<span class="hljs-number" style="color:rgb(0,136,0)">1</span>], <span class="hljs-number" style="color:rgb(0,136,0)">1.0</span>);
property->SetScalarOpacity(f);
</code></pre>
<p style="margin:0px 0px 1.2em!important">Hope that helps,<br>Sankhesh</p>
<div title="MDH:SGkgPGcgY2xhc3M9ImdyXyBncl8xMyBnci1hbGVydCBncl9zcGVsbCBncl9pbmxpbmVfY2FyZHMg
Z3JfcnVuX2FuaW0gQ29udGV4dHVhbFNwZWxsaW5nIGlucy1kZWwgbXVsdGlSZXBsYWNlIiBpZD0i
MTMiIGRhdGEtZ3ItaWQ9IjEzIj5Tb3Bob25ldDwvZz4sPGRpdj48YnI+PC9kaXY+PGRpdj5Ucnkg
c2V0dGluZyB0aGUgc2NhbGFyIG9wYWNpdHkgZnVuY3Rpb24gb3ZlciB0aGUgd2hvbGUgcmFuZ2Ug
b2Ygc2NhbGFyIHZhbHVlcy48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlNvbWV0aGluZyBsaWtl
OjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+YGBgY3BwPC9kaXY+PGRpdj5kb3VibGUgKiByYW5n
ZSA9IGRhdGEtJmd0O0dldFNjYWxhclJhbmdlKCk7PC9kaXY+PGRpdj52dGtOZXcmbHQ7dnRrUGll
Y2V3aXNlRnVuY3Rpb24mZ3Q7IGY7PC9kaXY+PGRpdj5mLSZndDtBZGRQb2ludChyYW5nZVswXSwg
MC4xKTs8L2Rpdj48ZGl2PmYtJmd0O0FkZFBvaW50KHJhbmdlWzFdLCAxLjApOzwvZGl2PjxkaXY+
cHJvcGVydHktJmd0O1NldFNjYWxhck9wYWNpdHkoZik7PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2
Pjxicj48L2Rpdj48ZGl2PkhvcGUgdGhhdCBoZWxwcyw8L2Rpdj48ZGl2PlNhbmtoZXNoPC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Feb 3, 2018 at 5:37 AM Sophonet <<a href="mailto:vtk12af6bc42@kant.sophonet.de">vtk12af6bc42@kant.sophonet.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi list,<br>
<br>
in an earlier version of my software using VTK7.x and the OpenGL<br>
backend, MIP rendering was working using vtkGPUVolumeRayCastMapper and<br>
MaximumIntensityProjection.<br>
<br>
However, in VTK 8.x (e.g. VTK 8.1.0), using the OpenGL2 backend, the<br>
renderwindow stays black/empty - VTK does not show an error message, and<br>
the IsRenderSupported (see below) does not seem to fail.<br>
<br>
Any hints what is wrong with the code below? By the way: I have added<br>
the volumeProperty (and the piecewise function) after following a<br>
current VTK test program<br>
(<a href="https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastFourComponentsMIP.cxx" rel="noreferrer" target="_blank">https://github.com/Kitware/VTK/blob/master/Rendering/Volume/Testing/Cxx/TestGPURayCastFourComponentsMIP.cxx</a>).<br>
<br>
vtkimagedata is a scalar medical image (unsigned short), so nothing<br>
special.<br>
<br>
Thanks,<br>
<br>
          Sophonet<br>
<br>
    vtkNew<vtkGPUVolumeRayCastMapper> mapper;<br>
    mapper->SetInputData(vtkimagedata);<br>
    mapper->SetBlendModeToMaximumIntensity();<br>
<br>
    vtkNew<vtkVolume> volume;<br>
    volume->SetMapper(mapper);<br>
    // ... connect to renderer etc.<br>
<br>
    //NOTE: The following lines from VTK's<br>
TestGPURayCastFourComponentsMIP.cxx did not solve the problem<br>
    //vtkNew<vtkVolumeProperty> volumeProperty;<br>
    //volumeProperty->IndependentComponentsOn();<br>
    //volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION);<br>
    //volumeProperty->SetShade(1);<br>
<br>
    //vtkNew<vtkPiecewiseFunction> f;<br>
    //f->AddPoint(0, 0.0);<br>
    //f->AddPoint(255, 1.0);<br>
    //volumeProperty->SetScalarOpacity(f);<br>
<br>
    //int valid =<br>
mapper->IsRenderSupported(vtkrenderer_->GetRenderWindow(),<br>
volumeProperty);<br>
<br>
    // NOTE: No exception was thrown on my system<br>
    //if (valid == 0)<br>
    //  throw std::runtime_error("MIP rendering is not supported");<br>
    //volume->SetProperty(volumeProperty);<br>
_______________________________________________<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 <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: <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="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div class="inbox-inbox-inbox-inbox-inbox-inbox-inbox-markdown-here-wrapper" style="font-family:"proza libre",sans-serif;color:rgb(0,56,107)"><h5 id="inbox-inbox-inbox-inbox-inbox-inbox-inbox-sankhesh-jhaveri" style="margin:1.3em 0px 1em;padding:0px;font-size:1.1em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);font-weight:bold;color:rgb(11,65,148)">Sankhesh Jhaveri</h5>
<h6 id="inbox-inbox-inbox-inbox-inbox-inbox-inbox--sr-research-development-engineer-kitware-http-www-kitware-com-518-881-4417" style="margin:1.3em 0px 1em;padding:0px;font-size:1em;color:rgb(11,83,148);font-family:"open sans",sans-serif;font-weight:normal"><em>Sr. Research & Development Engineer</em> | <a href="http://www.kitware.com/">Kitware</a> | (518) 881-4417</h6>
<div title="MDH:PGIgc3R5bGU9ImZvbnQtZmFtaWx5OiB2ZXJkYW5hLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDEx
LCA4MywgMTQ4KTsiPjxmb250IHNpemU9IjIiPiMjIyMjU2Fua2hlc2ggSmhhdmVyaTwvZm9udD48
L2I+PGRpdj48Zm9udCBjb2xvcj0iIzBiNTM5NCIgZmFjZT0idmVyZGFuYSwgc2Fucy1zZXJpZiIg
c2l6ZT0iMiI+PGI+PGJyPjwvYj48L2ZvbnQ+PGRpdj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6
IGFyaWFsLCBzYW5zLXNlcmlmOyBjb2xvcjogcmdiKDExLCA4MywgMTQ4KTsiPjxzcGFuIHN0eWxl
PSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsiPjxpPiMjIyMjIypTci4gUmVzZWFy
Y2ggJmFtcDsgRGV2ZWxvcG1lbnQgRW5naW5lZXIqPC9pPiZuYnNwO3wmbmJzcDs8L3NwYW4+PC9z
cGFuPjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFuYSwgc2Fucy1zZXJpZjsgY29sb3I6
IHJnYigxMSwgODMsIDE0OCk7Ij48YSBocmVmPSJodHRwOi8vd3d3LmtpdHdhcmUuY29tLyIgdGFy
Z2V0PSJfYmxhbmsiIHN0eWxlPSJjb2xvcjogcmdiKDE3LCA4NSwgMjA0KTsiPktpdHdhcmU8L2E+
Jm5ic3A7fCZuYnNwOzwvc3Bhbj48c3BhbiBzdHlsZT0iZm9udC1mYW1pbHk6IHZlcmRhbmEsIHNh
bnMtc2VyaWY7IGNvbG9yOiByZ2IoMTEsIDgzLCAxNDgpOyI+KDUxOCkgODgxLTQ0MTc8L3NwYW4+
PGJyPjwvZGl2PjxkaXY+PGRpdj48ZGl2PjxzcGFuIHN0eWxlPSJmb250LWZhbWlseTogdmVyZGFu
YSwgc2Fucy1zZXJpZjsgY29sb3I6IHJnYigxMSwgODMsIDE0OCk7Ij48L3NwYW4+PC9kaXY+PC9k
aXY+PC9kaXY+PC9kaXY+" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px">​</div></div></div></div>