Re: about .inp file of MCX

516 views
Skip to first unread message

Qianqian Fang

unread,
Sep 1, 2011, 12:26:31 PM9/1/11
to Yamashita Okito, mcx-...@googlegroups.com
On 08/29/2011 05:37 AM, Yamashita Okito wrote:
Dear Dr.Qiangqian

I am Okito Yamashita, a researcher in ATR in Kyoto.
(Takeaki Shimokawa who previously asked a question about cuda is my collegue.)
I am sorry for asking questions not using the mailing-list.

Dear Okito

Apologize for the delay to get back to you.
Last week I was out of office for a few days.

I am now using your MCX (ver 0.5) software to make a forward model for NIRS experiments.
However I am now confused about how the coordinate of voxel spece and sourse position is defined.
Would you give me some idea what some lines of the .inp file mean?

 1000000              # total photon, use -n to overwrite in the command line
 29012392             # RNG seed, negative to generate
 30.0 30.0 1.0        # source position (in grid unit)
 0 0 1                # initial directional vector
 0.e+00 1.e-09 1.e-10 # time-gates(s): start, end, step
 semi60x60x60.bin     # volume ('unsigned char' format)
 1 60 1 60            # (the first number is not used), dim, start/end indices
 1 60 1 60            # (the first number is not used), dim, start/end indices
 1 60 1 60            # (the first number is not used), dim, start/end indices
 1                    # num of media
 1.010101 0.01 0.005 1.37  # scat. mus (1/mm), g, mua (1/mm), n
 4       1            # detector number and radius (in grid unit)
 30.0    20.0    1.0  # detector 1 position (real numbers in grid unit)
 30.0    40.0    1.0  # ...
 20.0    30.0    1.0
 40.0    30.0    1.0

The above is an example .inp file you mention in the documentation of MCX. Actually I have two questions.

It does seems to be confusing. let me explain.

