Computed tomography
From UCL HEP PBT Wiki
for
Computed tomography
Jump to:
navigation
,
search
== <span style="color:#000080"> Introduction </span> == This tutorial will based on the DICOM GEANT4 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. Then, these files are used by GEANT4 to construct patient geometry. The geometry is constructed by voxelizing computed tomography data. Four navigation algorithms are available to create the voxel geometry: G4SmartVoxel, G4VNestedParameterisation, G4RegularNavigation and G4Replica. In this tutorial we investigate the different geometry implementations. The DICOM images pixel values represent Hounsfield numbers which are converted to density according to the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/CT2Density.dat Hounsfield scale]. Then, the densities are converted to material type according to the information in the [http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/Materials.txt file]. A simple monenergetic electron beam is simulated inside the patient. The output of the example is a text file with dose deposited in several voxels. http://www.hep.ucl.ac.uk/pbt/RadiotherapyWorkbook/skins/common/images/DICOM/dicom.png This is one of the DICOM files that will be used in this tutorial. == <span style="color:#000080"> Setting up the environment </span> == ; Connect to HEP cluster and create folder DICOMFolder in your area <pre style="color: #800000; background-color: #dcdcdc"> ssh -X username@plus1.hep.ucl.ac.uk password: type your password here cd /home/username/ mkdir DICOMFolder cd DICOMFolder </pre> ; Setup your environment <pre style="color: #800000; background-color: #dcdcdc"> source /unix/pbt/software/dev/bin/pbt-dev.sh </pre> == <span style="color:#000080"> How to get the code </span> == ; Copy the code to your working directory and rename it <pre style="color: #800000; background-color: #dcdcdc"> cp -r /unix/pbt/tutorials/basic/DICOM . mv DICOM DICOM_source </pre> == <span style="color:#000080"> How to run the code </span> == ; Inside /home/username/DICOMFolder/ create a directory <pre style="color: #800000; background-color: #dcdcdc"> mkdir DICOM_build </pre> ; To compile the code enter this directory and run cmake and make <pre style="color: #800000; background-color: #dcdcdc"> cd DICOM_build cmake -DGeant4_DIR=/unix/pbt/software/dev /home/username/DICOMFolder/DICOM_source make </pre> ; Before running the code you can chose among several voxelisation algorithms. * Using '''G4RegularNavigation''' Special algorithm to navigate in regular voxelised geometries. It includes an option to skip frontiers between voxels when they have the same material i.e. replacing group of voxels with a smaller number of larger voxels. '''G4RegularNavigation''' is the default version of this tutorial. To run with the default settings simply run macro run.mac. <pre style="color: #800000; background-color: #dcdcdc"> ./DICOM run.mac </pre> * Using '''G4NestedParameterization''' <pre style="color: #800000; background-color: #dcdcdc"> export DICOM_NESTED_PARAM=1 </pre> You can check if you set this environment variable correctly by typing in the command line <pre style="color: #800000; background-color: #dcdcdc"> env </pre> Then, run the code: <pre style="color: #800000; background-color: #dcdcdc"> ./DICOM run.mac </pre> * Usinging '''G4VoxelNavigation''' Using smart voxels required a huge amount of memory. At /home/username/DICOMFolder/DICOM_source/src/DicomRegularDetectorConstruction.cc set <pre style="color: #800000; background-color: #dcdcdc"> patient_phys->SetRegularStructureId(0); </pre> compile and run the code: <pre style="color: #800000; background-color: #dcdcdc"> make ./DICOM run.mac </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 explanation notes. We recommend to read it before proceeding with this tutorial. === <span style="color:#000080"> Text files </span> === === <span style="color:#000080"> Visualisation </span> ===
Return to
Computed tomography
.
Views
Page
Discussion
View source
History
Personal tools
Log in
Navigation
Main page
Community portal
Current events
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages