Hello
I have been trying to convert a matrix to an image without success, as a simple example please see below;
var view = ImageWindow.activeWindow; // All white image
var matrixView = view.mainView.image.toMatrix(); // Convert image to matrix
console.writeln(matrixView.maxElement()) // returns 1 as expected for all white view
matrixView.div(10); // just to see that matrix changed
console.writeln(matrixView.maxElement()) // returns 0.1 as expected
// Now to convert matrix back to image, some examples I have tried;
matrixView.toImage(); // no error but no image
view = matrixView.toImage(); // no error but no image
view.mainView = matrixView.toImage(); // error
view.mainView.image = matrixView.toImage(); // error
I've tried many other mostly random variations without success. I'm sure its simple if you know how. Unfortunately there are no helpful comments or examples in Object Editor, just a list of objects.
Thanks Ken
I have been trying to convert a matrix to an image without success, as a simple example please see below;
var view = ImageWindow.activeWindow; // All white image
var matrixView = view.mainView.image.toMatrix(); // Convert image to matrix
console.writeln(matrixView.maxElement()) // returns 1 as expected for all white view
matrixView.div(10); // just to see that matrix changed
console.writeln(matrixView.maxElement()) // returns 0.1 as expected
// Now to convert matrix back to image, some examples I have tried;
matrixView.toImage(); // no error but no image
view = matrixView.toImage(); // no error but no image
view.mainView = matrixView.toImage(); // error
view.mainView.image = matrixView.toImage(); // error
I've tried many other mostly random variations without success. I'm sure its simple if you know how. Unfortunately there are no helpful comments or examples in Object Editor, just a list of objects.
Thanks Ken