def __PlanePositionCallback(self, obj, event):
        newCoordinate = [int(self.planes[i].GetRepresentation().GetOrigin()[i]) \
                         for i in range(3)]
        axis = -1
        for i in range(3):
            
            if newCoordinate[i] != self.coordinate[i]: axis = i; break
        if axis < 0: return
        if newCoordinate[axis] >= self.dataShape[axis]: newCoordinate[axis] = self.dataShape[axis]-1
                         
        self.__UpdateCross()
        self.lastChangedAxis = axis
        
        self.coordinate = newCoordinate
        #print "__PlanePositionCallback: setting coordinate to", self.coordinate
        self.InvokeEvent("CoordinatesEvent")
dataset/ETHPy150Open ilastik/ilastik-0.5/ilastik/gui/slicingPlanesWidget.py/SlicingPlanesWidget.__PlanePositionCallback/original