How To Use Binary Data Files Generated by MCCL

40 views
Skip to first unread message

Daemon Dikeman

unread,
May 25, 2022, 11:15:27 AM5/25/22
to Virtual Photonics
Hello,

I was wondering if there was any documentation/guidance as to the structure of the binary data files generated by the MCCL outputs for custom processing of that data, especially acquiring the partial paths of each photon? I know that MCCL comes packaged with the readBinaryData.m code, but given it just outputs a list of numbers when I attempt to read the entire file, without a clear pattern or any idea of the structure of the file, it's rather difficult to make use of effectively.

We're using Monte Carlo Extreme for SFDI simulations and getting odd results when trying to implement the Gardner method - we think that this might be due to the specifics of MCX, but wanted to make sure by testing the Gardner method in MCCL as well. We're trying to recreate the results from the paper "Two-layer inverse model for improved longitudinal preclinical tumor imaging in the spatial frequency domain" ( https://doi.org/10.1117/1.JBO.23.7.076011 ) for comparison purposes, and they used MCCL but we're uncertain how they implemented the Gardner method in MCCL exactly and were hoping to build up an implementation ourselves if necessary.

 If there's anything you could do to help here we'd really appreciate it!

- Daemon Dikeman

Carole Hayakawa

unread,
May 25, 2022, 3:38:08 PM5/25/22
to Virtual Photonics
Dear Daemon,

Thank you for your interest in our software!  It would be helpful to know what MCCL detector or database you are interested in knowing more details about, and what details, e.g. path lengths in each tissue region, etc.  Depending upon the details you want to know, you could clone a copy of our source code and add print statements to output what you want to the screen.  I could provide details of how to do that.

Best,
Carole

Daemon Dikeman

unread,
May 27, 2022, 5:21:58 PM5/27/22
to Virtual Photonics
Dear Carole,

I was really hoping to know about the CollisionInfoDatabase, as it seemed to have the information such as photon exit locations and path lengths in each tissue region. I had been using the ROfFx detector thus far, but the Gardner method I'm hoping to test shouldn't require the use of the built-in detectors, if I'm able to access/store the information regarding the photon exit locations and their various partial path lengths.

Of course, if you have access to the previous code used to implement such, that would also be very helpful - in the paper I referenced previously, they mention in section 2.2.3 that "Previously developed command-line implementation of the Gardner method was used for the MC simulations (software developed by and implemented with the assistance of the Virtual Photonics Technology Initiative at the Beckman Laser Institute, University of California, Irvine, California)".

If that is unfeasible for any reason, that is perfectly understandable and I would be quite happy to get help with modifying the source code to be able to keep a record of the information we're looking for.

Thank you very much,

Daemon

Daemon Dikeman

unread,
Jun 6, 2022, 10:10:07 AM6/6/22
to Virtual Photonics
Carole,

I just wanted to check in about this?

Thank you very much,
Daemon

Carole Hayakawa

unread,
Jun 7, 2022, 2:50:00 PM6/7/22
to Virtual Photonics
Hi Daemon,

I'm very sorry about my delayed response!  Somehow I was not notified about your replies to my post!  I'll work on that.

There are two databases that get created when you specify "Database" to be "pMCDiffuseReflectance", DiffuseReflectanceDatabase and CollisionInfoDatabase.  DiffuseReflectanceDatabase captures the exiting location and direction.  CollisionInfoDatabase accompanies that database with information about pathlengths and number of collisions in each tissue region for each photon.  To see the actual values on a per photon basis, you would need to pull a copy of the source code, add code to output those individual values to a file.   I can help you with this if you'd like.

Alternatively, another user of our code posted code that he wrote in python that reads our database.  The post is here:
I have not personally tried to use this code.

Regarding the paper you list.  Syeda created a lookup table by running several simulations at incremental optical properties and then used this table to solve inverse problems.  No knowledge of photon by photon information was used, only the resulting reflectance estimates that were averaged over all photons was used.

Let me know if more information would be helpful.
Best,
Carole

Daemon Dikeman

unread,
Jun 8, 2022, 4:10:57 PM6/8/22
to Virtual Photonics
Hi Carole,

The code you posted might actually help a lot, in fact! And I think that modifying the source code might also potentially help with what we're hoping to do, but first, I had some questions regarding your description of the process used for the paper, as it contradicts my previous understanding of the process/methods involved, so I wanted to ask about that in order to make sure the problem isn't arising in my misunderstanding of the Gardner Method's appropriate implementation itself.

As I'd understood it, the Gardner method uses the following equations to determine Rd (this is the two-layer form described in the paper we discussed, but the essentials remain the same) - Wn being the weight of the n'th photon, with Di;n being the pathlength (through layer i), and Xn being the net displacement, with the diffuse reflectance being the sum of those photon weights averaged by the total number of photons I spoke to Syeda and received some files, including infiles that appear to have been, at the very least, templates for their work on this, but the infiles used ROfFx. As I understand it, for what you're saying to function as a means of testing the Gardner method, they would have had to use ROfRho in order to know/account for displacement.
Gardner.PNG
Gardner2.PNG

If you'd be open to meeting over Zoom or similar to discuss this more easily, with the potential for me to demonstrate more directly what I'm referring to, I would appreciate it! If you don't have the time or need to spend your energy on other things, that's totally understandable too.

Thank you very much,
Daemon

Carole Hayakawa

unread,
Jun 8, 2022, 6:30:54 PM6/8/22
to Virtual Photonics
Hi Daemon,

I think Syeda implemented the Gardner method correctly.  I might have misspoke because her paper uses multiple infiles to generate a lookup table which has no photon-by-photon information in it.  I think you want to get at the photon-by-photon information?

I would be happy to skype or zoom.  Email me directly and we can set this up.
Best,
Carole
Reply all
Reply to author
Forward
0 new messages