gdesk.panels.imgview.dimensions module

multiple dimension range and slicing

virtual sequence of numbers defined by start to stop by step functions to

  • modify the range by applying slices

  • reset to full range

  • get default python range object

  • partial ranges for representations

start = first number; 0 by default stop = all numbers are lower then stop, so not included in sequence step = stepping of the sequence; 1 by default maxstop = stop can never be set larger than maxstop

DimRange: single dimension DimRanges: multiple dimensions

class gdesk.panels.imgview.dimensions.DimRange(maxstop)

Bases: object

range info of a single dimension

maxstop = the size of the dimension

apply slices to a range to get a new range slices can be applied cumulatively range can be reset to the original range

applyslice(aslice, full=False)

return a range based on another range and a range definition

ex:

bslice = slice(3,None,2) or [3::2] on the __getitem__ or __setitem__ brange = (0,50,2) return range(6,50,4)

clip()
clone()
copy()
property count
getrange()
getslice()
getstartrange(count=7)
getstoprange(count=7)
inherite(source)
isfullrange()
property range
reset()
setfromslice(aslice, full=True)

slice the current range by the slice aslice

a slice is e.g. created from item[0:10:2]

or by slice(0,10,2)

if full == True: don’t build on the current roi

size()
property slice
splitstarts(count)
class gdesk.panels.imgview.dimensions.DimRanges(sizes=None)

Bases: object

range info of a multiple dimensions

sizes = tuple of the sizes of the dimensions

accslices(index)
clip()
clone()
copy()
property fullshape
getfullshape()
getshape()
getslices(swap_row_columns=False)
inherite(source)
isfullrange()
maketuple(index)
reset()
setslices(index)
property shape
class gdesk.panels.imgview.dimensions.SetSlices(parent)

Bases: object

to set the roi, use the slices syntax on set example:

b = pybix.ones(100,80) * 12000 b.roi >>>[dim:100 slice:0:100:1, dim:80 slice:0:80:1] b.roi.set[20:60,::2] b.roi >>>[dim:100 slice:20:60:1, dim:80 slice:0:80:2]