def save_to_stack(self): image = self.plugin.filtered_image.copy() io.push(image) msg = dedent('''\ The image has been pushed to the io stack. Use io.pop() to retrieve the most recently pushed image. NOTE: The io stack only works in interactive sessions.''') notify(msg)
def save_to_stack(self): from skimage import io img = self.arr.copy() io.push(img) msg = dedent(''' The image has been pushed to the io stack. Use io.pop() to retrieve the most recently pushed image.''') msglabel = QLabel(msg) dialog = QtGui.QDialog() ok = QtGui.QPushButton('OK', dialog) ok.clicked.connect(dialog.accept) ok.setDefault(True) dialog.layout = QtGui.QGridLayout(dialog) dialog.layout.addWidget(msglabel, 0, 0, 1, 3) dialog.layout.addWidget(ok, 1, 1) dialog.exec_()
def test_stack_non_array(): with testing.raises(ValueError): io.push([[1, 2, 3]])
def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x)
def test_stack_non_array(): io.push([[1, 2, 3]])