SimSET: Creando un objeto
11 April, 2017 | SimSET | Eduardo Marquez
Una vez creada el área de trabajo se analiza el objeto a simular, a modo de ejemplo se propone modelar el torso, pulmones, espina dorsal y corazón de manera básica, como muestra las siguientes figuras
he de admitir, que desconozco (por ahora) que representa el punto oscuro dentro del corazón, por el momento creo se trata de algún atrio o bien una vena. Pero, ¿por que se necesitan dos figuras?
Representación de un Phantom SimSET
La idea general es sencilla, se representara un Phantom por medio de dos archivos, uno representa la actividad (concentración) del fármaco y otro atenuación. Suponga que la siguiente tabla representa la imagen mostrada antes:
0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 0 | 0 |
0 | 2 | 2 | 2 | 2 | 2 | 5 | 5 | 2 | 2 | 0 |
2 | 6 | 6 | 6 | 2 | 2 | 5 | 2 | 6 | 6 | 2 |
2 | 6 | 6 | 6 | 2 | 2 | 2 | 6 | 6 | 6 | 2 |
2 | 6 | 6 | 6 | 2 | 2 | 2 | 6 | 6 | 6 | 2 |
0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 0 |
0 | 0 | 2 | 2 | 2 | 3 | 2 | 2 | 2 | 0 | 0 |
0 | 0 | 0 | 0 | 2 | 2 | 2 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Para la atenuación se tiene la siguiente lista de elementosEntonces, para cada valor o tono de gris, se debe especificar su material según la tabla siguiente, y el nivel de concentración de fármaco que hay en ese voxel. Y la manera de hacerlo es mediante números, empecemos por la atenuación:
Material | Attenuation index |
Air
|
0 |
Water | 1 |
Blood | 2 |
Bone | 3 |
Brain | 4 |
Heart | 5 |
Lung | 6 |
Muscle | 7 |
Lead | 8 |
Sodium Iodide | 9 |
BGO | 10 |
Iron | 11 |
Graphite | 12 |
Tin | 13 |
GI Tract | 14 |
Connective tissue | 15 |
Copper | 16 |
Perfect absorber | 17 |
LSO | 18 |
GSO | 19 |
Aluminum | 20 |
Tungsten | 21 |
Liver | 22 |
Fat | 23 |
LaBr3 | 24 |
Low viscosity polycarbonate | 25 |
NEMA polyethylene | 26 |
Polymethyl methylcrylate | 27 |
Polystyrene fibers | 28 |
LYSO | 29 |
A partir de aquí trabajaremos con un solo slice, pero recuerda podemos tener mas, por lo que se aplicaran los mismos conceptos a todos los slices. Entonces dado un slice
0 | 0 | 0 | 0 | 0 | 2 | 2 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 0 | 0 |
0 | 2 | 2 | 2 | 2 | 2 | 5 | 5 | 2 | 2 | 0 |
2 | 6 | 6 | 6 | 2 | 2 | 5 | 2 | 6 | 6 | 2 |
2 | 6 | 6 | 6 | 2 | 2 | 2 | 6 | 6 | 6 | 2 |
2 | 6 | 6 | 6 | 2 | 2 | 2 | 6 | 6 | 6 | 2 |
0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 0 |
0 | 0 | 2 | 2 | 2 | 3 | 2 | 2 | 2 | 0 | 0 |
0 | 0 | 0 | 0 | 2 | 2 | 2 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Por orden, el (3) representa los huesos de la columna, el (2) representa la sangre, (5) representa el corazón, los pulmones (6) y finalmente (0) representa el aire.
Con esta información se crea/modifica el archivo objeto.att_index, en el cual se especifica como una lista el tono de gris y su atenuación, por ejemplo, utilizando la tabla de materiales y la imagen, podemos definir object.att_index como:
############################################################################## # # INDEX TRANSLATION FILE FOR THE PHG SIMULATION ACTIVITY INDEXES TO # ATTENUATION TABLE ENTRIES. # # RUN NAME: # CREATED: 10/05/17 # OWNER: Eduardo Marquez # ############################################################################## 0 0 # Se define el tono de gris 0 como aire (0) de la lista de materiales 1 0 2 2 # Se define el tono de gris 2 como sangre (2) de la lista de materiales 3 3 # Se define el tono de gris 3 como hueso (3) de la lista de materiales 4 0 5 5 # Se define el tono de gris 5 como corazón (5) de la lista de materiales 6 6 # Se define el tono de gris 6 como pulmon (6) de la lista de materiales 7 0 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 0 50 0 51 0 52 0 53 0 54 0 55 0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71 0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79 0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87 0 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 0 149 0 150 0 151 0 152 0 153 0 154 0 155 0 156 0 157 0 158 0 159 0 160 0 161 0 162 0 163 0 164 0 165 0 166 0 167 0 168 0 169 0 170 0 171 0 172 0 173 0 174 0 175 0 176 0 177 0 178 0 179 0 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 188 0 189 0 190 0 191 0 192 0 193 0 194 0 195 0 196 0 197 0 198 0 199 0 200 0 201 0 202 0 203 0 204 0 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 0 214 0 215 0 216 0 217 0 218 0 219 0 220 0 221 0 222 0 223 0 224 0 225 0 226 0 227 0 228 0 229 0 230 0 231 0 232 0 233 0 234 0 235 0 236 0 237 0 238 0 239 0 240 0 241 0 242 0 243 0 244 0 245 0 246 0 247 0 248 0 249 0 250 0 251 0 252 0 253 0 254 0 255 0
NOTA: No siempre queda 2 2, o 5 5, por ejemplo en algunos casos el 2 puede representar quizás huesos, entonces quedaría 2 3.
De la misma manera, se edita el documento objeto.act_index con los diferentes valores de concentración del fármaco, según el tono de gris de la imagen:
############################################################################## # # INDEX TRANSLATION FILE FOR THE PHG SIMULATION ACTIVITY INDEXES TO # ACTIVITY TABLE ENTRIES. # # RUN NAME: # CREATED: 10/05/17 # OWNER: Eduardo Marquez # ############################################################################## 0 0 # Define 0 de concentración en el aire 1 0 2 10 # Define los 2 (sangre en este caso) con 10 de concentracion 3 0 # Define 0 de concentración en los huesos 4 0 5 50 # Define 50 de concentración en el corazón 6 0 # Define 0 de concentración en los pulmones 7 0 8 0 9 0 10 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18 0 19 0 20 0 21 0 22 0 23 0 24 0 25 0 26 0 27 0 28 0 29 0 30 0 31 0 32 0 33 0 34 0 35 0 36 0 37 0 38 0 39 0 40 0 41 0 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 0 50 50 # Define el tono de gris 50 aire con 50 de concentracion 51 0 52 0 53 0 54 0 55 0 56 0 57 0 58 0 59 0 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71 0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79 0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87 0 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 0 149 0 150 0 151 0 152 0 153 0 154 0 155 0 156 0 157 0 158 0 159 0 160 0 161 0 162 0 163 0 164 0 165 0 166 0 167 0 168 0 169 0 170 0 171 0 172 0 173 0 174 0 175 0 176 0 177 0 178 0 179 0 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 188 0 189 0 190 0 191 0 192 0 193 0 194 0 195 0 196 0 197 0 198 0 199 0 200 0 201 0 202 0 203 0 204 0 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 0 214 0 215 0 216 0 217 0 218 0 219 0 220 0 221 0 222 0 223 0 224 0 225 0 226 0 227 0 228 0 229 0 230 0 231 0 232 0 233 0 234 0 235 0 236 0 237 0 238 0 239 0 240 0 241 0 242 0 243 0 244 0 245 0 246 0 247 0 248 0 249 0 250 0 251 0 252 0 253 0 254 0 255 0
Creación de un Phantom
Crear un objeto o slice puede ser sencillo o tedioso según lo necesites, pero para comenzar, veremos dos maneras de crear el objeto, la primera utilizando un script, y la segunda de manera manual.
Utilidad MakeIndexFile
Para utilizar este script, es necesario tener dirigirnos a la carpeta bin de SimSET, utilizando la terminal, en mi caso:
cd Documents/SimSET/2.9.2/bin
Aquí, se encuentran diferentes utilidades, por ahora nos interesa MakeIndexFile.
Para utilizarlo basta ejecutar el comando
./makeindexfile "direccion del object.phg_params"
En mi caso:
./makeindexfile ~/Documents/SimSET/2.9.2/Example/object.phg_params
Y comenzara un cuestionario (las respuestas están en negritas):
Build indexes for objeto.act_index (Yes..No) [Yes]: Yes // Aparecerá la lista de materiales o elementos y su valor para llenar la atenuación. NOTA: Primero llenaremos la concentración del fármaco. Would you like to fill the entire object with a single value? (Yes..No) [Yes]: Yes // En un inicio todo tiene 0 de concentración del fármaco Enter fill value for object (0..255): 0 // Especificamos la concentración del fármaco Would you like to fill the entire object from a single data file? (Yes..No) [No]: No // Nuestro objeto tendrá mas de un material Would you like to initialize specific slice values? (Yes..No) [No]: No // No, trabajaremos en el área completa Would you like to create an 'object'? (Yes..No) [Yes]: Yes // Si, crearemos un objeto Select a type (cylinder,sphere,voxel) [cylinder]: cylinder // Definiremos el torso como un cilindro. Please select a center point for the cylinder Enter x-axis coordinate : 0 // Especificamos su centro Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 48 // Especificamos sus dimensiones Enter x-axis radius : 24 Enter y-axis radius : 16 Enter fill value for object (0..255): 10 // Especificamos la concentración del fármaco Filled 58080 voxels. // Nos indica lo creado. Would you like to create another 'object'? (Yes..No) [No]: Yes // Crearemos los pulmones Select a type (cylinder,sphere,voxel) [cylinder]: cylinder // Definiremos el pulmon como un cilindro. Please select a center point for the cylinder Enter x-axis coordinate : 12 // Especificamos su centro Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 40 // Especificamos sus dimensiones Enter x-axis radius : 6 Enter y-axis radius : 6 Enter fill value for object (0..255): 0 // Especificamos la concentración del fármaco Filled 4480 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes // Crearemos los pulmones Select a type (cylinder,sphere,voxel) [cylinder]: cylinder // Definiremos el pulmon como un cilindro. Please select a center point for the cylinder Enter x-axis coordinate : -12 // Especificamos su centro Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 40 // Especificamos sus dimensiones Enter x-axis radius : 6 Enter y-axis radius : 6 Enter fill value for object (0..255): 0 // Especificamos la concentración del fármaco Filled 4480 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes // Crearemos la espina Select a type (cylinder,sphere,voxel) [cylinder]: cylinder Please select a center point for the cylinder Enter x-axis coordinate : 0 Enter y-axis coordinate : -12 Enter z-axis coordinate : 0 Enter length along z-axis : 48 Enter x-axis radius : 3 Enter y-axis radius : 3 Enter fill value for object (0..255): 0 Filled 1344 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes // Crearemos el corazón Select a type (cylinder,sphere,voxel) [cylinder]: sphere Please select a center point for the sphere Enter x-axis coordinate : 4 Enter y-axis coordinate : 4 Enter z-axis coordinate : 0 Enter radius : 5 Enter fill value for object (0..255): 50 Especificamos la concentración del fármaco Filled 512 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes // Crearemos un atrio Select a type (cylinder,sphere,voxel) [sphere]: sphere Please select a center point for the sphere Enter x-axis coordinate : 5 Enter y-axis coordinate : 4 Enter z-axis coordinate : 0 Enter radius : 3 Enter fill value for object (0..255): 10 Especificamos la concentración del fármaco Filled 120 voxels. Would you like to create another 'object'? (Yes..No) [No]: No // Finalizamos la creación Build indexes for object.att_index (Yes..No) [Yes]: Yes // Si deseamos crear los datos de los materiales. Would you like to fill the entire object with a single value? (Yes..No) [Yes]: Yes // Por el momento todo es aire Enter fill value for object (0..255): 0 // 0 Corresponde al aire según la tabla Would you like to fill the entire object from a single data file? (Yes..No) [No]: No // Todo es diferente Would you like to initialize specific slice values? (Yes..No) [No]: No // Trabajaremos todo el espacio de trabajo Would you like to create an 'object'? (Yes..No) [Yes]: Yes // Todo sera igual, excepto el valor de llenado. Select a type (cylinder,sphere,voxel) [cylinder]: cylinder Please select a center point for the cylinder Enter x-axis coordinate : 0 Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 48 Enter x-axis radius : 24 Enter y-axis radius : 16 Enter fill value for object (0..255): 2 // Se define como sangre el torso. Filled 58080 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes Select a type (cylinder,sphere,voxel) [cylinder]: cylinder Please select a center point for the cylinder Enter x-axis coordinate : 12 Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 40 Enter x-axis radius : 6 Enter y-axis radius : 6 Enter fill value for object (0..255): 6 // Se define como pulmón Filled 4480 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes Select a type (cylinder,sphere,voxel) [cylinder]: cylinder Please select a center point for the cylinder Enter x-axis coordinate : -12 Enter y-axis coordinate : 0 Enter z-axis coordinate : 0 Enter length along z-axis : 40 Enter x-axis radius : 6 Enter y-axis radius : 6 Enter fill value for object (0..255): 6 // Se define como pulmón Filled 4480 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes Select a type (cylinder,sphere,voxel) [cylinder]: cylinder Please select a center point for the cylinder Enter x-axis coordinate : 0 Enter y-axis coordinate : -12 Enter z-axis coordinate : 0 Enter length along z-axis : 48 Enter x-axis radius : 3 Enter y-axis radius : 3 Enter fill value for object (0..255): 3 // Se define como hueso Filled 1344 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes Select a type (cylinder,sphere,voxel) [cylinder]: sphere Please select a center point for the sphere Enter x-axis coordinate : 4 Enter y-axis coordinate : 4 Enter z-axis coordinate : 0 Enter radius : 5 Enter fill value for object (0..255): 5 // Se define como corazón Filled 512 voxels. Would you like to create another 'object'? (Yes..No) [No]: Yes Select a type (cylinder,sphere,voxel) [sphere]:sphere Please select a center point for the sphere Enter x-axis coordinate : 5 Enter y-axis coordinate : 4 Enter z-axis coordinate : 0 Enter radius : 3 Enter fill value for object (0..255): 2 // Se define el atrio o vena Filled 120 voxels. Would you like to create another 'object'? (Yes..No) [No]: No // Ya no hay nada que agregar.
De esta manera habrás creado un ejemplo básico.