[Gate-users] Gate v6.2 Source setRotationAxis
Marc Chamberland
MarcChamberland at cmail.carleton.ca
Wed Aug 28 15:31:48 CEST 2013
Hi Sonoko,
I can confirm that the visualization of the source has a bug (or maybe it's just a "limitation"?) where it will not show the updated position of the source when attached to a volume.
You can see for yourself: the GateVSourc::Visualize function generates circles on the viewer scene within the source's position with the following line:
circle.SetPosition(m_posSPS->GenerateOne());
where m_posSPS is the original location of the source.
But when you attach a source to a volume, it does not update m_posSPS. Instead, when Gate is generating particles from the source, it generates the particles from the original source location, then moves the *particles* relative to the attached volume. This can be seen in GateVSource::GeneratePrimaryVertex:
ChangeParticlePositionRelativeToAttachedVolume(particle_position);
So, this explains why you see the source in the "wrong" position in the viewer. I think this could be fixed, but I'm not sure if I'll have time to fix it myself. Feel free to give it a try if you want (or anyone else, for that matter).
Marc
__________________________
Marc Chamberland, MSc
PhD candidate
Department of Physics
Carleton University
Ottawa (ON)
On 2013-08-28, at 9:18 AM, Marc Chamberland <MarcChamberland at cmail.carleton.ca>
wrote:
> Hi Sonoko,
>
> This problems sounds familiar to me. Have you actually run your simulation? Try it out quickly with a back-to-back source and then check that your photons are emitted from where you think the source should be.
>
> I vaguely remember that sources did not show their updated position in the viewer, but maybe I'm just making it up. In any case, a short simulation should tell you if your source is placed correctly or not.
>
> Marc
>
>
>
> __________________________
>
> Marc Chamberland, MSc
> PhD candidate
> Department of Physics
> Carleton University
> Ottawa (ON)
>
> On 2013-08-27, at 5:23 PM, Sonoko Nakano <snakano at sfu.ca>
> wrote:
>
>> Hello Gate users,
>>
>> I tried to attach the source to a volume and rotate the volume. But the source is not rotated.
>> Can someone help me?
>>
>>
>> ## PHANTOM
>> ## Create the phantom volume
>> ##############################################################
>> /gate/world/daughters/name Phantom1
>> /gate/world/daughters/insert cylinder
>> /gate/Phantom1/geometry/setRmax 5 mm
>> /gate/Phantom1/geometry/setRmin 0. mm
>> /gate/Phantom1/geometry/setHeight 6.3 cm
>> /gate/Phantom1/setMaterial Air
>> #/gate/Phantom1/vis/setColor white
>> #/gate/Phantom1/vis/forceSolid
>>
>>
>> ## D E F I N E T H E S O U R C E
>> #############################################################
>> /gate/source/addSource SourceConfinement
>> /gate/source/SourceConfinement/gps/type Volume
>> /gate/source/SourceConfinement/gps/shape Cylinder
>> /gate/source/SourceConfinement/gps/radius 1 mm
>> /gate/source/SourceConfinement/gps/halfz 31.5 mm
>> /gate/source/SourceConfinement/gps/centre 0. 0. 0. mm
>> /gate/source/SourceConfinement/gps/particle gamma
>> /gate/source/SourceConfinement/gps/energy 140. keV
>> /gate/source/SourceConfinement/setActivity 2400000 Bq
>> /gate/source/SourceConfinement/gps/angtype iso
>>
>> /gate/source/SourceConfinement/attachTo Phantom1 #<----- attach to the volume
>>
>> /gate/Phantom1/placement/setRotationAxis 1 0 0 #<----- rotate the volume
>> /gate/Phantom1/placement/setRotationAngle 90 deg #<----- rotate the volume
>> /gate/source/SourceConfinement/visualize 5000 red 2
>>
>>
>> When I view the volume (called Phantom1), it is rotated.
>> But when I view the source, it is not rotated.
>>
>> Thank you,
>>
>> Sonoko
>>
>>
>>
>> ----- Original Message -----
>> From: "Marc Chamberland" <MarcChamberland at cmail.carleton.ca>
>> To: "Sonoko Nakano" <snakano at sfu.ca>
>> Cc: "Gate Users" <gate-users at lists.opengatecollaboration.org>
>> Sent: Monday, August 19, 2013 11:25:34 AM
>> Subject: Re: [Gate-users] Gate v6.2 Source setRotationAxis
>>
>> Someone can correct me if I'm wrong, but I don't think you can use these commands with a source.
>>
>>
>> You have to use the Geant4 General Particle Source (gps) commands to position a source.
>>
>>
>> See the Geant4 gps user's manual here: http://reat.space.qinetiq.com/gps/new_gps_sum_files/gps_sum.htm
>>
>>
>>
>>
>> But I believe a simpler alternative is to attach the source to a volume and place (or move) the volume as you wish.
>>
>>
>>
>>
>> Marc
>>
>>
>>
>>
>>
>>
>> __________________________
>>
>>
>> Marc Chamberland, MSc PhD candidate
>> Department of Physics
>> Carleton University
>> Ottawa (ON)
>>
>>
>> On 2013-08-19, at 2:18 PM, Sonoko Nakano < snakano at sfu.ca >
>> wrote:
>>
>>
>> Hello Gate users,
>>
>> My computer is MacBook Pro(Mac OSX), and I am using gate v6.2.
>>
>> When I use /gate/source/[source name]/setRotationAxis 1 0 0
>> /gate/source/[source name]/setRotationAngle 90 deg
>>
>> I got an error message:
>>
>> ***** COMMAND NOT FOUND </gate/source/[source name]/setRotationAxis 1 0 0 > *****
>>
>> Can someone help me?
>>
>> Thank you,
>>
>> Sonoko
>> _______________________________________________
>> Gate-users mailing list
>> Gate-users at lists.opengatecollaboration.org
>> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
>>
>>
>>
>
> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.opengatecollaboration.org
> http://lists.opengatecollaboration.org/mailman/listinfo/gate-users
More information about the Gate-users
mailing list