2007年5月29日星期二

回复: 用amide转换的interfile�募荒鼙籊ate正确读取

你好!不好意思,前两天是周末和节日(memorial day),所以没有来办公室。

我印象中amide的export是使用它自己的格式,而不是保留文件读入时原先的格式。你碰到的应该就是这个问题。建议使用xmedcon进行图像的格式转换。不过即使我用xmedcon转换得到的图像文件在读入Gate时也会有问题,至少我碰到的是这样,原因可能是我自己在用xmedcon转换前的analyze格式的头文件就不太正确(我自己用程序生成的,可能漏掉什么重要的参数)。

这个帖子里说了需要修改的参数:
http://tutorsky.net/gate/2007/05/interfilephantomsource.html
例子中
scaling factor (mm/pixel) [1] := + 1.000000e-01
scaling factor (mm/pixel) [2] := +1.000000e-01

表示pixel在x和y方向上是0.1mm。但是并没有z方向的参数
scaling factor (mm/pixel) [3]。但如果不设z方向大小的话,图像读进去是不对的,最后我把这个参数从

slice thickness (pixels) := +1.000000e+00

改成
slice thickness (pixels) := +1.000000e-01

使得z方向也是0.1mm/pixel。

我不确定我这样做是不是一定对,不过目前图像读入没有问题。。。


希望能对你有所帮助。

On 5/25/07, Guifen Lin <guifen_lin@yahoo.com.cn> wrote:
HI,Shawn
你能告诉我修改了哪些参数?我用stir的generate_image命令产生的图像文件分别为image.hv,image.ahv ,image.v,可以直接用AMIDE打开,可是我明明在image.ahv中定义"!number format := unsigned integer",但当我用AMIDE的File->Export Data Set->run->image,结果生成文件"image.i33""image.h33",可是在文件image.h33中变成"!number format := short float",我不知道为什么?
AMIDE转换为何会发生数据格式转换?谢谢你给我提供宝贵建议。


2007年5月24日星期四

3D PET中这样模拟体素化源分布

我东南大学的一名普通教师,我也是刚用GATE不久,其中遇到不少困难,不好意思,首次联系就想问你们一个问题。我用gate 成功模拟了gate 提供的体素源(hof3.h33,hof3.i33),但当我想自己通过STIR的generate_image命令产生3DPET文件(image.hv,image.ahv,image.v),然后再通过AMIDE转化为Interfile 3.3的文件(image.h33,image.i33),最后在用gate模拟时总是不成功,我想了很多办法都无济于事,你能告诉我如何做?出错信息见文件Volxel_error.txt
谢谢


抢注雅虎免费邮箱3.5G容量,20M附件!

3D PET中这样模拟体素化源分布

我东南大学的一名普通教师,我也是刚用GATE不久,其中遇到不少困难,不好意思,首次联系就想问你们一个问题。我用gate 成功模拟了gate 提供的体素源(hof3.h33,hof3.i33),但当我想自己通过STIR的generate_image命令产生3DPET文件(image.hv,image.ahv,image.v),然后再通过AMIDE转化为Interfile 3.3的文件(image.h33,image.i33),最后在用gate模拟时总是不成功,我想了很多办法都无济于事,你能告诉我如何做?出错信息见文件Volxel_error.txt
谢谢


抢注雅虎免费邮箱3.5G容量,20M附件!

2007年5月23日星期三

两个不同的GATE

GATE的mailing list是在下面这个网页:
http://lists.healthgrid.org/mailman/listinfo/gate-users

不知道为什么一不小心跑到这个网页去了:
https://lists.sourceforge.net/lists/listinfo/gate-users

实在太象了,呵呵。。。结果。。。可想而知了。

在xserve1上安装GATE

通过VNC控制xserve1,安装GATE,和原先在desktop上本地安装有一些区别,主要是:

1. 为了以后能在其他node上直接运行,Gate和其他必需的程序都安装在一个以后被automount的目录下面,这里用的是/Volumes/Gate4Xgrid/

2. 以前CLHEP是通过fink安装的,这次不行

安装细节:

1. 安装X11. Mac OS X 10.4的X11只能通过光盘安装, 下载的版本不行。从Server光盘找到X11User.pkg和X11SDK.pkg,全部传到xserve1并安装。(问题:如果要用xgrid,其他node是否都要安装X11?)

