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

I added a row for data correspongin tho the

whole sample.

So the different zones of computation are
Whole sample
Deposit Layer and Gravel Layer mixed togueter ***
Dep Layer
Grv Layer

*** The criterion we defined for the deposit
and gravel layer makes that the sum of the two regions
is smaller than the whole sample

That is why I added the new line for the whole sample
*** O
parent c9dfca94
......@@ -74,7 +74,7 @@ def compute_global_fractions_volumes_depths(r, image, sample_name, start_dl, end
end_gl = int, ending of the gravel layer # should be the ending slice of the image
"""
print('computing...')
zones = ['Total','Deposit Layer', 'Gravel Layer']
zones = ['Total', 'Deposit + Gravel Layer','Deposit Layer', 'Gravel Layer']
phases = ['Outside', 'Voids', 'Fouling Material' , 'Gravel']
labels = [1,0,128,255] # each phase has its label
......@@ -82,13 +82,15 @@ def compute_global_fractions_volumes_depths(r, image, sample_name, start_dl, end
df["Zone"] = zones
depths= []
depths.append(len(image)*r)
depths.append((len(image)-start_dl)*r)
depths.append((end_dl-start_dl)*r)
depths.append((len(image)-end_dl)*r)
df["depth (mm)"]= depths
# total volumes in vox (it is necessary to subtract voxels corresponding to the phase outside the cylinder)
global_volume = np.product(image[start_dl:].shape) - np.count_nonzero(image[start_dl:] == 1)
total_volume = np.product(image.shape) - np.count_nonzero(image == 1)
volume_dep_and_gravel_layer = np.product(image[start_dl:].shape) - np.count_nonzero(image[start_dl:] == 1)
volume_dep_layer = np.product(image[start_dl:end_dl].shape) - np.count_nonzero(image[start_dl:end_dl] == 1)
volume_grv_layer = np.product(image[end_dl:end_gl].shape)- np.count_nonzero(image[end_dl:end_gl] == 1)
......@@ -101,25 +103,31 @@ def compute_global_fractions_volumes_depths(r, image, sample_name, start_dl, end
if phase == 'Outside':
# global volume fraction
# volume fraction in the whole sample
fractions.append(np.count_nonzero(image == label)/np.product(image.shape))
# volume fraction in the deposit + gravel layer
fractions.append(np.count_nonzero(image[start_dl:] == label)/np.product(image[start_dl:].shape))
# volume fraction in the deposit layer
fractions.append(np.count_nonzero(image[start_dl:end_dl] == label)/np.product(image[start_dl:end_dl].shape))
# volume fraction in the gravel layer
fractions.append(np.count_nonzero(image[end_dl:end_gl] == label)/np.product(image[end_dl:end_gl].shape))
else:
# global volume fraction
fractions.append(np.count_nonzero(image[start_dl:] == label)/global_volume)
# volume fraction in the whole sample
fractions.append(np.count_nonzero(image == label)/total_volume)
# volume fraction in the deposit + gravel layer
fractions.append(np.count_nonzero(image[start_dl:] == label)/volume_dep_and_gravel_layer)
# volume fraction in the deposit layer
fractions.append(np.count_nonzero(image[start_dl:end_dl] == label)/volume_dep_layer)
# volume fraction in the gravel layer
fractions.append(np.count_nonzero(image[end_dl:end_gl] == label)/volume_grv_layer)
# global volume # IN cm3
# volume of each phase in the whole sample # IN cm3
volumes.append(np.count_nonzero(image == label)*((r**3))/1000)
# volume of each phase in the deposit + gravel layer # IN cm3
volumes.append(np.count_nonzero(image[start_dl:] == label)*((r**3))/1000)
# volume of the deposit layer
# volume of each phase the deposit layer
volumes.append(np.count_nonzero(image[start_dl:end_dl] == label)*((r**3))/1000)
# volume of the gravel layer
# volume of each phase the gravel layer
volumes.append(np.count_nonzero(image[end_dl:end_gl] == label)*((r**3))/1000)
......
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