This project has moved and is read-only. For the latest updates, please go here.

Reflectance differences between geometrically identical situations (Command line MC and VTS)

Jan 16, 2013 at 1:16 AM

When I run a configuration such as:

Layer 1: start: -Inf, stop: 0, mua=0, musp=0, g=1, n=1

Layer 2: start: 0, stop: 1, mua=0.01, musp=1, g=0.6, n=1.33

Layer 3: start: 1, stop: 2, mua=0.01, musp=1, g=0.6, n=1.33

Layer 4: start: 2, stop: Inf, mua=0.01, musp=1, g=0.6, n=1.33

This is essentially a uniform block starting at 0 and extending to Inf.  The reflectance result turns out differently than if I do 

If I change the start/stop point of Layer 2/3, this should NOT change the result, since it is a uniform optical block.  However, if I change it to, for example, 

Layer 2: start: 0, stop: 7, mua=0.01, musp=1, g=0.6, n=1.33

Layer 3: start: 7, stop: 8, mua=0.01, musp=1, g=0.6, n=1.33

Layer 4: start: 8, stop: Inf, mua=0.01, musp=1, g=0.6, n=1.33

I get completely different results at higher Source Detector separation.  Any idea what might be happening here?

Thanks,

Tyler 

 

Jan 16, 2013 at 2:23 AM

Hi Tyler,

Did you use an infile that specifies MultiLayerTissue?  If so, one of the assumptions made about using the MultiLayerTissue input is that the top and bottom layer need to be air.  I *just* added validation code to check for that and inform the user of this assumption.  I haven't put this new code on codeplex yet.  If you would like to model a semi-infinite tissue assumption, one way is to make the last tissue layer (2nd to last layer) very large, but make sure the last layer has air specifications (mua=0.0, musp=1e-10, g=1.0,n=1.0).  If you're worried about how much is potentially lost out the bottom layer, you can add TDiffuseDetectorIInput into the list of detectors and it will track how much light is lost out the bottom of the tissue.

I am also in the process of generating a Monte Carlo Command Line (MCCL) FAQ.  It is currently underway.  Please check it out on our codeplex Documentation page here.

Please let me know if you make this change to the tissue definition and still have inconsistent results with varying internal layer interfaces.

Carole

Jan 16, 2013 at 2:30 AM
Ok I see. It may be a good idea to grey out those options in the web GUI, since as it stands it makes it seem like you can adjust the 1st/4th layer properties. For me, I think it would be beneficial to be able to change the bottom layer to something else besides air. I realize I could do semi-infinite by making the 2nd layer large, but I my work could really use a 3 layer model situation. Would this be nontrivial to implement? Thanks!

Tyler

On Tue, Jan 15, 2013 at 6:23 PM, hayakawa <notifications@codeplex.com> wrote:

From: hayakawa

Hi Tyler,

Did you use an infile that specifies MultiLayerTissue? If so, one of the assumptions made about using the MultiLayerTissue input is that the top and bottom layer need to be air. I *just* added validation code to check for that and inform the user of this assumption. I haven't put this new code on codeplex yet. If you would like to model a semi-infinite tissue assumption, one way is to make the last tissue layer (2nd to last layer) very large, but make sure the last layer has air specifications (mua=0.0, musp=1e-10, g=1.0,n=1.0). If you're worried about how much is potentially lost out the bottom layer, you can add TDiffuseDetectorIInput into the list of detectors and it will track how much light is lost out the bottom of the tissue.

I am also in the process of generating a Monte Carlo Command Line (MCCL) FAQ. It is currently underway. Please check it out on our codeplex Documentation page here.

Please let me know if you make this change to the tissue definition and still have inconsistent results with varying internal layer interfaces.

Carole

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jan 16, 2013 at 4:38 AM
Tyler,

You can always download and upload a file with as many layers as you want. I like to use XML Notepad to edit the inputs.

David
Jan 16, 2013 at 6:55 PM
Sorry I was under the impression I was doing that (with 4 layers)! So I could have a 3 layer system by adding one layer and having 5? Top air, bottom air, middle 3 different layers?

On Tue, Jan 15, 2013 at 8:38 PM, dcuccia <notifications@codeplex.com> wrote:

From: dcuccia

Tyler,

You can always download and upload a file with as many layers as you want. I like to use XML Notepad to edit the inputs.

David

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jan 16, 2013 at 8:07 PM

Yes, it sounds like from your first post that you'd like to have three tissue layers.  So define a 5-layer system with an air layer above and below those three tissue layers.  For your first example, you could make your third tissue layer start at 2 and stop at 100 for example, then the bottom air layer would go from 100mm to Inf.  With your optical properties, mus=2.5/mm, mut=2.51/mm and so 1/mut=0.4mm.  A slab 100m thick has an optical thickness of 100/0.4=250 and in terms of l* it is 100l*.  You shouldn't lose too much out the bottom of the tissue with this thickness, but like I said adding in a TDiffuseDetectorInput would determine the loss out the bottom of the tissue.

Carole

Jan 17, 2013 at 8:02 PM
Ok thanks, this works well! Now one thing which is becoming an issue now is that I need photons with 0% MT in layerx to enter in the first bin. As it stands, the 0% MT does not seem to get binned in the histogram. In other words, each fractional MT distribution should individually add up to the total MT distribution

On Wed, Jan 16, 2013 at 12:07 PM, hayakawa <notifications@codeplex.com> wrote:

From: hayakawa