2. 下载clhep的binary解压缩到/Volume/Gate4Xgrid/clhep- 1.9.3.1下面 (后来发现,clhep的binary里面没有HepMC,所以导致Geant安装失败。)

"The latest release is 1.9.3.1 and 2.0.3.1, released on October 18, 2006.
Note that HepPDT, HepMC, and StdHep are no longer being built."

最后,安装了binary的 CLHEP 2.0.3.1 for gcc 4.0 ,然后把我desktop已正常使用的CLHEP(通过fink安装的)下面的HepMC, HepPDT, StdHep三个文件夹的内容全部ftp到xserve1的/Volume/Gate4Xgrid/CLHEP/include/CLHEP/HepMC, etc... 再编译geant4的时候就通过了。

3. 安装XCode2.0(同样的问题:其他node怎么办?Xcode是编译Geant4的时候需要呢,还是运行的时候也需要?)

4. 到 http://geant4.web.cern.ch/geant4/support/source_archive.shtml 下载Geant4 8.1 "Unix tar format, compressed using gzip"。解压缩后把整个文件夹geant4.8.1.p02移到/Volume/Gate4Xgrid/下面

5. mkdir /Volume/Gate4Xgrid/geant4.8.1.p02/data, 下载 "data files for low energy electromagnetic processes" G4EMLOW.3.0.tar.gz,以及其他数据,放到data下面

6. 安装root5.12 : 下载root源程序,放到/Volumes/Gate4Xgrid/root下面,运行./configure macosx,设置环境变量ROOTSYS=/Volumes/Gate4Xgrid/root,再运行make,结果出错。然后下载了binary,直接放到/Volumes/Gate4Xgrid/root-5.12下面,可以运行。

7. 在/Volumes/Gate4Xgrid/geant4.8.1.p02 下运行 ./Configure -build,通过。

8. 在/Volumes/Gate4Xgrid/geant4.8.1.p02 下运行 ./Configure,生成env.sh和env.csh

9. 把gate3.1.1源程序放到/Volumes/Gate4Xgrid/gate_v3.1.1,编写.cshrc文件如下:

setenv ROOTSYS /Volumes/Gate4Xgrid/root- 5.12
setenv DISPLAY :0.0
setenv G4INSTALL /Volumes/Gate4Xgrid/geant4.8.1.p02/
setenv G4WORKDIR /Volumes/Gate4Xgrid/geant4.8.1.p02/
setenv G4VERSION "8.1"
setenv GATEHOME "/Volumes/Gate4Xgrid/gate_v3.1.1"
set path = ($path /usr/loca/bin/  ${ROOTSYS}/bin ${GATEHOME}/bin/Darwin-g++)

setenv LD_LIBRARY_PATH "${ROOTSYS}/lib"
setenv DYLD_LIBRARY_PATH "${ROOTSYS}/lib"

source /Volumes/Gate4Xgrid/gate_v3.1.1/env_gate.csh

10. 运行make,编译Gate,通过。

11. 运行Gate,出错:
dyld: Library not loaded: libCLHEP-2.0.3.1.dylib
  Referenced from: /Volumes/Gate4Xgrid/gate_v3.1.1/bin/Darwin-g++/Gate
  Reason: image not found

检查/Volumes/Gate4Xgrid/CLHEP/lib/libCLHEP-2.0.3.1.dylib,存在
检查环境变量: printenv |grep CLHEP
CLHEP_BASE_DIR=/Volumes/Gate4Xgrid/CLHEP
CLHEP_INCLUDE_DIR=/Volumes/Gate4Xgrid/CLHEP/include
CLHEP_LIB_DIR=/Volumes/Gate4Xgrid/CLHEP/lib
CLHEP_LIB=CLHEP
不知道什么原因,Gate运行的时候,没有从Volumes/Gate4Xgrid/CLHEP/lib下面去找libCLHEP-2.0.3.1.dylib,而是从当前目录。cd到/Volumes/Gate4Xgrid/CLHEP/lib下面再运行Gate,成功启动。








2007年5月16日星期三

G4WORKDIR

环境变量G4WORKDIR到底应该设成geant4安装的目录,还是任何一个指定的作为Gate工作的目录?

2007年5月10日星期四

Gate里的scatter记录

