def set_image(self, image):
if isinstance(image, np.ndarray):<EOL><INDENT>image = util.Image(image)<EOL><DEDENT>if isinstance(image, util.NullImage):<EOL><INDENT>self.model_as_data = True<EOL><DEDENT>else:<EOL><INDENT>self.model_as_data = False<EOL><DEDENT>self.image = image<EOL>self._data = self.image.get_padded_image(self.pad)<EOL>self.oshape = util.Tile(self._data.shape)<EOL>self.ishape = self.oshape.pad(-self.pad)<EOL>self.inner = self.ishape.slicer<EOL>for c in self.comps:<EOL><INDENT>c.set_shape(self.oshape, self.ishape)<EOL><DEDENT>self._model = np.zeros(self._data.shape, dtype=np.float64)<EOL>self._residuals = np.zeros(self._data.shape, dtype=np.float64)<EOL>self.calculate_model()<EOL>
Update the current comparison (real) image