[vtkusers] Reverse clipping box

Julien Finet julien.finet at kitware.com
Mon Apr 22 13:35:14 EDT 2013


Please note that vtkFixedPointVolumeRayCastMapper is a CPU only volume
rendering (not gpu).
Depending on how old your Mac is, the GPU raycast mapper might work (I know
it works if your opengl version is "2.1 NVIDIA-8.0.61" and higher). (you
would need to comment the line 2166 of vtkOpenGLGPUVolumeRayCastMapper.

Concerning the unstructured grid, you can maybe convert it back to a
vtkimagedata.

j.



On Mon, Apr 22, 2013 at 11:44 AM, Christopher Mullins <
christopher.mullins at kitware.com> wrote:

> Hi Julien,
>
> Thanks for the suggestion, it's clear that this is one place where
> clipping planes are being computed.  However these volume mappers are not
> supported on my architecture (Mac OS X). So the SmartVolumeMapper is using
> the vtkFixedPointVolumeRayCastMapper.  So would it be correct to look at a
> corresponding function in this mapper [1] ?
>
> vtkClipVolume appears to have my functionality in mind, but its Update()
> function returns a vtkUnstructuredGrid [2], which makes it seem like this
> is not what I should use (I'm operating on vtkImageData).
>
> [1]
> https://github.com/Kitware/VTK/blob/master/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.h#L709
> [2] http://www.vtk.org/doc/release/4.0/html/classvtkClipVolume.html#a19
>
>
> On Mon, Apr 22, 2013 at 10:19 AM, Julien Finet <julien.finet at kitware.com>wrote:
>
>> Hi Chris,
>>
>> You would need to look at the 2 classes: vtkGPUVolumeRayCastMapper and
>> vtkOpenGLGPUVolumeRayCastMapper.
>> Some option would need to be added to the classes to handle inside
>> cropping (vs outside clipping).
>> j.
>>
>>
>> On Sun, Apr 21, 2013 at 10:54 PM, Christopher Mullins <
>> christopher.mullins at kitware.com> wrote:
>>
>>> Hi all,
>>>
>>> My question is probably fairly simple.  I'd like to implement something
>>> like a reverse clipping box.  Instead of rendering everything inside the
>>> box and clipping outside the box, I'd like to render what is outside the
>>> box and clip what is inside the box.
>>>
>>> My code is almost exactly the SmartVolumeMapper example [1].  I've been
>>> able to create a regular clipping box with the vtkBoxWidget, and placing
>>> within a callback:
>>>
>>> vtkPlanes *planes = vtkPlanes::New();
>>>  boxWidget->GetPlanes(planes);
>>> volumeMapper->SetClippingPlanes(planes);
>>>
>>> There exists a function called boxWidget->InsideOutOn();, but it appears
>>> this was not made with my use case in mind.  I've also tried (in the
>>> callback function) manually getting each plane from the boxWidget and
>>> reversing each normal - but this also does nothing.
>>>
>>> Does anyone have an idea of where I should look?  I've looked into
>>> vtkClipVolume, but I'm not sure what the point is of using this, if the
>>> volume mapper will accept clipping planes.
>>>
>>> Thanks for all your help,
>>>
>>> [1]
>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/VolumeRendering/SmartVolumeMapper
>>>  --
>>> Christopher Mullins
>>> R&D Engineer
>>> Kitware Inc.,
>>> 919.869.8871
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>
>
> --
> Christopher Mullins
> R&D Engineer
> Kitware Inc.,
> 919.869.8871
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130422/21266f09/attachment.htm>


More information about the vtkusers mailing list