[Gate-users] Autorotation axis issue.
Etienne Auger
Etienne.Auger at USherbrooke.ca
Mon Apr 27 16:57:34 CEST 2020
Hello Steve,
I think you may want to simplify your code and autorotation will do what you desire. I commented the lines that I think are unnecessary or even detrimental to your problem. Feel free to delete them in your code once you are convinced :
# SPECT Head: main volume, everything is included in SPECThead
# the name MUST be SPECThead - one of available systems is table 1.1
/gate/world/daughters/name SPECThead
/gate/world/daughters/insert box
/gate/SPECThead/geometry/setZLength 57.6 cm # swapped value with X
/gate/SPECThead/geometry/setYLength 44.6 cm
/gate/SPECThead/geometry/setXLength 18 cm # swapped value with Z
/gate/SPECThead/placement/setTranslation 60. 0. 0. cm # added arbitrary translation
# /gate/SPECThead/placement/setRotationAxis 1 0 0 # detrimental
# /gate/SPECThead/placement/setRotationAngle -90 deg # detrimental
/gate/SPECThead/vis/setColor white
/gate/SPECThead/setMaterial Air
/gate/SPECThead/vis/forceWireframe
# Replicate SPECThead to get a multi-headed system
/gate/SPECThead/repeaters/insert ring
# /gate/SPECThead/ring/setPoint1 0 0 0 # unnecessary
# /gate/SPECThead/ring/setPoint2 0 0 1 # unnecessary
/gate/SPECThead/ring/enableAutoRotation
/gate/SPECThead/ring/setAngularSpan 360. deg
/gate/SPECThead/ring/setRepeatNumber 4
The idea is to first define your SPECThead as you want it to appear on the first of the four positions. For that, I swapped the X and Z dimensions of your SPECThead in order to better represent the usual geometry of a SPECT camera. This, I think, takes care of what you tried to do with your first rotation about X axis (which should have been around Y axis really I think). Then, I added an arbitrary 60 cm translation, which I'm guessing you must specify somewhere else in your code, but did not provide in the sample code (change it according to your specs). It is important to translate the SPECThead before applying a ring repeater on it. And then, the magic of autorotation takes care of repeating the first unit around with always the same face of your SPECThead facing the center of the scanner, as you wanted (no need to specify setPoint1 and setPoint2 as the axis of rotation is already by default the Z axis).
In the hope of having well understood your question and having answered it accordingly,
Étienne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20200427/2e14b5d8/attachment.html>
More information about the Gate-users
mailing list