def _imageFromOrientationMap(menuitem, microstructure, imagename, colorscheme): ms = ooflib.common.microstructure.microStructures[microstructure] orientdata = orientmapdata.getOrientationMap(ms.getObject()) immidge = orientdata.createImage(imagename, colorscheme) # OOFImage object immidge.setSize(ms.getObject().size()) immidge.setMicrostructure(ms.getObject()) imagemenu.loadImageIntoMS(immidge, microstructure)
def _imageFromOrientationMap(menuitem, microstructure, imagename, colorscheme): ms = ooflib.common.microstructure.microStructures[microstructure] orientdata = orientmapdata.getOrientationMap(ms.getObject()) immidge = orientdata.createImage(imagename, colorscheme) # OOFImage object immidge.setSize(ms.getObject().size()) immidge.setMicrostructure(ms.getObject()) imagemenu.loadImageIntoMS(immidge, microstructure) switchboard.notify("redraw")
def _newImage(menuitem, name, microstructure, pixels): ms = \ ooflib.common.microstructure.microStructures[microstructure].getObject() # TODO OPT: reading pixels in is very slow image = oofimage.newImageFromData(name, ms.size(), ms.sizeInPixels(), pixels.values()) image.setSize(ms.size()) imagemenu.loadImageIntoMS(image, microstructure)
def _newImage(menuitem, name, microstructure, pixels): ms = ooflib.common.microstructure.microStructures[microstructure].getObject() image = oofimage.newImageFromData(name, ms.sizeInPixels(), pixels.values()) image.setSize(ms.size()) imagemenu.loadImageIntoMS(image, microstructure)