Class: ReadOnlyImageImpl

Inherits:
Object
  • Object
show all
Defined in:
lib/rimageanalysistools/drawing.rb,
lib/rimageanalysistools/image_shortcuts.rb

Instance Method Summary collapse

Instance Method Details

#[](ic) ⇒ Object



35
36
37
# File 'lib/rimageanalysistools/image_shortcuts.rb', line 35

def [](ic)
  getValue(ic)
end

#box_conservative(lower, upper, dims) ⇒ void

This method returns an undefined value.

Allows setting a region of interest of an image along only some dimenions, preserving any current region of interest along other dimenions.

Parameters:

  • lower (Hash, ImageCoordinate)

    a hash or ImageCoordinate mapping dimensions to the lower bound of the box (inclusive) along the specified dimensions. Can contain extra dimenions not boxed; only the boxing on the dimenions specified in the dims parameter will be changed.

  • upper (Hash, ImageCoordinate)

    a hash or ImageCoordinate mapping dimensions to the upper bound of the box (exclusive) along the specified dimensions. Can contain extra dimenions not boxed; only the boxing on the dimenions specified in the dims parameter will be changed.

  • dims (Enumerable)

    an enumeration of the dimensions to be boxed (these should be the symbol shortcuts to the dimensions; e.g. :x, :y)



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rimageanalysistools/drawing.rb', line 49

def box_conservative(lower, upper, dims)

  low_curr = nil
  up_curr = nil

  if getIsBoxed then

    low_curr = getBoxMin
    up_curr = getBoxMax

  else

    low_curr = ImageCoordinate[0,0,0,0,0]
    up_curr = ImageCoordinate.cloneCoord(getDimensionSizes)

  end

  dims.each do |d|
    low_curr[d]= lower[d]
    up_curr[d]= upper[d]
  end

end