[vtkusers] Help! Writing a filter to get vtkImageData from vtkUnstructuredGrid...
Cory Quammen
cquammen at cs.unc.edu
Thu Jul 26 13:59:42 EDT 2012
Oops, forgot to post the link to the filter:
https://github.com/cquammen/vtkPartialVolumeModeller
Usually I only forget to attach files, not insert links.
Look in the class vtkPartialVolumeModeller.
Hope that helps,
Cory
On Thu, Jul 26, 2012 at 1:26 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
> I have a filter similar to what you are try to do in terms of input
> and output. You can take a look at my implementations of
> FillInputPortInformation and RequestInformation. Please note that this
> is based on VTK 5.10.0 and may not work with the most recent VTK in
> git.
>
> One thing that I am immediately suspicious of is whether you have the
> proper method signature for overriding the methods correctly. Without
> seeing the code, I can't tell :-) You could compile in debug mode and
> set a break point within your methods using your favorite debugger to
> make sure they are being called.
>
> Cory
>
> On Thu, Jul 26, 2012 at 1:18 PM, Ricardo Villegas <ricvilleg at gmail.com> wrote:
>> Hello,
>>
>> I'm writing a filter to obtain a 3D vtkImageData from a volume represented
>> as a vtkUnstructuredGrid.
>> The image data is being obtained by sampling the unstructured grid with
>> certain criteria and the help of a 3D widget.
>>
>> I chose vtkImageAlgorithm as the base class for my filter, overriding the
>> FillInputPortInformation for setting the proper input data.
>> The application crashes when I connect the output of this filter to a mapper
>> or any other component for its visualization.
>> It seems something is wrong in the RequestInformation method because it
>> expects vtkImageData as an input. I overrode it; nothing changed.
>> Curiously, if I attach a vtkImageChangeInformation filter that acts an
>> intermediary between my filter and the next componente in the pipeline, it
>> works fine. However, I want my filter can work standalone without using a
>> vtkImageChangeInformation after it.
>>
>> Could somebody give me a hint about what could wrong here? Which other
>> methods from vtkImageAlgorith should I change so that my filter works? Is
>> there a solution?
>>
>> Thanks in advance,
>>
>> Ricardo Villegas
>>
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Cory Quammen
> Research Associate
> Department of Computer Science
> The University of North Carolina at Chapel Hill
--
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill
More information about the vtkusers
mailing list