Re: [mv2] LUT, ImagePlaneWidget and custom import module

B. P. Thrane wrote:
>     r = tvtk.StructuredPoints(origin=zzz.origin(), 
> dimensions=zzz.dims(), spacing=zzz.spacing())
>     r.point_data.scalars = zzz.datadict["Var1"]
>     r.point_data.scalars.name = 'Var1'
>     r.update()
> 
>     src = VTKDataSource(data=r)
>     return src
> 
> I've tried setting scalar_type='float' in the call, but that doesn't 

In which call?  Could you try this:

  id = tvtk.ImageData()
  id.scalar_type = 'float'
  id.set(origin= ...)
  id.update()
  src = VTKDataSource(data=id)
  return src

> help. What I cannot figure out is how the set the lookup table to 
> default, as you have to when you write to file using 
> StructuredPointsWriter.

Hmm, strange, I have never needed to set this at all.

A reproducible example would really help.

cheers,
(Continue reading)

B. P. Thrane | 3 Dec 09:51
Favicon

Re: [mv2] LUT, ImagePlaneWidget and custom import module

Prabhu Ramachandran wrote:
> B. P. Thrane wrote:
>   
>>     r = tvtk.StructuredPoints(origin=zzz.origin(), 
>> dimensions=zzz.dims(), spacing=zzz.spacing())
>>     r.point_data.scalars = zzz.datadict["Var1"]
>>     r.point_data.scalars.name = 'Var1'
>>     r.update()
>>
>>     src = VTKDataSource(data=r)
>>     return src
>>
>> I've tried setting scalar_type='float' in the call, but that doesn't 
>>     
>
> In which call?  Could you try this:
>   id = tvtk.ImageData()
>   id.scalar_type = 'float'
>   id.set(origin= ...)
>   id.update()
>   src = VTKDataSource(data=id)
>   return src
>   
Yes, I tried that like this, but that should be the same.

r = tvtk.StructuredPoints(origin=zzz.origin(),dimensions=zzz.dims(), spacing=zzz.spacing(), scalar_type='float')

Well since this is not a fatal error, I will leave it. I still think this may be related to the fact that
ImagePlaneWidget inherits the lookup table if present, but also has it's own. 

(Continue reading)


Gmane