Skip to content

Commit

Permalink
Add MathJax to docs configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ScientistRachel committed Dec 16, 2024
1 parent 9e1c0a9 commit bdd79b2
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 16 deletions.
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ nav_external_links:
url: https://github.com/aicjanelia/LLSM
hide_icon: false # set to true to hide the external link icon - defaults to false
opens_in_new_tab: true # set to true to open this link in a new tab - defaults to false

math: mathjax
6 changes: 6 additions & 0 deletions docs/_includes/head_custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% assign math = page.math | default: layout.math | default: site.math %}

{% case math %}
{% when "mathjax" %}
{% include mathjax.html %}
{% endcase %}
9 changes: 9 additions & 0 deletions docs/_includes/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Automatically display code inside script tags with type=math/tex using MathJax -->
<script type="text/javascript" defer
src="/just-the-docs-tests/assets/js/mathjax-script-type.js">
</script>

<!-- Copied from https://docs.mathjax.org/en/latest/web/components/combined.html -->
<script type="text/javascript" id="MathJax-script" defer
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>
12 changes: 12 additions & 0 deletions docs/_layouts/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default
math: mathjax
---
<div style="display: none">
\(
<!-- optional definitions using \newcommand, etc.
see https://docs.mathjax.org/en/latest/input/tex/macros.html -->
\)
</div>

{{ content }}
18 changes: 18 additions & 0 deletions docs/assets/js/mathjax-script-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copied from https://docs.mathjax.org/en/latest/upgrading/v2.html#changes-in-the-mathjax-api
MathJax = {
options: {
renderActions: {
findScript: [10, function (doc) {
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
const display = !!node.type.match(/; *mode=display/);
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
const text = document.createTextNode('');
node.parentNode.replaceChild(text, node);
math.start = {node: text, delim: '', n: 0};
math.end = {node: text, delim: '', n: 0};
doc.math.push(math);
}
}, '']
}
}
};
32 changes: 17 additions & 15 deletions docs/flatfield/flatfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ When averaging the collected calibration images, it is best to use ImageJ's 32-b

To use, run the `flatfield_inputs.ijm` macro. A GUI will open, as shown in the figure below. You can specify the darkfield image in multiple ways: (i) use the `Browse` button to find the stack of darkfield images, (ii) copy the full path into the box, or (iii) simply drag and drop the image file onto the darkfield line of the GUI. Repeat this process for the flatfield stacks. Any channel entries without files will be ignored. The macro will average the stacks and save a file called *DarkAverage.tif* in the same folder as the input darkfield stack. The macro will then continue to perform the $I_N$ calculation, saving one *I_N_###.tif* file per channel in the same folder, with *###* specified by the values in the Channel input line of the macro GUI. These files can then be specified in the paths section of the pipeline configuration file to run the flatfield correction module.

![](FlatFieldGUI.png)
![](https://github.com/aicjanelia/LLSM/blob/master/docs/flatfield/FlatFieldGUI.png)

## Reference
$^1$ Hobson, C. M., Guo, M., Vishwasrao, H. D., Wu, Y., Shroff, H. and Chew, T.-L. (2022). Practical considerations for quantitative light sheet fluorescence microscopy. Nat Methods 1-12. [doi:10.1038/s41592-022-01632-x](https://doi.org/10.1038/s41592-022-01632-x)
Expand All @@ -35,20 +35,22 @@ $^1$ Hobson, C. M., Guo, M., Vishwasrao, H. D., Wu, Y., Shroff, H. and Chew, T.-
This is an example portion of a configuration file that sets up the inputs to the flatfield module and enables the module.

```json
"paths": {
"root": "/aic/instruments/llsm/pipeline-test/",
"flatfield": {
"dir": "Calibration",
"dark": "DarkAverage.tif",
"laser": {
"488": "I_N_488.tif",
"560": "I_N_560.tif"
}
}
},
"flatfield": {
"bit-depth": 16
}
{
"paths": {
"root": "/aic/instruments/llsm/pipeline-test/",
"flatfield": {
"dir": "Calibration",
"dark": "DarkAverage.tif",
"laser": {
"488": "I_N_488.tif",
"560": "I_N_560.tif"
}
}
},
"flatfield": {
"bit-depth": 16
}
}
```

### Command Line Example
Expand Down
2 changes: 1 addition & 1 deletion docs/mip/mip.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nav_order: 7
The `mip` module is run together with the other processing modules and will create MIPs for key modules that are run. For example, if running both `deskew` and `decon`, MIPs will be made for both. The subfolder created by `mip` will contain subfolders indicating which input images were used to create them (e.g., a `decon` subfolder). Inside this folder will be files that end with `mip_x`, `mip_y`, and `mip_z`. The dimension in the file name is the axes over which the images have been projected.


| Modules Enabled | MIPs created |
| Modules Enabled | MIPs Created |
| ----- | ----- |
| mip only | input images |
| flatfield| flatfield |
Expand Down

0 comments on commit bdd79b2

Please sign in to comment.