Computed tomography
From UCL HEP PBT Wiki
m |
|||
Line 1: | Line 1: | ||
== <span style="color:#000080"> Introduction </span> == | == <span style="color:#000080"> Introduction </span> == | ||
- | This tutorial is based on the GEANT4 DICOM example originally developed by Louis Archambault, Luc Beaulieu and Vincent Hubert-Tremblay. In this example a list of DICOM files (.dcm) are converted to ASCII files (.g4dcm) and binary (.g4bin) that can be read by GEANT4. Each of these files corresponds to a Z slice. Then, the .g4dcm (.g4bin) files are merged into one | + | This tutorial is based on the GEANT4 DICOM example originally developed by Louis Archambault, Luc Beaulieu and Vincent Hubert-Tremblay. In this example a list of DICOM files (.dcm) are converted to ASCII files (.g4dcm) and binary files (.g4bin) that can be read by GEANT4. Each of these files corresponds to a Z Computed tomography (CT) slice. Then, the .g4dcm (.g4bin) files are merged into one volume. |
- | The geometry is constructed by voxelizing | + | The geometry is constructed by voxelizing this volume. There are four navigation algorithms used to create the voxel geometry: '''G4RegularNavigation''', '''G4VNestedParameterisation''', '''G4SmartVoxel'''/'''G4VoxelNavigation''' and '''G4PVReplica'''. |
- | The material is constructed by converting the pixel values (Hounsfield numbers) from the DICOM images to densities using | + | The material for this volume is constructed by converting the pixel values (Hounsfield numbers) from the DICOM images to densities using the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/CT2Density.dat Hounsfield scale]. Then, the densities are converted to material types according to this [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/Materials.txt table]. |
- | the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/CT2Density.dat Hounsfield scale]. Then, the densities are converted to material types according to this [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/Materials.txt table]. | + | |
- | A simple monenergetic electron beam is simulated using '''G4ParticleGun''' class. The output of the tutorial is a text file with dose deposition in several voxels. The dose is scored using classes ''' | + | A simple monenergetic electron beam is simulated using '''G4ParticleGun''' class. The output of the tutorial is a text file with dose deposition in several voxels. The dose is scored using classes '''G4MutiFunctionalDetector''', '''G4VPrimitiveScorer''', '''G4PSDoseDeposit3D''' and '''G4THitsMap'''. |
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/dicom.png | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/dicom.png | ||
- | This is one of the DICOM files | + | This is one of the DICOM files used in the tutorial. |
== <span style="color:#000080"> How to run the tutorial </span> == | == <span style="color:#000080"> How to run the tutorial </span> == | ||
Line 58: | Line 57: | ||
</pre> | </pre> | ||
- | ; | + | ; Run macro run.mac |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 68: | Line 63: | ||
</pre> | </pre> | ||
- | * | + | == <span style="color:#000080"> How to analyze data </span> == |
+ | |||
+ | This is a [http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/ExampleDICOM.html link] to the official DICOM tutorial explanation notes. We recommend to read it before proceeding with this tutorial. | ||
+ | |||
+ | === <span style="color:#000080"> Text files </span> === | ||
+ | |||
+ | The macro run.mac produces a text file '''dicom.out''' which includes the dose deposition in several voxels. | ||
+ | |||
+ | === <span style="color:#000080"> Run with different settings </span> === | ||
+ | |||
+ | ; Chose among several voxelization algorithms | ||
+ | |||
+ | * <span style="color:#ff0000"> G4RegularNavigation </span>: | ||
+ | |||
+ | '''G4RegularNavigation''' class is the default class for this tutorial. This algorithm skips frontiers between voxels when they have the same material i.e. "replacing group of voxels with a smaller number of larger voxels". | ||
+ | |||
+ | * <span style="color:#ff0000"> G4NestedParameterization </span>: | ||
+ | |||
+ | To run with this voxelization algorithm you need to set the variable '''DICOM_NESTED_PARAM''' | ||
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 74: | Line 87: | ||
</pre> | </pre> | ||
- | You can check if | + | You can check if it is set correctly by typing in the command line |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
Line 80: | Line 93: | ||
</pre> | </pre> | ||
- | Then, run the code: | + | Then, compile and run the code: |
<pre style="color: #800000; background-color: #dcdcdc"> | <pre style="color: #800000; background-color: #dcdcdc"> | ||
+ | [username@plus1 DICOM_build]$ make | ||
+ | |||
[username@plus1 DICOM_build]$ ./DICOM run.mac | [username@plus1 DICOM_build]$ ./DICOM run.mac | ||
</pre> | </pre> | ||
- | * | + | * <span style="color:#ff0000"> G4SmartVoxel / G4VoxelNavigation </span>: |
Using smart voxels required a huge amount of memory. At /home/username/DICOMFolder/DICOM_source/src/DicomRegularDetectorConstruction.cc set | Using smart voxels required a huge amount of memory. At /home/username/DICOMFolder/DICOM_source/src/DicomRegularDetectorConstruction.cc set | ||
Line 102: | Line 117: | ||
</pre> | </pre> | ||
- | + | ; Change the type, energy and position of the incident particle | |
- | + | At /home/username/DICOMFolder/DICOM_source/src/DicomPrimaryGeneratorAction.cc change the following lines: | |
- | + | <pre style="color: #800000; background-color: #dcdcdc"> | |
+ | G4ParticleDefinition* particle = particleTable->FindParticle(particleName="e-"); | ||
- | + | fParticleGun->SetParticleEnergy(100.*MeV); | |
+ | |||
+ | fParticleGun->SetParticlePosition(G4ThreeVector(0.,0.,0.)); | ||
+ | </pre> | ||
+ | |||
+ | You can chose among several particles like "gamma", "e+", "alpha" and "He3". Then, compile and run the code | ||
+ | |||
+ | <pre style="color: #800000; background-color: #dcdcdc"> | ||
+ | [username@plus1 DICOM_build]$ make | ||
+ | |||
+ | [username@plus1 DICOM_build]$ ./DICOM run.mac | ||
+ | </pre> | ||
=== <span style="color:#000080"> Visualisation </span> === | === <span style="color:#000080"> Visualisation </span> === | ||
Line 127: | Line 154: | ||
http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/g4_03.eps | http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/g4_03.eps | ||
+ | |||
+ | == <span style="color:#000080"> Files </span> == | ||
+ | |||
+ | [[List of computed tomography files with brief description]] |