P HI T S PHITS Tutorial for making Voxel Phantom Multi-Purpose Particle and Heavy Ion Transport code System title1 Last revised 2014/8.

Slides:



Advertisements
Similar presentations
Chapter 3 – Web Design Tables & Page Layout
Advertisements

© Paradigm Publishing, Inc Access 2010 Level 1 Unit 2Creating Forms and Reports Chapter 6Creating Reports and Mailing Labels.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
P HI T S Exercise ( II ) : How to stop , ,  -rays and neutrons? Multi-Purpose Particle and Heavy Ion Transport code System title1 Feb revised.
SPARC Architecture & Assembly Language
Lecture 2:Basic Concepts
Page Features Footnotes and endnotes Headers and footers Page numbering Margins Columns.
XP New Perspectives on Microsoft Access 2002 Tutorial 61 Microsoft Access 2002 Tutorial 6 – Creating Custom Reports.
Word Lesson 7 Working with Documents
Introduction to C Programming
An Introduction to Programming with C++ Fifth Edition Chapter 10 Void Functions.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
 2008 Pearson Education, Inc. All rights reserved. 1 Introduction to HTML.
P HI T S Advanced Lecture (II): variance reduction techniques to improve efficiency of calculation Multi-Purpose Particle and Heavy Ion Transport code.
Introduction to C Programming
Chapter Three Using Variables and Constants Programming with Microsoft Visual Basic th Edition.
Basic Lecture I: Geometry and Source Definition
Programming with Microsoft Visual Basic th Edition CHAPTER THREE USING VARIABLES AND CONSTANTS.
LATTICE TECHNOLOGY, INC. For Version 10.0 and later XVL Web Master Advanced Tutorial For Version 10.0 and later.
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Project 5 Creating, Sorting, and Querying a List.
The Voxel geometry FLUKA Courses Houston may 2007.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Chapter 6: User-Defined Functions
S. Guatelli, CPS Innovations, Knoxville, 13 th -21 st January Brachytherapy exercise.
Lecture 6: Computer Languages. Programming Environments (IDE) COS120 Software Development Using C++ AUBG, COS dept.
Computer Information Technology – Section 4-12 Some text and examples used with permission from: Note: We not endorsing or promoting.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
GTSTRUDL Using the GTSTRUDL Base Plate Wizard Example of Creating and Analyzing a Base Plate Rob Abernathy CASE Center GTSUG June, 2009 Atlanta, GA.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Office Word 2007 Lab 3 Creating Reports and Tables.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
P HI T S Melt a snowman by proton beam Multi-Purpose Particle and Heavy Ion Transport code System title1 Aug revised.
#include using namespace std; // Declare a function. void check(int, double, double); int main() { check(1, 2.3, 4.56); check(7, 8.9, 10.11); } void check(int.
P HI T S Setting of various source Part I Multi-Purpose Particle and Heavy Ion Transport code System Title1 Aug revised.
Lesson 12 Spreadsheets Unit 2—Using the Computer.
Programming with Microsoft Visual Basic th Edition
P HI T S PHITS Tutorial How to use DICOM2PHITS Multi-Purpose Particle and Heavy Ion Transport code System Title1 Last revised 2015/3.
Outline Intro: voxel phantom + MCNPX Building geometry
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic properties and characteristics of external files ❏ To.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Flair development for the MC TPS Wioletta Kozłowska CERN / Medical University of Vienna.
An Introduction to Programming with C++1 Void Functions Tutorial 5.
P HI T S Setting of various source Part II Multi-Purpose Particle and Heavy Ion Transport code System Title1 May 2016 revised.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Multi-Purpose Particle and Heavy Ion Transport code System
PHITS Tutorial PHITS simulation using DICOM
Building a User Interface with Forms
Value-Returning Functions
Chapter 7 Text Input/Output Objectives
variance reduction techniques to improve efficiency of calculation A
A Brachytherapy Treatment Planning Software Based on Monte Carlo Simulations and Artificial Neural Network Algorithm Amir Moghadam.
variance reduction techniques to improve efficiency of calculation B
Microsoft Word: Tables
Multi-Purpose Particle and Heavy Ion Transport code System
User-Defined Functions
variance reduction techniques to improve efficiency of calculation B
Variables and Arithmetic Operations
Setting of various sources A
Multi-Purpose Particle and Heavy Ion Transport code System
How to stop a, b, g-rays and neutrons?
How to stop a, b, g-rays and neutrons?
Chapter 4 File Basics.
Computer Science Projects Database Theory / Prototypes
Chapter 11: Inheritance and Composition
Setting of various source Part II
CS 1308 Exam 2 Review.
Presentation transcript:

P HI T S PHITS Tutorial for making Voxel Phantom Multi-Purpose Particle and Heavy Ion Transport code System title1 Last revised 2014/8

