[vtkusers] vtkSmartVolumeMapper ignoring clipping

Richard Whitehead richard.whitehead at vivosight.com
Fri Apr 11 14:40:19 EDT 2014


David,

Yes I did read it (several times).

"Reduces the image extent of the input.

vtkImageClip <http://www.vtk.org/doc/nightly/html/classvtkImageClip.html> will
make an image smaller. The output must have an image extent which is the
subset of the input. The filter has two modes of operation: 1: By default,
the data is not copied in this filter. Only the whole extent is modified.
2: If ClipDataOn is set, then you will get no more that the clipped extent."

I can't say I completely understand.  If ClipDataOn is not set, then what
does this filter do (nothing?)?
My understanding was that this extent metadata flowed down the pipeline; if
it doesn't work that way then I'm still confused.
Imagine I have a series of filters, I now have to pass this information
into each of them (since they should each only be filtering valid data),
keeping track of what's connected to what in a dynamic system, when I was
just hoping to join one filter into the next.  Exactly the sort of thing
that the information flow was supposed to achieve, I thought.  I don't
really see why the volume viewer can't get the whole extent from its info
object and set SetCroppingRegionPlanes on itself.  You're sayiing this is
normal behaviour and not a bug, it's a deficiency of the clipper, but in
this case I don't see what use the clipper is.

Please can you explain, when you say that the clipper ".. simply modifies
the WholeExtent in the image information instead of actually clipping the
data.", what is it that it could do to clip the data?  What information
carries the valid volume, if not the whole extent?  I'm going to be writing
my own 3D filters soon and I need to understand this stuff.  (And yes, I am
working my way through the two books, but I can't sit at work and read
them!).

Many thanks,

Richard



On 11 April 2014 16:38, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Richard,
>
> Did you read the doxygen web page for vtkImageClip before posting your
> question?
>
> 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.
>
> In general, my advice is to just try different ways of doing the cropping
> until you find out which way gives the best performance.
>
>   David
>
>
>
> On Fri, Apr 11, 2014 at 9:21 AM, Richard Whitehead <
> richard.whitehead at vivosight.com> wrote:
>
>> David,
>>
>> 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 ("physically
>> clipping the Extent"?) and then the upstream filters would understand,
>> is that correct?
>>
>> 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.
>>
>> Many thanks,
>>
>> Richard
>>
>>
>>
>>
>> On 11 April 2014 13:49, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>>> Hi Richard,
>>>
>>> The vtkImageClip filter performs what I consider to be an undesirable
>>> optimization, by default it simply modifies the WholeExtent in the
>>> image information instead of actually clipping the data.  See the
>>> doxygen page on this filter for more info.
>>>
>>> The volume mappers generally ignore the WholeExtent, instead what
>>> they do is ask the pipeline to update the whole image, and then they
>>> render whatever data is present.  Since vtkImageClip only modifies the
>>> WholeExtent info, without physically clipping the Extent, the effects
>>> of vtkImageClip are ignored.
>>>
>>> I do not consider this to be a bug in the volume mappers.  I consider
>>> it to be an unwise optimization in vtkImageClip that does something
>>> that is unexpected not only to users, but also to downstream filters
>>> and mappers.
>>>
>>>   David
>>>
>>> On Fri, Apr 11, 2014 at 4:28 AM, Richard Whitehead
>>> <richard.whitehead at vivosight.com> wrote:
>>> >
>>> > This looks like a bug in VTK?
>>> >
>>> > I'm visualising a memory volume (vtkImageData) which is then connected
>>> to a
>>> > vtkImageClip so that only the valid parts of the volume are rendered.
>>> >
>>> > Connecting that clipper into a vtkImageViewer2 to view slices works
>>> fine;
>>> > the invalid part of a slice is clipped off.
>>> >
>>> > But connecting that same clipper into a vtkSmartVolumeMapper, which is
>>> set
>>> > as the mapper of a vtkVolume, the display always shows the whole
>>> extent of
>>> > my memory volume, ignoring the clipping.
>>> > I have set CroppingOn on the mapper, no effect.
>>> >
>>> > If I set the mapper's clipping region with SetCroppingRegionPlanes
>>> then it
>>> > clips as expected, but I would have expected the mapper to take notice
>>> of
>>> > the "whole region" given by the clipper without me having to pass the
>>> clip
>>> > information around my program myself.
>>> >
>>> > Please can someone tell me if this is wrong, or if not for now perhaps
>>> a
>>> > cheat so I can get the clipping region from the clipper and set it on
>>> the
>>> > mapper.
>>> >
>>> > Many thanks,
>>> >
>>> > Richard
>>>
>>
>>
>>
>> --
>>
>> Richard Whitehead *-* Senior Imaging Engineer
>>
>> *Michelson Diagnostics Ltd*
>>
>> *M:* +44 (0)7905 955276   *T:* +44 (0)20 8308 1695
>>
>> *E: *richard.whitehead at vivosight.com   *W:* www.vivosight.com
>>
>>
>> <http://www.vivosight.com/>
>>
>>
>> Michelson Diagnostics Ltd, 1 Grays Farm Production Village, Grays Farm
>> Road, Orpington, Kent  BR5 3BD, UK
>>
>> Registered Office: 3 Shearwater, Maidstone, ME16 0DW.     Registered in
>> England No. 5732681
>>
>
>


-- 

Richard Whitehead *-* Senior Imaging Engineer

*Michelson Diagnostics Ltd*

*M:* +44 (0)7905 955276   *T:* +44 (0)20 8308 1695

*E: *richard.whitehead at vivosight.com   *W:* www.vivosight.com


<http://www.vivosight.com/>


Michelson Diagnostics Ltd, 1 Grays Farm Production Village, Grays Farm
Road, Orpington, Kent  BR5 3BD, UK

Registered Office: 3 Shearwater, Maidstone, ME16 0DW.     Registered in
England No. 5732681
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140411/b76a2bcd/attachment.html>


More information about the vtkusers mailing list