In the middle of the desert you can say anything you want
This doesn’t work on SVGs for me:
![](images/02/svgs/02_seqsiii.svg){.absolute top=0 left=0}
This does:
::: {.absolute top=0 left=0}
![](images/02/svgs/02_seqsiii.svg)
:::
SO.
One can literally generate a plot w/ graphviz, export as svg, open and edit in inkscape, save as optimized svg, paste into quarto, and manually add the correct class="fragment" data-fragment-index=4
bits to the relevant groups.
Insert with the usual {=html} thing.
Damn.
almost works with quarto, except that line.position needs to be called on slide change — ergo likely won’t work in pdf export mode.
maurosilber/pyfragments: Animated figures for Quarto installs as-is
IT WORKS FOR PDF MODE TOO! And uses fragments
# | fig-width: 15
# | fig-height: 10
# | output: asis
import matplotlib.pyplot as plt
from pyfragments import AnimatedFigure
with AnimatedFigure() as ani:
# Data for plotting
train_loss = [1.0, 0.6, 0.3, 0.2, 0.1]
val_loss = [1.2, 0.8, 0.5, 0.4, 0.6]
iterations = [1, 2, 3, 4, 5]
plt.xlim(0, 6)
plt.ylim(0, 1.5)
# Labels and legend
plt.xlabel('Trainingsiterationen', fontsize=14)
plt.ylabel('Loss', fontsize=14)
plt.legend(loc='upper right', fontsize=12)
# Plot
for x in range(len(train_loss)+1):
with ani.fragment():
plt.plot(iterations[:x], train_loss[:x], 'bo-', label='Training', linewidth=2)
plt.plot(iterations[:x], val_loss[:x], 'go-', label='Validation', linewidth=2)
# Add a dashed vertical line in the middle
mid_iteration = (iterations[0] + iterations[-1]) / 2
with ani.fragment():
plt.axvline(x=mid_iteration, color='r', linestyle='--', linewidth=1.5)
I couldn’t make a graph large enough to fill the screen, increasing fig-width didn’t help.
Solution: increase both fig-width and fig-height!
{dot}
//| fig-width: 12
//| fig-height: 9
digraph G {
rankdir=LR;
..
Execution Options – Quarto has figure options that lists the default sizes of figures based on output formats. Couldn’t find them because was looking in figures/graphviz etc. pages, not execution. …
For reveal slides, it’s 9 x 5.
Apparently it didn’t want to increase the 5 till I explicitly told it to, then width started increasing as well.
… are hard and you have to use a table.
digraph Neural_Network {
rankdir=LR;
ranksep=1.3;
node [shape=circle, style=filled, fontcolor=white, fontsize=25, fillcolor="blue", color="black"];
subgraph cluster_0 {
node [fillcolor="#2c3e50", style="filled"];
x1 [label=<
<TABLE border="0" cellborder="0" cellspacing="0">
<TR><TD rowspan="2" style="...">X</TD><TD style="...">1</TD></TR>
<TR> <TD style="...">1</TD></TR>
</TABLE>>];
x2 [label=<
<TABLE border="0" cellborder="0" cellspacing="0">
<TR><TD rowspan="2" style="...">X</TD><TD style="...">1</TD></TR>
<TR> <TD style="...">2</TD></TR>
</TABLE>>];
}
sum [label=<∑<FONT color="yellow" point-size="10">(⎰)</FONT>>, fillcolor="#27ae60", width=0.8, height=0.8, fixedsize=true];
y [label=<y<sup>1</sup>>];
edge [style=solid, color="#2c3e50"];
x2 -> sum;
x1 -> sum;
edge [style=solid, color="#27ae60"];
sum -> y;
{rank=same; x1; x2;}
}
NeuroMorph is a set of tools designed to import, analyze, and visualize mesh models in Blender. It has been developed specifically for the morphological analysis of 3D objects derived from serial electron microscopy images of brain tissue, but much of its functionality can be applied to any 3D mesh.
https://kitware.github.io/glance/doc/index.html
Comparison of Three 3D Segmentation Software Tools for Hip Surgical Planning - PMC: compares 3d slicer, Singo, and Materialize ↩︎ ↩︎
Comprehensive Review of 3D Segmentation Software Tools for MRI Usable for Pelvic Surgery Planning - PMC ↩︎ ↩︎
Commit messages starting with #14 whatever
are awkward as #
is the default comment in git rebase and friends.
git config core.commentchar ";"
fixes that for me.
For a one-time thing this works as well:
git -c core.commentChar="|" commit --amend
(escaping - Escape comment character (#) in git commit message - Stack Overflow)
Why is the number of voxels different from the number of matrices? - Support - 3D Slicer Community
>>> raw = getNode('probe1_0000.nii.gz')
>>> slicer.util.arrayFromVolume(raw).shape
(180, 180, 500)
>>>
doesn’t work for segmentations because not a volume.
Image dimensions can be seen from volume information And are identical in both segmentations and original
I found smoothing in view controllerS!
In Slice controllers there’s this arrow button that allows to set basically layers AND SMOOTHING per slice!
So everything is as expected wrt smoothing — there was none.
Zooming in slices w/ CTRL!
// ref: 240701-1752 NII MRI annotation tools
Importing 2x .nii as directory worked as-is
Volumes can do settings per file, incl.:
Volume renderings gives 3d views?
Annotations can be imported as annotations/segmentations through add data! Then they are parsed semantically
One can segment N slices and it magically creates a 3d shape out of it!
Exporting annos as nifti possible through “export” in Segmentation module 2(not Segment Editor!)
Formats (NITRC: dcm2nii: MainPage)
The DICOM standard is very complex, and different vendors have interpreted it differently. Accurate conversion to NIfTI format requires reading the vendor’s private tags.
Save a DICOM Data as a Nifti - Support - 3D Slicer Community ↩︎
Graphviz Online is a really nice viewer
edge [color="white"]
makes all child edges white, unless overwrittenI figured out this way to label different ranks by using an invisible pseudo-graph: viewer
This is the chunk:
subgraph labels {
edge [fontcolor="black"];
node [style="filled", fontcolor="black", fontsize=10];
node1 [label="Inputs"];
node2 [label="Weights"];
node3 [label="Sum"];
node4 [label="Activation\nfunction"];
node5 [label="Output"];
node1 -> node2 -> node3 -> node4 -> node5;
{rank=same; node1;n0;n1; n2; n3;}
{rank=same; node3;sum;}
}
Note using ranks to align inputs/sum to the correct level; also the use of \n
in the label.
xlabel
, and use HTML to make it a diff color than the main label.
dot - Graphviz: Putting a Caption on a Node In Addition to a Label - Stack Overflow
Graphviz: Distinct colors for xlabel and nodelabel - Stack Overflow