What is Voxel Phantom? Introduction2 Reproduce a complex structure such as human body based on repeated rectangles filled with a certain material (See Manual 5.7.5) Low resolution High resolution You can make voxel phantom in PHITS virtual space using Universe and Lattice functions (See Manual and 5.7.4)

Examples of PHITS calculations using voxel phantom 3 Biological dose estimation for charged-particle therapy Treatment planning for BNCT T. Sato et al. Radiat. Res. (2009) H. Kumada et al. J. Phys.: Conf. Ser. (2007) Introduction

Table of Contents4 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

What is Universe? Universe5 You can define many universes in PHITS virtual space But only 1 universe (main space) is the stage of particle transport simulation Other universes are used for replacing some parts of the main space using “fill” command Some parts of the main space (inside the boxes) are filled with universe 1 Universe1 Main space → Virtual space in PHITS

Example of Universe Universe6 universe.inp [ C e l l ] $ Main space FILL= FILL= #1 #2 $ Universe U= #101 U=1 $ Universe U= #201 U=2 [ S u r f a c e ] 10 CY 5 11 PX PX 6 13 PY PY 6 15 PZ PZ 6 17 PZ 0 Declare universe 1 always void PX -3 PX 9 Filled with Universe1 Figure 5.13 (a) Two rectangular solids. (b) Cylinder filled with water. (c) Iron cylinder in water

Table of Contents7 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

What is Lattice? Lattice8 → Repeated structure used in PHITS virtual space It is troublesome to define all surfaces and cells used in repeated structure Define only surfaces and cells used in fundamental structure Examples of Lattice in PHITS Express the repeated structure using “lat” command

How to define lattice? 9 Only repeated structure can be defined in lattice universe You have to fill lattice with other universe It is better to define lattice not in main space but in a universe You cannot directly define the contents inside lattice Define repeated structure using more than 2 universes Universe1 (Lattice structure) Universe2 (fundamental structure) fill Main space fill Lattice

10 lattice.inp [ S u r f a c e ] 1 rpp rpp so rpp sph [ C e l l ] $ Main space fill= $ Universe lat=1 u=1 fill=-2:2 -2:2 0: $ Universe u= u=2 Declare lattice type 1 (Rectangle) Define the region of basic lattice Define the number of repeated structure Universe number to be filled with ( 5×5×1 matrix ) Location should be adjusted to that of the basic lattice Basic lattice ( 0,0,0 ) -5 X 5 ( 2,2,0 ) Region Y 5 ( -2,-2,0 ) PHITS input Lattice

Change the contents of lattice 11 lattice1.inp [ C e l l ] $ Main space fill= $ Universe lat=1 u=1 fill=-2:2 -2:2 0: $ Universe u= u=2 $ Universe u=3 Before (lattice.inp) Lattice After (lattice1.inp) Change 1 st box from golden ball to void

Table of Contents12 Table of Contents 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

How to define voxel phantom? 13 Universe1 (void) Simple Voxel Phantom ① Make universes filled with an unique material such as bone and soft tissue Universe2 (water) Universe3 (Aluminum) ② Make voxel phantom by repeating those universes Universe10 (Voxel Phantom) Main Space ③ Fill some part of the main space with the voxel phantom

PHITS input file 14Simple Voxel Phantom robot.inp [ C e l l ] $ Material universe u= u= u=3 $ Voxel universe lat=1 u=10 fill=0:4 0:4 0: … repeat 4 times $ Main space fill= [ S u r f a c e ] $ fundamental voxel 1 px -5 2 px -3 3 py 3 4 py 5 5 pz 3 6 pz 5 99 so 100 $ Main space 201 rpp rcc rcc Lattice order: X+, Y+, Z+ (start with left&lower voxel) Surfaces for the basic lattice Any large region is OK x y z

Change materials 15Simple Voxel Phantom robot1.inp [ C e l l ] $ Material universe u= u= u= u=4 $ Voxel universe lat=1 u=10 fill=0:4 0:4 0:4... last one … repeat 4 times $ Main space fill= Before (robot.inp) After (robot1.inp) Change the material of the phantom head from water to copper

Example of dose calculation 16Simple Voxel Phantom [t-heat] tally using mesh = xyz [t-heat] tally using mesh = reg robot-heat-reg.out Visualize the dose distribution Calculate dose for each region (Head, torso, and arm&leg) x: Serial Num. of Region y: Heat [MeV/source] h: x n n y(total),l3 n # num reg volume heat r.err E E E E E E robot-heat-xz.eps Useful for calculating dose inside tumor region

Table of Contents17 Table of Contents 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

DICOM format (Binary) 18 ① Header (Information on time, voxel size etc.) ② CT values ( 1,1→2,1→3,1→…→n x -1, n y → n x, n y ) Data for 1 slice ( sample001.dcm ) Several files are contained in one folder to represent an object cross sectional view 3D view Dicom to PHITS It is necessary to convert from DICOM to PHITS-input format (CT value, binary) (Universe number, text)

