Class: Vtk::TkPhotoImage

Inherits:
TkPhotoImage
  • Object
show all
Defined in:
lib/VTK/tk/vtkTkPhotoImage.rb

Instance Method Summary collapse

Constructor Details

#initialize(kw = {}) ⇒ TkPhotoImage

A subclass of PhotoImage with helper functions

A subend
for displaying vtkImageData


16
17
18
19
20
# File 'lib/VTK/tk/vtkTkPhotoImage.rb', line 16

def initialize( kw={} )
  # Caller the superclass
  super( kw )
  Vtk.LoadRubyTkWidgets
end

Instance Method Details

#PutImageSlice(image, z, options = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/VTK/tk/vtkTkPhotoImage.rb', line 21

def PutImageSlice ( image, z, options={} )
  default_options = { 'orientation'=>'transverse', 'window'=>256, 'level'=>128 }
  default_options.update( options )
  options = default_options
  t = "_"+image.GetAddressAsString('vtkImageData')[5..-1]+"_"+image.GetClassName
  Tk.tk_call("vtkImageDataToTkPhoto", t, @path, "%d"%z, options['orientation'], "%d"%options['window'], "%d"%options['level'])
end