<div dir="ltr">Hi Richard,<div><br></div><div>Did you read the doxygen web page for vtkImageClip before posting your question?</div><div><br></div><div>If your intent is simply to crop the volume rendering, then you can apply the cropping in the mapper (using vtkVolumeMapper::SetCroppingRegionPlanes()) instead of using a filter to crop the data beforehand.</div>
<div><br></div><div>In general, my advice is to just try different ways of doing the cropping until you find out which way gives the best performance.</div><div><br></div><div> David</div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Apr 11, 2014 at 9:21 AM, Richard Whitehead <span dir="ltr"><<a href="mailto:richard.whitehead@vivosight.com" target="_blank">richard.whitehead@vivosight.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">David,<div><br></div><div>Thanks very much for replying. The filter is actually doing exactly what I want - I don't want the data to be altered or reallocated, I just want to mark its extent as reduced. It sounds like it should be doing a bit more ("<span style="font-family:arial,sans-serif;font-size:13px">physically clipping the Extent"?) </span>and then the upstream filters would understand, is that correct?</div>
<div><br></div><div>Can you advise whether I should instead use another filter (such as vtkImageReslice or vtkExtractVOI), or would it be better to continue with what I have done which is to remember the clipping in my app? Performance is an issue here, the extent may be updated several times a second, and the memory volume is reasonably large.</div>
<div><br></div><div>Many thanks,</div><div><br></div><div>Richard</div><div><br></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On 11 April 2014 13:49, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<br>
The vtkImageClip filter performs what I consider to be an undesirable<br>
optimization, by default it simply modifies the WholeExtent in the<br>
image information instead of actually clipping the data. See the<br>
doxygen page on this filter for more info.<br>
<br>
The volume mappers generally ignore the WholeExtent, instead what<br>
they do is ask the pipeline to update the whole image, and then they<br>
render whatever data is present. Since vtkImageClip only modifies the<br>
WholeExtent info, without physically clipping the Extent, the effects<br>
of vtkImageClip are ignored.<br>
<br>
I do not consider this to be a bug in the volume mappers. I consider<br>
it to be an unwise optimization in vtkImageClip that does something<br>
that is unexpected not only to users, but also to downstream filters<br>
and mappers.<br>
<br>
David<br>
<br>
On Fri, Apr 11, 2014 at 4:28 AM, Richard Whitehead<br>
<<a href="mailto:richard.whitehead@vivosight.com" target="_blank">richard.whitehead@vivosight.com</a>> wrote:<br>
><br>
> This looks like a bug in VTK?<br>
><br>
> I'm visualising a memory volume (vtkImageData) which is then connected to a<br>
> vtkImageClip so that only the valid parts of the volume are rendered.<br>
><br>
> Connecting that clipper into a vtkImageViewer2 to view slices works fine;<br>
> the invalid part of a slice is clipped off.<br>
><br>
> But connecting that same clipper into a vtkSmartVolumeMapper, which is set<br>
> as the mapper of a vtkVolume, the display always shows the whole extent of<br>
> my memory volume, ignoring the clipping.<br>
> I have set CroppingOn on the mapper, no effect.<br>
><br>
> If I set the mapper's clipping region with SetCroppingRegionPlanes then it<br>
> clips as expected, but I would have expected the mapper to take notice of<br>
> the "whole region" given by the clipper without me having to pass the clip<br>
> information around my program myself.<br>
><br>
> Please can someone tell me if this is wrong, or if not for now perhaps a<br>
> cheat so I can get the clipping region from the clipper and set it on the<br>
> mapper.<br>
><br>
> Many thanks,<br>
><br>
> Richard<br>
</blockquote></div><br><br clear="all"><div><br></div></div></div>-- <br><div dir="ltr"><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif">Richard Whitehead </span><b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">–</span></b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif"> Senior Imaging Engineer</span></p>
<p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">Michelson Diagnostics Ltd</span></b></p><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt">
<b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">M:</span></b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif"> <a href="tel:%2B44%20%280%297905%20955276" value="+447905955276" target="_blank">+44 (0)7905 955276</a> </span><b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">T:</span></b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif"> <a href="tel:%2B44%20%280%2920%208308%201695" value="+442083081695" target="_blank">+44 (0)20 8308 1695</a></span></p>
<p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">E: </span></b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,176,240)"><a href="mailto:richard.whitehead@vivosight.com" style="color:rgb(17,85,204)" target="_blank"><span style="color:rgb(0,176,240)">richard.whitehead@vivosight.com</span></a></span><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif"> </span><b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(146,39,143)">W:</span></b><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif"> </span><span lang="EN" style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,176,240)"><a href="http://www.vivosight.com/" style="color:rgb(17,85,204)" target="_blank"><span style="color:rgb(0,176,240)">www.vivosight.com</span></a></span></p>
<p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><br></p><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><a href="http://www.vivosight.com/" target="_blank"><span style="color:windowtext;text-decoration:none"><img src="https://sites.google.com/a/vivosight.com/logo/_/rsrc/1361922206747/home/VivoSight.png" border="0"></span></a></p>
<p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"><br></p><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt"></p><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt">
<span style="font-size:7.5pt;font-family:Arial,sans-serif;color:gray">Michelson Diagnostics Ltd, 1 Grays Farm Production Village, Grays Farm Road, Orpington, Kent BR5 3BD, UK</span></p><p style="color:rgb(80,0,80);font-family:Calibri;margin:0cm 0cm 0.0001pt">
<span style="font-size:7.5pt;font-family:Arial,sans-serif;color:gray">Registered Office: 3 Shearwater, Maidstone, ME16 0DW. Registered in England No. 5732681</span></p></div>
</div>
</blockquote></div><br></div>