The phantomSD plays a crucial role in GATE simulations, as it is used to detect and count Compton and Rayleigh interactions taking place in the scanner FOV. This information is then used to estimate whether a photon reaching a detector is a direct or a Compton-scattered photon. Thus, in PET, the phantomSD is currently the only way to discriminate scattered from true coincidences. To simulate low energy X-ray acquisitions (for example mammography acquisitions from 7 to 28 keV), information concerning Rayleigh interactions is significant.

Using this type of sensitive detector, it's possible to retrieve two types of information considering the hits:

• The number of Compton and Rayleigh interactions occuring in all the volumes attached to the phantomSD: this information is stored in the data output variables nPhantomCompton and nPhantomRayleigh.

Note: This information is also available for the crystalSD with the variables nCrystalCompton and nCrystalRayleigh.

• The last volume attached to the phantomSD in which a Compton or aRayleigh interaction occured: the data output variables used are named compVolName and RayleighVolName.

Attachment of the phantomSD

• One first needs to define a dummy, air-filled volume covering the whole field-of-view of the scanner.
• Then, all the source volumes should be offsprings (direct or indirect) of this volume.
• Last, all these volumes (FOV and sources) should be attached to the phantomSD using the command attachPhantomSD.


2007年5月9日星期三

需要在每个Xgrid的Agent上安装Gate

From Apple's Xgrid mailing list:

1.

Question:

Is it possible NOT to duplicate the whole environment (binaries, libraries, etc...), and just send the input files? In other words, is it possible to have the executable already on the agents (as we have), and just the input files on the controller?

Answer:

Yes. The simplest way to do this is to pre-install the executables, and simply use a shell-script which invokes them as the 'command'

2.

