vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

meow_fiz
For a long time I've used vtkGPUVolumeRayCastMapper  in vtk 6.3 (OpenGL 1.x). I could change interactively volume mask voxel values set by:

volMapper->SetMaskInput (myMask);


Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications to volume mask interactively. Calling Update(), Modified() on every element of the pipeline (volume, input data, mask input, mapper) does not affect visual result.

The only way I can get the updated mask volume is to call:

Renderer->RemoveVolume(Volume);
Renderer->AddVolume(Volume);

Is there any way that I could force volume mask update for vtkGPUVolumeRayCastMapper  ?

Regards,
 Michal


Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Alvaro Sanchez
Hi,

there is a related patch [1] about to be merged, not sure if this would address this issue though, could you try it?    I will try to reproduce the problem.

Thanks.


On Mon, Nov 28, 2016 at 5:56 PM, meow_fiz <[hidden email]> wrote:
For a long time I've used vtkGPUVolumeRayCastMapper  in vtk 6.3 (OpenGL 1.x).
I could change interactively volume mask voxel values set by:

volMapper->SetMaskInput (myMask);


Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications to
volume mask interactively. Calling Update(), Modified() on every element of
the pipeline (volume, input data, mask input, mapper) does not affect visual
result.

The only way I can get the updated mask volume is to call:

Renderer->RemoveVolume(Volume);
Renderer->AddVolume(Volume);

Is there any way that I could force volume mask update for
vtkGPUVolumeRayCastMapper  ?

Regards,
 Michal






--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4901

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Sankhesh Jhaveri-2
Hi,

The patch that Alvaro mentioned should have fixed your masking issue. It has been merged into master.
Please try the latest VTK master.

Thanks,
Sankhesh

On Tue, Nov 29, 2016 at 11:39 AM Alvaro Sanchez <[hidden email]> wrote:
Hi,

there is a related patch [1] about to be merged, not sure if this would address this issue though, could you try it?    I will try to reproduce the problem.

Thanks.


On Mon, Nov 28, 2016 at 5:56 PM, meow_fiz <[hidden email]> wrote:
For a long time I've used vtkGPUVolumeRayCastMapper  in vtk 6.3 (OpenGL 1.x).
I could change interactively volume mask voxel values set by:

volMapper->SetMaskInput (myMask);


Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications to
volume mask interactively. Calling Update(), Modified() on every element of
the pipeline (volume, input data, mask input, mapper) does not affect visual
result.

The only way I can get the updated mask volume is to call:

Renderer->RemoveVolume(Volume);
Renderer->AddVolume(Volume);

Is there any way that I could force volume mask update for
vtkGPUVolumeRayCastMapper  ?

Regards,
 Michal






--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: <a href="tel:(518)%20881-4901" value="+15188814901" class="gmail_msg" target="_blank">518-881-4901
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

VTK - Users mailing list
In reply to this post by Alvaro Sanchez
I have problems with vtkVolumeTextureMapper2D   (OpenGL2) and test  voltm2rotateclip.tcl no works



From: Alvaro Sanchez <[hidden email]>
To: meow_fiz <[hidden email]>
Cc: VTK Users <[hidden email]>
Sent: Tuesday, November 29, 2016 6:39 PM
Subject: Re: [vtkusers] vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Hi,

there is a related patch [1] about to be merged, not sure if this would address this issue though, could you try it?    I will try to reproduce the problem.

Thanks.


On Mon, Nov 28, 2016 at 5:56 PM, meow_fiz <[hidden email]> wrote:
For a long time I've used vtkGPUVolumeRayCastMapper  in vtk 6.3 (OpenGL 1.x).
I could change interactively volume mask voxel values set by:

volMapper->SetMaskInput (myMask);


Now when i switched to VTK 7.1RC & OpenGL2 I can't make any modifications to
volume mask interactively. Calling Update(), Modified() on every element of
the pipeline (volume, input data, mask input, mapper) does not affect visual
result.

