Commit e1085baa authored by acpaquette's avatar acpaquette
Browse files

Updated roi object to use new clipped_array and clip_center properties

parent 80bd6df2
Loading
Loading
Loading
Loading
+30 −33
Original line number Diff line number Diff line
@@ -174,8 +174,6 @@ class Roi():
        """
        if self.ndv == None:
            return True
        if len(self.clipped_array) == 0:
            return False
        # Check if we have any ndv values this will return an inverted array
        # where all no data values are true, we need to then invert the array
        # and return the all result. This ensures that a valid array will return
@@ -185,7 +183,7 @@ class Roi():

    @property
    def variance(self):
        return np.var(self.array)
        return np.var(self.clipped_array)

    @property
    def clipped_array(self):
@@ -313,9 +311,9 @@ class Roi():
                                        mode=mode,
                                        order=3)

            self.clip_center = (np.array(pixel_locked.shape)[::-1]) / 2.0
            self._clip_center = (np.array(pixel_locked.shape)[::-1]) / 2.0

            self.clipped_array = img_as_float32(pixel_locked)
            self._clipped_array = img_as_float32(pixel_locked)
        else:

            # Now that the whole pixel array has been read, interpolate the array to align pixel edges
@@ -335,7 +333,6 @@ class Roi():
            if self.buffer != 0:
                pixel_locked = pixel_locked[self.buffer:-self.buffer,
                                            self.buffer:-self.buffer]
            self.clip_center = tuple(np.array(pixel_locked.shape)[::-1] / 2.)
            self._clip_center = tuple(np.array(pixel_locked.shape)[::-1] / 2.)
            self.warped_array_center = self.clip_center
            self.clipped_array = img_as_float32(pixel_locked)
            self._clipped_array = img_as_float32(pixel_locked)