Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
<<importTiddlers>>
<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

----
Also see [[AdvancedOptions]]
<!--{{{-->
<div class='header' role='banner' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' role='navigation' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' role='navigation' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' role='complementary' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea' role='main'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected {color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:alpha(opacity=60);}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0; top:0;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0 3px 0 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0; padding-bottom:0;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='toolbar' role='navigation' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
[img[images/OCT_nerve_sm.png]] 
Optical Coherence Tomography using visible wavelengths is used to quantify tissue scattering properties that can indicate disease.

The Rogers Lab develops optical instrumentation and imaging methods for the quantitative study of cells and tissues and is affiliated with:
* [[Department of Biomedical Engineering|http://www.engr.wisc.edu/bme.html]] at the [[University of Wisconsin - Madison|http://www.wisc.edu/]] 
* [[Laboratory for Optical and Computational Instrumentation (LOCI)|http://loci.wisc.edu/]]
* [[McPherson Eye Research Institute|http://vision.wisc.edu/]]

Additional information can be found on our [[Research]] page.
/%
!! Funding
We thank the following for supporting our research:
* NIH/NCI, [[Grant |]]
* Retina Research Foundation, [[Edwin and Dorothy Gamewell Professorship|http://retinaresearchfnd.org/research-programs/chairs-professorships/gamewell/]]
* National Science Foundation, [[EFRI-BioFlex 1240416|http://nsf.gov/awardsearch/showAward?AWD_ID=1240416]]

!!Media
* Aug. 30, 2013 """UW-Madison""" College of Engineering interview [[Sound Engineering: Fighting disease with optics|http://www.engr.wisc.edu/news/archive/2013/aug30-podcast-fighting-disease-with-optics.html]]
%/
<<tiddler HideTiddlerTags>><<tiddler HideTiddlerSubtitle>><<tiddler HideTiddlerToolbar>>
Code, programs, tools, etc. written by J.D. Rogers

//All code on this page is Copyright J.D. Rogers. Please use, copy, modify and redistribute anything you find here, but please give credit where due. I prefer to keep a running list of authors in the top of the code, so add your name, write some code, and have fun.//
!!Programs
<<<
!!! Some instructions on how to write:
* [[Parallel Monte Carlo]] using MPI to easily distribute MC loops across multiple cores, processors, or nodes.
* Signal handling to make [[Interruptible MC]] that can be stopped without loosing simulation data making it possible to run MC for a specified time rather than for a specified number of rays.

!!!~MCML_mpi
''MCML for parallel processing,'' for example on clusters or multiprocessor workstations.
[[MCML|http://labs.seas.wustl.edu/bme/Wang/mc.html]] is a multi-layered [[Monte Carlo|http://omlc.ogi.edu/software/mc]] simulation for studying light transport in random media. It was written by [[Steve Jacques|http://www.bme.ogi.edu/biomedicaloptics/jacques/]] and [[Lihong Wang|http://labs.seas.wustl.edu/bme/Wang/]] for light scattering in biological tissue (or other random media). This version is the minimal modification to the original that adds MPI support. Message Passing Interface (MPI) allows the code to be run in parallel across many processors (or cores) such as clusters, multi-processors workstations, etc. You will need a working installation of MPI such as [[open-mpi|http://www.open-mpi.org]].
* README
* tarball
* zip file
* Patch file

!!!nscat_MCML
''MCML modified to track and bin the number of scattering events'', and other parameters.
It also uses a more general 3-parameter phase function based on the ~Whittle-Matern correlation function. The phase function includes exponential, stretched-exponential, ~Henyey-Greenstein and mass-fractal type scattering functions.
<<<
!!Code snippets, matlab functions, etc
<<<
!!!Matlab functions
<<list filter [tag[matlab]]>>
<<<

<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
/***
|Name|CoreTweaks|
|Source|http://www.TiddlyTools.com/#CoreTweaks|
|Version||
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.2.0|
|Type|plugin|
|Description|a small collection of overrides to TW core functions|
This tiddler contains small changes to TW core functions that correct or enhance standard features or behaviors.
***/
//{{{
// calculate TW version number - used to determine which tweaks should be applied
var ver=version.major+version.minor/10+version.revision/100;
//}}}
/***
----

***/
// // closed: won't fix //(leave as core tweaks)//
// // {{block{
/***
!!!637 TiddlyLink tooltip - custom formatting
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/637 - CLOSED: WON'T FIX
This tweak modifies the tooltip format that appears when you mouseover a link to a tiddler.  It adds an option to control the date format, as well as displaying the size of the tiddler (in bytes)

Tiddler link tooltip format:
{{stretch{<<option txtTiddlerLinkTootip>>}}}
^^where: %0=title, %1=username, %2=modification date, %3=size in bytes, %4=description slice, %5=first N characters of tiddler content^^
Tiddler link tooltip date format:
{{stretch{<<option txtTiddlerLinkTooltipDate>>}}}
Tiddler excerpt limit (chars):
{{stretch{<<option txtTiddlerLinkTooltipLimit>>}}}
***/
//{{{
config.messages.tiddlerLinkTooltip='%0 - %1, %2 (%3 bytes) - %4';
config.messages.tiddlerLinkTooltipDate='DDD, MMM DDth YYYY 0hh12:0mm AM';
config.messages.tiddlerLinkTooltipLimit=50;

config.options.txtTiddlerLinkTootip=
	config.options.txtTiddlerLinkTootip||config.messages.tiddlerLinkTooltip;
config.options.txtTiddlerLinkTooltipDate=
	config.options.txtTiddlerLinkTooltipDate||config.messages.tiddlerLinkTooltipDate;
config.options.txtTiddlerLinkTooltipLimit=
	config.options.txtTiddlerLinkTooltipLimit||config.messages.tiddlerLinkTooltipLimit;

Tiddler.prototype.getSubtitle = function() {
	var modifier = this.modifier;
	if(!modifier) modifier = config.messages.subtitleUnknown;
	var modified = this.modified;
	if(modified) modified = modified.formatString(config.options.txtTiddlerLinkTooltipDate);
	else modified = config.messages.subtitleUnknown;
	var descr=store.getTiddlerSlice(this.title,'Description')||'';
	var txt=this.text.substr(0,config.options.txtTiddlerLinkTooltipLimit);
	if (this.text.length>config.options.txtTiddlerLinkTooltipLimit) txt+="...";
	return config.options.txtTiddlerLinkTootip.format([this.title,modifier,modified,this.text.length,descr,txt]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!607 add HREF link on permaview command
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/607 - CLOSED: WON'T FIX
This tweak automatically sets the HREF for the 'permaview' sidebar command link so you can use the 'right click' context menu for faster, easier bookmarking.  Note that this does ''not'' automatically set the permaview in the browser's current location URL... it just sets the HREF on the command link.  You still have to click the link to apply the permaview.
***/
//{{{
config.macros.permaview.handler = function(place)
{
	var btn=createTiddlyButton(place,this.label,this.prompt,this.onClick);
	addEvent(btn,'mouseover',this.setHREF);
	addEvent(btn,'focus',this.setHREF);
};
config.macros.permaview.setHREF = function(event){
	var links = [];
	story.forEachTiddler(function(title,element) {
		links.push(String.encodeTiddlyLink(title));
	});
	var newURL=document.location.href;
	var hashPos=newURL.indexOf('#');
	if (hashPos!=-1) newURL=newURL.substr(0,hashPos);
	this.href=newURL+'#'+encodeURIComponent(links.join(' '));
}
//}}}
// // }}}}}}// // {{block{
/***
!!!458 add permalink-like HREFs on internal TiddlyLinks
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/458 - CLOSED: WON'T FIX
This tweak assigns a permalink-like HREF to internal Tiddler links (which normally do not have any HREF defined).  This permits the link's context menu (right-click) to include 'open link in another window/tab' command.  Based on a request from Dustin Spicuzza.
***/
//{{{
window.coreTweaks_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function(place,title,includeText,theClass,isStatic,linkedFromTiddler,noToggle)
{
	// create the core button, then add the HREF (to internal links only)
	var link=window.coreTweaks_createTiddlyLink.apply(this,arguments);
	if (!isStatic)
		link.href=document.location.href.split('#')[0]+'#'+encodeURIComponent(String.encodeTiddlyLink(title));
	return link;
}
//}}}
// // }}}}}}
// // to be fixed in 2.6.0:
// // {{block{
/***
!!!1151 adjust popup placement when root element is in scrolled DIV
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/1151
When a popup link is placed inside a DIV with style "overflow:scroll" or "overflow:auto" and that DIV is then scrolled, the position of the resulting popup appears further down the page that intended, because it is not adjusting for the relative scroll offset of the containing DIV.  This tweak patches the Popup.place() function to calculate and subtract the current scroll offset from the computed popup position, so that it appears in the correct location on the page.

Test case: //(scroll to the bottom of this DIV and click on "test popup")//
{{groupbox{
 <<tiddler ScrollBox with: CoreTweaks##1151test 12em>>}}}/%
!1151test
<<tiddler About>>
<<showPopup tiddler:About label:"test popup" tip:About popupClass:sticky>>
!end
%/
***/
//{{{
window.findScrollOffsetX=function(obj) {
	var x=0;
	while(obj) {
		if (obj.scrollLeft && obj.nodeName!='HTML')
			x+=obj.scrollLeft;
		obj=obj.parentNode;
	}
	return -x;
}

window.findScrollOffsetY=function(obj) {
	var y=0;
	while(obj) {
		if (obj.scrollTop && obj.nodeName!='HTML')
			y+=obj.scrollTop;
		obj=obj.parentNode;
	}
	return -y;
}

var fn=Popup.place.toString();
if (fn.indexOf('findScrollOffsetX')==-1) { // only once
	fn=fn.replace(/var\s*rootLeft\s*=/,'var rootLeft = window.findScrollOffsetX(root) +');
	fn=fn.replace(/var\s*rootTop\s*=/,'var rootTop = window.findScrollOffsetY(root) +');
	eval('Popup.place='+fn);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!1147 tiddler macro with params does not refresh
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/1147
when the {{{<<tiddler SomeTiddler>>}}} macro is handled, the resulting span has extra attributes: {{{refresh='content'}}} and {{{tiddler='SomeTiddler'}}}.  If SomeTiddler is changed, {{{store.notify('SomeTiddler')}}} triggers {{{refreshDisplay()}}}, which automatically re-renders transcluded content in any span that has these extra attributes.  However, when additional arguments are passed by using {{{<<tiddler SomeTiddler with: arg arg arg ...>>}}} then the resulting span does NOT get the extra attributes noted above and, as a consequence, the transcluded content is not being refreshed, even though the underlying tiddler has changed

To correct this, in {{{config.macros.tiddler.handler}}}:
*set the 'refresh' and 'tiddler' attributes even when arguments are present in the macro
*store the arguments themselves in an attribute (e.g, 'args'), using as a space-separated, bracketed list
Then, in {{{config.refreshers.content}}}:
*retrieve the stored arguments (if any) and the tiddler source
*substitute arguments into source and re-render the span with the updated content

***/
//{{{
config.refreshers.content=function(e,changeList) {
		var title = e.getAttribute("tiddler");
		var force = e.getAttribute("force");
		var args = e.getAttribute("args"); // ADDED
		if(force != null || changeList == null || changeList.indexOf(title) != -1) {
			removeChildren(e);
//			wikify(store.getTiddlerText(title,""),e,null,store.fetchTiddler(title)); // REMOVED
			config.macros.tiddler.transclude(e,title,args); // ADDED
			return true;
		} else
			return false;
};

config.macros.tiddler.handler=function(place,macroName,params,wikifier,paramString,tiddler) {
	params = paramString.parseParams("name",null,true,false,true);
	var names = params[0]["name"];
	var tiddlerName = names[0];
	var className = names[1] || null;
	var args = params[0]["with"];
	var wrapper = createTiddlyElement(place,"span",null,className);
//	if(!args) { // REMOVED
		wrapper.setAttribute("refresh","content");
		wrapper.setAttribute("tiddler",tiddlerName);
// 	} // REMOVED
	if(args!==undefined) wrapper.setAttribute("args",'[['+args.join(']] [[')+']]'); // ADDED
	this.transclude(wrapper,tiddlerName,args); // REFACTORED TO ...tiddler.transclude
}

// REFACTORED FROM ...tiddler.handler
config.macros.tiddler.transclude=function(wrapper,tiddlerName,args) {
	var text = store.getTiddlerText(tiddlerName); if (!text) return;
	var stack = config.macros.tiddler.tiddlerStack;
	if(stack.indexOf(tiddlerName) !== -1) return;
	stack.push(tiddlerName);
	try {
		if (typeof args == "string") args=args.readBracketedList(); // ADDED
		var n = args ? Math.min(args.length,9) : 0;
		for(var i=0; i<n; i++) {
			var placeholderRE = new RegExp("\\$" + (i + 1),"mg");
			text = text.replace(placeholderRE,args[i]);
		}
		config.macros.tiddler.renderText(wrapper,text,tiddlerName,null); // REMOVED UNUSED 'params'
	} finally {
		stack.pop();
	}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!1134 allow leading whitespace in section headings / TBD handle shadow tiddler sections
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/1134
This tweak REPLACES and extends {{{store.getTiddlerText()}}} so it can return sections defined in shadow tiddlers as well as permitting use of leading whitespace in section headings.
***/
//{{{
TiddlyWiki.prototype.getTiddlerText = function(title,defaultText)
{
	if(!title) return defaultText;
	var parts = title.split(config.textPrimitives.sectionSeparator);
	var title = parts[0];
	var section = parts[1];
	var parts = title.split(config.textPrimitives.sliceSeparator);
	var title = parts[0];
	var slice = parts[1]?this.getTiddlerSlice(title,parts[1]):null;
	if(slice) return slice;
	var tiddler = this.fetchTiddler(title);
	var text = defaultText;
	if(this.isShadowTiddler(title))
		text = this.getShadowTiddlerText(title);
	if(tiddler)
		text = tiddler.text;
	if(!section) return text;
	var re = new RegExp("(^!{1,6}[ \t]*" + section.escapeRegExp() + "[ \t]*\n)","mg");
	re.lastIndex = 0;
	var match = re.exec(text);
	if(match) {
		var t = text.substr(match.index+match[1].length);
		var re2 = /^!/mg;
		re2.lastIndex = 0;
		match = re2.exec(t); //# search for the next heading
		if(match)
			t = t.substr(0,match.index-1);//# don't include final \n
		return t;
	}
	return defaultText;
};
//}}}
// // }}}}}}// // {{block{
/***
!!!824 ~WindowTitle - alternative to combined ~SiteTitle/~SiteSubtitle in window titlebar
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/824 - OPEN
This tweak allows definition of an optional [[WindowTitle]] tiddler that, when present, provides alternative text for display in the browser window's titlebar, instead of using the combined text content from [[SiteTitle]] and [[SiteSubtitle]] (which will still be displayed as usual in the TiddlyWiki document header area).

Note: this ticket replaces http://trac.tiddlywiki.org/ticket/401 (closed), which proposed using a custom [[PageTitle]] tiddler for this purpose.  ''If you were using the previous '401 ~PageTitle' tweak, you will need to rename [[PageTitle]] to [[WindowTitle]] to continue to use your custom window title text''
***/
//{{{
config.shadowTiddlers.WindowTitle='<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>';
window.getPageTitle=function() { return wikifyPlain('WindowTitle'); }
store.addNotification('WindowTitle',refreshPageTitle); // so title stays in sync with tiddler changes
//}}}
// // }}}}}}// // {{block{
/***
!!!471 'creator' field for new tiddlers
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/471 - OPEN
This tweak HIJACKS the core's saveTiddler() function to automatically add a 'creator' field to a tiddler when it is FIRST created. You can use """<<view creator>>""" (or """<<view creator wikified>>""" if you prefer) to show this value embedded directly within the tiddler content, or {{{<span macro="view creator"></span>}}} in the ViewTemplate and/or EditTemplate to display the creator value in each tiddler.  
***/
//{{{
// hijack saveTiddler()
TiddlyWiki.prototype.CoreTweaks_creatorSaveTiddler=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields)
{
	var existing=store.tiddlerExists(title);
	var tiddler=this.CoreTweaks_creatorSaveTiddler.apply(this,arguments);
	if (!existing) store.setValue(title,'creator',config.options.txtUserName);
	return tiddler;
}
//}}}
// // }}}}}}
// // fixed in ~TW2.4.3
// // {{block{
/***
!!!444 'tiddler' and 'place' - global variables for use in computed macro parameters
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/444 - CLOSED:FIXED - TW2.4.3 - http://trac.tiddlywiki.org/changeset/8367
When invoking a macro, this tweak makes the current containing tiddler object and DOM rendering location available as global variables (window.tiddler and window.place, respectively).  These globals can then be used within //computed macro parameters// to retrieve tiddler-relative and/or DOM-relative values or perform tiddler-specific side-effect functionality.
***/
//{{{
if (ver<2.43) {
window.coreTweaks_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
	var here=story.findContainingTiddler(place);
	window.tiddler=here?store.getTiddler(here.getAttribute('tiddler')):tiddler;
	window.place=place;
	window.coreTweaks_invokeMacro.apply(this,arguments);
}
}
//}}}
// // }}}}}}
// // fixed in ~TW2.4.2:
// // {{block{
/***
!!!823 apply option values via paramifiers (e.g. #chk...and #txt...)
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/823 - CLOSED:FIXED - TW2.4.2 http://trac.tiddlywiki.org/changeset/7988
This tweak extends and ''//replaces//'' the core {{{invokeParamifier()}}} function to support use of ''option paramifiers'' that set TiddlyWiki option values on-the-fly, directly from a document URL.

If a paramifier begins with 'chk' (checkbox) or 'txt' (text field), it's value will be automatically stored in {{{config.options.*}}}, adding to or overriding any existing 'chk' or 'txt' option values that may have already been loaded from browser cookies and/or assigned by the TW core or plugin initialization functions using hard-coded default values.  Note: option values that have been overriden by paramifiers are only applied during the current document session, and are not //automatically// retained.  However, if you edit an overridden option value during that session, then the modified value is, of course, saved in a browser cookie, as usual.
***/
//{{{
if (ver<2.42) {
function invokeParamifier(params,handler)
{
	if(!params || params.length == undefined || params.length <= 1)
		return;
	for(var t=1; t<params.length; t++) {
		var p = config.paramifiers[params[t].name];
		if(p && p[handler] instanceof Function)
			p[handler](params[t].value);
		else { // not a paramifier with handler()... check for an 'option' prefix
			var h=config.optionHandlers[params[t].name.substr(0,3)];
			if (h && h.set instanceof Function)
				h.set(params[t].name,params[t].value);
		}
	}
}
}
//}}}
// // }}}}}}
// // open tickets:
// // {{block{
/***
!!!608/609/610 toolbars - toggles, separators and transclusion
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/608 - OPEN (more/less toggle)
http://trac.tiddlywiki.org/ticket/609 - OPEN (separators)
http://trac.tiddlywiki.org/ticket/610 - OPEN (wikify tiddler/slice/section content)

This combination tweak extends the """<<toolbar>>""" macro to add use of '<' to insert a 'less' menu command (the opposite of '>' == 'more'), as well as use of '*' to insert linebreaks and "!" to insert a vertical line separator between toolbar items.  In addition, this tweak add the ability to use references to tiddlernames, slices, or sections and render their content inline within the toolbar, allowing easy creation of new toolbar commands using TW content (such as macros, links, inline scripts, etc.)

To produce a one-line style, with "less" at the end, use
| ViewToolbar| foo bar baz > yabba dabba doo < |
or to use a two-line style with more/less toggle:
| ViewToolbar| foo bar baz > < * yabba dabba doo |
***/
//{{{
merge(config.macros.toolbar,{
	moreLabel: 'more\u25BC',
	morePrompt: 'Show additional commands',
	lessLabel: '\u25C4less',
	lessPrompt: 'Hide additional commands',
	separator: '|'
});
config.macros.toolbar.onClickMore = function(ev) {
	var e = this.nextSibling;
	e.style.display = 'inline'; // show menu
	this.style.display = 'none'; // hide button
	return false;
};
config.macros.toolbar.onClickLess = function(ev) {
	var e = this.parentNode;
	var m = e.previousSibling;
	e.style.display = 'none'; // hide menu
	m.style.display = 'inline'; // show button
	return false;
};
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler) {
	for(var t=0; t<params.length; t++) {
		var c = params[t];
		switch(c) {
			case '!':  // ELS - SEPARATOR (added)
				createTiddlyText(place,this.separator);
				break;
			case '*':  // ELS - LINEBREAK (added)
				createTiddlyElement(place,'BR');
				break;
			case '<': // ELS - LESS COMMAND (added)
				var btn = createTiddlyButton(place,
					this.lessLabel,this.lessPrompt,config.macros.toolbar.onClickLess,'moreCommand');
				break;
			case '>':
				var btn = createTiddlyButton(place,
					this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore,'moreCommand');
				var e = createTiddlyElement(place,'span',null,'moreCommand');
				e.style.display = 'none';
				place = e;
				break;
			default:
				var theClass = '';
				switch(c.substr(0,1)) {
					case '+':
						theClass = 'defaultCommand';
						c = c.substr(1);
						break;
					case '-':
						theClass = 'cancelCommand';
						c = c.substr(1);
						break;
				}
				if(c in config.commands)

					this.createCommand(place,c,tiddler,theClass);
				else { // ELS - WIKIFY TIDDLER/SLICE/SECTION (added)
					if (c.substr(0,1)=='~') c=c.substr(1); // ignore leading ~
					var txt=store.getTiddlerText(c);
					if (txt) {
						// trim any leading/trailing newlines
						txt=txt.replace(/^\n*/,'').replace(/\n*$/,'');
						// trim PRE format wrapper if any
						txt=txt.replace(/^\{\{\{\n/,'').replace(/\n\}\}\}$/,'');
						// render content into toolbar
						wikify(txt,createTiddlyElement(place,'span'),null,tiddler);
					}
				} // ELS - end WIKIFY CONTENT
				break;
		}
	}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!529 IE fixup - case-sensitive element lookup of tiddler elements
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/529 - OPEN
This tweak hijacks the standard browser function, document.getElementById(), to work-around the case-INsensitivity error in Internet Explorer (all versions up to and including IE7) //''Note: This tweak is only applied when using IE, and only for lookups of rendered tiddler elements within the containing 'tiddlerDisplay' element.''//
***/
//{{{
if (config.browser.isIE) {
document.coreTweaks_coreGetElementById=document.getElementById;
document.getElementById=function(id) {
	var e=document.coreTweaks_coreGetElementById(id);
	if (!e || !e.parentNode || e.parentNode.id!='tiddlerDisplay') return e;
	for (var i=0; i<e.parentNode.childNodes.length; i++)
		if (id==e.parentNode.childNodes[i].id) return e.parentNode.childNodes[i];
	return null;
};
}
//}}}
// // }}}}}}// // {{block{
/***
!!!890 add conditional test to """<<tiddler>>""" macro
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/890 - OPEN
This tweak extends the {{{<<tiddler>>}}} macro syntax so you can include a javascript-based //test expression// to determine if the tiddler transclusion should be performed:
{{{
<<tiddler TiddlerName if:{{...}} with: param param etc.>>
}}}
If the test is ''true'', then the tiddler is transcluded as usual.  If the test is ''false'', then the transclusion is skipped and //no output is produced//.
***/
//{{{
config.macros.tiddler.if_handler = config.macros.tiddler.handler;
config.macros.tiddler.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
	params = paramString.parseParams('name',null,true,false,true);
	if (!getParam(params,'if',true)) return;
	this.if_handler.apply(this,arguments);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!831 backslash-quoting for embedding newlines in 'line-mode' formats
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/831 - OPEN
This tweak pre-processes source content to convert 'double-backslash-newline' into {{{<br>}}} before wikify(), so that literal newlines can be embedded in line-mode wiki syntax (e.g., tables, bullets, etc.)
***/
//{{{
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
	if (source) arguments[0]=source.replace(/\\\\\n/mg,'<br>');
	coreWikify.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!683 FireFox3 Import bug: 'browse' button replacement
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/683 - OPEN
The web standard 'type=file' input control that has been used as a local path/file picker for TiddlyWiki no longer works as expected in FireFox3, which has, for security reasons, limited javascript access to this control so that *no* local filesystem path information can be revealed, even when it is intentional and necessary, as it is with TiddlyWiki.  This tweak provides alternative HTML source that patches the backstage import panel.  It replaces the 'type=file' input control with a text+button combination of controls that invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
>Note: ''This tweak also requires http://trac.tiddlywiki.org/ticket/604 - cross-platform askForFilename()''
***/
//{{{
if (window.Components) {
	var fixhtml='<input name="txtBrowse" style="width:30em"><input type="button" value="..."'
		+' onClick="window.browseForFilename(this.previousSibling,true)">';
	var cmi=config.macros.importTiddlers;
	cmi.step1Html=cmi.step1Html.replace(/<input type='file' size=50 name='txtBrowse'>/,fixhtml);
}

merge(config.messages,{selectFile:'Please enter or select a file'}); // ready for I18N translation

window.browseForFilename=function(target,mustExist) { // note: both params are optional
	var msg=config.messages.selectFile;
	if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
	// get local path for current document
	var path=getLocalPath(document.location.href);
	var p=path.lastIndexOf('/'); if (p==-1) p=path.lastIndexOf('\\'); // Unix or Windows
	if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
	var file=''
	var result=window.askForFilename(msg,path,file,mustExist); // requires #604
	if (target && result.length) // set target field and trigger handling
		{ target.value=result; target.onchange(); }
	return result; 
}
//}}}
// // }}}}}}// // {{block{
/***
!!!604 cross-platform askForFilename()
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/604 - OPEN
invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
window.askForFilename=function(msg,path,file,mustExist) {
	var r = window.mozAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.ieAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = window.javaAskForFilename(msg,path,file,mustExist);
	if(r===null || r===false)
		r = prompt(msg,path+file);
	return r||'';
}

window.mozAskForFilename=function(msg,path,file,mustExist) {
	if(!window.Components) return false;
	try {
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
		var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
		picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
		var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
		thispath.initWithPath(path);
		picker.displayDirectory=thispath;
		picker.defaultExtension='html';
		picker.defaultString=file;
		picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
		if (picker.show()!=nsIFilePicker.returnCancel)
			var result=picker.file.path;
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.ieAskForFilename=function(msg,path,file,mustExist) {
	if(!config.browser.isIE) return false;
	try {
		var s = new ActiveXObject('UserAccounts.CommonDialog');
		s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
		s.FilterIndex=3; // default to HTML files;
		s.InitialDir=path;
		s.FileName=file;
		return s.showOpen()?s.FileName:'';
	}
	catch(ex) { displayMessage(ex.toString()); }
	return result;
}

window.javaAskForFilename=function(msg,path,file,mustExist) {
	if(!document.applets['TiddlySaver']) return false;
	// TBD: implement java-based askFile(...) function
	try { return document.applets['TiddlySaver'].askFile(msg,path,file,mustExist); } 
	catch(ex) { displayMessage(ex.toString()); }
}
//}}}
// // }}}}}}// // {{block{
/***
!!!657 wrap tabs onto multiple lines
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/657 - OPEN
This tweak inserts an extra space element following each tab, allowing them to wrap onto multiple lines if needed.
***/
//{{{
config.macros.tabs.handler = function(place,macroName,params)
{
	var cookie = params[0];
	var numTabs = (params.length-1)/3;
	var wrapper = createTiddlyElement(null,'div',null,'tabsetWrapper ' + cookie);
	var tabset = createTiddlyElement(wrapper,'div',null,'tabset');
	tabset.setAttribute('cookie',cookie);
	var validTab = false;
	for(var t=0; t<numTabs; t++) {
		var label = params[t*3+1];
		var prompt = params[t*3+2];
		var content = params[t*3+3];
		var tab = createTiddlyButton(tabset,label,prompt,this.onClickTab,'tab tabUnselected');
		createTiddlyElement(tab,'span',null,null,' ',{style:'font-size:0pt;line-height:0px'}); // ELS
		tab.setAttribute('tab',label);
		tab.setAttribute('content',content);
		tab.title = prompt;
		if(config.options[cookie] == label)
			validTab = true;
	}
	if(!validTab)
		config.options[cookie] = params[1];
	place.appendChild(wrapper);
	this.switchTab(tabset,config.options[cookie]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!628 hide 'no such macro' errors
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/628 - OPEN
When invoking a macro that is not defined, this tweak prevents the display of the 'error in macro... no such macro' message.  This is useful when rendering tiddler content or templates that reference macros that are defined by //optional// plugins that have not been installed in the current document.

<<option chkHideMissingMacros>> hide 'no such macro' error messages
***/
//{{{
if (config.options.chkHideMissingMacros===undefined)
	config.options.chkHideMissingMacros=false;

window.coreTweaks_missingMacro_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
	if (!config.macros[macro] || !config.macros[macro].handler)
		if (config.options.chkHideMissingMacros) return;
	window.coreTweaks_missingMacro_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}
// // <<foldHeadings>>
[[About]]
/***
|Name|FoldHeadingsPlugin|
|Source|http://www.TiddlyTools.com/#FoldHeadingsPlugin|
|Version|1.1.2|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|automatically turn headings into slider-like panels that can be folded/unfolded with a single click|
This plugin defines a macro that automatically converts heading-formatted content into sliders that let you expand/collapse their content by clicking on individual headings.
!!!!!Usage
<<<
{{{
<<foldHeadings opened|closed tag tag tag...>>
}}}
where: ''opened'' or ''closed'' is a keyword indicating the initial state of the sections (default: opened), and ''tag tag tag...'' is an optional list of tags to match, so that the foldable effect is only applied to tiddlers that contain one (or more) of the indicated tags.  

When you place the macro in a tiddler, any heading-formatted content (i.e, "!" through "!!!!!") in that tiddler will automatically become //'fold-able'//, allowing you to expand/collapse the content that follows each heading simply by clicking on that heading.  Each content section begins with the first element following a heading, and continues until either another heading is found or the end of the tiddler is reached.  For example:
{{{
<<foldHeadings closed>>
}}}
is embedded in ''this'' tiddler in order to make all the headings it contains 'fold-able'.  Note that the macro has been placed at the //end// of the tiddler because it only operates on *rendered* content.  Thus, only headings that //precede// it in the same tiddler will become fold-able, as any headings that //follow// it are not actually rendered until //after// the macro has been processed.

You can further limit the effect of the macro within the tiddler by surrounding several headings in a "CSS class wrapper" ("""{{classname{...}}}""") or other containing DOM element (e.g., """@@display:inline;...@@""") and then embedding the {{{<<foldHeadings>>}}} macro inside that container (at the end)... only those headings that are also within that container will be made fold-able, instead of converting ''all'' the headings in that tiddler.

Conversely, if you want the fold-able ability to apply to the headings in //all// tiddlers, ''without having to alter //any// of those individual tiddlers'', you can add the macro to the end of your [[ViewTemplate]], so that it will be invoked after the content in each tiddler has been rendered, causing all headings they contain to automatically become fold-able.  For example:
{{{
<span macro="foldHeadings closed"></span>
}}}
You can also limit this effect to selected tiddlers by specifying one or more tags as additional macro parameters.  For example:
{{{
<span macro="foldHeadings closed systemConfig"></span>
}}}
is only applied to headings contained in //plugin tiddlers// (i.e., tiddlers tagged with <<tag systemConfig>>), while headings in other tiddlers remain unaffected by the macro, even though it is embedded in the common [[ViewTemplate]] definition.
<<<
!!!!!Revisions
<<<
2009.11.30 [1.1.2] corrected CSS 'text-weight' to 'font-weight'
2009.01.06 [1.1.1] removed hijack of scrollToSection() (see [[SectionLinksPlugin]] for equivalent code)
2008.11.17 [1.1.0] added hijack of 'scrollToSection()' function (see [[CoreTweaks]] and http://trac.tiddlywiki.org/ticket/784)
2007.12.06 [1.0.2] fix handling for empty sections when checking for sliderPanel/floatingPanel
2007.12.02 [1.0.1] fix handling when content following a heading is already a sliderPanel/floatingPanel
2007.12.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.FoldHeadingsPlugin= {major: 1, minor: 1, revision: 2, date: new Date(2009,11,30)};

config.macros.foldHeadings = {
	guideText: "opened|closed className",
	showtip: "click to show '%0'",
	hidetip: "click to hide '%0'",
	showlabel: "more...",
	hidelabel: "[x]",
	html: "<span style='float:right;font-weight:normal;font-size:80%;' class='TiddlyLinkExisting'>%0&nbsp;</span>",
	handler: function(place,macroName,params) {
		var show=params[0] && params.shift().toLowerCase()!="closed";
		if (params.length) { // if filtering by tag(s)
			var here=story.findContainingTiddler(place);
			if (here) var tid=store.getTiddler(here.getAttribute("tiddler"));
			if (!tid || !tid.tags.containsAny(params)) return; // in a tiddler and not tagged... do nothing...
		}
		var elems=place.parentNode.getElementsByTagName("*");
		var heads=[]; for (var i=0; i<elems.length; i++) { // get non-foldable heading elements
			var n=elems[i].nodeName; var foldable=hasClass(elems[i],"foldable");
			if ((n=="H1"||n=="H2"||n=="H3"||n=="H4"||n=="H5")&&!foldable)
				heads.push(elems[i]);
			}
		for (var i=0; i<heads.length; i++) { var h=heads[i]; // for each heading element...
			// find start/end of section content (up to next heading or end of content)
			var start=end=h.nextSibling; while (end && end.nextSibling) {
				var n=end.nextSibling.nodeName.toUpperCase();
				if (n=="H1"||n=="H2"||n=="H3"||n=="H4"||n=="H5") break;
				end=end.nextSibling;
			}
			if (start && hasClass(start,"sliderPanel")||hasClass(start,"floatingPanel")) continue; // heading is already a slider!
			var span=createTiddlyElement(null,"span",null,"sliderPanel"); // create container
			span.style.display=show?"inline":"none"; // set initial display state
			h.parentNode.insertBefore(span,start); // and insert it following the heading element
			// move section elements into container...
			var e=start; while (e) { var next=e.nextSibling; span.insertBefore(e,null); if (e==end) break; e=next; }
			// set heading label/tip/cursor...
			h.title=(show?this.hidetip:this.showtip).format([h.textContent])
			h.innerHTML=this.html.format([show?this.hidelabel:this.showlabel])+h.innerHTML;
			h.style.cursor='pointer';
			addClass(h,"foldable"); // so we know it been done (and to add extra styles)
			h.onclick=function() {
				var panel=this.nextSibling; var show=panel.style.display=="none";
				// update panel display state
				if (config.options.chkAnimate) anim.startAnimating(new Slider(panel,show));
				else panel.style.display = show?"inline":"none";
				// update heading label/tip
				this.removeChild(this.firstChild); // remove existing label
				var fh=config.macros.foldHeadings; // abbreviation for readability...
				this.title=(show?fh.hidetip:fh.showtip).format([this.textContent])
				this.innerHTML=fh.html.format([show?fh.hidelabel:fh.showlabel])+this.innerHTML;
			}
		}		
	}
}

if (story.scrollToSection) {
Story.prototype.foldheadings_scrollToSection=Story.prototype.scrollToSection;
Story.prototype.scrollToSection=function(title,section) {
	var e=this.foldheadings_scrollToSection.apply(this,arguments);
	// if scrolling to a folded section heading, click to expand it
	if (e && hasClass(e,'foldable') && e.nextSibling.style.display=='none') e.onclick();
}
}
//}}}
// //<<foldHeadings closed>>
/%
|Name|HideTiddlerSubtitle|
|Source|http://www.TiddlyTools.com/#HideTiddlerSubtitle|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|hide a tiddler's subtitle (dates/created by) display|

Usage: <<tiddler HideTiddlerSubtitle>>

%/<script>
	var t=story.findContainingTiddler(place);
	if (!t || t.id=="tiddlerHideTiddlerSubtitle") return;
	var nodes=t.getElementsByTagName("*");
	for (var i=0; i<nodes.length; i++)
		if (hasClass(nodes[i],"subtitle"))
			nodes[i].style.display="none";
</script>
/%
|Name|HideTiddlerTags|
|Source|http://www.TiddlyTools.com/#HideTiddlerTags|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|hide a tiddler's tagged/tagging display elements|

Usage: <<tiddler HideTiddlerTags>>

%/<script>
	var t=story.findContainingTiddler(place);
	if (!t || t.id=="tiddlerHideTiddlerTags") return;
	var nodes=t.getElementsByTagName("div");
	for (var i=0; i<nodes.length; i++)
		if (hasClass(nodes[i],"tagged"))
			nodes[i].style.display="none";
</script>
/%
|Name|HideTiddlerToolbar|
|Source|http://www.TiddlyTools.com/#HideTiddlerToolbar|
|Version|0.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|hide a tiddler's toolbar display|

Usage: <<tiddler HideTiddlerToolbar>>

%/<script>
	var t=story.findContainingTiddler(place);
	if (!t || t.id=="tiddlerHideTiddlerToolbar") return;
	var nodes=t.getElementsByTagName("*");
	for (var i=0; i<nodes.length; i++)
		if (hasClass(nodes[i],"toolbar"))
			nodes[i].style.display="none";
</script>
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.4|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides||
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2009.02.26 [1.9.4] in $(), handle leading '#' on ID for compatibility with JQuery syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 3, date: new Date(2008,6,11)};

config.formatters.push( {
	name: "inlineJavascript",
	match: "\\<script",
	lookahead: "\\<script(?: src=\\\"((?:.|\\n)*?)\\\")?(?: label=\\\"((?:.|\\n)*?)\\\")?(?: title=\\\"((?:.|\\n)*?)\\\")?(?: key=\\\"((?:.|\\n)*?)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",

	handler: function(w) {
		var lookaheadRegExp = new RegExp(this.lookahead,"mg");
		lookaheadRegExp.lastIndex = w.matchStart;
		var lookaheadMatch = lookaheadRegExp.exec(w.source)
		if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
			var src=lookaheadMatch[1];
			var label=lookaheadMatch[2];
			var tip=lookaheadMatch[3];
			var key=lookaheadMatch[4];
			var show=lookaheadMatch[5];
			var code=lookaheadMatch[6];
			if (src) { // load a script library
				// make script tag, set src, add to body to execute, then remove for cleanup
				var script = document.createElement("script"); script.src = src;
				document.body.appendChild(script); document.body.removeChild(script);
			}
			if (code) { // there is script code
				if (show) // show inline script code in tiddler output
					wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
				if (label) { // create a link to an 'onclick' script
					// add a link, define click handler, save code in link (pass 'place'), set link attributes
					var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
					var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
					link.code="function _out(place){"+fixup+"\n};_out(this);"
					link.tiddler=w.tiddler;
					link.onclick=function(){
						this.bufferedHTML="";
						try{ var r=eval(this.code);
							if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
								var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
							if(this.bufferedHTML.length)
								s.innerHTML=this.bufferedHTML;
							if((typeof(r)==="string")&&r.length) {
								wikify(r,s,null,this.tiddler);
								return false;
							} else return r!==undefined?r:false;
						} catch(e){alert(e.description||e.toString());return false;}
					};
					link.setAttribute("title",tip||"");
					var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
					URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
					URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
					link.setAttribute("href",URIcode);
					link.style.cursor="pointer";
					if (key) link.accessKey=key.substr(0,1); // single character only
				}
				else { // run inline script code
					var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
					var c="function _out(place){"+fixup+"\n};_out(w.output);";
					try	 { var out=eval(c); }
					catch(e) { out=e.description?e.description:e.toString(); }
					if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
				}
			}
			w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
		}
	}
} )
//}}}

// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
	if(limit > 0) text = text.substr(0,limit);
	var wikifier = new Wikifier(text,formatter,null,tiddler);
	return wikifier.wikifyPlain();
}
//}}}

// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
''How to include signal handling in Monte Carlo code.''

Monte Carlo is a simulation method used to solve complex problems by rolling dice in a casino. Or rather, by pretending to roll dice using a pseudo-random number generator in a computer. The method can be applied to simulate many types of problems, but here I focus on light scattering. 

http://omlc.ogi.edu/software/mc/ is the definitive starting point for simulating light scattering in biological media using Monte Carlo. 

On this page, I will show how to use [[signal handling|http://www.gnu.org/s/libc/manual/html_node/Signal-Handling.html#Signal-Handling]] to allow a user to control the running code. This can be useful on a single machine or especially for running large simulations on a cluster with [[Parallel Monte Carlo]]. This makes it possible to:
* Check on the progress of a simulation by asking the code to print a status report or write data to a file without the slow down of doing this continuously.
* Shut down a simulation gracefully and write the results. For example, in the event of an unexpected power outage near the end of a 3 day simulation, a signal can be passed during the limited battery run time to ask the code to write the data obtained so far to disk.
* Use run-time based simulations rather than predetermined number of rays. This can be especially useful in a large queue-based computing cluster where queues may impose walltime limits. 

!!! Steps to add signal handling to Monte Carlo
# Include signal library using ''#include <signal.h>''
# Write a signal handler function to do something when the signal is caught
# Add ''signal(~SIGtoWatchfor,sighandlerfunc);'' to main{}
# Pass signals to the running program using ''kill'' or jobcontrol from scheduler program

The easiest way to understand this is to follow a simple example. I again use Scott Prahl's tiny_mc as a starting point and add signal handling to catch SIGINT which asks the program to exit nicely displaying the results obtained so far. 

!!! Example: [[tiny_mc.c|http://omlc.ogi.edu/software/mc/tiny_mc.c]]

[[Scott Prahl|http://www.bme.ogi.edu/~prahl/]]'s shortest example of a realistic light scattering simulation makes a convenient example because the entire code fits on a single page. The changes to include signal handling ammount to an additional 9 lines of code. The lines where I made changes are appended with  the comment ''-- JDR'' and the modified program is [[tiny_mc_sig.c|code/tiny_mc_sig.c]]: 

# Compile using "gcc -O3 -lm -o tiny_mc_sig tiny_mc_sig.c"
# Run with "./tiny_mc_sig"
# To end the run, use "Ctrl+c" which should result in the code exiting nicely and printing the result

{{{
char   t1[80] = "Tiny Monte Carlo by Scott Prahl (http://omlc.ogi.edu)";
char   t2[80] = "1 W Point Source Heating in Infinite Isotropic Scattering Medium";
// Modified to handle SIGINT so that the run can be interrupted and still 
// output data. Modifications by Jeremy D. Rogers, Northwestern University
// Lines modified by JDR are noted with appended comments as:            -- JDR
char   t3[80] = "SIGINT added by Jeremy D. Rogers http://biophotonics.bme.northwestern.edu";// -- JDR

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <signal.h> // include the signal library                        -- JDR
#define SHELL_MAX  11

double mu_a = 2;        /* Absorption Coefficient in 1/cm !!non-zero!! */
double mu_s = 20;       /* Reduced Scattering Coefficient in 1/cm */
double microns_per_shell = 50; /* Thickness of spherical shells in microns */
long   i, shell, photons = 1000000;
double x, y, z, u, v, w, weight;
double albedo, shells_per_mfp, xi1, xi2, t, heat[SHELL_MAX];

char done = 0;  //                                                       -- JDR
void finish(int signum) // signal handler function                       -- JDR
{
   printf("Caught SIGINT, exiting after %8ld of %8ld photons.\n",i,photons);
   done = 1;
}

int main ()
{
        signal(SIGINT,finish); // actually watch for signal             -- JDR
        albedo = mu_s / (mu_s + mu_a);
        shells_per_mfp = 1e4/microns_per_shell/(mu_a+mu_s);

        for (i = 1; i <= photons; i++)
        {
          if (done) break; // exit loop if SIGINT is caught             -- JDR
                x = 0.0; y = 0.0; z = 0.0;                        /*launch*/
                u = 0.0; v = 0.0; w = 1.0;
                weight = 1.0;

                for (;;) {
                        t = -log((rand()+1.0)/(RAND_MAX+1.0));  /*move*/
                        x += t * u;
                        y += t * v;
                        z += t * w;

                        shell=sqrt(x*x+y*y+z*z)*shells_per_mfp; /*absorb*/
                        if (shell > SHELL_MAX-1) shell = SHELL_MAX-1;
                        heat[shell] += (1.0-albedo)*weight;
                        weight *= albedo;

                        for(;;) {                       /*new direction*/
                                xi1=2.0*rand()/RAND_MAX - 1.0;
                                xi2=2.0*rand()/RAND_MAX - 1.0;
                                if ((t=xi1*xi1+xi2*xi2)<=1) break;
                        }
                        u = 2.0 * t - 1.0;
                        v = xi1 * sqrt((1-u*u)/t);
                        w = xi2 * sqrt((1-u*u)/t);

                        if (weight < 0.001){                    /*roulette*/
                                if (rand() > 0.1 * RAND_MAX) break;
                                weight /= 0.1;
                        }
                }
        }

        printf("%s\n%s\n\nScattering = %8.3f/cm\nAbsorption = %8.3f/cm\n",t1,t2,mu_s,mu_a);
        printf("Photons    = %8ld\n\n Radius         Heat\n[microns]     [W/cm^3]\n",photons);
        t = 4*3.14159*pow(microns_per_shell,3)*photons/1e12;
        for (i=0;i<SHELL_MAX-1;i++)
                printf("%6.0f    %12.8f\n",i*microns_per_shell, heat[i]/t/(i*i+i+1.0/3.0));
        printf(" extra    %12.8f\n",heat[SHELL_MAX-1]/photons);
        return 0;
}
}}}

<<tiddler HideTiddlerTags>><<tiddler HideTiddlerSubtitle>><<tiddler HideTiddlerToolbar>>
[img[images/JDR_headshot_MERI_cropped.jpg]]
Assistant Professor
[[Biomedical Engineering|http://www.engr.wisc.edu/bme.html]]
[[University of Wisconsin - Madison|http://wisc.edu]] 

Research appointments in:
[[Laboratory for Optical and Computational Instrumentation|http://loci.wisc.edu/]] 
[[McPherson Eye Research Institute|http://vision.wisc.edu/]]

/%
The core of Dr. Rogers' research is the development of new optical instrumentation and imaging methods for the study of biological cells and tissues. Applications of his work include endoscopic quantification of scattering properties of tissue for cancer screening and risk stratification. Development of tools to quantify changes in cells and tissue make use of:
* Microscopy
* Spectroscopy 
* Polarization
* Coherence
* Interference

!!!Contact:
Jeremy D. Rogers
2140 Engineering Centers Building
1550 Engineering Dr.
Madison, WI 53706
(608) 262-8537
jdrogers5 (at) wisc.edu
%/

!!!Education
2006 - ~PhD, Optical Sciences, University of Arizona
2003 - MS, Optical Sciences, University of Arizona
1999 - BS, Physics, Michigan Technological Univ.

/%
!!!//Curriculum Vitae//
* [[CV in PDF format|jdr-cv12.pdf]] (last updated September, 2012)
%/
<<tiddler HideTiddlerTags>><<tiddler HideTiddlerSubtitle>><<tiddler HideTiddlerToolbar>>
''Low-coherence Enhanced Backscattering''

LEBS is a coherence phenomenon resulting in a retroreflection of light from a random medium.

<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
/%[[About]]
[[Publications]]
[[Research]]
[[Code]]%/
/%<html><a href=academic.html#About title="Basic biography and CV" class="tiddlyLinkExisting">About</a></html>
<html><a href=academic.html#Publications title="Papers and other writings" class="tiddlyLinkExisting">Publications</a></html>
<html><a href=academic.html#Research title="Projects and areas of investigation" class="tiddlyLinkExisting">Research</a></html>
<html><a href=academic.html#Code title="Various programs and scripts" class="tiddlyLinkExisting">Code</a></html>%/
[[About]]<<tiddler {{place.lastChild.title='Basic biography and CV';''}}>>
[[People]]<<tiddler {{place.lastChild.title='Lab members';''}}>>
[[Publications|Publications]]<<tiddler {{place.lastChild.title='Papers and other writings';''}}>>
[[Research|Research]]<<tiddler {{place.lastChild.title='Projects and areas of investigation';''}}>>
[[Code|Code]]<<tiddler {{place.lastChild.title='Various programs and scripts';''}}>>
[[Other Links|Resources]]<<tiddler {{place.lastChild.title='Other useful sites and links';''}}>>
<<closeAll>><<permaview>><<newTiddler>><<newJournal 'DD MMM YYYY'>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options ۧ 'Change TiddlyWiki advanced options'>>
!!!Contact:
Jeremy D. Rogers
9433 WIMR
1111 Highland Ave.
Madison, WI 53705
(608) 262-8537
jdrogers5 (at) wisc.edu
/%
jdrogers5 (at) wisc.edu
(608) 262-8357
[img[Jeremy D. Rogers|JDR_headshot_jacket2_tn.jpg]]
Copyright © 2013
by J.D. Rogers
%/
A list of software available for lens design, stray light analysis, modeling
http://www.optenso.de/links/links.html
<!--{{{-->
<div id='header' class='header'>
<div class='headerShadow'>

<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>

</div>
<div id='mainMenu'>
<span refresh='content' tiddler='MainMenu'></span>
<span id='noticeBoard' refresh='content' tiddler='NoticeBoard'></span>

</div>
<div id='sidebar'>
<span class='searchBar' macro='search'></span>
<div id='sidebarOptions' refresh='content' tiddler='MochaSideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
''How to parallelize Monte Carlo code using MPI.''

Monte Carlo is a simulation method used to solve complex problems by rolling dice in a casino. Or rather, by pretending to roll dice using a pseudo-random number generator in a computer. The method can be applied to simulate many types of problems, but here I focus on light scattering. 

http://omlc.ogi.edu/software/mc/ is the definitive starting point for simulating light scattering in biological media using Monte Carlo. 

On this page, I will show how to use a [[Message Passing Interface (MPI)|http://www.mcs.anl.gov/research/projects/mpi/]] to enable a Monte Carlo simulation to use multiple processor, cores, or nodes. MPI is a standard on High Performance Computing clusters and this makes it possible to run Monte Carlo simulations on large clusters with thousands of nodes, or a laptop with a dual core processor.

''Scalable:'' Most programmers using MPI must worry about scalability of their code. Fortunately for us, Monte Carlo is what is known as 'trivially parallel' or 'embarrassingly parallel'. What that means is that we don't actually need to worry about passing messages during a simulation, only at the end to collect all the results. This means that the simulation will scale almost perfectly and a simulation spread across 100 nodes will take only about 1/100th the time as a simulation on a single processor. There is a little extra time spent collecting data at the end, but that is usually insignificant.

!!! Steps to add MPI
# Install MPI (I like openMPI as I can install it on Ubuntu or Debian using ''aptitude install libopenmpi-dev openmpi-bin''.
# Include MPI library using '' #include "mpi.h"''
# initialize MPI and assign the names and number of other processors 
# Seed the random number generator differently for each processor
# Divide the main loop across the number of processors
# Communicate the results from each processor back to the main node (rank 0) after all the processors finish
# Output the result from the main processor (rank 0)
# Close MPI

''How it works:'' Essentially what is happening is that each node or processor will begin running the same binary, but with arguments that tell it which node it is and how many other nodes there are. If a node sees that it is not node 0, it sends the result it gets to node 0. If the program sees that it is running on node 0, it collects the results and handles all the output. For a simulation of 1000 rays split over two processors, each node only sees the fact that it should perform the loop a total of 500 times and then report the result, or collect the result if it happens to be node 0. The tricky thing to remember is that the random number generator must be seeded differently for each node, otherwise the result will be the same from each node and you might as well just multiply a simulation from 1 node by the number of processors.

To get all this to work, you need to compile using the wrapper ''openmpicc'' and run the program using ''mpirun'' (see the comments in the code example).

!!! Example: [[tiny_mc.c|http://omlc.ogi.edu/software/mc/tiny_mc.c]]

[[Scott Prahl|http://www.bme.ogi.edu/~prahl/]]'s shortest example of a realistic light scattering simulation makes a convenient example because the entire code fits on a single page (or did until I started adding MPI). Although this example program runs very fast and probably does not benefit from running on multiple processors, it's simplicity makes it easy to follow. Here, I have added MPI to create [[tiny_mc_mpi.c|code/tiny_mc_mpi.c]]: 

{{{
char   t1[80] = "Tiny Monte Carlo by Scott Prahl (http://omlc.ogi.edu)";
char   t2[80] = "1 W Point Source Heating in Infinite Isotropic Scattering Medium";
// Lines modified by JDR for MPI are noted with appended comments as:   --  JDR
// Compile with "mpicc -O3 -o tiny_mc_mpi -lm tiny_mc_mpi.c"            --  JDR
// Run with "mpirun -np <# of procs> ./tiny_mc_mpi"                     --  JDR
char   t3[80] = "MPI support added by Jeremy D. Rogers http://biophotonics.bme.northwestern.edu";// -- JDR

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "mpi.h"                     // make sure you have MPI installed -- JDR
#define SHELL_MAX  101

double mu_a = 2;             /* Absorption Coefficient in 1/cm !!non-zero!! */
double mu_s = 20;                 /* Reduced Scattering Coefficient in 1/cm */
double microns_per_shell = 50;  /* Thickness of spherical shells in microns */
long   i, shell, photons = 100000;
double x, y, z, u, v, w, weight;
double albedo, shells_per_mfp, xi1, xi2, t, heat[SHELL_MAX];
int mpi_np;                          // the number of processors to use  -- JDR
int mpi_rank;                                    // the processor number -- JDR

int main (int argc, char *argv[]) // need input args for number of procs -- JDR 
{

        MPI_Init(&argc, &argv);                   // initialize MPI      -- JDR
        MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);                     // -- JDR
        MPI_Comm_size(MPI_COMM_WORLD, &mpi_np);                       // -- JDR


        albedo = mu_s / (mu_s + mu_a);
        shells_per_mfp = 1e4/microns_per_shell/(mu_a+mu_s);

        srand(time(NULL)*(1+mpi_rank));  // seed random number generator -- JDR 
        /* note: this is a good idea even for the non-mpi version unless you
           want to get the same exact data every time you run the program.
           Needed for MPI, otherwise each proc will return identical values. 
           (time*(1+mpi_rank)) ensures each proc has a differnet seed.   -- JDR
        */

        photons /= mpi_np;  // split the loop across the number of procs -- JDR
        for (i = 1; i <= photons; i++)
        {
                x = 0.0; y = 0.0; z = 0.0;                                      /*launch*/
                u = 0.0; v = 0.0; w = 1.0;
                weight = 1.0;

                for (;;) {
                        t = -log((rand()+1.0)/(RAND_MAX+1.0));  /*move*/
                        x += t * u;
                        y += t * v;
                        z += t * w;

                        shell=sqrt(x*x+y*y+z*z)*shells_per_mfp; /*absorb*/
                        if (shell > SHELL_MAX-1) shell = SHELL_MAX-1;
                        heat[shell] += (1.0-albedo)*weight;
                        weight *= albedo;

                        for(;;) {      
                /*new direction*/
                                xi1=2.0*rand()/RAND_MAX - 1.0;
                                xi2=2.0*rand()/RAND_MAX - 1.0;
                                if ((t=xi1*xi1+xi2*xi2)<=1) break;
                        }
                        u = 2.0 * t - 1.0;
                        v = xi1 * sqrt((1-u*u)/t);
                        w = xi2 * sqrt((1-u*u)/t);

                        if (weight < 0.001){                                    /*roulette*/
                                if (rand() > 0.1 * RAND_MAX) break;
                                weight /= 0.1;
                        }
                }
        }

        // sum the data from all the processors                          -- JDR
        if (mpi_rank!=0){MPI_Reduce(heat,heat,SHELL_MAX,              // -- JDR
                          MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD);       // -- JDR
                        }                                             // -- JDR
        else    { MPI_Reduce(MPI_IN_PLACE,heat,SHELL_MAX,             // -- JDR
                              MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD);   // -- JDR
                }                                                     // -- JDR


        if (mpi_rank==0){   // only print output from the head processor -- JDR
           photons *= mpi_np; // back to original val since we MPI_SUMmed - JDR
           printf("%s\n%s\n%s\n\nScattering = %8.3f/cm\nAbsorption = %8.3f/cm\n",t1,t2,t3,mu_s,mu_a); //added note about MPI -- JDR
           printf("Photons    = %8ld\n\n Radius         Heat\n[microns]     [W/cm^3]\n",photons);
           t = 4*3.14159*pow(microns_per_shell,3)*photons/1e12;
           for (i=0;i<SHELL_MAX-1;i++)
                printf("%6.0f    %12.8f\n",i*microns_per_shell, heat[i]/t/(i*i+i+1.0/3.0));
           printf(" extra    %12.8f\n",heat[SHELL_MAX-1]/photons);
        }
        MPI_Finalize(); // close MPI                                     -- JDR
        return 0;
}}}

<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
!Principle Investigator
{{borderlessL{ 
|[<img[images/JDR_headshot_MERI_cropped.jpg]]|[[Jeremy D. Rogers]]<br>Retina Research Foundation Edwin and Dorothy Gamewell Professor<br>Assistant Professor, [[Biomedical Engineering|http://www.engr.wisc.edu/bme.html]]<br>[[University of Wisconsin - Madison|http://wisc.edu]]<br><br><br>Research appointments in:<br>[[Laboratory for Optical and Computational Instrumentation|http://loci.wisc.edu/]]<br>[[McPherson Eye Research Institute|http://vision.wisc.edu/]]|
}}}

! Postdocs
!!! Zach Simmons
{{borderlessL{ 
|[<img[images/zjsimmons_hs.jpg]]|Zach Simmons<br>Postdoctoral Fellow<br>zjsimmons (at) wisc.edu<br>|
}}}


! Graduate Students
!!! Ryan Neimeier
{{borderlessL{ 
|[<img[images/rcniemeier_hsa_sm.jpg]]|Ryan Niemeier<br>Graduate Student<br>rniemeier (at) wisc.edu<br>|
}}}

! Undergraduate Students
* Melanie Loppnow 
* J.T. Postlewaite

! Lab alumni
* Zach Poskin, MS 2013-2016
* Samantha Metz, Research Intern 2014-2015

<<tiddler HideTiddlerTags>><<tiddler HideTiddlerSubtitle>><<tiddler HideTiddlerToolbar>>
!!External aggregators and citation metrics 
[[Google Scholar|http://scholar.google.com/citations?user=0TdWJIoAAAAJ]]
[[Researcher ID|http://www.researcherid.com/rid/A-4572-2008]] (citation metrics uses Web of Science database)
[[PubMed|http://www.ncbi.nlm.nih.gov/pubmed/?term=Rogers+J[Author]+AND+%28Fawzi+A[Author]+OR+Merrins+M[Author]+OR+Backman+V[Author]+OR+Nadeau+J[Author]+OR+Tkaczyk+T[Author]+OR+Descour+M[Author]+OR+Pastel[Author]+OR+Ftaclas[Author]%29]] (not all-inclusive and occasionally pulls in stray cats)

!! Journal Papers 
|45.|[[link|http://dx.doi.org/10.1371/journal.pone.0162869]]||Joel Kaluzny, Patryk Purta, Zach Poskin, ''Jeremy D. Rogers'', Amani A. Fawzi, "Ex Vivo Confocal Spectroscopy of Autofluorescence in """Age-Related""" Macular Degeneration," """PLoS""" ONE, 11(9), Sept. 15 (2016).|
|44.|[[link|http://diabetes.diabetesjournals.org/content/early/2016/05/31/db16-0432]]||Trillian Gregg, Chetan Poudel, Brian A. Schmidt, Rashpal S. Dhillon, Sophia M. Sdao, Nathan A. Truchan, Emma L. Baar, Luis A. Fernandez, John M. Denu, Kevin W. Eliceiri, ''Jeremy D. Rogers'', Michelle E. Kimple, Dudley W. Lamming, Matthew J. Merrins, "Pancreatic β cells from Mice Offset """Age-Associated""" Mitochondrial Deficiency with Reduced KATP Channel Activity," Diabetes, June (2016).|
|44.|[[link|https://www.osapublishing.org/boe/abstract.cfm?uri=boe-6-12-4859]]||Yuming Liu, Steven L. Jacques, Mehdi Azimipour, ''Jeremy D. Rogers'', Ramin Pashaie, and Kevin W. Eliceiri, """"OptogenSIM""": a 3D Monte Carlo simulation platform for light delivery design in optogenetics," Biomed. Opt. Express 6, 4859-4870 (2015).|
|43.|[[link|http://clincancerres.aacrjournals.org/content/early/2015/05/19/1078-0432.CCR-15-0136.abstract]]||Andrew J Radosevich, Nikhil N Mutyal, Adam Eshein, Bradley Gould, ''Jeremy D Rogers'', Michael J Goldberg, Laura K Bianchi, Eugene Yen, Vani JA Konda, Douglas K Rex, Jacques Van Dam, Vadim Backman, Hemant K Roy, "Rectal Optical Markers for In-vivo Risk Stratification of Premalignant Colorectal Lesions." Clinical Cancer Research (2015).|
|42.|[[link|http://journals.lww.com/pancreasjournal/Fulltext/2015/07000/In_Vivo_Risk_Analysis_of_Pancreatic_Cancer_Through.7.aspx]]||Nikhil N Mutyal, Andrew J Radosevich, Shailesh Bajaj, Vani Konda, Uzma D Siddiqui, Irving Waxman, Michael J Goldberg, ''Jeremy D Rogers'', Bradley Gould, Adam Eshein, Sudeep Upadhye, Ann Koons, Mariano """Gonzalez-Haba""" Ruiz, Hemant K Roy, Vadim Backman, "In Vivo Risk Analysis of Pancreatic Cancer Through Optical Characterization of Duodenal Mucosa." Pancreas 44(5), 735-741 (2015).|
|41.|[[link|http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0110157#pone-0110157-g004]]||Andrew J. Radosevich, Nikhil N. Mutyal, ''Jeremy D. Rogers'', Bradley Gould, Thomas A. Hensing, Daniel Ray, Vadim Backman, Hemant K. Roy, "Buccal Spectral Markers for Lung Cancer Risk Stratification." """PLoS""" ONE 9(10): e110157 (2014). doi:10.1371/journal.pone.0110157|
|40.|[[link|http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6589943]]||''Rogers, J.D.''; Radosevich, A.J.; Ji Yi; Backman, V., "Modeling Light Scattering in Tissue as Continuous Random Media Using a Versatile Refractive Index Correlation Function," Selected Topics in Quantum Electronics, IEEE Journal of , vol.20, no.2, pp.173,186, """March-April""" 2014 doi: 10.1109/JSTQE.2013.2280999 (invited)|
|39.|[[link|http://biomedicaloptics.spiedigitallibrary.org/article.aspx?articleid=1735573]]|[[pdf|papers/JBO_18_9_097002.pdf]]|Andrew J. Radosevich, Nikhil N. Mutyal, Ji Yi, Yolanda ~Stypula-Cyrus, ''Jeremy D. Rogers'', Michael J. Goldberg, Laura K. Bianchi, Shailesh Bajaj, Hemant K.Roy, and Vadim Backman, "Ultra-structural alterations in field carcinogenesis measured by enhanced backscattering spectroscopy," JBO 0001;18(9):097002-097002.  doi:10.1117/1.JBO.18.9.097002.|
|38.|[[link|http://www.opticsinfobase.org/boe/abstract.cfm?URI=boe-4-8-1401]]||Sarah Ruderman, Scott Mueller, Andrew Gomes, ''Jeremy Rogers'', and Vadim Backman, "Method of detecting tissue contact for fiber-optic probes to automate data acquisition without hardware modification," Biomedical Optics Express 4 pp. 1401-1412 (2013).|
|37.|[[link|http://prl.aps.org/abstract/PRL/v111/i3/e033903]]||L. Cherkezyan, I. Capoglu, H. Subramanian, ''J. D. Rogers'', D. Damania, A. Taflove, and V. Backman, "Interferometric Spectroscopy of Scattered Light Can Quantify the Statistics of Subdiffractional """Refractive-Index""" Fluctuations," PRL 111  033903 (2013).|
|36.|[[link|http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0061492]]||Marcelino LA, Westneat MW, Stoyneva V, Henss J, ''Rogers JD'',  Radosevich A, Turzhitsky V, Siple M, Fang A, Swain TD, Fung J, Backman V, "Modulation of """Light-Enhancement""" to Symbiotic Algae by """Light-Scattering""" in Corals and Evolutionary Trends in Bleaching." """PLoS""" ONE 8(4) e61492 (2013).|
|35.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?uri=oe-21-7-9043]]||J. Yi, A. Radosevich, ''J. Rogers'', S. Norris, I. Çapoğlu, A. Taflove, and V. Backman, "Can OCT be sensitive to nanoscale structural alterations in biological tissue?," Opt. Express  21, 9043-9059 (2013).|
|34.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?uri=ol-37-24-5220]]||A. Radosevich, J. Yi, ''J. Rogers'', and V. Backman, "Structural length-scale sensitivities of reflectance measurements in continuous random media under the Born approximation," Opt. Lett.  37, 5220-5222 (2012).|
|33.|[[link|http://biomedicaloptics.spiedigitallibrary.org/article.aspx?articleid=1389289]]||Radosevich AJ, ''Rogers JD,'' Çapoğlu İR, Mutyal NN, Pradhan P, Backman V; Open source software for electric field monte carlo simulation of coherent backscattering in biological media containing birefringence. J. Biomed. Opt. 0001;17(11):115001-115001 (2012).|
|32.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?uri=oe-20-18-19643]]|[[pdf|papers/mutyal_OE_2012.pdf]]|Nikhil N. Mutyal, Andrew Radosevich, Bradley Gould, ''Jeremy D. Rogers'', Andrew Gomes, Vladimir Turzhitsky, and Vadim Backman, "A fiber optic probe design to measure depth- limited optical properties in-vivo with Low-coherence Enhanced Backscattering (LEBS) Spectroscopy," //Opt. Express//, ''20'' 19643-19657 (2012).|
|31.|[[link|http://www.sciencedirect.com/science/article/pii/B9780444594228000011]]||I. R. Capoglu, ''J.D. Rogers'', A. Taflove, and V. Backman, "The Microscope in a Computer: Image Synthesis from """Three-Dimensional""" """Full-Vector""" Solutions of Maxwell’s Equations at the Nanometer Scale," //Progress in Optics//, Chapter 1, Vol. 57, July (2012).|
|30.|[[link|http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6062378]]|[[pdf|papers/radosevich_jstqe_2012.pdf]]|A.R. Radosevich, ''J.D. Rogers'', V. Turzhitsky, N. N. Mutyal, J. Yi, H. Roy, and V. Backman, "Polarized Enhanced Backscattering Spectroscopy for Characterization of Biological Tissues at Subdiffusion Length-scales," //IEEE JSTQE//, 18 """Jul-Aug""" (2012).|
|29.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?uri=ol-37-10-1601]]|[[pdf|papers/cherkezyan_OL_2012.pdf]]|L. Cherkezyan, H. Subramanian, V. Stoyneva, ''J. Rogers,'' S. Yang, D. Damania, A. Taflove, and V. Backman, "Targeted alteration of real and imaginary refractive index of biological cells by histological staining," //Opt. Lett.//, ''37'' 1601-1603 (2012).|
|28.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?URI=ol-37-4-506]]|[[pdf|papers/strasser_OL_2012.pdf]]|Samantha Dale Strasser, Gajendra Shekhawat, ''Jeremy D. Rogers,'' Vinayak P. Dravid, A. Taflove, and V. Backman, "Near-field penetrating optical microscopy: a live cell nanoscale refractive index measurement technique for quantification of internal macromolecular density," //Opt. Lett.//, ''37'' 506-508 (2012).|
|27.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?uri=ol-36-24-4737]]|[[pdf|papers/radosevich-OL-2011.pdf]]|A.R. Radosevich, N. N. Mutyal, V. Turzhitsky, ''J.D. Rogers'', J. Yi, A. Taflove, and V. Backman, "Measurement of the spatial backscattering impulse-response at short length-scales with polarized enhanced backscattering (EBS)," //Opt. Lett.//, ''36'' 4737-4739 (2011).|
|26.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?uri=oe-19-13-11922]]|[[pdf|papers/rogers-OE-2011.pdf]]|''J.D. Rogers'', V. Stoyneva, V. Turzhitsky, N. N. Mutyal, P. Pradhan, I. R. Capoglu, and V. Backman, "Alternate formulation of enhanced backscattering as phase conjugation and diffraction: derivation and experimental observation," //Opt. Express//, ''19'' 11922-11931 (2011).|
|25.|[[link|http://spiedigitallibrary.org/jbo/resource/1/jbopfo/v16/i6/p067007_s1]]|[[pdf|papers/turzhitsky-JBO-2011.pdf]]|V. Turzhitsky, A. J. Radosevich, N. N. Mutyal, ''J. D. Rogers'', and V. Backman, "Measurement of Optical Scattering Properties with """Low-Coherence""" Enhanced Backscattering Spectroscopy," //J. Biomed. Opt.// ''16'', 067007 (2011).|
|24.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?uri=ol-36-9-1596]]|[[pdf|papers/capoglu-OL-2011.pdf]]|I. R. Capoglu, C. A. White, ''J. D. Rogers'', H. Subramanian, A. Taflove, and V. Backman, "Numerical simulation of partially-coherent broadband optical imaging using the finite-difference time-domain method," //Opt. Lett.//, ''36'', 1596-1598 (2011).|
|23.|[[link|http://www.opticsinfobase.org/boe/abstract.cfm?URI=boe-1-4-1196]]|[[pdf|papers/radosevich-BOE-2010.pdf]]|Andrew J. Radosevich, Vladimir M. Turzhitsky, Nikhil N. Mutyal, ''Jeremy D. Rogers'', Valentina Stoyneva, Ashish Kumar Tiwari, Mart De La Cruz, Dhananjay P. Kunte, Ramesh K. Wali, Hemant K. Roy, and Vadim Backman, "Depth-resolved measurement of mucosal microvascular blood content using 
low-coherence enhanced backscattering spectroscopy," //Biomed. Opt. Express// 1, 1196-1208 (2010).|
|22.|[[link|http://cancerres.aacrjournals.org/content/70/20/7748]]||Hemant K. Roy, Hariharan Subramanian, Dhwanil Damania, Thomas A. Hensing, William N. Rom, Harvey I. Pass, Daniel Ray, ''Jeremy D. Rogers,'' Andrej Bogojevic, Maitri Shah, Tomasz Kuzniar, Prabhakar Pradhan, and Vadim Backman, "Optical Detection of Buccal Epithelial Nanoarchitectural Alterations in Patients Harboring Lung Cancer: Implications for Screening," //Cancer Res// 70; 7748 Oct. (2010).|
|21.|[[link|http://www.opticsinfobase.org/boe/abstract.cfm?URI=boe-1-3-1034]]|[[pdf|papers/turzhitsky-BOE-2010.pdf]]|Vladimir Turzhitsky, Andrew Radosevich, ''Jeremy D. Rogers'', Allen Taflove, and Vadim Backman, "A predictive model of backscattering at subdiffusion length scales," //Biomed. Opt. Express// 1, 1034-1046 (2010).|
|20.|[[link|http://www.opticsinfobase.org/boe/abstract.cfm?uri=boe-1-2-489]]|[[pdf|papers/ruderman-BOE-2010.pdf]]|Sarah Ruderman, Andrew J. Gomes, Valentina Stoyneva, ''Jeremy D. Rogers'', Angela J. Fought, Borko D. Jovanovic, and Vadim Backman, "Analysis of pressure, angle and temporal effects on tissue optical properties from 
polarization-gated spectroscopic probe measurements," //Biomedical Optics Express//, Vol. 1, Issue 2, pp. 489-499 Sept. (2010).|
|19.|[[link|http://cancerpreventionresearch.aacrjournals.org/content/3/7/844.abstract]]||Hemant K. Roy, Andrew J. Gomes, Sarah Ruderman, Laura K. Bianchi, Michael J. Goldberg, Valentina Stoyneva, ''Jeremy D. Rogers'', Vladimir Turzhitsky, Young Kim, Eugene Yen, Mohammed Jameel, Andrej Bogojevic, and Vadim Backman,"Optical Measurement of Rectal Microvasculature as an Adjunct to Flexible Sigmoidosocopy: """Gender-Specific Implications"""," //Cancer Prev Res// ''3'':844-851 July (2010).|
|18.|[[link|http://ieeexplore.ieee.org/search/srchabstract.jsp?tp=&arnumber=5299094]]|[[pdf|papers/turzhitsky-jstqe-2010.pdf]]|Turzhitsky, V.; ''Rogers, J. D.''; Mutyal, N. N.; Roy, H. K.; Backman, V.; "Characterization of Light Transport in Scattering Media at Subdiffusion Length Scales with """Low-Coherence""" Enhanced Backscattering, "IEEE Journal of Selected Topics in Quantum Electronics", vol.16, no.3, 619-626, """May-June""" (2010).|
|17.|[[link|http://dx.doi.org/10.1016/j.pss.2009.06.014]]|[[pdf|papers/rogers-PSS-2010.pdf]]|''J.D. Rogers'', N.N. Perreault, T.D. Niederberger, C. Lichten, L.G. Whyte, J.L. Nadeau, "A life detection problem in a High Arctic microbial community," //Planetary and Space Science//, ''58''(4), 623-630 (2010).|
|16.|[[link|http://www.opticsinfobase.org/abstract.cfm?uri=ol-34-17-2679]]|[[pdf|papers/capoglu-OL-2009.pdf]] |İlker R. Çapoğlu, ''Jeremy D. Rogers'', Allen Taflove, and Vadim Backman, "Accuracy of the Born approximation in calculating the scattering coefficient of biological continuous random media," //Opt. Lett.// ''34'', 2679-2681 (2009).|
|15.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?URI=ol-34-12-1891]]|[[pdf|papers/rogers-OL-2009.pdf]] |''Jeremy D. Rogers'', İlker R. Çapoğlu, and Vadim Backman, "Nonscalar elastic light scattering from continuous random media in the Born approximation," //Opt. Lett.// ''34'', 1891-1893 (2009). //[[erratum|http://www.opticsinfobase.org/abstract.cfm?uri=ol-35-9-1367]]//|
|14.|[[link|http://cancerres.aacrjournals.org/cgi/content/abstract/69/10/4476]]||Roy HK, Turzhitsky V, Kim Y, Goldberg MJ, Watson P, ''Rogers JD'', Gomes AJ, Kromine A, Brand RE, Jameel M, Bogovejic A, Pradhan P, Backman V., "Association between rectal optical signatures and colonic neoplasia: potential applications for screening," //Cancer Res.// ''69''(10), 4476-83 (2009).|
|13.|[[link|http://clincancerres.aacrjournals.org/cgi/content/short/1078-0432.CCR-08-2880v1]]||Gomes AJ, Roy HK, Turzhitsky V, Kim Y, ''Rogers JD'', Ruderman S, Stoyneva V, Goldberg MJ, Bianchi LK, Yen E, Kromine A, Jameel M, Backman V., "Rectal mucosal microvascular blood supply increase is associated with colonic neoplasia," //Clin. Cancer Res.// ''15''(9), 3110-7 (2009).|
|12.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?URI=ol-34-4-518]]||Hariharan Subramanian, Prabhakar Pradhan, Yang Liu, Ilker R. Capoglu, ''Jeremy D. Rogers'', Hemant K. Roy, Randall E. Brand, and Vadim Backman, "Partial-wave microscopic spectroscopy detects subwavelength refractive index fluctuations: an application to cancer diagnosis," //Opt. Lett.// ''34'', 518-520 (2009).|
|11.|[[link|http://www.pnas.org/content/105/51/20118.abstract]]||Hariharan Subramanian, Prabhakar Pradhan, Yang Liu, Ilker R. Capoglu, Xu Li, ''Jeremy D. Rogers'', Alexander Heifetz, Dhananjay Kunte, Hemant K. Roy, Allen Taflove, and Vadim Backman, "Optical methodology for detecting histologically unapparent nanoscale consequences of genetic alterations in biological cells." //PNAS//, 105:20118-20123 (2008).|
|10.|[[link|http://www.opticsinfobase.org/abstract.cfm?URI=ao-47-32-6046]]||Vladimir M. Turzhitsky, Andrew J. Gomes, Young L. Kim, Yang Liu, Alexey Kromine, ''Jeremy D. Rogers'', Mohammed Jameel, Hemant K. Roy, and Vadim Backman, "Measuring mucosal blood supply in vivo with a polarization-gating probe," Appl. Opt. ''47'', 6046-6057 (2008).|
|9.|[[link|http://www.gastrojournal.org/article/S0016-5085(08)01100-1/abstract]]||H. K. Roy, A. Gomes, V. Turzhitsky, M. J. Goldberg, ''J. Rogers'', S. Ruderman, Y. L. Kim, A. Kromine, R. E. Brand, M. Jameel, N. Hasabou, V. Backman, "Spectroscopic Microvascular Blood Detection from the Endoscopically Normal Colonic Mucosa: Biomarker for Neoplasia Risk", Gastroenterology, 135(4), 1069-1078 (2008).|
|8.|[[link|http://dx.doi.org/10.1117/1.2978060]]|[[pdf|papers/rogers_JBO_2008.pdf]] |''Jeremy D. Rogers'', Sara Landau, Tomasz S. Tkaczyk, Michael R. Descour, Mohammed S. Rahman, Rebecca ~Richards-Kortum, Ari H. O. Karkainen, and Todd Christenson, "Imaging performance of a miniature integrated microendoscope." //J. Biomed. Opt.// ''13'', 054020 (2008), DOI:10.1117/1.2978060|
|7.|[[link|http://www.opticsinfobase.org/ol/abstract.cfm?URI=ol-31-4-504]]|[[pdf|papers/rogers-OL-2006.pdf]]|''J. D. Rogers'', T. S. Tkaczyk, M. R. Descour, A. H. O. Kärkkäinen, R. ~Richards-Kortum, “Removal of ghost images by using tilted element optical systems with polynomial surfaces for aberration compensation.” //Opt. Lett.// ''31'', 504-506 (2006).|
|6.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?URI=oe-12-16-3745]]|[[pdf|papers/tkaczyk-OE-2004.pdf]] |T. S. Tkaczyk, M. Rahman, V. Mack, K. Sokolov, ''J. D. Rogers'', R. ~Richards-Kortum, and M. R. Descour, “High resolution, molecular-specific, reflectance imaging in optically dense tissue phantoms with structured-illumination.” //Optics Express//, (12), 3745-+, (2004).|
|5.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?URI=oe-12-7-1294]]|[[pdf|papers/rogers-OE-2004.pdf]]|''J. D. Rogers'', A. H. O. Kärkkäinen, T. Tkaczyk, J. T. Rantala, M. Descour, “Realization of refractive microoptics through grayscale lithographic patterning of photosensitive hybrid glass.” //Optics Express//, (2004).|
|4.|[[link|http://www.opticsinfobase.org/oe/abstract.cfm?URI=oe-11-12-1436]]|[[pdf|papers/lee-OE-2003.pdf]]|J. Lee, ''J. D. Rogers'', M. R. Descour, E. Hsu, J. S. Aaron, K. Sokolov, R. R. ~Richards-Kortum, “Imaging quality assessment of multi-modal miniature microscope.” //Optics Express//, (11) 1436-+ (2003).|
|3.|[[link|http://www.opticsinfobase.org/ao/abstract.cfm?URI=ao-41-19-3988]]||A. H. O. Karkkainen, J. M. Tamkin, ''J. D. Rogers'', D. R. Neal, O. E. Hormi, G. E. Jabbour, J. T. Rantala,  M. R. Descour, “Direct photolithographic deforming of organomodified siloxane films for micro-optics fabrication.” //Applied Optics//, (41) 3988-3998 (2002).|
|2.|[[link|http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?tp=&arnumber=980264&isnumber=21116]]|[[pdf|papers/descour-jqe-2002.pdf]]|M. R. Descour, A. H. O. Karkkainen, ''J. D. Rogers'', C. Liang, R. S. Weinstein, J. T. Rantala, B. Kilic, E.  Madenci, R. R. ~Richards-Kortum, E. V. Anslyn, R. D. Dupuis, R. J. Schul, C. G. Willison, C. P. Tigges, “Toward the development of miniaturized imaging systems for detection of pre-cancer.” //Quantum Electronics, IEEE Journal of//, (38):2 122-130 (2002).|
|1.|[[link|http://dx.doi.org/10.1119/1.1286048]]|[[pdf|papers/pastel-AJP-2000.pdf]]|R. Pastel, A. Struthers, R. Ringle, ''J. Rogers'', C. Rohde, P. Geiser, “Laser trapping of microscopic particles for undergraduate experiments.” //American Journal of Physics//, (68) 993-1001 (2000).|


!!Conference Presentations
#J. D. Rogers, "Recovering refractive index correlation function from measurement of tissue scattering phase function." BIOS, SPIE Photonics West 2016 (Invited).
#J. D. Rogers, "Fractal phantom design for mimicking spectral and spatial scattering in tissue." BIOS, SPIE Photonics West 2015.
#J. D. Rogers, "Intracellular scattering metrology with spectral microscopy." Gordon Research Conference: Lasers in biology and Medicine July 2012. ''(Invited)''
#J. D. Rogers, Nikhil Mutyal, Andrew Radosevich, Vladimir Turzhitsky, Hemant Roy, and Vadim Backman, "Biomedical Applications of Enhanced Backscattering Spectroscopy." CLEO May 2011. ''(Invited)''
#Jeremy D. Rogers, Andrew Radosevich, Ilker R. Capoglu, Allen Taflove, and Vadim Backman, "Methods and models for simulating light propagation and scattering in biological media." URSI Boulder 2011. ''(Invited)''
#J.D. Rogers and Vadim Backman, "Scattering from Mass Fractals: Modeling and Observation," SPIE Photonics West 2011 ''(Invited)''
#Jeremy D. Rogers, Ilker R. Capoglu, Valentina Stoyneva, Vladimir M. Turzhitsky, Vadim Backman, "Modeling spectral dependence of reduced scattering coefficient for continuous random media with the Born Approximation." Poster ~BSuD53, OSA ~BioMed Topical Meeting, April, 2010.
#J. D. Rogers, T. S. Tkaczyk, M. R. Descour, “Foveated endoscope objective design to combine high resolution with wide field of view.” [7558-07] BIOS, SPIE Photonics West, January, 2010.
#J. D. Rogers, V. Stoyneva, N. N. Mutyal, V. M. Turzhitsky, V. Backman, “Lensless LEBS: a simplified geometry for low-coherence enhanced backscattering (LEBS).” [7561-28] BIOS, SPIE Photonics West, January, 2010.
#J. D. Rogers, V. Turzhitsky, H. Subramanian, I. R. Capoglu, V. Backman, “Enhanced Backscattering Simulation using Monte Carlo to Simulate Short-range Light Transport in Weakly Scattering Media.” URSI, Boulder, 2010.
#J. D. Rogers, H. Subramanian, V. Turzhitsky, V. Backman, "Relationship of Low-coherence Enhanced Backscattering Spectroscopy measurements to optical properties of scattering media." BIOS, SPIE Photonics West, January, 2009. ''(Invited)''
#J. D. Rogers, H. Subramanian, V. Turzhitsky, P. Pradhan, Y. L. Kim, A. Taflove, and V. Backman, "Enhanced Backscattering for Tissue Characterization and Diagnosis." APS/URSI, San Diego, 2008. ''(Invited)''
#Jeremy D. Rogers, Vladimir M. Turzhitsky, Nikhil N. Mutyal, Andrew Gomes, Alexey Kromin, Vadim Backman, "An Endoscope Compatible Low‐Coherence Enhanced Backscattering Spectroscopy Probe for Cancer Screening." Poster ~BTuF10, OSA ~BioMed Topical Meeting, March, 2008.
# J. D. Rogers, T. S. Tkaczyk, M. S. Rahman, R. R. ~Richards-Kortum, T. C. Christenson, M. R. Descour, “Integrated miniature microscope with structured illumination for in vivo microscopy.” Optical Diagnostic Imaging from Bench to Bedside at the National Institutes of Health, (2006).
#J. D. Rogers, T. S. Tkazcyk, M. R. Descour, A. H. O. Kärkkäinen, M. S. Rahman and R. ~Richards-Kortum, “Imaging with a miniature microscope constructed from grayscale lithographically patterned refractive microlenses.” OSA Topical Meeting on Diffractive Optics and Micro Optics (2004).
# J. D. Rogers, J. Lee, A. H. O. Kärkkäinen, T. Tkaczyk, M. R. Descour, “Gray-scale lithographic fabrication of optomechanical features using hybrid sol-gel glass for precision assembly of miniature imaging systems.” SPIE Annual Meeting: Gradient Index, Miniature, and Diffractive Optical Systems III. Proceedings of SPIE 5177 (2003).
# J. D. Rogers, T. Tkazcyk, M. R. Descour, T. R. Christenson, “Characterization and testing of a MEMS scanning grating for structured illumination in a miniature microscope.” FIO and Laser Science, OSA Anual Meeting, Oct. 5-9, 2003.
# J. D. Rogers, C. Liang, A. H. Kärkkäinen, M. R. Descour, “Fabrication and assembly of microoptical imaging systems.” Photonics West, SPIE, (2002).
#J. D. Rogers, M. R. Descour, A. H. O. Kärkkäinen, R. J. Shul, C. G. Willison, C. P. Tigges, “Fabrication and assembly of miniature imaging systems using lithographically patterned microoptics and silicon microstructures.” OSA Topical Meeting on Diffractive Optics and Micro Optics (2002).
#J. D. Rogers, C. Ftaclas, “Coronagraphs for Small Telescopes.” American Astronomical Society Meeting Abstracts, 194 (1999).

!!Patents
* ''US Patent 7,652,772''  //Systems, Methods, and Apparatuses of Low-coherence Enhanced Backscattering Spectroscopy.//
* ''US Patent 8,131,348''  //Systems, Methods, and Apparatuses of Elastic Light Scattering Spectroscopy and Low-coherence Enhanced Backscattering Spectroscopy.//

!!Book Chapters

*//Advances in FDTD Computational Electrodynamics: Photonics and Nanotechnology//, Chapter 14, "Computational Optical Imaging Using the ~Finite-Difference ~Time-Domain Method," Ilker R. Capoglu, Jeremy D. Rogers, Allen Taflove, and Vadim Backman, ed. A. Taflove, A. Oskooi, and S. G. Johnson, Artech House, (2013).
*//Advances in FDTD Computational Electrodynamics: Photonics and Nanotechnology//, Chapter 16, "FDTD and PSTD Applications in Biophotonics," Ilker R. Capoglu, Jeremy D. Rogers, César Méndez Ruiz, Jamesina J. Simpson, Snow H. Tseng, Kun Chen, Ming Ding, Allen Taflove, and Vadim Backman, ed. A. Taflove, A. Oskooi, and S. G. Johnson, Artech House, (2013).

*//Biomedical Applications of Light Scattering//, Chapter 2, "Light Scattering from Continuous Random Media," İlker R. Çapoğlu, Jeremy D. Rogers, and Vadim Backman, ed. A. Wax, V. Backman, ~McGraw Hill, (2009).
*//Biomedical Applications of Light Scattering//, Chapter 14, "Enhanced Backscattering and """Low-Coherence""" Enhanced Backscattering Spectroscopy," J. D. Rogers, Vladimir Turzhitsky, Young. Kim, Vadim Backman, ed. A. Wax, V. Backman, ~McGraw Hill, (2009).

!!Dissertation
[[PDF|jdrdiss2006.pdf]] //Miniature microscope design and construction based on tilted rotationally asymmetric printed lenses//, University of Arizona, 2006.

<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
Refractometry is the measurement of refractive index. Measuring refractive index of bulk materials is done with tools such as an Abbe Refractometer. Measuring the distribution of R.I. in cells is more difficult because if the spatial variation of R.I. at small length scales not much larger than the wavelength of visible light. There have been some notable methods developed based on scattered light and various forms of interferometry. Here is a list of references and links to various relevant work:

!!Refractive index of materials and cell components
* [[Dissertation, A. Dunn|http://www.nmr.mgh.harvard.edu/~adunn/papers/dissertation/node7.html]] - Table 1.1 contains a compiled list of previously published refractive index values for various cell components.
* 

!!Refractometry methods for cells and tissue
*[[Tomographic phase microscopy|http://www.nature.com/nmeth/journal/v4/n9/full/nmeth1078.html#B4]] - Choi / Feld //Nature Methods// paper 2007
*

!!
<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
/%
|Name|ReplaceDoubleClick|
|Source|http://www.TiddlyTools.com/#ReplaceDoubleClick|
|Version|2.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides|tiddler background click and doubleclick handlers|
|Description|disable doubleclick-to-edit-tiddler or replace doubleclick with shift/ctrl/alt+singleclick|

Usage:
	in tiddler content:
		<<tiddler ReplaceDoubleClick>> or
		<<tiddler ReplaceDoubleClick with: key trigger>>
	in ViewTemplate:
		<span macro="tiddler ReplaceDoubleClick"></span> or
		<span macro="tiddler ReplaceDoubleClick with: key trigger"></span>
where: 
	'key' (optional) is one of: none (default), ctrl, shift, or alt
	'trigger' (optional) is one of: click, doubleclick (default)

* if no key parameter (or "none") is specified, then the double-click action is **disabled** for that tiddler.
* if a key (other than none) is specified, the doubleclick action for the tiddler will only be invoked
	when the key+trigger combination is used.
* note: double-clicking will also trigger the single-click handler.  As a result, when 'click' option is specified,
	either click OR double-click (plus the specified key) will trigger the action.

Revisions:
2.0.0 renamed from ShiftClickToEdit and merged with DoubleClickDisable and added support specifying alternative key+click combination

%/<script>
	var here=story.findContainingTiddler(place); if (!here) return;
	if (here.ondblclick) {
		here.setAttribute("editKey","none");
		if ("$1"=="shift" || "$1"=="ctrl" || "$1"=="alt")
			here.setAttribute("editKey","$1"+"Key");
		var trigger=("$2"=="click")?"onclick":"ondblclick";
		here.save_dblclick=here.ondblclick;
		here.ondblclick=null;
		if (here.getAttribute("editKey")!="none")
			here[trigger]=function(e) {
				var ev=e?e:window.event;
				if (ev[this.getAttribute("editKey")])
					this.save_dblclick.apply(this,arguments);
			}
	}
</script>
Research in the Rogers lab explores the exciting ways in which we can use imaging and optics to enable discoveries in biology and medicine and to improve screening, diagnosis, and medical care. By combining aspects of theoretical modeling, computational simulation, and development of new optical instruments, we work to advance the state of the art and develop new medical technologies for a wide range of applications. 

[img[images/RogersLabOCTsystem_sm.jpg]]

!!Applications
Current research projects include:  [>img[images/Retina_combinedSHG_Fl_2.png]] 
* Fiber optic probe development for cancer screening and risk stratification through detection\\
 of field carcinogenesis via Enhanced Backscattering Spectroscopy
* Quantification of lipofucsin autofluorescence spectral changes in Age-related Macular Degeneration
* Imaging metabolic activity in differentiating retinal stem cells //in vitro//
* Optical metrology of scattering properties of tissue

Optical methods used in our research include:
* Microscopy
* Spectroscopy 
* Polarization imaging
* Coherent or Enhanced Backscattering
* Interferometry and holography
* Optical coherence tomography

!!Theory
[<img[images/Bnr.png]] 
As light propagates through tissue, the structure, distribution, and composition of cells, organelles, and extracellular matrix cause the light to be absorbed and scattered. By quantifying these scattering and absorption properties, we gain a wealth of information about the tissue composition. To relate the measured optical properties to tissue structure, we employ theoretical models based on a mass fractal organization of tissue. 
/%Developed a mass fractal model of tissue using """Whittle-Matern""" correlation function to describe the refractive index correlation function. When scattering is weak, the "Born approximation" or """"Rayleigh-Gans-Debye"""" approximation is valid and the differential scattering cross section (scattering as a function of angle) can be computed by taking the Fourier transform of the refractive index correlation function. This can be done analytically for some types of media, but is often a numerical solution. The most common model of light scattering in tissue is the semi-empirical """Henyey-Greenstein""" phase function that describes the probability distribution of angular scattering. This function is used in Monte Carlo simulations and provides reasonable agreement with experiments. However, it only works for scalar waves, cannot reproduce the donut shaped dipole component of scattering, and does not include the wavelength dependent falloff of scattering observed in tissue. The fractal model assumes that some degree of self-similarity across different length scales in tissue can result in a power-law correlation function. The """Whittle-Matern""" model provides more flexibility in modeling tissue and when applied to Monte Carlo  simulations, has been shown to agree well with measurements using enhance backscattering.%/
See for example:
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6589943

!!Simulation 
Simulating radiative transport in random media can be done in several ways. Analytical solutions only exist for very specialized geometries, so more general modeling uses either approximations (diffusion approximation, etc) or numerical solutions. Monte Carlo (MC) simulations have proven to be an effective and flexible method for computing a numerical solution to the radiative transport equation. An outstanding resource for Monte Carlo modeling of tissue, and THE place to start is the [[Oregon Medical Laser Center|http://omlc.ogi.edu/software/mc/]] with great documentation and opensource code you can download and modify to suite your needs. 

Our contributions to MC include:
* Monte Carlo modeling of light transport in random/turbid media [>img[images/ebs_notationdia.png]]
* Numerical simulation of [[LEBS]]
* [[Parallel Monte Carlo]] for HPC clusters using openMPI
* Add signal handling to allow interruptible or timed simulations instead of fixed number of rays/photons

We are also working to implement MC on High Throughput Computational (HTC) facilities such as [[open science grid|http://www.opensciencegrid.org/]].  

See for example:
[[Andrew Radosevich's website|http://goo.gl/ZVd45Y]] with open source code and Matlab scripts
http://biomedicaloptics.spiedigitallibrary.org/article.aspx?articleid=1389289
http://www.sciencedirect.com/science/article/pii/B9780444594228000011

!!Experiment
* Experimental [[LEBS]]  
* Spectral microscopy
* Optical metrology
* [[Refractometry]] of cells

!!Design and engineering
* Raytracing and optical design
* Building prototype fiber optic probes for //in vivo// clinical trials
* Stray light analysis and reduction in endoscopic instruments

/%
Optical phenomena:
I am generally interested in developing quantitative methods of measuring biological materials. Besides basic scattering, I have been very interested in several phenomena because of the potential to exploit them to this purpose.

1. Polarization is useful because the process of scattering changes the polarization state in well defined ways. By using specific polarization states, light propagation depth or length scales can be somewhat controlled. This has advantages in isolating optical signal that has interacted with shallower or deeper tissue. As an example, polarization gating allows isolation of the component of diffusely reflected light that travelled only within the epithelium, the surface region of many organs where cancer originates.
http://www.opticsinfobase.org/abstract.cfm?URI=ao-47-32-6046

2. Spectroscopy of fluorophores in tissue has the potential to provide information about the chemistry with a tissue. This is particularly useful for endogenous fluorophores like NADH and FAD which can provide information about the metabolic state of a cell. However, much of my work in spectroscopy centers on the wavelength dependence of elastic light scattering. That is, the spectroscopy of diffuse scattering in tissue. This can be analyzed to determine tissue properties such as fractal dimension.
http://www.opticsinfobase.org/oe/abstract.cfm?uri=oe-21-7-9043
http://www.pnas.org/content/105/51/20118.abstract

3. Enhanced backscattering is a unique phenomena 
%/

<<tiddler HideTiddlerTags>>
<<tiddler HideTiddlerSubtitle>>
<<tiddler HideTiddlerToolbar>>
A list of some useful links to other resources.
!! Affilliations
* [[Laboratory for Optical and Computational Instrumentation|http://loci.wisc.edu]]
* [[McPherson Eye Research Institute|http://vision.wisc.edu]]

!! Collaborators
* [[Vadim Backman Biophotonics Lab at Northwestern University|http://biophotonics.bme.northwestern.edu/]]
* [[Paul Campagnola Lab at UW-Madison|http://campagnola.molbio.wisc.edu/]]

!!Code and software
*List of Optical Design Software: http://www.optenso.com/links/links.html
*Code for Monte Carlo, Mie scattering, and inverse scattering: http://omlc.ogi.edu/software/
*[[Andrew Radosevich|https://goo.gl/9gfhwq]]'s homepage with matlab tools and opensource Monte Carlo for simulating or processing EBS data

!!Writing
*Latex for NIH grants: http://www.cs.duke.edu/brd/NIH/tips/
*Latex for NSF grants: https://math.mit.edu/services/grants/index.php

*Bibtex entries from ISBN numer: http://manas.tungare.name/software/isbn-to-bibtex/ 
*Bibtex entries (or Endnote, Refman, Refworks, etc) can be generated by http://scholar.google.com by editing preferences

<<tiddler HideTiddlerTags>><<tiddler HideTiddlerSubtitle>><<tiddler HideTiddlerToolbar>>
/***
|Name|SinglePageModePlugin|
|Source|http://www.TiddlyTools.com/#SinglePageModePlugin|
|Documentation|http://www.TiddlyTools.com/#SinglePageModePluginInfo|
|Version|2.9.6|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler(), Story.prototype.displayTiddlers()|
|Options|##Configuration|
|Description|Show tiddlers one at a time with automatic permalink, or always open tiddlers at top/bottom of page.|
This plugin allows you to configure TiddlyWiki to navigate more like a traditional multipage web site with only one tiddler displayed at a time.
!!!!!Documentation
>see [[SinglePageModePluginInfo]]
!!!!!Configuration
<<<
<<option chkSinglePageMode>> Display one tiddler at a time
><<option chkSinglePagePermalink>> Automatically permalink current tiddler
><<option chkSinglePageKeepFoldedTiddlers>> Don't close tiddlers that are folded
><<option chkSinglePageKeepEditedTiddlers>> Don't close tiddlers that are being edited
<<option chkTopOfPageMode>> Open tiddlers at the top of the page
<<option chkBottomOfPageMode>> Open tiddlers at the bottom of the page
<<option chkSinglePageAutoScroll>> Automatically scroll tiddler into view (if needed)

Notes:
* The "display one tiddler at a time" option can also be //temporarily// set/reset by including a 'paramifier' in the document URL: {{{#SPM:true}}} or {{{#SPM:false}}}.
* If more than one display mode is selected, 'one at a time' display takes precedence over both 'top' and 'bottom' settings, and if 'one at a time' setting is not used, 'top of page' takes precedence over 'bottom of page'.
* When using Apple's Safari browser, automatically setting the permalink causes an error and is disabled.
<<<
!!!!!Revisions
<<<
2008.10.17 [2.9.6] changed chkSinglePageAutoScroll default to false
| Please see [[SinglePageModePluginInfo]] for previous revision details |
2005.08.15 [1.0.0] Initial Release.  Support for BACK/FORWARD buttons adapted from code developed by Clint Checketts.
<<<
!!!!!Code
***/
//{{{
version.extensions.SinglePageModePlugin= {major: 2, minor: 9, revision: 6, date: new Date(2008,10,17)};
//}}}
//{{{
config.paramifiers.SPM = { onstart: function(v) {
	config.options.chkSinglePageMode=eval(v);
	if (config.options.chkSinglePageMode && config.options.chkSinglePagePermalink && !config.browser.isSafari) {
		config.lastURL = window.location.hash;
		if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
	}
} };
//}}}
//{{{
if (config.options.chkSinglePageMode==undefined)
	config.options.chkSinglePageMode=false;
if (config.options.chkSinglePagePermalink==undefined)
	config.options.chkSinglePagePermalink=true;
if (config.options.chkSinglePageKeepFoldedTiddlers==undefined)
	config.options.chkSinglePageKeepFoldedTiddlers=false;
if (config.options.chkSinglePageKeepEditedTiddlers==undefined)
	config.options.chkSinglePageKeepEditedTiddlers=false;
if (config.options.chkTopOfPageMode==undefined)
	config.options.chkTopOfPageMode=false;
if (config.options.chkBottomOfPageMode==undefined)
	config.options.chkBottomOfPageMode=false;
if (config.options.chkSinglePageAutoScroll==undefined)
	config.options.chkSinglePageAutoScroll=false;
//}}}
//{{{
config.SPMTimer = 0;
config.lastURL = window.location.hash;
function checkLastURL()
{
	if (!config.options.chkSinglePageMode)
		{ window.clearInterval(config.SPMTimer); config.SPMTimer=0; return; }
	if (config.lastURL == window.location.hash) return; // no change in hash
	var tids=decodeURIComponent(window.location.hash.substr(1)).readBracketedList();
	if (tids.length==1) // permalink (single tiddler in URL)
		story.displayTiddler(null,tids[0]);
	else { // restore permaview or default view
		config.lastURL = window.location.hash;
		if (!tids.length) tids=store.getTiddlerText("DefaultTiddlers").readBracketedList();
		story.closeAllTiddlers();
		story.displayTiddlers(null,tids);
	}
}


if (Story.prototype.SPM_coreDisplayTiddler==undefined)
	Story.prototype.SPM_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly)
{
	var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
	var tiddlerElem=document.getElementById(story.idPrefix+title); // ==null unless tiddler is already displayed
	var opt=config.options;
	var single=opt.chkSinglePageMode && !startingUp;
	var top=opt.chkTopOfPageMode && !startingUp;
	var bottom=opt.chkBottomOfPageMode && !startingUp;
	if (single) {
		story.forEachTiddler(function(tid,elem) {
			// skip current tiddler and, optionally, tiddlers that are folded.
			if (	tid==title
				|| (opt.chkSinglePageKeepFoldedTiddlers && elem.getAttribute("folded")=="true"))
				return;
			// if a tiddler is being edited, ask before closing
			if (elem.getAttribute("dirty")=="true") {
				if (opt.chkSinglePageKeepEditedTiddlers) return;
				// if tiddler to be displayed is already shown, then leave active tiddler editor as is
				// (occurs when switching between view and edit modes)
				if (tiddlerElem) return;
				// otherwise, ask for permission
				var msg="'"+tid+"' is currently being edited.\n\n";
				msg+="Press OK to save and close this tiddler\nor press Cancel to leave it opened";
				if (!confirm(msg)) return; else story.saveTiddler(tid);
			}
			story.closeTiddler(tid);
		});
	}
	else if (top)
		arguments[0]=null;
	else if (bottom)
		arguments[0]="bottom";
	if (single && opt.chkSinglePagePermalink && !config.browser.isSafari) {
		window.location.hash = encodeURIComponent(String.encodeTiddlyLink(title));
		config.lastURL = window.location.hash;
		document.title = wikifyPlain("SiteTitle") + " - " + title;
		if (!config.SPMTimer) config.SPMTimer=window.setInterval(function() {checkLastURL();},1000);
	}
	if (tiddlerElem && tiddlerElem.getAttribute("dirty")=="true") { // editing... move tiddler without re-rendering
		var isTopTiddler=(tiddlerElem.previousSibling==null);
		if (!isTopTiddler && (single || top))
			tiddlerElem.parentNode.insertBefore(tiddlerElem,tiddlerElem.parentNode.firstChild);
		else if (bottom)
			tiddlerElem.parentNode.insertBefore(tiddlerElem,null);
		else this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
	} else
		this.SPM_coreDisplayTiddler.apply(this,arguments); // let CORE render tiddler
	var tiddlerElem=document.getElementById(story.idPrefix+title);
	if (tiddlerElem&&opt.chkSinglePageAutoScroll) {
		// scroll to top of page or top of tiddler
		var isTopTiddler=(tiddlerElem.previousSibling==null);
		var yPos=isTopTiddler?0:ensureVisible(tiddlerElem);
		// if animating, defer scroll until after animation completes
		var delay=opt.chkAnimate?config.animDuration+10:0;
		setTimeout("window.scrollTo(0,"+yPos+")",delay); 
	}
}

if (Story.prototype.SPM_coreDisplayTiddlers==undefined)
	Story.prototype.SPM_coreDisplayTiddlers=Story.prototype.displayTiddlers;
Story.prototype.displayTiddlers = function() {
	// suspend single/top/bottom modes when showing multiple tiddlers
	var opt=config.options;
	var saveSPM=opt.chkSinglePageMode; opt.chkSinglePageMode=false;
	var saveTPM=opt.chkTopOfPageMode; opt.chkTopOfPageMode=false;
	var saveBPM=opt.chkBottomOfPageMode; opt.chkBottomOfPageMode=false;
	this.SPM_coreDisplayTiddlers.apply(this,arguments);
	opt.chkBottomOfPageMode=saveBPM;
	opt.chkTopOfPageMode=saveTPM;
	opt.chkSinglePageMode=saveSPM;
}
//}}}
Biomedical Optics and Biophotonics<<tiddler ToggleRightSidebar with: ".">>
Rogers Lab
/*{{{*/
/*Mocha TiddlyWiki Theme*/
/*Version 1.0*/
/*Design and CSS originally by Anthonyy, ported to TiddlyWiki by Saq Imtiaz.*/
/*}}}*/
/*{{{*/
 #contentWrapper{
margin: 0 3.4em;

			font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif; /* Lucida Grande for the Macs, Tahoma for the PCs */
font-size: 14px;
			line-height: 1.6em;
			color: #666;
}

.header {
 background: #fff; 
			padding-top: 10px;
			clear: both;

border-bottom: 4px solid #948979;
}

.headerShadow {	padding: 2.6em 0em 0.5em 0em; }

.siteTitle {
			font-family: 'Trebuchet MS' sans-serif;
			font-weight: bold;
			font-size: 32px;
			color: #A00000;
			margin-bottom: 30px;
			background-color: #FFF;
}

.siteTitle a{color:#A00000; border-bottom:1px dotted #A00000;}

.siteSubtitle {
	font-size: 1.0em;
        display: block;
        margin: .5em 3em; color: #999999;
}

#mainMenu {
position:relative;
float:left;
margin-bottom:1em;
display:inline;
text-align:left;
padding: 2em 0.5em 0.5em 0em;
width:13em;
font-size:1em;
}

#sidebar{
position:relative;
float:right;
margin-bottom:1em;
padding-top:2em;
display:inline;

}

#displayArea {
	margin: 0em 17em 0em 15em;
}

.tagClear {clear:none;}

#contentFooter {background:#575352; color:#BFB6B3; clear: both; padding: 0.5em 1em;}

		
		#contentFooter a {
			color: #BFB6B3;
			border-bottom: 1px dotted #BFB6B3;
		}
		
		#contentFooter a:hover {
			color: #FFFFFF;
			background-color:#575352;
		}

		a,#sidebarOptions .sliderPanel a{
			color:#A00000;
			text-decoration: none;
		}

		a:hover,#sidebarOptions .sliderPanel a:hover {
			color:#A00000;
			background-color: #F5F5F5; 
		}

.viewer .button, .editorFooter .button{
	color: #666;
	border: 1px solid #A00000;
}

.viewer .button:hover, 
.editorFooter .button:hover{
	color: #fff;
	background: #A00000;
	border-color: #A00000;
}

.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#575352;border-color:#575352;}


		#mainMenu a {
			display: block;
			padding: 5px;
			border-bottom: 1px solid #CCC;
		}

		#mainMenu a:link, #navlist a:visited {
			color:#A00000;
			text-decoration: none;
		}
		
		#mainMenu a:hover {
			background: #000000 url(arrow.gif) 96% 50% no-repeat;
			background-color: #F5F5F5;
			color:#A00000;
		}
		
		#mainMenu a:hover, #mainMenu a:active, #mainMenu .highlight, #mainMenu .marked {
			background: #000000 url(arrow.gif) 96% 50% no-repeat;
			background-color: #F5F5F5;
			color:#A00000;
		}

#mainMenu span {position:relative;}

#mainMenu br {display:none;}

#sidebarOptions a {
			color:#999;
			text-decoration: none;
		}

#sidebarOptions	a:hover {
			color:#4F4B45;
			background-color: #F5F5F5;border:1px solid #fff;
		}

#sidebarOptions {line-height:1.4em;}

		.tiddler {
			padding-bottom: 40px;
			border-bottom: 1px solid #DDDDDD; 
		}
.title {color:#A00000;}
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#948979;}

.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#4F4B45; background:transparent;border:1px solid #fff;}

.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#4F4B45; background:transparent;border:1px solid #fff;}

 .listLink,#sidebarTabs .tabContents {line-height:1.5em;}
 .listTitle {color:#888;}

#sidebarTabs .tabContents {background:#fff;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#4F4B45;background:#fff}

#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#4F4B45;background:#fff}

.tabSelected{color:#fff; background:#948979;}

.tabUnselected {
 background: #ccc;
}

 .tabSelected, .tabSelected:hover {
 color: #fff;
 background: #948979;
 border: solid 1px #948979;
padding-bottom:1px;
}

 .tabUnselected {
 color: #999;
 background: #eee;
 border: solid 1px #ccc;
padding-bottom:1px;
}

#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}


#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}

#sidebarOptions .sliderPanel {
	background: #fff; border:none;
	font-size: .9em;
}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebarOptions .sliderPanel input {border:1px solid #999;}

.viewer blockquote {
	border-left: 3px solid #948979;
}

.viewer table {
	border: 2px solid [[ColorPalette::TertiaryDark]];
}

.viewer th, thead td {
	background: #948979;
	border: 1px solid #948979;
	color: #fff;
}
.viewer pre {
	border: 1px solid #948979;
	background: #f5f5f5;
}

.viewer code {
	color: #2F2A29;
}

.viewer hr {
	border-top: dashed 1px #948979;
}

.editor input {
	border: 1px solid #948979;
}

.editor textarea {
	border: 1px solid #948979;
}

.popup {
	background: #948979;
	border: 1px solid #948979;
}

.popup li.disabled {
	color: #000;
}

.popup li a, .popup li a:visited {
	color: #eee;
	border: none;
}

.popup li a:hover {
	background: #575352;
	color: #fff;
	border: none;
}

.tagging, .tagged {
	border: 1px solid #eee;
	background-color: #F7F7F7;
}

.selected .tagging, .selected .tagged {
	background-color: #eee;
	border: 1px solid #BFBAB3;
}

 .tagging .listTitle, .tagged .listTitle {
	color: #bbb;
}

.selected .tagging .listTitle, .selected .tagged .listTitle {
	color: #666; 
}

.tagging .button, .tagged .button {
		color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
		color:#4F4B45;
}

.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}

.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
		border: none; background:transparent; text-decoration:underline; color:#000;
}

h1,h2,h3,h4,h5 { color: #666; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}

#messageArea {
	border: 4px solid #948979;
	background: #f5f5f5;
	color: #999;
        font-size:90%;
}

#messageArea a:hover { background:#f5f5f5;}

#messageArea .button{
	color: #666;
	border: 1px solid #CC6714;
}

#messageArea .button:hover {
	color: #fff;
	background: #948979;
	border-color: #948979;
}


* html .viewer pre {
	margin-left: 0em;
}

* html .editor textarea, * html .editor input {
	width: 98%;
}

.searchBar {float:right;font-size: 1.0em;}
.searchBar .button {color:#999;display:block;}
.searchBar .button:hover {border:1px solid #fff;color:#4F4B45;}
.searchBar input {			
                        background-color: #FFF;
			color: #999999;
			border: 1px solid #CCC;		margin-right:3px;
}

#sidebarOptions .button:active, #sidebarOptions .highlight {background:#F5F5F5;}

*html #contentFooter { padding:0.25em 1em 0.5em 1em;}

#noticeBoard {font-size: 0.9em; color:#999; position:relative;display:block;background:#fff; clear: both; margin-right:0.5em; margin-top:60px; padding:5px; border-bottom: 1px dotted #CCC; border-top: 1px dotted #CCC;}
#mainMenu #noticeBoard a,#mainMenu #noticeBoard .tiddlyLink {display:inline;border:none;padding:5px 2px;color:#DF9153 }
#noticeBoard a:hover {border:none;}	

#noticeBoard br {display:inline;}

#mainMenu #noticeBoard  .button{
	color: #666;
	border: 1px solid #DF9153;padding:2px;
}

#mainMenu #noticeBoard  .button:hover{
	color: #fff;
	background: #DF9153;
	border-color: #DF9153;
}

.searchbar {position:relative; width:11em;}
.searchbar .button{margin:0; width:11em;}
#header {display:block;}  /%#header {display:inline-block;}    %/ /%commented out to fix firefox 3.5.2 -- jDR %/ 

%/ added for |borderless|k in tables /%
.imgfloatleft{float:left;} .imgfloatright{float:right;padding:5px} .imgfloatcenter{float:center;} 
.borderlessL, .borderlessL table, .borderlessL td, .borderlessL tr, .borderlessL th, .borderlessL tbody { border:0 !important; margin:0 !important; padding:0 !important; td.vertical-align:top !important;margin-left: 0 !important; margin-right: auto !important; padding:7px !important;} 

/*}}}*/
/%
|Name|ToggleRightSidebar|
|Source|http://www.TiddlyTools.com/#ToggleRightSidebar|
|Version|2.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and [[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires|InlineJavascriptPlugin|
|Overrides||
|Description|show/hide right sidebar (MainMenu)|

Usage: <<tiddler ToggleRightSidebar with: "label">>

Config settings:
	config.options.chkShowRightSidebar (true)
	config.options.txtToggleRightSideBarLabelShow (䩊	config.options.txtToggleRightSideBarLabelHide (ꩊ
%/<script label="$1" title="show/hide right sidebar content">
	var co=config.options;
	if (co.chkShowRightSidebar=='undefined') co.chkShowRightSidebar=true;
	co.chkShowRightSidebar=!co.chkShowRightSidebar;
	var sb=document.getElementById('sidebar'); if (!sb) return;
	sb.style.display=co.chkShowRightSidebar?'block':'none';
	document.getElementById('displayArea').style.marginRight=co.chkShowRightSidebar?'':'1em';
	saveOptionCookie('chkShowRightSidebar');
	var labelShow=co.txtToggleRightSideBarLabelShow||'&#x25C4;';
	var labelHide=co.txtToggleRightSideBarLabelHide||'&#x25BA;';
	if (typeof(place)!='undefined' && '$1'=='$'+'1') {
		place.innerHTML=co.chkShowRightSidebar?labelHide:labelShow;
		place.title=(co.chkShowRightSidebar?'hide':'show')+' right sidebar';
	}
	var sm=document.getElementById('storyMenu'); if (sm) config.refreshers.content(sm);
</script><script>
	var co=config.options;
	if (co.chkShowRightSidebar=='undefined') co.chkShowRightSidebar=true;
	var sb=document.getElementById('sidebar'); if (!sb) return;
	sb.style.display=co.chkShowRightSidebar?'block':'none';
	document.getElementById('displayArea').style.marginRight=co.chkShowRightSidebar?'':'1em';
	if ('$1'=='$'+'1') {
		var labelShow=co.txtToggleRightSideBarLabelShow||'&#x25C4;';
		var labelHide=co.txtToggleRightSideBarLabelHide||'&#x25BA;';
		place.lastChild.innerHTML=co.chkShowRightSidebar?labelHide:labelShow;
		place.lastChild.title=(co.chkShowRightSidebar?'hide':'show')+' right sidebar';
	}
</script>
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<span macro="tiddler ReplaceDoubleClick with: shift doubleclick"></span>
<!--}}}-->
This webpage is a single file called a [[TiddlyWiki|http://www.tiddlywiki.com]] ɠOsmosoft version <<version>>
{{{
% Find the center of the peak of a 2D peaked array
% There are two forms of this function depending on the number of
% arguments used to call it:
% (1) if called with 2 args, first smooth by convolution to make this 
% routine insensative to noise, then find the max of the smoothed array 
% (2) if called with 4 args, a faster averaging method is used, where the 
% rows are summed to find the peak in x, then the cols are summed to find
% the peak in y. The only problem with this method is that if there is an 
% inverse peak (dip) that lines up in x or y with the peak, they will
% cancel and the peak will not be located. To account for this, the extra
% args are the approximate position of the peak and the array is only
% summed over the smoothsize width around the peak position.
%
% written by Jeremy D. Rogers on June 30, 2009 (20090630)
% last updated: 20090916 by: jdrogers
%
% Notes: 

function center = findpeak(a, smoothsize, r,c)
if (nargin == 2)
   % convolution with a box is an effective smoothing method
   %a=convn(a,ones(smoothsize)/smoothsize,'same');
   
   %n = [4*smoothsize 4*smoothsize];
   %sigma = smoothsize;
   %h = fspecial('gaussian',n,sigma);
   a=filter2(ones(smoothsize),a);
   
   [y,x]=find(a==max(max(a)));
end
if (nargin == 4)
   sm=round(smoothsize/2);
   y=find(sum(a((c-sm):(c+sm),(r-sm):(r+sm)),2)==max(sum(a((c-sm):(c+sm),(r-sm):(r+sm)),2)))+(c-sm);
   x=find(sum(a((c-sm):(c+sm),(r-sm):(r+sm)),1)==max(sum(a((c-sm):(c+sm),(r-sm):(r+sm)),1)))+(r-sm);
end
center = [x,y];

}}}
//{{{
//This ensures that the footer sticks to the bottom of the screen when there are no tiddlers open. If that is not desirable, it can be deleted.
function setFooter() {
         if (document.getElementById && document.getElementById("contentFooter") ) {
            var windowHeight=findWindowHeight();
         if (windowHeight>0) {
            var contentHeight= document.getElementById('mainMenu').offsetHeight + document.getElementById("header").offsetHeight + document.getElementById("contentFooter").offsetHeight;
            var menu= document.getElementById('mainMenu');
            if (windowHeight-(contentHeight)>=0) {
               menu.style.position='relative';
               menu.style.marginBottom=(windowHeight-(contentHeight))+'px';
               }
            else {
                 menu.style.position='';
                 menu.style.marginBottom='';
                 }
            }
         }
}
window.onresize = function() {
  setFooter();
}

Story.prototype.refreshTiddler_footerhack=Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title,template,force)
{    
var theTiddler = Story.prototype.refreshTiddler_footerhack.apply(this,arguments);
setFooter();
   return theTiddler;}

//}}}
{{{
% function to find a rotational average around a center point from a 2D arr
% rotational averaging about center (c1,c2) with sub array of length (len)
%
% written by Jeremy D. Rogers on June 30, 2009 (20090630)
% last updated: 20090630 by: jdrogers
%
% Notes: may want to try to further vectorize this to avoid the for loop 

function ravg = rotavg(a2, len, c1, c2)
a2sub = a2((c2-len):(c2+len),(c1-len):(c1+len));

dist = ((-len:len)'*(ones(1,2*len+1))).^2;dist = (dist+dist').^.5;
dist = round(dist)+1; % round to nearest pixel and add 1 (start index)

% masking corners should not be necessary
%mask=dist;mask(dist<len)=1;mask(dist>=len)=0; % create mask for zeroing corners
%dist(dist>N)=N; % keep index values from exceeding 1D matrix dimension

ravg = 1:len+1;
for i=1:len+1
    ravg(i)=mean(a2sub(dist==i));
end
}}}
//{{{
config.options.chkSinglePageMode = true;
config.options.chkSinglePagePermalink = true;
config.options.chkShowRightSidebar = false;
//}}}