-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprep_node_list.py
45 lines (36 loc) · 1.25 KB
/
prep_node_list.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Summary
"""
# external dependencies
import numpy as np
import vtk
from vtk.util import numpy_support as nps
import sys
import os
import argparse
from tqdm import tqdm
# internal modules
from AneurysmGeneration.utils.batch import *
from AneurysmGeneration.utils.normalization import *
from AneurysmGeneration.utils.slice import *
#fnames = ['p2', 'p3', 'p4']
#fnames = ['p3']
fnames = ['m1']
shapes = ['ASI2/']#, 'ASI4/', 'ASI6/']
read_dir = "clipped_results_short/RCA/"
out_path = "AdvectionDiffusion/"
total_path = "Artificial/RCA/"
#baseline_total = "Artificial/baseline/all_results.vtu"
#baseline_base = "clipped_results_short/baseline/"
for shape in shapes:
for fname in fnames:
un_clipped = total_path + shape + fname + '/all_results.vtu'
#un_clipped = baseline_total
print 'the total number of nodes for ', un_clipped
print return_unstructured(un_clipped).GetNumberOfPoints()
clipped_name = read_dir + shape + fname + '.vtu'
#clipped_name = baseline_base + 'baseline_' + shape[:-1] + '_' + fname + '.vtu'
gnids = extract_gnids(clipped_name)
out_name = out_path + shape[:-1] + '_' + fname + '_nodes.txt'
#out_name = out_path + 'baseline_' + shape[:-1] + '_' + fname + '_nodes.txt'
with open(out_name, 'wb') as f:
gnids.tofile(f, sep="\n")