import sys sys.path.append(scriptdir + '..') from eidolon import ReprType, ImageSceneObject, extendImage from TestUtils import generateTimeSphereImages step = 0.1 dim = 50 # create an object and repr with a particular name images = generateTimeSphereImages(step, dim) obj = ImageSceneObject('Sphere', [], images) mgr.addSceneObject(obj) rep = obj.createRepr(ReprType._imgtimevolume) mgr.addSceneObjectRepr(rep) del obj del rep mgr.clearScene() # this should free up existing objects # attempt to create an object and repr with the same name as the above, this will crash if the repr doesn't choose unique names for materials, textures, etc. images = generateTimeSphereImages(step, dim) obj = ImageSceneObject('Sphere', [], images) mgr.addSceneObject(obj) rep = obj.createRepr(ReprType._imgtimevolume) mgr.addSceneObjectRepr(rep)
# # Eidolon is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program (LICENSE.txt). If not, see <http://www.gnu.org/licenses/> from eidolon import ImageSceneObject, generateSphereImageStack, ReprType, delayedcall images = generateSphereImageStack(50, 50, 50) obj = ImageSceneObject('Sphere', [], images) mgr.addSceneObject(obj) rep = obj.createRepr(ReprType._imgstack) mgr.addSceneObjectRepr(rep) mgr.setCameraSeeAll() d1 = mgr.create2DView() mgr.callThreadSafe(d1.setImageStackPosition, 25) d2 = mgr.create2DView() mgr.callThreadSafe(d2.setImageStackPosition, 25) # wait for 1 second, remove the second 2d window and then add a third @mgr.addFuncTask @delayedcall(1.0) def _remove():
# # You should have received a copy of the GNU General Public License along # with this program (LICENSE.txt). If not, see <http://www.gnu.org/licenses/> import sys sys.path.append(scriptdir+'..') from eidolon import ReprType,ImageSceneObject,vec3 from TestUtils import generateTimeSphereImages step=0.1 images=generateTimeSphereImages(step) obj=ImageSceneObject('Sphere',[],images) mgr.addSceneObject(obj) rep=obj.createRepr(ReprType._imgtimestack) mgr.addSceneObjectRepr(rep) rep.setPosition(vec3(5,-10,-4)) rep.setRotation(0.1,0.2,-0.12) rep1=obj.createRepr(ReprType._imgtimevolume) mgr.addSceneObjectRepr(rep1) rep1.setPosition(vec3(61,6,8)) rep1.setRotation(-0.1,-0.13,0.22) obj1 = SlicePlugin.createSlicePlane(vec3(49.5,-25.0,24.5),vec3(-0.128762689557,-0.782178248535,0.60960426286)) mgr.addSceneObject(obj1) rep2 = obj1.createRepr(ReprType._line) mgr.addSceneObjectRepr(rep2) mgr.showHandle(rep2,True)
# Eidolon Biomedical Framework # Copyright (C) 2016-7 Eric Kerfoot, King's College London, all rights reserved # # This file is part of Eidolon. # # Eidolon is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eidolon is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program (LICENSE.txt). If not, see <http://www.gnu.org/licenses/> from eidolon import ReprType, generateSphereImageStack, ImageSceneObject, vec3 images = generateSphereImageStack(50, 50, 50, vec3(0.5, 0.5, 1), vec3(0.45, 0.45, 0.9)) obj = ImageSceneObject('Sphere', [], images) mgr.addSceneObject(obj) rep = obj.createRepr(ReprType._imgvolume) mgr.addSceneObjectRepr(rep) mgr.setCameraSeeAll()