Yes, it sounds like from your first post that you'd like to have three tissue layers. So define a 5-layer system with an air layer above and below those three tissue layers. For your first example, you could make your third tissue layer start at 2 and stop at 100 for example, then the bottom air layer would go from 100mm to Inf. With your optical properties, mus=2.5/mm, mut=2.51/mm and so 1/mut=0.4mm. A slab 100m thick has an optical thickness of 100/0.4=250 and in terms of l* it is 100l*. You shouldn't lose too much out the bottom of the tissue with this thickness, but like I said adding in a TDiffuseDetectorInput would determine the loss out the bottom of the tissue.

Carole

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jan 17, 2013 at 9:42 PM

Referring back to the discussion here,  the following algorithm is currently in the code:

  1. for each photon exiting surface of tissue:
  2.   determine rho bin index it exited, ir  (if beyond last rho bin, it is put in last bin)
  3.   for each collision photon experienced:
  4.     determine which tissue subregion (layer) index collision occurred in, isr
  5.     determine MT = 1 - cosineBetweenTrajectories;
  6.     add MT into array subregionMT[isr] += MT
  7.   end
  8.   totalMT = sum of subregionMT over isr;
  9.   if totalMT > 0
  10.     determine which MT bin totalMT is in, imt
  11.     add photon exiting weight to Mean[ir,imt] += photon weight
  12.     for all subregions isr
  13.       if (subregionMT[isr] > 0
  14.         determine which fractional bin the fraction (subregionMT[isr]/totalMT) is in, ifrac
  15.         add photon exiting weight to FractionalMT[ir,imt,isr,ifrac] += photon weight
  16.       endif
  17.     endfor
  18.   endif
  19. endfor

I plan to do the following per your comments:

  1. delete line 9 and 18 so that now totalMT=0 WILL get binned into the first imt bin.  
  2. delete line 13 and 16 so that if a subregion MT=0 then it will be part of the fractionalMT
  3. since I don't have the check "if totalMT>0" on line 9, I can't form the fraction subregionMT[isr]/totalMT on line 14 which is how I used determine which fractional bin it is in.  So instead on line 14, I can check if (totalMT==0) and then if (subregionMT[isr]==0), then set ifrac to 0?  if (totalMT!=0), then form fraction (subregionMT[isr]/totalMT) and determine ifrac.

Let me know what you think.  Carole

Jan 17, 2013 at 9:51 PM
I think line 9 should be in there. If the totalMT is 0 then I don't want it. Line 13/16 should be the ones removed I think, so if subregionMT==0, then ifrac=0 and the weight will get binned in FractionalMT var at the 0 bin. Out of curiosity, is the bin determination line a round or ceiling or floor function? Thanks for all the help again!

Tyler

On Thu, Jan 17, 2013 at 1:43 PM, hayakawa <notifications@codeplex.com> wrote:

From: hayakawa

Referring back to the discussion here, the following algorithm is currently in the code:

  1. for each photon exiting surface of tissue:
  2. determine rho bin index it exited, ir (if beyond last rho bin, it is put in last bin)
  3. for each collision photon experienced:
  4. determine which tissue subregion (layer) index collision occurred in, isr
  5. determine MT = 1 - cosineBetweenTrajectories;
  6. add MT into array subregionMT[isr] += MT
  7. end
  8. totalMT = sum of subregionMT over isr;
  9. if totalMT > 0
  10. determine which MT bin totalMT is in, imt
  11. add photon exiting weight to Mean[ir,imt] += photon weight
  12. for all subregions isr
  13. if (subregionMT[isr] > 0
  14. determine which fractional bin the fraction (subregionMT[isr]/totalMT) is in, ifrac
  15. add photon exiting weight to FractionalMT[ir,imt,isr,ifrac] += photon weight
  16. endif
  17. endfor
  18. endif
  19. endfor

I plan to do the following per your comments:

  1. delete line 9 and 18 so that now totalMT=0 WILL get binned into the first imt bin.
  2. delete line 13 and 16 so that if a subregion MT=0 then it will be part of the fractionalMT
  3. since I don't have the check "if totalMT>0" on line 9, I can't form the fraction subregionMT[isr]/totalMT on line 14 which is how I used determine which fractional bin it is in. So instead on line 14, I can check if (totalMT==0) and then if (subregionMT[isr]==0), then set ifrac to 0? if (totalMT!=0), then form fraction (subregionMT[isr]/totalMT) and determine ifrac.

Let me know what you think. Carole

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jan 17, 2013 at 10:16 PM

Great response.  I think I know how to modify the code. 

The bin determination uses floor.  I should mention that in the binning code, if the determined bin is < 0, it is assigned 0.  And if the bin > numberOfBins-1 (largest index), then it is assigned numberOfBins-1.  So *everything* gets binned into some bin.

I'll make the code changes and push a new release to codeplex.  I'll let you know when that is complete.

Carole

Jan 17, 2013 at 11:33 PM

I just pushed a new MCCL release (version 1.0.10) to codeplex.  You can download it from the Downloads tab here.  Let me know how it goes.

Carole

Jan 18, 2013 at 2:22 AM
Seems like it's working thus far. Thanks Carole!

On Thu, Jan 17, 2013 at 3:33 PM, hayakawa <notifications@codeplex.com> wrote:

From: hayakawa

I just pushed a new MCCL release (version 1.0.10) to codeplex. You can download it from the Downloads tab here. Let me know how it goes.

Carole

Read the full discussion online.

To add a post to this discussion, reply to this email (virtualphotonics@discussions.codeplex.com)

To start a new discussion for this project, email virtualphotonics@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Jan 18, 2013 at 3:41 AM

Good to hear!  You're welcome!  Carole