Commit c689a006 authored by Martinez-Carvajal German's avatar Martinez-Carvajal German
Browse files

Cleaning some unuseful lists.

parent 18af04d1
......@@ -238,13 +238,13 @@ def Compute_Volume_Fraction_Profile (path, path_save, image_name, labels, neighb
# END of FUNCTION TO PLOT THE profiles
##################################################################################################
def check_paths_and_files(paths, path_save, files):
for path in paths:
assert (os.path.isdir(path)) , "Folder: " + path + " IS NOT A FOLDER!"
def check_paths_and_files(path_read, path_save, file):
for i in range(len(paths)):
chdir (paths[i])
assert (os.path.exists(files[i])), "Scan_File: " + files[i] + " DOES NOT EXIST!"
assert (os.path.isdir(path_read)) , "Folder: " + path + " IS NOT A FOLDER!"
chdir (path_read)
assert (os.path.exists(file)), "Scan_File: " + file + " DOES NOT EXIST!"
assert (os.path.isdir(path_save)) , "Folder: " + path_save + " IS NOT A FOLDER!"
......@@ -254,17 +254,14 @@ def check_paths_and_files(paths, path_save, files):
###################################################################################################
def main():
# Directory Reading
paths = []
paths.append('/home/german.martinez-carvajal/Desktop/These/Hashemi_segmentation/Tests/Test9_Rapide/Results/heavy_results')
path_read = '/home/german.martinez-carvajal/Desktop/These/Hashemi_segmentation/Tests/Test9_Rapide/Results/heavy_results'
# Directory saving
path_save = "/home/german.martinez-carvajal/Desktop/These/Volume_fraction_profiles/Test"
# Image Name
image_names = []
image_names.append("Hash_Segm_of_Image_Filtered_PVE_50_Tol_0.5_NumVS_1.tif")
image_name ="Hash_Segm_of_Image_Filtered_PVE_50_Tol_0.75_NumVS_1.tif"
# cheking
assert len(paths) == len(image_names)
check_paths_and_files(paths, path_save, image_names)
check_paths_and_files(path_read, path_save, image_name)
# Constant parameters
# Image resolution
resolution = 0.035 #mm per vox
......@@ -272,18 +269,19 @@ def main():
neighbors = 57 # in voxels
# Labels of the phases
labels = [1,0,128,255] # 1 = outside the cylinder, 0 = voids, 128 = fouling material, 255 = gravel
# Relabel ? (see relabel function)
flag_relabel = True
# Draw Transition Zone ?
flag_TZ = True
# Relabel
flag_relabel = True # set value of pixels outside the inscribed cylinder to int(1)
# Draw Transition Zone ?
flag_TZ = False
lims = (-2*resolution, -5*resolution) # limits of the transition zone in mm
# RAM limitation ?
flag_RAM_limitation = False
# Computing
for i in range(len(paths)):
path = paths[i]
image_name = image_names[i]
Compute_Volume_Fraction_Profile (path, path_save, image_name, labels, neighbors, resolution, flag_TZ = flag_TZ, lims = lims, flag_RAM_limitation = flag_RAM_limitation, flag_relabel = flag_relabel)
Compute_Volume_Fraction_Profile (path_read, path_save, image_name, labels, neighbors, resolution, flag_TZ = flag_TZ, lims = lims, flag_RAM_limitation = flag_RAM_limitation, flag_relabel = flag_relabel)
main()
print("Finished")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment