def __init__(self, slot, start=None, stop=None, pslice=None): super(SubRegion, self).__init__(slot) if pslice != None or start is not None and stop is None and pslice is None: if pslice is None: pslice = start shape = self.slot.meta.shape if shape is None: # Okay to use a shapeless slot if the key is bounded # AND if the key has the correct length assert slicingtools.is_bounded(pslice) # Supply a dummy shape shape = [0] * len(pslice) self.start, self.stop = sliceToRoi(pslice, shape) elif start is None and pslice is None: self.start, self.stop = sliceToRoi(slice(None, None, None), self.slot.meta.shape) else: self.start = TinyVector(start) self.stop = TinyVector(stop) self.dim = len(self.start)
def __init__(self, slot, start = None, stop = None, pslice = None): super(SubRegion,self).__init__(slot) if pslice != None or start is not None and stop is None and pslice is None: if pslice is None: pslice = start assert self.slot.meta.shape is not None self.start, self.stop = sliceToRoi(pslice,self.slot.meta.shape) else: self.start = start self.stop = stop