[vtkusers] vtkImageMedian3D with Custom Source
David Doria
daviddoria+vtk at gmail.com
Tue Feb 2 16:27:17 EST 2010
On Tue, Feb 2, 2010 at 2:09 PM, Georg Ziegler <gziegler at mail.tuwien.ac.at>wrote:
> Hello!
>
> I am not very experienced with the workings of the new pipeline but I have
> managed to write a custom source similar to the one in this example:
> http://www.vtk.org/Wiki/VTK_Examples_vtkImageAlgorithm_Source
>
> Then I have built a pipeline like so:
>
> vtkImageMedian3D->SetInputConnection(vtkMyCustomSource->GetOutputPort());
>
> vtkVolumeRayCastMapper->SetInputConnection(vtkImageMedian3D->GetOutputPort());
>
> Unfortunately, this setup does not produce a volume as expected.
> If I connect my custom source directly to the mapper I do get a result.
>
> vtkVolumeRayCastMapper->SetInputConnection(vtkMyCustomSource->GetOutputPort());
>
> Can you point me to where the problem might be?
> Do I have to implement another method in my custom source besides
> RequestData()?
>
> Regards,
> Georg
>
>
Maybe you're having the same issue I was having a few days ago:
Bill found that the solution was to add these lines at the end of
RequestData():
output->ShallowCopy(image);
output->SetExtent(image->GetExtent());
output->SetUpdateExtent(image->GetUpdateExtent());
output->SetWholeExtent(image->GetWholeExtent());
I just added them to the example page that you were referring to.
I'm not exactly sure why it is necessary, but it seemed to fix my issue.
Let me know if it works for you.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100202/a2b7c54b/attachment.htm>
More information about the vtkusers
mailing list