Skip to content

Commit

Permalink
Merge pull request #44 from bwheelz36/master
Browse files Browse the repository at this point in the history
some typos in geometry/patient
  • Loading branch information
jiperl committed Sep 15, 2021
2 parents 5a009db + 4639701 commit 42a3186
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
19 changes: 10 additions & 9 deletions parameters/geometry/patient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ The built-in Geant4 visualization tools do not perform well when a complex voxel

There is generally little value in showing all pixels of the image at once. Each slice just covers up the last slice. To instead show only a specific set of slices in any dimension::

iv:Gr/Patient/ShowSpecificSlicesZ = 4 1 3 9 12 # will only show slices 1, 3, 9 and 12.
iv:Ge/Patient/ShowSpecificSlicesZ = 4 1 3 9 12 # will only show slices 1, 3, 9 and 12.

Number of slices begins at number 1.
Number of slices begins at number 1. Note that the slice specification uses the `patient coordinate system <http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.2.html>`_, not the topas coordinate system.

Similar slicing is allowed in X and Y.
Three special values are also allowed::

iv:Gr/Patient/ShowSpecificSlicesZ = 1 0 # means show all slices
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -1 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -2 # means only first, center and last slice
iv:Ge/Patient/ShowSpecificSlicesZ = 1 0 # means show all slices
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -1 # means only show center slice
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -2 # means only first, center and last slice

The following will result in a display that shows 27 pixels comprising the boundaries and center of the image. This allows you to see the overall placement of the image and see the individual voxel size::

iv:Gr/Patient/ShowSpecificSlicesX = 1 -2 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesY = 1 -2 # means only show center slice
iv:Gr/Patient/ShowSpecificSlicesZ = 1 -2 # means only show center slice
iv:Ge/Patient/ShowSpecificSlicesX = 1 -2 # means only show center slice
iv:Ge/Patient/ShowSpecificSlicesY = 1 -2 # means only show center slice
iv:Ge/Patient/ShowSpecificSlicesZ = 1 -2 # means only show center slice

You have the Option to Load a Truncated DICOM, XiO or ImageCube.
Parameters to restrict which voxels of a patient image are loaded are:
Parameters to restrict which voxels of a patient image are loaded are::

i:Ge/MyComponent/RestrictVoxelsXMin
i:Ge/MyComponent/RestrictVoxelsYMin
Expand All @@ -77,6 +77,7 @@ Parameters to restrict which voxels of a patient image are loaded are:
i:Ge/MyComponent/RestrictVoxelsYMax
i:Ge/MyComponent/RestrictVoxelsZMax


The previously mentioned parameters, ShowSpecificSlicesVoxels, affect only the graphical output of the voxels.
The voxels were still all loaded, and all affected the physics results, but only specific voxels were shown in graphics.

Expand Down
1 change: 1 addition & 0 deletions parameters/intro/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Introduction to Parameter System

design
syntax
syntax_highlighting
relative
hierarchy
batch_jobs
15 changes: 15 additions & 0 deletions parameters/intro/syntax_highlighting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

Syntax highlighting
-------------------

It can be very useful to have a text editor capable of performing syntax highlighting.
The following editors currently support topas syntax highlighting:

- `Atom <https://atom.io/>`_:
Go to Packages >> Settings View >> Install Packages/Themes, and search for topas. This package should recognise both *.tps and *.topas files and highlight them automatically. Otherwise you have to manually turn on syntax highlighting in the bottom right of your screen
- `Sublime text <https://www.sublimetext.com/>`_
open the Command Palette (cmd+shift+p on Mac, ctrl+shift+p on Linux/Windows)
select Package Control: Install Package
search for Topas Syntax
- `Vim <https://www.vim.org/>`_
see `here <https://github.com/murdock-grewar/topas-vim>`_ for instructions
20 changes: 14 additions & 6 deletions parameters/variance/intro.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
Introduction
------------

Variance reduction (VR) techniques in TOPAS can be combined to create a very sophisticated setup. However, please note that VR is highly dependent on your specific geometry. Approach these features with caution and test all variance reduced setups against an equivalent setup without variance reduction.
Variance, or noise, is in inherent property of Monte Carlo Method which decreases as more particles are run. As such, there is always a trade off between variance and simulation time.
Variance reduction techniques aim to shift this balance such that variance can be reduced without increasing simulation time. There are a number of ways you can think of doing this, for example:

You should also review the Geant4 document that describes which cases are problematic `here <https://geant4.web.cern.ch/geant4/collaboration/working_groups/geometry/biasing/BiasScoreUseCases.html>`_.
- Bias certain interactions so they occur more often
- At a certain point, split certain particles N times, and reduce the weight of each particle by a factor of N
- Make some rules about which particles you care about, and kill the others

To enable the particle split applied to protons::
Note that some of these techniques only change the variance of the simulation, whereas others (like killing particles) will also change the *results* of your simulation. That can be ok if the result are changed in a region you don't care about, but obviously you have to be very careful. In general, the use of these techniques comes with a warning:

b:Vr/UseVarianceReduction = "true"
b:Vr/ParticleSplit/Active = "true"
sv:Vr/ParticleSplit/ParticleName = 1 "proton"
.. warning::
Variance reduction (VR) techniques in TOPAS can be combined to create a very sophisticated setup. However, please note that VR is highly dependent on your specific geometry. Approach these features with caution and test all variance reduced setups against an equivalent setup without variance reduction. You should also review the Geant4 document that describes which cases are problematic `here <https://geant4.web.cern.ch/geant4/collaboration/working_groups/geometry/biasing/BiasScoreUseCases.html>`_.

To put this another way: ***with great power comes great responsibility.***

All variance reduction techniques in topas can be switched on/off with a master parameter::

b:Vr/UseVarianceReduction = "true"

Specific variance reduction techniques are described next.

Specify the Split Geometry
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 42a3186

Please sign in to comment.