From 7703c8e969fa062ac224c108926a037bc1920abf Mon Sep 17 00:00:00 2001 From: bergolho Date: Thu, 25 Apr 2019 17:18:46 -0300 Subject: [PATCH] Plot APD over a line seems to be working --- Changes.txt | 58 +- ToDo | 4 +- scripts/calc_apd_specific_cells/aps/test | 0 .../calc_apd_specific_cells.py | 222 + .../calc_apd_specific_cells/clean_files.sh | 4 + scripts/calc_apd_specific_cells/getAps.sh | 46 + .../inputs/cells_positions_inside_region.txt | 100 + .../output/cells-apd-inside-region.txt | 100 + .../output/cells-apd.txt | 10000 ++++++++++++++++ scripts/calc_apd_specific_cells/output/test | 0 .../CMakeLists.txt | 12 + .../clean_project.sh | 15 + .../main.cpp | 328 + .../recompile_project.sh | 21 + 14 files changed, 10890 insertions(+), 20 deletions(-) create mode 100644 scripts/calc_apd_specific_cells/aps/test create mode 100644 scripts/calc_apd_specific_cells/calc_apd_specific_cells.py create mode 100755 scripts/calc_apd_specific_cells/clean_files.sh create mode 100755 scripts/calc_apd_specific_cells/getAps.sh create mode 100644 scripts/calc_apd_specific_cells/inputs/cells_positions_inside_region.txt create mode 100644 scripts/calc_apd_specific_cells/output/cells-apd-inside-region.txt create mode 100644 scripts/calc_apd_specific_cells/output/cells-apd.txt create mode 100644 scripts/calc_apd_specific_cells/output/test create mode 100644 scripts/cell_position_calculator_over_a_line/CMakeLists.txt create mode 100755 scripts/cell_position_calculator_over_a_line/clean_project.sh create mode 100644 scripts/cell_position_calculator_over_a_line/main.cpp create mode 100755 scripts/cell_position_calculator_over_a_line/recompile_project.sh diff --git a/Changes.txt b/Changes.txt index 21723b46..e1ce6ab6 100644 --- a/Changes.txt +++ b/Changes.txt @@ -1,20 +1,44 @@ -1) Merged Sachetto changes since 19/03/2019 - -2) Fix bugs: - - On the "free_grid" function there was a bug when dealing with Purkinje network, the program - could not be finished correctly. - - On "vtk_polydata_grid.c" file the name of the datatype to be saved was set to "realcpu_32" - instead of "Float32". - -3) Upgrades: - - Add a description and more comments for the usage of "calc_APD.py" script. - - Add a new script to plot several action potentials in one single axis - ("plot_multiple_potentials.py"). - - Add a new program in the scripts folder to calculate and dump the positions (x,y,z) of every single cell in the grid to a file. - ("cell_positions_calculator") - - Add a new program in the scripts folder to calculate the propagation velocity between two cells in the grid. - ("calc_propagation_velocity") - - Add new Purkinje networks that were build using the "Network-Generator" for testing. +1) Merged Sachetto changes since 22/04/2019 + - Fill discretization matrix with different sigmas is working fine for the default case + - Each 'struct cell' now has a (sigma_x,sigma_y,sigma_z) +2) New features + - New mixed celular models + + A new "extra_library" has been added (extra_mixed_models) + + This library is responsible for deciding which celular model of each cell on the grid (mask_functions) + + New examples for testing mixed celular models have been added + - Different sigmas + + Simulations where we had cells with different sigmas are now working properly + + New "source_sink_mismatch" simulation with different sigmas has been added + +2) New scripts + - New script to calculate the APD based on Elnaz's algorithm + + Works with multiples AP's by passing the pacing period + + We can now set the percentage of the APD we want + + - New script to calculate the APD of specific cells in the grid (scripts/calc_apd_multiple_cells) + - New script to calculate the APD of all the cells in the grid (scripts/calc_apd_full_grid) + - New script to plot the APD error as a VTU file + - New script for the butterfly plot + +3) New celular model + - New Mitchell & Shaeffer 2003 + - New mixed celular models + + Mitchell & Shaeffer + FitzHugh-Nagumo + + TenTusscher Epicardium + TenTusscher Myocardium + +4) New stimulus + - New concave stimulus + +5) New assembly matrix function + - source_sink_discretization_matrix_with_different_sigma + +6) New domain function + - initialize_grid_with_plain_source_sink_fibrotic_mesh + +7) New simulations + - Source-Sink simulation + - Plain mesh Ohara & Rudy 2011 simulation + diff --git a/ToDo b/ToDo index 0779ea39..d0c3d466 100644 --- a/ToDo +++ b/ToDo @@ -8,11 +8,9 @@ Sachetto Berg - Implement 'save_vtk_polydata_grid_as_vtu_compressed' function - Implement coupling between Purkinje and tissue -- Implement multi-celular-model solver (use the 'extra_data' data structure as Sachetto suggested) - Try to reduce the size of the files generated by the "calc_apd_full_grid.py" script Pedro -- Upgrade and refactor the DDM code. -- Rewrite the 'update_monodomain' function for the DDM case +- Change the DDM code to the new version of the 'fill_discretization_matrix' function - Implement the anisotropic case for the DDM. The kappas can be different now along the control volumes diff --git a/scripts/calc_apd_specific_cells/aps/test b/scripts/calc_apd_specific_cells/aps/test new file mode 100644 index 00000000..e69de29b diff --git a/scripts/calc_apd_specific_cells/calc_apd_specific_cells.py b/scripts/calc_apd_specific_cells/calc_apd_specific_cells.py new file mode 100644 index 00000000..efbfe5d2 --- /dev/null +++ b/scripts/calc_apd_specific_cells/calc_apd_specific_cells.py @@ -0,0 +1,222 @@ +# Author: Lucas Berg +# +# Program that calculates the APD of every cell in the grid by passing a certain percentage. +# e.g: APD_90 --> percentage = 90 +# APD_80 --> percentage = 80 +# APD_70 --> percentage = 70 +# +# This program also works with multiples AP's ! + +import sys +import subprocess +import time +import numpy as np + +def forwarddiff(y, h): + n = len(y) + res = [] + + for i in range(1, n): + res.append((y[i] - y[i-1]) / h) + + return res + + +def slope_start(data, start=0, epsilon=0.0001, h=1.0): + + d = data[start:] + n = len(d) + + for i in range(1,n): + if abs(d[i] - d[i-1]/h) > epsilon: + return i+start + + +def slope_end(data, start=0, epsilon=0.0001, h=1.0): + + d = data[start:] + n = len(d) + + for i in range(1,n): + if abs(d[i] - d[i-1]/h) < epsilon: + return i+start + + +def max_index(data, start, end): + + d = data[start:(start+end)] + + max_v = max(d) + + max_index = d.index(max_v) + start + + return max_index + + +def index_activation(data, start=0): + + d = data[start:] + + for i, v in enumerate(d): + if d[i + start] < 0.0 < d[i + start + 1]: + return i+start + +def calc_ap_limits (vms, start, end): + + v = vms[start:end].tolist() + + maxV = max(v) + minV = min(v) + + index_maxV = v.index(maxV) + start + + return index_maxV, maxV, minV + +def calc_reference_potential (minV, maxV, percentage): + + refV = minV + (maxV - minV)*(1.0 - percentage) + + return refV + +def calc_apd (vms, start, end, h, percentage): + + index_maxV, maxV, minV = calc_ap_limits(vms,start,end) + + refV = calc_reference_potential(minV,maxV,percentage) + + index_peak, t_peak = calc_max_derivative(vms,start,end,h) + + index_ref, t_ref = calc_time_reference(vms,index_maxV,end,h,refV) + + #print("Start = %g -- Finish = %g -- Peak = %d -- Ref = %d" % (start,end,t_peak,t_ref)) + #print("APD = %g ms" % (t_ref - t_peak)) + + if (index_ref == -1): + print("[-] ERROR! Could not find reference potential!") + sys.exit(1) + + return (t_ref - t_peak) + + +def calc_time_reference (vms, start, end, h, refV): + + v = vms[start:(start+end)] + + for i in range(len(v)): + if (v[i] < refV): + return (i+start), (i+start)*h + return -1, -1 + +def calc_max_min_ref_potential (data,apd_p,start,end): + + d = data[start:end] + + max_v = max(d) + min_v = min(d) + ref_v = min_v + (max_v - min_v)*(1.0 - apd_p) + + return max_v, min_v, ref_v + +def calc_max_derivative (vms,start,end,h): + v = vms[start:end] + n = len(v) + dvdt = range(0,n) + + for i in range(1,n): + dvdt[i] = abs(v[i] - v[i-1]/h) + + max_dvdt = max(dvdt) + + max_index = dvdt.index(max_dvdt) + start + + return max_index, max_index*h + +def main (): + if ( len(sys.argv) != 9 ): + print("-------------------------------------------------------------------------------------------------------------") + print("Usage:> python %s " % sys.argv[0]) + print(" ") + print(" ") + print("-------------------------------------------------------------------------------------------------------------") + print(" = Output directory of the simulation") + print(" = Filename with the indexes and positions from the specific cells") + print(" = Number of AP's to be used for the APD calculation") + print(" = Period of each action potential occurs") + print(" = Number of milliseconds from each timestep") + print(" this value can be calculated as:") + print(" num_files = (simulation_time) / (dt * print_rate)") + print(" ms_each_step = (simulation_time) / (num_files)") + print(" Where the values ,
and are all") + print(" given in the configuration file of the simulation.") + print(" = Total number of cells to calculate the APD") + print(" = The print rate of the simulation") + print(" = Percentage to be used as reference on the APD calculus") + print("-------------------------------------------------------------------------------------------------------------") + print("Example:> python calc_apd_specific_cells.py ../../outputs/plain_mixed_models_tt inputs/cells_positions_inside_region.txt 1 250 2 10000 100 90") + print("-------------------------------------------------------------------------------------------------------------") + return 1 + + # Get user inputs + output_dir = sys.argv[1] + cell_positions_filename = sys.argv[2] + num_aps = int(sys.argv[3]) + period = int(sys.argv[4]) + ms_each_step = float(sys.argv[5]) + total_num_cells = int(sys.argv[6]) + print_rate = int(sys.argv[7]) + APD_percentage = float(sys.argv[8]) + + # Get the transmembrane potential for all timesteps and every single cell in the grid + print("[!] Calling 'getAps.sh' script ...") + cmd = "./getAps.sh %s V 6 %d %d" % (output_dir,total_num_cells,print_rate) + rc = subprocess.call( cmd, shell=True ) + + # Open the generated file from the previous script as a Numpy array and get its dimensions + timesteps_file = open("timesteps.txt") + ap_data = np.genfromtxt(timesteps_file) + num_cells = ap_data.shape[0] + num_timesteps = ap_data.shape[1] + + # Open the input cell positions file + cell_positions_file = open(cell_positions_filename) + index_positions = np.genfromtxt(cell_positions_file) + num_indexes = index_positions.shape[0] + num_cols = index_positions.shape[1] + + # Open the output file + out_file = open("output/cells-apd-inside-region.txt","w") + + print("[!] Calculating APD's ...") + + begin = time.time() + # Iterate over each cell inside the region + for i in range(num_indexes): + + # Get the index of the cell + index = int(index_positions[i][0]) + + # Get the transmembrane potential from the current cell + vms = ap_data[index] + + apds = [] + for j in range(num_aps): + + start = j*period + finish = start + period + + # Calculates its APD + apd = calc_apd(vms,start,finish,ms_each_step,APD_percentage*0.01) + + apds.append(apd) + + # Write the mean APD value on the output file + out_file.write("%g\n" % (sum(apds)/len(apds))) + end = time.time() + + print("[!] Elapsed time = %g seconds" % (end - begin)) + + out_file.close() + print("[+] Output file saved in 'output/cells-apd-inside-region.txt'") + +if __name__ == "__main__": + main() diff --git a/scripts/calc_apd_specific_cells/clean_files.sh b/scripts/calc_apd_specific_cells/clean_files.sh new file mode 100755 index 00000000..54a9f942 --- /dev/null +++ b/scripts/calc_apd_specific_cells/clean_files.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +rm timesteps.txt +rm aps/*.txt diff --git a/scripts/calc_apd_specific_cells/getAps.sh b/scripts/calc_apd_specific_cells/getAps.sh new file mode 100755 index 00000000..5679fa0c --- /dev/null +++ b/scripts/calc_apd_specific_cells/getAps.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +AP_DIR=$1 +AP_PREFIX=$2 +AP_LINE=$3 +TOTAL_NUMBER_CELLS=$4 +PRINT_RATE=$5 + +if [[ "$#" -ne 5 ]]; then + echo "---------------------------------------------------------------------------------" + echo "Usage:> $0 " + echo "---------------------------------------------------------------------------------" + echo " = Directory where the results of the simulation are stored" + echo " = Prefix of the results files" + echo " = Line where the action potential information is stored" + echo " = Total number of grid cells" + echo " = The print rate of the simulation" + echo "---------------------------------------------------------------------------------" + echo "!!! This script only works if the output file is NOT saved in !!!" + echo "!!! binary format !!!" + echo "---------------------------------------------------------------------------------" + echo " guide:" + echo " VTP/VTU --> Line 6" + echo " VTK --> Last line" + echo "---------------------------------------------------------------------------------" + exit 1 +fi + +# Get the transmembrane potential from each of the .vtu files and dump it into a .txt +TIMESTEP=0 +for i in `ls -1v ${AP_DIR}/${AP_PREFIX}*`; do + AP_OUT="aps/timestep-$TIMESTEP.txt" + sed -n "${AP_LINE}p" $i | awk -v TOTAL_NUMBER_CELLS="$TOTAL_NUMBER_CELLS" -F ' ' '{ for (i=0; i < TOTAL_NUMBER_CELLS; i++) { printf "%g\n", $i } }' > ${AP_OUT} + let "TIMESTEP=TIMESTEP+$PRINT_RATE" +done + +# Adjust the total number of timesteps +let "TOTAL_TIMESTEPS=TIMESTEP-$PRINT_RATE" + +# Concatenate the filename from each timestep +CMD="" +for i in $(seq 0 $PRINT_RATE $TOTAL_TIMESTEPS); do + CMD="$CMD aps/timestep-$i.txt" +done + +# Use the 'paste' command to append each timestep into a column on the output file +paste $CMD > timesteps.txt diff --git a/scripts/calc_apd_specific_cells/inputs/cells_positions_inside_region.txt b/scripts/calc_apd_specific_cells/inputs/cells_positions_inside_region.txt new file mode 100644 index 00000000..ef1b2a45 --- /dev/null +++ b/scripts/calc_apd_specific_cells/inputs/cells_positions_inside_region.txt @@ -0,0 +1,100 @@ +513 7950 4950 50 +514 7850 4950 50 +518 7650 4950 50 +519 7750 4950 50 +568 7450 4950 50 +569 7550 4950 50 +573 7350 4950 50 +574 7250 4950 50 +578 7050 4950 50 +579 7150 4950 50 +588 6850 4950 50 +589 6950 4950 50 +593 6750 4950 50 +594 6650 4950 50 +598 6450 4950 50 +599 6550 4950 50 +852 8050 4950 50 +855 8150 4950 50 +856 8250 4950 50 +859 8350 4950 50 +868 8450 4950 50 +871 8550 4950 50 +872 8650 4950 50 +875 8750 4950 50 +916 8850 4950 50 +919 8950 4950 50 +920 9050 4950 50 +923 9150 4950 50 +932 9250 4950 50 +935 9350 4950 50 +936 9450 4950 50 +939 9550 4950 50 +1076 9650 4950 50 +1079 9750 4950 50 +1080 9850 4950 50 +1083 9950 4950 50 +4865 1550 4950 50 +4866 1450 4950 50 +4870 1250 4950 50 +4871 1350 4950 50 +4920 1050 4950 50 +4921 1150 4950 50 +4925 950 4950 50 +4926 850 4950 50 +4930 650 4950 50 +4931 750 4950 50 +4940 450 4950 50 +4941 550 4950 50 +4945 350 4950 50 +4946 250 4950 50 +4950 50 4950 50 +4951 150 4950 50 +5204 1650 4950 50 +5207 1750 4950 50 +5208 1850 4950 50 +5211 1950 4950 50 +5220 2050 4950 50 +5223 2150 4950 50 +5224 2250 4950 50 +5227 2350 4950 50 +5268 2450 4950 50 +5271 2550 4950 50 +5272 2650 4950 50 +5275 2750 4950 50 +5284 2850 4950 50 +5287 2950 4950 50 +5288 3050 4950 50 +5291 3150 4950 50 +5544 4650 4950 50 +5545 4750 4950 50 +5549 4550 4950 50 +5550 4450 4950 50 +5554 4250 4950 50 +5555 4350 4950 50 +5564 4050 4950 50 +5565 4150 4950 50 +5570 3850 4950 50 +5571 3950 4950 50 +5580 3650 4950 50 +5581 3750 4950 50 +5585 3550 4950 50 +5586 3450 4950 50 +5590 3250 4950 50 +5591 3350 4950 50 +6184 6250 4950 50 +6185 6350 4950 50 +6189 6150 4950 50 +6190 6050 4950 50 +6194 5850 4950 50 +6195 5950 4950 50 +6204 5650 4950 50 +6205 5750 4950 50 +6210 5450 4950 50 +6211 5550 4950 50 +6220 5250 4950 50 +6221 5350 4950 50 +6225 5150 4950 50 +6226 5050 4950 50 +6230 4850 4950 50 +6231 4950 4950 50 diff --git a/scripts/calc_apd_specific_cells/output/cells-apd-inside-region.txt b/scripts/calc_apd_specific_cells/output/cells-apd-inside-region.txt new file mode 100644 index 00000000..b40d788a --- /dev/null +++ b/scripts/calc_apd_specific_cells/output/cells-apd-inside-region.txt @@ -0,0 +1,100 @@ +283 +282 +283 +283 +283 +283 +284 +284 +284 +284 +285 +285 +286 +286 +288 +288 +282 +281 +282 +281 +282 +281 +281 +281 +281 +280 +280 +280 +279 +279 +279 +278 +278 +278 +278 +276 +339 +339 +340 +340 +340 +340 +340 +340 +339 +340 +340 +339 +339 +339 +339 +339 +338 +338 +338 +339 +338 +338 +338 +337 +337 +335 +335 +334 +334 +334 +333 +332 +312 +312 +314 +314 +318 +318 +321 +321 +324 +324 +326 +326 +328 +328 +330 +331 +290 +290 +290 +290 +294 +294 +296 +296 +299 +299 +302 +302 +303 +303 +309 +309 diff --git a/scripts/calc_apd_specific_cells/output/cells-apd.txt b/scripts/calc_apd_specific_cells/output/cells-apd.txt new file mode 100644 index 00000000..4e436a9b --- /dev/null +++ b/scripts/calc_apd_specific_cells/output/cells-apd.txt @@ -0,0 +1,10000 @@ +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +382 +382 +384 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +382 +382 +384 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +380 +380 +380 +380 +380 +380 +386 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +380 +380 +380 +380 +380 +380 +386 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +382 +382 +384 +384 +384 +382 +382 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +390 +390 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +390 +390 +382 +382 +384 +384 +384 +382 +382 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +390 +390 +384 +384 +390 +390 +384 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +390 +390 +384 +384 +390 +390 +384 +390 +384 +384 +390 +382 +384 +384 +382 +382 +384 +384 +382 +390 +390 +384 +384 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +382 +382 +384 +384 +382 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +380 +380 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +388 +388 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +388 +388 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +388 +388 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +388 +380 +380 +388 +388 +380 +380 +388 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +388 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +388 +382 +382 +388 +388 +388 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +380 +380 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +380 +380 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +380 +380 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +380 +380 +388 +382 +382 +388 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +388 +388 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +382 +382 +384 +384 +382 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +384 +382 +382 +384 +384 +382 +382 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +390 +382 +382 +390 +390 +382 +382 +390 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +380 +380 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +388 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +388 +388 +382 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +388 +388 +382 +380 +382 +382 +380 +380 +382 +382 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +388 +388 +382 +382 +388 +388 +382 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +388 +388 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +388 +388 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +380 +382 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +388 +388 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +380 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +382 +382 +388 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +382 +382 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +380 +382 +382 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +388 +380 +380 +388 +388 +388 +380 +380 +380 +380 +382 +382 +382 +380 +380 +382 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +388 +388 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +388 +388 +380 +380 +380 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +380 +380 +382 +380 +380 +382 +382 +382 +380 +380 +380 +380 +388 +388 +388 +380 +380 +388 +382 +382 +380 +380 +380 +388 +388 +380 +380 +388 +388 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +380 +382 +382 +380 +380 +382 +382 +380 +388 +382 +382 +388 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +386 +384 +384 +386 +386 +384 +384 +386 +384 +384 +384 +384 +380 +380 +380 +380 +380 +380 +380 +380 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +380 +382 +382 +380 +380 +380 +382 +382 +382 +382 +380 +380 +380 +382 +382 +380 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +390 +390 +382 +382 +382 +390 +390 +382 +382 +384 +384 +382 +382 +382 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +384 +384 +382 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +382 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +390 +390 +384 +384 +390 +390 +384 +390 +384 +384 +390 +382 +384 +384 +382 +382 +384 +384 +382 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +382 +382 +390 +384 +384 +390 +390 +384 +384 +390 +382 +384 +384 +382 +390 +384 +384 +390 +382 +384 +384 +382 +382 +384 +384 +382 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +390 +390 +382 +382 +384 +384 +384 +382 +382 +384 +384 +390 +390 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +384 +384 +390 +384 +384 +384 +384 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +384 +384 +382 +382 +384 +384 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +388 +382 +382 +388 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +390 +384 +384 +390 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +390 +390 +384 +384 +390 +390 +384 +384 +384 +384 +384 +390 +384 +384 +390 +390 +390 +384 +384 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +384 +384 +384 +384 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +382 +382 +382 +382 +382 +388 +388 +382 +382 +388 +388 +382 +382 +382 +382 +382 +384 +384 +384 +384 +382 +382 +382 +382 +382 +382 +382 +382 +384 +384 +384 +384 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +386 +386 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +386 +386 +380 +380 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 +386 +386 +380 +380 +386 +386 +386 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +380 +386 diff --git a/scripts/calc_apd_specific_cells/output/test b/scripts/calc_apd_specific_cells/output/test new file mode 100644 index 00000000..e69de29b diff --git a/scripts/cell_position_calculator_over_a_line/CMakeLists.txt b/scripts/cell_position_calculator_over_a_line/CMakeLists.txt new file mode 100644 index 00000000..bfef89e6 --- /dev/null +++ b/scripts/cell_position_calculator_over_a_line/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8) + +PROJECT(CellPositionInsideRegion) + +find_package(VTK REQUIRED) +include(${VTK_USE_FILE}) + +SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin ) + +add_executable(CellPositionInsideRegion main.cpp ) + +target_link_libraries(CellPositionInsideRegion ${VTK_LIBRARIES}) diff --git a/scripts/cell_position_calculator_over_a_line/clean_project.sh b/scripts/cell_position_calculator_over_a_line/clean_project.sh new file mode 100755 index 00000000..d25ced98 --- /dev/null +++ b/scripts/cell_position_calculator_over_a_line/clean_project.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +BUILD_DIR="build" + +if [[ "$#" -eq 1 ]]; then + BUILD_DIR=$1 +fi + +if [[ ! -d "${BUILD_DIR}" ]]; then + echo "Directory ${BUILD_DIR} does not exist" + exit +fi + +rm -fr ${BUILD_DIR}/* +rm -fr bin/* diff --git a/scripts/cell_position_calculator_over_a_line/main.cpp b/scripts/cell_position_calculator_over_a_line/main.cpp new file mode 100644 index 00000000..cb1f818b --- /dev/null +++ b/scripts/cell_position_calculator_over_a_line/main.cpp @@ -0,0 +1,328 @@ +// Author: Lucas Berg +// Script to write to a file the positions from the center of each control volume + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PRINT_LINE "=============================================================================" + +using namespace std; + +// Control volumes are hexahedrons +// p6______p7 +// /| /| +// p2/_|__p3/ | +// | |___|__| +// | /p5 | /p4 +// |/_____|/ +// p1 p0 +struct control_volume +{ + uint32_t id; + + double p0[3]; // Coordinates of the first point + double p1[3]; // Coordinates of the second point + double p2[3]; // Coordinates of the third point + double p3[3]; // Coordinates of the forth point + double p4[3]; // Coordinates of the fifth point + double p5[3]; // Coordinates of the sixty point + double p6[3]; // Coordinates of the seventy point + double p7[3]; // Coordinates of the eighty point +}; + +struct region +{ + double min_x; // Minimum value of x + double max_x; // Maximum value of x + double min_y; // Minimum value of y + double max_y; // Maximum value of y + double min_z; // Minimum value of z + double max_z; // Maximum value of z +}; + +struct region* new_region (const double min_x, const double max_x,\ + const double min_y, const double max_y,\ + const double min_z, const double max_z) +{ + struct region *result = (struct region*)malloc(sizeof(struct region)); + + result->min_x = min_x; + result->max_x = max_x; + result->min_y = min_y; + result->max_y = max_y; + result->min_z = min_z; + result->max_z = max_z; + + return result; +} + +struct tissue +{ + uint32_t num_volumes; + + struct control_volume *volumes; +}; + +struct tissue* new_tissue () +{ + struct tissue *t = (struct tissue *)malloc(sizeof(struct tissue)); + + t->num_volumes = 0; + t->volumes = NULL; + + return t; +} + +void read_control_volumes_from_vtu (struct tissue *the_tissue, vtkUnstructuredGrid *unstructuredGrid) +{ + uint32_t num_cells = unstructuredGrid->GetNumberOfCells(); + + the_tissue->num_volumes = num_cells; + the_tissue->volumes = (struct control_volume*)malloc(sizeof(struct control_volume)*num_cells); + + for (uint32_t i = 0; i < num_cells; i++) + { + vtkCell *cell = unstructuredGrid->GetCell(i); + + vtkHexahedron *hexahedron = dynamic_cast(cell); + + double p0[3]; + double p1[3]; + double p2[3]; + double p3[3]; + double p4[3]; + double p5[3]; + double p6[3]; + double p7[3]; + + hexahedron->GetPoints()->GetPoint(0, p0); + hexahedron->GetPoints()->GetPoint(1, p1); + hexahedron->GetPoints()->GetPoint(2, p2); + hexahedron->GetPoints()->GetPoint(3, p3); + hexahedron->GetPoints()->GetPoint(4, p4); + hexahedron->GetPoints()->GetPoint(5, p5); + hexahedron->GetPoints()->GetPoint(6, p6); + hexahedron->GetPoints()->GetPoint(7, p7); + + memcpy(the_tissue->volumes[i].p0,p0,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p1,p1,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p2,p2,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p2,p2,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p3,p3,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p4,p4,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p5,p5,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p6,p6,sizeof(double)*3); + memcpy(the_tissue->volumes[i].p7,p7,sizeof(double)*3); + } +} + +void print_control_volumes (struct tissue *the_tissue) +{ + uint32_t nv = the_tissue->num_volumes; + struct control_volume *volumes = the_tissue->volumes; + + for (uint32_t i = 0; i < nv; i++) + { + printf("%s\n",PRINT_LINE); + printf("Cell %u\n",i); + + printf("p0: (%g,%g,%g)\n",volumes[i].p0[0],volumes[i].p0[1],volumes[i].p0[2]); + printf("p1: (%g,%g,%g)\n",volumes[i].p1[0],volumes[i].p1[1],volumes[i].p1[2]); + printf("p2: (%g,%g,%g)\n",volumes[i].p2[0],volumes[i].p2[1],volumes[i].p2[2]); + printf("p3: (%g,%g,%g)\n",volumes[i].p3[0],volumes[i].p3[1],volumes[i].p3[2]); + printf("p4: (%g,%g,%g)\n",volumes[i].p4[0],volumes[i].p4[1],volumes[i].p4[2]); + printf("p5: (%g,%g,%g)\n",volumes[i].p5[0],volumes[i].p5[1],volumes[i].p5[2]); + printf("p6: (%g,%g,%g)\n",volumes[i].p6[0],volumes[i].p6[1],volumes[i].p6[2]); + printf("p7: (%g,%g,%g)\n",volumes[i].p7[0],volumes[i].p7[1],volumes[i].p7[2]); + + printf("%s\n",PRINT_LINE); + } +} + +void calc_control_volume_center (const struct control_volume volume, double center[]) +{ + center[0] = (volume.p0[0] + volume.p1[0]) / 2.0; + center[1] = (volume.p0[1] + volume.p3[1]) / 2.0; + center[2] = (volume.p0[2] + volume.p4[2]) / 2.0; +} + +void write_control_volumes_middle_positions_inside_region (struct tissue *the_tissue, struct region *the_region) +{ + uint32_t nv = the_tissue->num_volumes; + struct control_volume *volumes = the_tissue->volumes; + + double min_x = the_region->min_x; + double max_x = the_region->max_x; + double min_y = the_region->min_y; + double max_y = the_region->max_y; + double min_z = the_region->min_z; + double max_z = the_region->max_z; + + FILE *file = fopen("outputs/cells_positions_inside_region.txt","w+"); + + for (uint32_t i = 0; i < nv; i++) + { + double center[3]; + + calc_control_volume_center(volumes[i],center); + + if (center[0] >= min_x && center[0] <= max_x &&\ + center[1] >= min_y && center[1] <= max_y &&\ + center[2] >= min_z && center[2] <= max_z) + { + fprintf(file,"%u %g %g %g\n",i,center[0],center[1],center[2]); + } + } + + fclose(file); +} + +void create_sphere (vtkSmartPointer appendFilter, const double center[]) +{ + // Create the sphere at the specified center + vtkSmartPointer sphereSource = vtkSmartPointer::New(); + sphereSource->SetCenter(center[0],center[1],center[2]); + sphereSource->SetRadius(0.05); + sphereSource->Update(); + + // Append the sphere to the filter + appendFilter->AddInputConnection(sphereSource->GetOutputPort()); + appendFilter->Update(); +} + +void write_control_volumes_middle_positions_inside_region_to_vtp (struct tissue *the_tissue,\ + struct region *the_region) +{ + uint32_t nv = the_tissue->num_volumes; + struct control_volume *volumes = the_tissue->volumes; + + double min_x = the_region->min_x; + double max_x = the_region->max_x; + double min_y = the_region->min_y; + double max_y = the_region->max_y; + double min_z = the_region->min_z; + double max_z = the_region->max_z; + + vtkSmartPointer appendFilter = vtkSmartPointer::New(); + + // For each control volume create a sphere + for (uint32_t i = 0; i < nv; i++) + { + printf("[main] Working on control volume %u\n",i); + + double center[3]; + + calc_control_volume_center(volumes[i],center); + + if (center[0] >= min_x && center[0] <= max_x &&\ + center[1] >= min_y && center[1] <= max_y &&\ + center[2] >= min_z && center[2] <= max_z) + { + create_sphere(appendFilter,center); + } + + } + + // Write the data that was appended to the file + vtkSmartPointer writer = vtkSmartPointer::New(); + writer->SetFileName("outputs/cells_positions_inside_region.vtp"); + writer->SetInputConnection(appendFilter->GetOutputPort()); + writer->Write(); +} + +void write_control_volumes_cells_indexes_inside_region (struct tissue *the_tissue, struct region *the_region) +{ + uint32_t nv = the_tissue->num_volumes; + struct control_volume *volumes = the_tissue->volumes; + + double min_x = the_region->min_x; + double max_x = the_region->max_x; + double min_y = the_region->min_y; + double max_y = the_region->max_y; + double min_z = the_region->min_z; + double max_z = the_region->max_z; + + FILE *file = fopen("outputs/cells_indexes_inside_region.txt","w+"); + + for (uint32_t i = 0; i < nv; i++) + { + double center[3]; + + calc_control_volume_center(volumes[i],center); + + if (center[0] >= min_x && center[0] <= max_x &&\ + center[1] >= min_y && center[1] <= max_y &&\ + center[2] >= min_z && center[2] <= max_z) + { + fprintf(file,"%u\n",i); + } + } + + fclose(file); +} + +int main (int argc, char *argv[]) +{ + if (argc-1 != 7) + { + cerr << PRINT_LINE << endl; + cerr << "Usage:> " << argv[0] << " " << endl; + cerr << PRINT_LINE << endl; + cerr << " = VTU file with the solution of a timestep from the simulation" << endl; + cerr << " = Minimum value for the x region" << endl; + cerr << " = Maximum value for the x region" << endl; + cerr << " = Minimum value for the y region" << endl; + cerr << " = Maximum value for the y region" << endl; + cerr << " = Minimum value for the z region" << endl; + cerr << " = Maximum value for the z region" << endl; + cerr << PRINT_LINE << endl; + cerr << "Example:" << endl; + cerr << argv[0] << " ../../outputs/plain_mixed_models_tt/V_it_0.vtu" << endl; + cerr << PRINT_LINE << endl; + + exit(EXIT_FAILURE); + } + + string filename = argv[1]; + double min_x = atof(argv[2]); + double max_x = atof(argv[3]); + double min_y = atof(argv[4]); + double max_y = atof(argv[5]); + double min_z = atof(argv[6]); + double max_z = atof(argv[7]); + + // Read all the data from the file + vtkSmartPointer reader = + vtkSmartPointer::New(); + reader->SetFileName(filename.c_str()); + reader->Update(); + + vtkUnstructuredGrid *unstructuredGrid = reader->GetOutput(); + + struct tissue *the_tissue = new_tissue(); + struct region *the_region = new_region(min_x,max_x,min_y,max_y,min_z,max_z); + + read_control_volumes_from_vtu(the_tissue,unstructuredGrid); + //print_control_volumes(the_tissue); + + write_control_volumes_cells_indexes_inside_region(the_tissue,the_region); + //write_control_volumes_middle_positions_inside_region(the_tissue,the_region); + //write_control_volumes_middle_positions_inside_region_to_vtp(the_tissue,the_region); + + return 0; +} diff --git a/scripts/cell_position_calculator_over_a_line/recompile_project.sh b/scripts/cell_position_calculator_over_a_line/recompile_project.sh new file mode 100755 index 00000000..5a19dab7 --- /dev/null +++ b/scripts/cell_position_calculator_over_a_line/recompile_project.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +BUILD_DIR="build" +BUILD_TYPE="Release" + +if [[ "$#" -eq 1 ]]; then + BUILD_DIR=$1 +fi + +if [[ "$#" -eq 2 ]]; then + BUILD_DIR=$1 + BUILD_TYPE=$2 +fi + + +if [[ ! -d "${BUILD_DIR}" ]]; then + echo "Directory ${BUILD_DIR} does not exist. Creating." + mkdir ${BUILD_DIR} +fi + +cd ${BUILD_DIR}; cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..; make