One thing about the darwin ports version, it builds povray using shared libraries, which means that when you run that version of povray, it looks in /usr/lib (or /opt/usr/lib--I don't remember) to find the required libraries (libpng for example). That means you have to pre install those libraries on all of the agent computers, which can be a problem if you don't have direct control over the agents. Anton Raves' compile instructions doesn't use shared libraries, but copies them into the executable (which makes the executable larger, but it makes it run better on the agents).

3.

For example, using Xgrid to run thousands of iterations of a Monte Carlo is a really good idea.  The trick is that you either need a stand-along program for the computation, or you need your 
computational environment (Mathematica, Matlab, etc.) pre-installed on every agent machine.

2007年5月8日星期二

在本地xgrid controller上运行gate

我把自己的mac设成controller兼agent兼client,运行:xgrid -h xxx -p xxx -job batch test.plist, where test.plist is as below:

{
jobSpecification = {
applicationIdentifier = "com.apple.xgrid.cli";
inputFiles = {};
name = "Gate";
submissionIdentifier = abc;
taskSpecifications = {
0 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test0.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
1 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test1.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
2 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test2.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
3 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test3.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
4 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test4.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
};
};
}

仍然不能运行,显示错误:

Fatal in <TROOT::TROOT>: ROOTSYS not set. Set it before trying to run.

尝试在Xserve G5 Cluster上用Xgrid运行Gate

看Gate3.1.1的说明里有对Xgrid的支持,所以试一下。

先编译安装jobsplitter:

[pcsk795:gate_v3.1.0/Cluster_Tools/jobsplitter] zixiongc% make
Making dependency for file gjs.cc ...
Making dependency for file src/GateToPlatform.cc ...
Making dependency for file src/GateSplitManager.cc ...
Making dependency for file src/GateSeeder.cc ...
Making dependency for file src/GateMacfileParser.cc ...
Compiling GateMacfileParser.cc ...
src/GateMacfileParser.cc: In member function 'void GateMacfileParser::CleanAbort()':
src/GateMacfileParser.cc:105: warning: unused variable 'res'
Compiling GateSeeder.cc ...
Compiling GateSplitManager.cc ...
Compiling GateToPlatform.cc ...
Creating/replacing object files in ./tmp/Darwin-g++/gjs/libgjs.a ...
ar: creating archive ./tmp/Darwin-g++/gjs/libgjs.a
Compiling gjs.cc ...
warning: this program uses gets(), which is unsafe.
Using granular libraries ...
Linking gjs ...
... Done!

再编辑安装filemerger:

[pcsk795:gate_v3.1.0/Cluster_Tools/filemerger] zixiongc% make

creating object file for ./gjm

creating object file for src/GateMergeManager
src/GateMergeManager.cc: In member function 'bool GateMergeManager::FastMergeGate(std::string)':
src/GateMergeManager.cc:504: warning: unused variable 'maxtime'
src/GateMergeManager.cc: In member function 'bool GateMergeManager::MergeTree(std::string)':
src/GateMergeManager.cc:495: warning: control reaches end of non-void function

linking gjm

安装后的执行文件gjs在
/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/bin/Darwin-g++
gjm在
/Applications/gate_v3.1.0/Cluster_Tools/filemerger

在~/G4work下运行:
/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/bin/Darwin-g++/gjs -numberofsplits 5 -clusterplatform xgrid test.mac

ROOT output is enabled
ASCII output is enabled but no filename is given; using a default one
INTER output is disabled
LMF output is disabled
ECAT output enabled if ECAT + sinogram selected but no filename is given; using a default one
SINO output enabled if ECAT system selected but no filename is given; using a default one
Information : Random seed file $(GC_DOT_GATE_DIR)/seed(n).rndm

在 /Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/下出现

seed1.rndm      seed2.rndm      seed3.rndm      seed4.rndm      seed5.rndm      test.split      test1.mac       test2.mac
test3.mac       test4.mac       test5.mac

其中

test1.mac最后两行:

/random/resetEngineFrom /Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/seed1.rndm
/gate/application/startDAQCluster 0 1 0 s

test2.mac最后两行:

/random/resetEngineFrom /Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/seed2.rndm
/gate/application/startDAQCluster 1 2 0 s


在当前目录~/G4work出现文件test.plist:

{
jobSpecification = {
applicationIdentifier = "com.apple.xgrid.cli";
inputFiles = {};
name = "Gate";
submissionIdentifier = abc;
taskSpecifications = {
0 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test0.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
1 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test1.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
2 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test2.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
3 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test3.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
4 = {arguments =(/Applications/gate_v3.1.0/Cluster_Tools/jobsplitter/dotGate/.Gate/test/test4.mac); command ="/Applications/gate_v3.1.0/bin/Darwin-g++/Gate"; };
};
};
}

接下去看如何让xgrid运行这样的任务了。。。

简单地用 xgrid -job batch test.plist 可以提交任务到xgrid controller,但是不能运行。。。





2007年5月6日星期日

Gate on Xgrid

在GateToPlatform.cc里面发现下面的句子:
  
if (platform=="xgrid"){
        err+=GenerateXgridSubmitfile();
        if (err>0) return 1;
   }


看了Gate3.1.0已经增加了对Xgrid的支持。。。值得好好挖掘一下。。。

2007年5月5日星期六

想通spblurring了

Gate里预设的spblurring功能只适用于一个比较特殊的SPECT的情况,即detector在(x,y)平面上,所以spatial
blurring就相当于给每个event的x和y附加一个符合高斯分布的shift,而z方向则没有。

这种情况完全不设用于我要模拟的环形探测器。

解决办法:从globalPosX、globalPosY、globalPosZ中得出photon最后的位置,转换为其在环形detector上的位置,再加上高斯shift来模拟spblurring,最后转换成crystal
index.

GateSpblurring.cc

看了gate-users2005年的讨论,GateSpblurring.cc程序里的
G4double PzNew = Pz;
应该改成:
G4double PzNew = G4RandGauss::shoot(Pz,m_spresolution/2.35);
来解决z方向的blurring问题。

我查了我安装的最新的Gate3.1.0版本,GateSpblurring.cc的那句还是没有改。是因为这个改动只是针对很特别的情况而不具备通用性?


新Gate里面的local position 是怎么回事,需要研究一下。。。

spblurring discussions in gate-users mailing list

In about Aug 2005

Christian found that when using

1/ /gate/digitizer/Singles/spblurring/setSpresolution 0.0
2/ /gate/digitizer/Singles/spblurring/setSpresolution 10.0

the distributions (with root or ASCII output) of globalPosX ; globalPosY ; globalPosZ for the above configurations differ:

avgX stdevX varX avgY stdevY varY avgZ stdevZ varZ
0mm : 242.435 1.795 3.223 0.919 9.09 82.659 -0.685 8.305 68.967
10mm: 241.85 4.9 24.015 0.955 10.222 104.49 -0.685 68.967 8.304

"I guess these values do make sense, but that does not explain why the projections from the interfile output look identical. Is there a bug in the interfile output?
"

Mikhail A. Shilov from The Johns Hopkins University posted:

First of all I don't get ANY blurring in the interfile projection output. Does anyone knows why?
Second, when I look at the ASCII gateSingles.dat file I see the correct blurring in the Y direction but absolutely no blurring in the Z direction.

Christian,

I saw your postings on this issue. Did you manage to fix the problem? Does you correction to the code fix this bug? :

GateSpblurring.cc:
G4double PzNew = G4RandGauss::shoot(Pz,m_spresolution/2.35);

In response, Christian said:

Dear Mikhail,

Good to hear that I am not the only one with this problem. Well, I never got
the spatial blurring in the interfile output to work. I probably would have
to dig deeper in the source code of GATE to do so. What I ended up doing is
writing a program to extract the detector "counts" from the gateSingles.dat
file. If you wish, I can provide the source code.

The correction I made to the GateSpblurring.cc fixes a different problem,
where the spatial blurring only works in the Y dimension. This is more a
hotfix, I think some more work is needed to make it 100% correct. I am in
contact with the developer of this file. If you manage to extract the
"counts" from gateSingles.dat, I would be more than interested in knowing
your results and if you also observe that the blurring only works in one
dimension.

Please let me know if you need any further help.

Regards,

Christian

Another post from Christian regarding the spblurring bug...

Dear Sebastien,

Thanks for the reply and for continuing the discussion. Please
correct me if I am wrong with my assumption, but aren't those
coordinates in the world coordinate system of the simultaion, or
does the detector have it's own coordinate system? If it is the
world coordinate system, than the z-axis should be along the
axis of rotation, which is actually one coordinate in the projection
image (ordinate).

If you take a closer look at the benchmark_projection.c file, there,
z is also used at the location of an event on the ordinate. x
and y contributions are variable, because they are being
rotated around the z axis. In benchmark_projection.c there are
multiple case where the correct location of the event along the
(absizza) is computed from x and y depending on the angle of rotation.
So at 0 and 180 degree, x is the depth of interaction in the crystal, and
at 90 and 270 degree y is the depth of intersection.

If you look at my original post below, where I simulated a point source
at the origin of the world coordinate system, the average value of X is
exactly the distance between the origin of the world coordinate system
and the detector, and Y and Z show roughly zero as expected.

So I created projection images, without spblurring, I get a nice round
projection of my point source through the pinhole, but if I turn on
spblurring, this projection is distorted, and shows no blurring in the
z direction, indicating that there is a bug in the spblurring functionality.
But after applying my patch, this distortion is not present anymore, and
I get a nice Gaussian distribution in all direction.

The only mistake I might be making is that there is indeed within Gate a
separate coordinate system for the crystal, but my results indicate differently.
If you have time, I would like to send you my files, running the macro only
takes 10 minutes, and you can see for yourself what I am talking about. I
just don't want to send tar archives to this mailing list.

I am looking forward to hearing more from you and I hope I can contribute to
the development of Gate in some way.

Best Regards,

Christian

Steven Staelens, a developer of Gate, answered Christian:

Hi Christian, Hi Mikhail,

This Spblurring function was used 3 years ago for the validation of
SPECT projections using the typical developer macros of that time. The
detector head was alywas perpendicular to the Z-axis, which is not the
case with your macros. This clearly highlights the fact that this class
is obiously not general enough, and apparently no one had discovered
that before. So thank you for pointing this out to the collaboration.

I will answer your 2 specific questions below.


> If this is correct, shouldn't Pz also be blurred
> with the Gaussian function? In my tests I simulated the projection of a point
> source through the pinhole and observed blurring only along the abscissa, and
> no blurring along the ordinate. When I change the line to :
>
> G4double PzNew = G4RandGauss::shoot(Pz,m_spresolution/2.35);
>
> I also observe blurring along the ordinate in the projection image.

OK, I agree this is a fix for your particular issue.

>
> Second, to be more accurate, shouldn't be Py first rotated
> (Py = (-1)*sin(theta) * Px + cos(theta) * Py;) before the blurring is applied?
> Then PxNew can be equal to Px?
>

actually in my current Gate development distribution I no longer use
spatial blurring on the global coordinates but I added three more leaves
to the ROOT tree for local position next to the global positions. In
that way, it is easier to implement a blurrer. This upgrade is not in
the users distribution however but can be implemented extremely easily
in a few lines: f.i in GateRootDefs and in GateSingleDigi.

The last thing you should add is a pointer to the RotationAxis so that
your blurring class knows which (newly created) local positions to blur,
since I assume you do not always want to blur the DOI.

hope this helps,

best regards,

Steven

spblurring

我在digitizer模块里加入了模拟detector的spatial resolution的spblurring:

/gate/digitizer/Singles/insert spblurring
/gate/digitizer/Singles/spblurring/setSpresolution 30.0 mm

想通过改变其中的数值(0, 3mm, 30mm)来确定这个blurring是否真的起了作用。结果发现:

把Spresolution从3mm改成30mm之后,结果中的rsectorID和moduleID并没有变化,但globalPosX与globalPosY发生了类似高斯分布的blurring效果(globalPosZ没有变化);另外sqrt(globalProjX*globalProjX+globalProjY*globalProjY)偏离collimator的内半径更多了。。。

这个结果至少是有问题的。

2007年5月4日星期五

尝试在cluster上运行gate(1)

先检索Gate-users的archive. (我做了一个只检索该网站的定制引擎,"置顶"在这个博客了)

Oct 2004
1. To run GATE on a cluster, you have to split the simulation in sub simulations that will be distributed to the different CPUs and run in parallel. There are two main ways to do it: by time or activity depending on the type of simulations and output you are generating. 

2. There is no guidelines to run GATE on a cluster. Furthermore, this kind of question is not specific to GATE, it's a general question about cluster computing and I don't think it's really relevant to this mailing list. The only information I can give you right now is that there is no parallel version of GATE and the only way to run it on a cluster is to send the different simulations to the different clients using your job scheduler the same way you would just run it on different desktops.

Corinne

3.
Be careful 5 simulations with an activity of 2 Bq is not equivalent to one run with 10Bq. The time difference between two events is
proportional to 1/A so the digitizer will have different effects on a small and a high activity.

The way to split your simulation is to keep a constant activity and divide the simulation with time, for instance:

job1:
/gate/application/setTimeStart 0 s
/gate/application/setTimeStop 0.25 s

job2:
/gate/application/setTimeStart 0.25 s
/gate/application/setTimeStop 0.5 s

and so on until 1s. You will end up with different output files that you should add before your final analysis.
sophie

2007年5月3日星期四

再说一下interfile文件的读入问题

slice thickness好像和amide/xmedcon里面的不一致。我把下面两个都改了才使得gate读入的数据正确:

slice thickness (pixels) := +4.000000e-01
centre-centre slice separation (pixels) := +4.000000e-01

完整的interfile header如下(这个header在amide/xmedcon里显示的时候slice thickness成了0.4*0.4=0.16):

!INTERFILE :=
!imaging modality := nucmed
!originating system := greetings
!version of keys := 3.3
date of keys := 1996:09:24
conversion program := (X)MedCon
program author := Erik Nolf
program version := 0.7.4
program date := 2002:02:18
;
!GENERAL DATA :=
!data offset in bytes := 0
!name of data file := MouseBrain.i33
patient name := hf
!patient ID := 271097
patient dob := 0000:00:00
patient sex := Unknown
!study ID := myPhantom
exam type := Spect study
data compression := none
data encode := none
;
!GENERAL IMAGE DATA :=
!type of data := Tomographic
!total number of images := 64
study date := 1997:11:28
study time := 00:00:00
imagedata byte order := BIGENDIAN
;
number of energy windows := 1
;
energy window [1] :=
energy window lower level [1] :=
energy window upper level [1] :=
flood corrected := N
decay corrected := N
;
!SPECT STUDY (general) :=
number of detector heads := 1
;
!number of images/energy window := 64
!process status := Reconstructed
!matrix size [1] := 64
!matrix size [2] := 64
!number format := unsigned integer
!number of bytes per pixel := 2
scaling factor (mm/pixel) [1] := +4.000000e-01
scaling factor (mm/pixel) [2] := +4.000000e-01
!number of projections := 64
!extent of rotation :=
!time per projection (sec) := 0
study duration (sec) := 0
!maximum pixel count := +1.000000e+01
patient orientation := head_in
patient rotation := supine
;
!SPECT STUDY (reconstructed data) :=
method of reconstruction := Unknown
!number of slices := 64
number of reference frame := 0
slice orientation := Transverse
slice thickness (pixels) := +4.000000e-01
centre-centre slice separation (pixels) := +4.000000e-01
filter name := Unknown
filter parameters := Cutoff
method of attenuation correction := measured
scatter corrected := N
oblique reconstruction := N
!END OF INTERFILE :=


voxelized的phantom和source的放置

试了很久才发现,默认的位置居然是把phantom/source的一个角放在了world的中心,而不是直觉上面把phantom的中心放在world的中心。

比如,如果phantom是64x64x64,voxel是0.4mm大小,那么就要用下面的语句来把它放到中间:

/gate/source/voxel_brain/setPosition -12.8 -12.8 -12.8 mm


12.8=64/2*0.4

如何显示voxelized phantom?

Gate里,voxelized phantom是可以显示的,voxelized source不可以。。。

gate_v2.2.0/examples/example_PHAMTOM_SOURCE/Voxelized_Phantom_Source/range.dat
  5
  0      0       Air        false 0.0  0.0   0.0  0.2
  6      6       Lung       false 1.0  0.0  0.0  0.2
  6      16      Breast     false 0.0  1.0  0.0  0.2
  16     36      Plastic    true  0.0  0.0  1.0  0.2
  36     200     Air        false 0.0  0.0  0.0  0.2

5 classes
lld  uld  material flag a b c d

The 'material' voxels are those for which lld < voxels < uld  where th e"material" is defined in GateMaterials.db
The flag indicates whether to display the phantom when visualising the 'a,b,c,d' parameters are related to the colour/line-style/line-width etc. to display the material.

In order to view transparency, you need a viewer that supports it, like the G4RayTracer (for more info see geant4/source/visualization/RayTracer/README). The alpha parameter controls
the transparency level: 0-transparent, 1-opaque.

2007年5月1日星期二

interfile格式的phantom/source读入问题

我用自己的c程序生成Analyze格式的digital phantom,然后用xmedcon转换成interfile格式,在读入gate的时候经常出错。最后把gate例子里面的hof.h33文件修改成需要的参数,顺利通过。现把修改后的interfile的header发在这里,红色部分为需要修改的:

!INTERFILE :=
!imaging modality := nucmed
!originating system := greetings
!version of keys := 3.3
date of keys := 1996:09:24
conversion program := (X)MedCon
program author := Erik Nolf
program version := 0.7.4
program date := 2002:02:18
;
!GENERAL DATA :=
!data offset in bytes := 0
!name of data file := Point000.i33
patient name := hf
!patient ID := 271097
patient dob := 0000:00:00
patient sex := Unknown
!study ID := myPhantom
exam type := Spect study
data compression := none
data encode := none
;
!GENERAL IMAGE DATA :=
!type of data := Tomographic
!total number of images := 64
study date := 1997:11:28
study time := 00:00:00
imagedata byte order := BIGENDIAN
;
number of energy windows := 1
;
energy window [1] :=
energy window lower level [1] :=
energy window upper level [1] :=
flood corrected := N
decay corrected := N
;
!SPECT STUDY (general) :=
number of detector heads := 1
;
!number of images/energy window := 64
!process status := Reconstructed
!matrix size [1] := 64
!matrix size [2] := 64
!number format := unsigned integer
!number of bytes per pixel := 2
scaling factor (mm/pixel) [1] := +1.000000e-01
scaling factor (mm/pixel) [2] := + 1.000000e-01
!number of projections := 64
!extent of rotation :=
!time per projection (sec) := 0
study duration (sec) := 0
!maximum pixel count := +1.000000e+01
patient orientation := head_in
patient rotation := supine
;
!SPECT STUDY (reconstructed data) :=
method of reconstruction := Unknown
!number of slices := 64
number of reference frame := 0
slice orientation := Transverse
slice thickness (pixels) := +1.000000e+00
centre-centre slice separation (pixels) := +1.000000e+00
filter name := Unknown
filter parameters := Cutoff
method of attenuation correction := measured
scatter corrected := N
oblique reconstruction := N
!END OF INTERFILE :=