"data/HumanVoxelTable.data" Conversion table "DICOM/" DICOM files are automatically identified in this directory "PHITSinputs" Directory for PHITS inputs to be created 1 20 Slices to be used (1<=z<=20) Clipping (70<=x<=430, 90<=y<=460) Coarse graining (Average on 4 times 4 voxels in x and y direction) 0 Origin option: 0:Center of data 1:Reading from DICOM header 0 PHITS parameter: 0:Minimal 1:Photon therapy 2:Particle therapy 1 Reading slice order: +1:Ascending order or -1:Descending order Conversion (DICOM2PHITS) 19 Convert from Dicom data to PHITS input format (voxel phantom) 1. Make an input file for DICOM2PHITS ( dicom2phits.inp ) 2. Execute Windows: Drag dicom2phits.inp and drop into dicom2phits.bat Mac: Double click dicom2phits.command and type dicom2phits.inp + enter DICOM2PHITS HowTo Refer to “PHITS Tutorial How to use DICOM2PHITS” phits/utility/dicom2phits/phits-lec-dicom2phits-jp.ppt A sample input file will be created in PHITSinputs/ directory

Reduce computational time 20 It converts its input file to binary, and re-reads the binary file Make binary file of voxel phantom prior to the PHITS execution Purpose Procedure ① Insert the following 2 lines in the [Parameters] section ivoxel = 2 # Convert the “fill” part of lattice to binary and output to file(18) file(18) = voxel.bin # Output file name for binary voxel phantom ② Execute PHITS → Binary file was successfully generated!! ③ Change “ivoxel = 1”, and comment out “infl” command ivoxel = 1 # Read the “fill” part of lattice from file(18) $ infl:{voxel1.inp} Speed up! Dicom to PHITS It is better to… Every time PHITS runs…

Table of Contents21 Table of Contents 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

Summary 22Summary ① Voxel phantom can be implemented in PHITS using Universe and Lattice concepts ② DICOM format must be converted into PHITS input format using DICOM2PHITS ③ Computational time can be reduced by using “ivoxel” parameter

Table of Contents23 Table of Contents 1.Universe 2.Lattice 3.Simple voxel phantom 4.Conversion from DICOM format 5.Summary 6.Appendix

How to Deal with High-Resolution Phantom? 24 High resolution voxel phantom requires numerous memory Default setting of PHITS is allowed to use memory only less than 2 Byte e.g.) Whole body voxel phantom (180cm×30cm×50cm) with 1mm 3 resolution consists of 270,000,000 voxels, and costs 5.4 GByte memory, since PHITS uses memory approximately 20 Byte / voxel Change “param.inc” included in “src” folder How to deal with the situation? increase mdas: Maximum memory allowed to be used by PHITS (Byte) / 8 increase latmax: Maximum number of lattice in a cell declare integer*8 for several parameters (see next page in detail) Divide voxel phantom into several regions to reduce the area to be voxelized Memory is insufficient? Combine several CT pixels into one voxel to decrease the resolution of phantom Delete all object files (*.o) and re-compile PHITS* *For Windows PC, gfortran is recommended to be used for this purpose, because PHITS executable file compiled by Intel Fortran may cause “stack overflow” for large voxel phantom

25Appendix If #voxels is greater than 50 millions, many changes are necessary e.g. total #voxel = 150 millions, max #voxel per cell = 40 millions Change include files in “src” folder Add compiler options ( e.g. for Intel Fortran in Linux ) param.inc integer*8 mdas,mcmx,mci,mmdas,mmmax,nbnds,mct ! avoid overflow (integer*4 =< ) parameter ( mdas = ) ! Maximum memory allowed to be used by PHITS (Byte) / 8 parameter ( latmax = ) ! Maximum number of lattice in a cell angel00.inc integer*8 mdas,mmdas,mmmax ! avoid overflow (integer*4 =< ) parameter ( mdas = ) ! Maximum memory allowed to be used by ANGEL (Byte) / 8 makefile F77 = ifort FCFLAGS = -noautomatic -mcmodel=large -i-dynamic -i-dynamic: Dynamic link to libraries -mcmodel=large: no limitation in memory use (this option is only valid for Linux) How to Deal with High-Resolution Phantom?

Change the order of lattice 26 lattice2.inp [ S u r f a c e ] (pick up partially) 101 px px py py pz pz 1 [ C e l l ] (pick up partially) $ Universe lat=1 u=1 fill=-2:2 -2:2 0: X: +, Y: –, Z:+ Appendix RPP is divided into each surface Order is important! X:+, Y:+, Z: X: –, Y:+, Z: X: –, Y: –, Z: + Prior surface faces to the forward direction Same as RPP, BOX