The first one is about lines 7-9 and line 3.  I suppose lines 7-9, respectively, defines x,y,z coordinate for each voxel of semi60x60x60.bin but I had unexpected results as follows.
When I tried your default settings, I had a result (let's say Result1).
When I changed the lines 7-9 to 1 60 2 61 from 1 60 1 60, I had another result (Result2).
Result2 was different from Result1 as I had expected.
When I changed the line 3 to 30 30 0 from 30 30 1, while keeping other settings unchanged, now I had an error which says improper source position.  This was unexpected.
In case of Result2, source position 30,30,1 is also out of the range [2:61 2:61 2:61] but it worked. The third setting did not work.  How do I interpret this results ? Wolud you let me know what lines 7-9 means and how they are related to line3 ?

For lines#7-9, the 3rd and 4th numbers are not explained well.
The 3rd column defines a 3D point (in voxel/grid unit), the 4th column
defines another point. These two points define a rectangular
region. When you run mcx_cached or mcx_det_cached, this region
will be stored inside the shared memory when you specify "-R -1"
in the command line. Any other cases, this input will be ignored.

The second question is about the detector positions.

in MCX, there is a command line option --srcfrom0. By
default, srcfrom0 is turned off (0). That means all src/det
coordinates assumes a volume with an origin of (1,1,1).
The origin is located at the exterior corner (tip) of the
first voxel. When you set "--srcfrom0 1" in the command
line, the origin becomes (0,0,0).


Your program works even if line12 is changed to 0 1 and the following lines are deleted.
How does the result from this setting differ from your default setting ?

if you do not define any detectors, you will not be able to
detect any photons from the detector (the .mch file should
contain no record).


I have read your documentation carefully but I have not found any description on the topics above.
I would really appreciate it if you would give me any idea.


Please let me know if this explanation match what you have observed.
If not, I can debug the code to see if there is a bug in the code.

Qianqian


Best regards
  Okito Yamashita
 





The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Yamashita Okito

unread,
Sep 1, 2011, 9:55:54 PM9/1/11
to mcx-...@googlegroups.com, Qianqian Fang
Dear Dr.Qiangqian

Thank you very much for your reply.

1. As to coordinate system, your explanation makes sense to me.
For making my understanding more clearly, let me confirm.


in MCX, there is a command line option --srcfrom0. By
default, srcfrom0 is turned off (0). That means all src/det
coordinates assumes a volume with an origin of (1,1,1).
The origin is located at the exterior corner (tip) of the
first voxel. When you set "--srcfrom0 1" in the command
line, the origin becomes (0,0,0).

I made a figure according to your explanation. Please see the attached file.
In the file, I consider 2D pixel case instead of 3D voxel case for simplicity.
Let's assume the pixel indices starting from 1.  Each pixel are specified by a pair of integers.
Then the coordinate system is defined such that the right-upper point of pixel (1,1) becomes (0.0,0.0) if -srcfrom0 is set to 1, otherwise (1.0,1.0).  Source and detector positions should be defined in this coordinate system. For example, if source position is set to (1.0,2.5) with -srcfrom0 0, it is located on the middle of upper edge of pixel (1,3).  Is this my understanding correct ?

2. As to meaning of line7-9, I don't have still clear idea.


For lines#7-9, the 3rd and 4th numbers are not explained well.
The 3rd column defines a 3D point (in voxel/grid unit), the 4th column
defines another point. These two points define a rectangular
region. When you run mcx_cached or mcx_det_cached, this region
will be stored inside the shared memory when you specify "-R -1"
in the command line. Any other cases, this input will be ignored.

I am not aware of mxc_cached or mcx_det_cached.
When do I need to change this parameters?
How do these parameters affect the result ?

3. As to detector position, your explanation makes sense.

Again thank you very much and I would appreciate your more feedback.

Best regards
  Okito Yamashita
dispose of the e-mail. --
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To post to this group, send email to mcx-...@googlegroups.com.
To unsubscribe from this group, send email to mcx-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mcx-users?hl=en.

coordinate.png

Qianqian Fang

unread,
Sep 1, 2011, 10:57:07 PM9/1/11
to Yamashita Okito, mcx-...@googlegroups.com
On 09/01/2011 09:55 PM, Yamashita Okito wrote:

I made a figure according to your explanation. Please see the attached file.
In the file, I consider 2D pixel case instead of 3D voxel case for simplicity.
Let's assume the pixel indices starting from 1.  Each pixel are specified by a pair of integers.
Then the coordinate system is defined such that the right-upper point of pixel (1,1) becomes (0.0,0.0) if -srcfrom0 is set to 1, otherwise (1.0,1.0).  Source and detector positions should be defined in this coordinate system. For example, if source position is set to (1.0,2.5) with -srcfrom0 0, it is located on the middle of upper edge of pixel (1,3).  Is this my understanding correct ?

I believe the position marked by the black triangle
in your graph should be (1.0, 3.5) when -srcfrom0 is set to 0.


2. As to meaning of line7-9, I don't have still clear idea.

I am not aware of mxc_cached or mcx_det_cached.
When do I need to change this parameters?
How do these parameters affect the result ?


since version 0.4.9, I've provided multiple binaries
under the bin/ folder. Which one did you use?

Please read the following link for more details

http://mcx.sourceforge.net/cgi-bin/index.cgi?Doc/ReleaseNotes/0.4.9

Qianqian



3. As to detector position, your explanation makes sense.

Again thank you very much and I would appreciate your more feedback.

Best regards
  Okito Yamashita

Yamashita Okito

unread,
Sep 1, 2011, 11:25:50 PM9/1/11
to Qianqian Fang, mcx-...@googlegroups.com
Dear Dr.Quianqian


I believe the position marked by the black triangle
in your graph should be (1.0, 3.5) when -srcfrom0 is set to 0.

You are right.   It is my careless miss.
The triangle will be (1.0,2.5) if -srcfrom0 is set to 1.

since version 0.4.9, I've provided multiple binaries
under the bin/ folder. Which one did you use?

Please read the following link for more details

http://mcx.sourceforge.net/cgi-bin/index.cgi?Doc/ReleaseNotes/0.4.9

Thank you very much for the information.
I am now using mcx command (vanilla mcx) of version 0.5.0.
I don't see in bin/ folder any binaries other than mcx. 
Since I asked the other person for setup of your code, other binaries may have been lost by mistake.
I will ask my colleague.

Thank you very much for your time.

Best regards
Okito Yamashita
-- 
--------------------------------------------
   ATR 脳情報解析研究所 主任研究員
        山下 宙人
   oyam...@atr.jp
   〒619-0288 京都府相楽郡精華町光台2-2-2
   0774-95-1073
----------------------------------------------

Yamashita Okito

unread,
Sep 1, 2011, 11:33:31 PM9/1/11
to mcx-...@googlegroups.com, Qianqian Fang
I found a mistake.


The triangle will be (1.0,2.5) if -srcfrom0 is set to 1.

The triangle will be (0.0, 2.5)  if -srcfrom0 is set to 1.

Best regards
Okito Yamashita
--

Qianqian Fang

unread,
Sep 2, 2011, 11:20:23 AM9/2/11
to mcx-...@googlegroups.com, Yamashita Okito
On 09/01/2011 11:25 PM, Yamashita Okito wrote:

Thank you very much for the information.
I am now using mcx command (vanilla mcx) of version 0.5.0.
I don't see in bin/ folder any binaries other than mcx. 
Since I asked the other person for setup of your code, other binaries may have been lost by mistake.
I will ask my colleague.

it is possible that you downloaded the source code
and compiled it with a "make" command. If you download
the precompiled binary package, you will see other binaries.

to compile other binaries from the source, you need to use
"make clean det", "make clean box", "make clean detbox"
and "make clean atomic" commands.


let me know if you have further questions.

Qianqian

--

Yamashita Okito

unread,
Sep 4, 2011, 9:05:48 PM9/4/11
to mcx-...@googlegroups.com, Qianqian Fang
Dear Dr.Quianqian

I asked my colleague who set up your program about the binaries.


it is possible that you downloaded the source code
and compiled it with a "make" command. If you download
the precompiled binary package, you will see other binaries.

That's the case.

to compile other binaries from the source, you need to use
"make clean det", "make clean box", "make clean detbox"
and "make clean atomic" commands.

We successfully compiled them but require some modification in "Makefile" as below
in order to change the output filenames (although I know this is not important at all).

det detbox: BINARY:=$(BINARY)_det
-->
det: BINARY:=$(BINARY)_det
detbox: BINARY:=$(BINARY)_det_casched

Best regards
 Okito Yamashita
Reply all
Reply to author
Forward
0 new messages