Particle Swarm Optimization (PSO) in C#

Particle Swarm Optimization (PSO) is a computational method for optimization of a problem by simulating a set of moving particles that move around a search-space. Now let’s say that you want to find the (global) minimum of the square function: f(x) = x[0]^2 + x[1]^2. The source code can be found on

Convert RT-Structures into binary images

With the help of plastimatch you can convert any rt-structure file into binary image by running: Now, if you wish to have the exported binary images of each structure registered with your rt-dose file, you can run: The plastimatch will generate the binary images in .nrrd format (also .mha can be specified in –prefix-format mha…

ESAPI: Retrieving DICOM files from ARIA DB

(comming soon)

DICOM resources

Standards: DICOM Standard browser Tools: – DVTk – dicompyler – Orthanc – DICOM Server

DICOM tags modification

A DICOM file is composed of a basic file structure which can be seen below: The header consists of a 128 byte File Preamble, followed by a 4 byte DICOM prefix. The header sometimes may not be included in the file. It depends on the application and the vendor. So, if you wish to check…

How to calculate a dose-volume-histogram

Dose-volume histogram (DVH)

A dose-volume histogram (DVH) is a histogram relating radiation dose to tissue volume in radiation therapy planning. DVHs are most commonly used as a plan evaluation tool and to compare doses from different plans or to structures. DVH summarizes 3D dose distributions in a graphical 2D format. In modern radiation therapy, 3D dose distributions are…

High performance looping

using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace FastLoopingConsole { class Program { static void Main(string[] args) { Stopwatch sw = new Stopwatch(); long MaxNumber = 2500000000; ///////////////////////////////////////////////////////////// long sum = 0; sw.Restart(); sum = 0; Parallel.For(0, MaxNumber, (i) => { Interlocked.Add(ref sum, (long) Math.Sqrt(i)); }); sw.Stop(); Trace.WriteLine($”Method_1 (Parallel.For): Sum…


Disclaimer:   The information contained in this website is for general information purposes only. The information is provided by and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect…