[vtkusers] vtk.js image volume issues

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri Jul 20 18:06:58 EDT 2018


For the second issue, you need to tell vtk that the data has changed.
Normally calling "scalars.modified();" should work (need to fix the mapper
to detect that base on the array mtime).
But it you call "this.imageData.modified();" you will be good.

On Fri, Jul 20, 2018 at 3:57 PM Richard Frank <rickfrank at me.com> wrote:

> Ah, yes thanks that makes sense.
>
>
>
> Rick
>
>
>
>
>
> *From:* Sebastien Jourdain <sebastien.jourdain at kitware.com>
> *Sent:* Friday, July 20, 2018 5:54 PM
> *To:* rickfrank at me.com
> *Cc:* vtkusers at public.kitware.com
> *Subject:* Re: [vtkusers] vtk.js image volume issues
>
>
>
> You need to disable those lines as your data is homogeneous.
>
>
>
>         // this.actor.getProperty().setUseGradientOpacity(0, true);
>
>         // this.actor.getProperty().setGradientOpacityMinimumValue(0, 15);
>
>         // this.actor.getProperty().setGradientOpacityMinimumOpacity(0,
> 0.0);
>
>         // this.actor.getProperty().setGradientOpacityMaximumValue(0, 100);
>
>         // this.actor.getProperty().setGradientOpacityMaximumOpacity(0,
> 1.0);
>
>         // this.actor.getProperty().setShade(true);
>
>
>
> On Fri, Jul 20, 2018 at 3:28 PM Richard Frank via vtkusers <
> vtkusers at public.kitware.com> wrote:
>
>
>
> Hi,
>
>
>
> I’m creating a simple volume from vtkImageData using vtk.js.
>
>
>
> I create an empty 3d vtkImageData and set it up with a mapper and actor,
> and add it to the renderer.
>
>
>
> I create a transfer function that has 0 = blue, 100 = red, 1000 = green.
>
>
>
> I’m trying to set pixels directly in the volume.
>
>
>
> There’s two problems –
>
>
>
> The first is that when I click anywhere on the screen the volume
> disappears…it shows on the first render call.
>
>
>
> I have a button that is used to trigger the voxel setting. This seems to
> work only on the first slice of voxels, and the rest seem to not “stick”.
>
> Regardless, however, the render call makes the volume disappear.
>
>
>
> My code is here:
>
>
>
> https://github.com/DominionSoftware/TestVolumeImage
>
>
>
> and can be built with the installation instructions like the other
> examples (this was cribbed from an example).
>
>
>
> Anyone have any suggestions as to why the volume disappears, and / or ways
> to debug this?
>
>
>
>
>
> Thanks,
>
>
>
> Rick
>
>
>
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180720/d2dd4897/attachment.html>


More information about the vtkusers mailing list