[vtkusers] InfoVis: geovis.py example problem?
Jeff Baumes
jeff.baumes at kitware.com
Wed Nov 19 13:04:46 EST 2008
The geovis.py python example should now be updated in VTK.
On Tue, Nov 18, 2008 at 7:31 PM, Jeff Baumes <jeff.baumes at kitware.com> wrote:
> Yeah, there was a recent change to that function, and I didn't update
> the python example. You are on the right track in fixing it, by
> changing the input from a string to a vtkImageData. I will try to get
> the fix in tomorrow.
>
> Jeff
>
> On Mon, Nov 17, 2008 at 4:42 PM, Eric E. Monson <emonson at cs.duke.edu> wrote:
>> Hey,
>>
>> I was trying the Examples/Infovis/Python/geovis.py example (CVS today), and
>> I couldn't get it to work, as is.
>>
>> File "geoview.py", line 23, in <module>
>> view.AddDefaultImageRepresentation(data_dir + "NE2_ps_bath.jpg")
>> ValueError: method requires a VTK object
>>
>> That methods seems to require a vtkImageData argument. Should this:
>>
>> # Create the background image
>> view.AddDefaultImageRepresentation(data_dir + "NE2_ps_bath.jpg")
>>
>> be changed to something like this?:
>>
>> # Create the background image
>> image = vtkImageData()
>> jpg = vtkJPEGReader()
>> jpg.SetFileName(data_dir + "NE2_ps_bath.jpg")
>> jpg.Update()
>> image.ShallowCopy(jpg.GetOutputDataObject(0))
>> view.AddDefaultImageRepresentation(image)
>>
>> Or, maybe there's an easier way (I'm not sure about that ShallowCopy()
>> part)?
>>
>> Thanks,
>> -Eric
>>
>>
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
>
> --
> Jeff Baumes, Ph.D.
> R&D Engineer, Kitware Inc.
> (518) 371-3971 x132
> jeff.baumes at kitware.com
>
--
Jeff Baumes, Ph.D.
R&D Engineer, Kitware Inc.
(518) 371-3971 x132
jeff.baumes at kitware.com
More information about the vtkusers
mailing list