The only way I can get the updated mask volume is to call:

Renderer->RemoveVolume(Volume) ;
Renderer->AddVolume(Volume);

Is there any way that I could force volume mask update for
vtkGPUVolumeRayCastMapper  ?

Regards,
 Michal






--
View this message in context: http://vtk.1045678.n5.nabble. com/vtkGPUVolumeRayCastMapper- OpenGL2-Mask-Input-update- tp5741322.html
Sent from the VTK - Users mailing list archive at Nabble.com.
______________________________ _________________
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:
http://public.kitware.com/ mailman/listinfo/vtkusers



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4901

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers



_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

meow_fiz
In reply to this post by Sankhesh Jhaveri-2
I've downloaded latest VTK from GIT (git clone https://gitlab.kitware.com/vtk/vtk.git VTK). I guess it's the latest. But the problem remains.

calling MaskInputData->Modified();  does not do any update to volume Mask

My temp solution until I find the right one:

(temporarily i've edited vtkOpenGLGPUVolumeRayCastMapper.cxx file - GPURender( ... ) by forcing to call LoadMask when mask was modified:

if (this->Impl->NeedToInitializeResources ||
      (input->GetMTime() > this->Impl->InputUpdateTime.GetMTime()))
  {
    volumeModified = true;
    input->GetDimensions(this->Impl->Dimensions);

    // Update bounds, data, and geometry
    this->Impl->ComputeBounds(input);
    this->Impl->LoadVolume(ren, input, volumeProperty,
                           scalars, independentComponents);
    this->Impl->ComputeCellToPointMatrix();
    this->Impl->LoadMask(ren, input, this->MaskInput,
                         this->Impl->Extents, vol);
  }
  else
  {
       ///---------------------changed lines

          if (MaskInput->GetMTime() >Impl->ShaderBuildTime.GetMTime())
          this->Impl->LoadMask(ren, input, this->MaskInput,
                  this->Impl->Extents, vol);
        //-------------------- end of changed lines

    this->Impl->UpdateVolume(volumeProperty);
  }

 
Regards,
Michal
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Sankhesh Jhaveri-2
Seems like you've exposed a bug. Mind creating a merge request to VTK. You can tag me on the MR for review. 

Thanks,
Sankhesh

On Wed, Nov 30, 2016 at 1:26 PM meow_fiz <[hidden email]> wrote:
I've downloaded latest VTK from GIT (git clone
https://gitlab.kitware.com/vtk/vtk.git VTK). I guess it's the latest. But
the problem remains.

calling MaskInputData->Modified();  does not do any update to volume Mask

My temp solution until I find the right one:

(temporarily i've edited vtkOpenGLGPUVolumeRayCastMapper.cxx file -
GPURender( ... ) by forcing to call LoadMask when mask was modified:

if (this->Impl->NeedToInitializeResources ||
      (input->GetMTime() > this->Impl->InputUpdateTime.GetMTime()))
  {
    volumeModified = true;
    input->GetDimensions(this->Impl->Dimensions);

    // Update bounds, data, and geometry
    this->Impl->ComputeBounds(input);
    this->Impl->LoadVolume(ren, input, volumeProperty,
                           scalars, independentComponents);
    this->Impl->ComputeCellToPointMatrix();
    this->Impl->LoadMask(ren, input, this->MaskInput,
                         this->Impl->Extents, vol);
  }
  else
  {
       ///---------------------changed lines

          if (MaskInput->GetMTime() >Impl->ShaderBuildTime.GetMTime())
          this->Impl->LoadMask(ren, input, this->MaskInput,
                  this->Impl->Extents, vol);
        //-------------------- end of changed lines

    this->Impl->UpdateVolume(volumeProperty);
  }


Regards,
Michal




--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741375.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | <a href="tel:(518)%20881-4417" value="+15188814417" class="gmail_msg" target="_blank">(518) 881-4417

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

meow_fiz
This post was updated on .
I'm not sure  it's the best solution. It seems like it's slower than in Vtk6.3 &OpenGl1.x backend.

Is it optimal solution to update modified mask volume to call LoadMask method?

The whole volume rendering on GPU doesn't look faster than in previous approach. I've read some threads about changing SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't affect the rendering frame rates ...
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Sankhesh Jhaveri-2

Hi,

Updating the mask texture when the mask input has been modified is the optimum solution.
Regarding performance, could you share some details about your data (size, data type, etc.) and pipeline?

Thanks,
Sankhesh


On Fri, Dec 2, 2016 at 6:57 AM meow_fiz <[hidden email]> wrote:
I'm not sure it's the best solution. It seems like it's slower than in Vtk6.3
&OpenGl1.x backend.

Is it optimal solution to update modified mask volume to call
LoadMaskMethod?

The whole volume rendering on GPU doesn't look faster than in previous
approach. I've read some threads about changing
SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't
affect the rendering frame rates ...



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741390.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
--
Sankhesh Jhaveri
Sr. Research & Development Engineer | Kitware | (518) 881-4417

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

meow_fiz
DataSet 512x512x219 unsigned short
RenderWindow - 1300x1000

VolumeMapper->SetMaxMemoryInBytes(2.04e+9);
VolumeMapper->SetBlendModeToComposite();
VolumeMapper->SetMaximumImageSampleDistance(4.0);
olumeMapper->SetAutoAdjustSampleDistances(1);
VolumeProperty->SetInterpolationTypeToNearest();
VolumeProperty->DisableGradientOpacityOff();
VolumeProperty->SetShade(0);

Volume zoomed in to fill window - I get 12fps maximum






Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Alvaro Sanchez
Hi Michal, could you also share your system's specs?



On Fri, Dec 2, 2016 at 9:57 AM, meow_fiz <[hidden email]> wrote:
DataSet 512x512x219 unsigned short
RenderWindow - 1300x1000

VolumeMapper->SetMaxMemoryInBytes(2.04e+9);
VolumeMapper->SetBlendModeToComposite();
VolumeMapper->SetMaximumImageSampleDistance(4.0);
olumeMapper->SetAutoAdjustSampleDistances(1);
VolumeProperty->SetInterpolationTypeToNearest();
VolumeProperty->DisableGradientOpacityOff();
VolumeProperty->SetShade(0);

Volume zoomed in to fill window - I get 12fps maximum










--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741394.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4901

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

meow_fiz
Tested on:

i7 980/ 2x GTX 580 / 24GB RAM

Also tested on notebook:

i7-4810MQ 2.8/3.8GHz / GTX 960M / 16GB RAM

Laptop is a bit faster


Reply | Threaded
Open this post in threaded view
|

Re: vtkGPUVolumeRayCastMapper (OpenGL2) - Mask Input update

Alvaro Sanchez
In reply to this post by meow_fiz
Hi Michal,

there is a merge request [1] which fixes the mask update issue, it should make it for 7.1.1.  Please give it a try, thanks!

[1]

On Fri, Dec 2, 2016 at 6:57 AM, meow_fiz <[hidden email]> wrote:
I'm not sure it's the best solution. It seems like it's slower than in Vtk6.3
&OpenGl1.x backend.

Is it optimal solution to update modified mask volume to call
LoadMaskMethod?

The whole volume rendering on GPU doesn't look faster than in previous
approach. I've read some threads about changing
SetMaximumImageSampleDistance &SetAutoAdjustSampleDistances but it didn't
affect the rendering frame rates ...



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-OpenGL2-Mask-Input-update-tp5741322p5741390.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers



--
Alvaro Sanchez
Kitware, Inc.
Senior R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4901

_______________________________________________
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:
http://public.kitware.com/mailman/listinfo/vtkusers