CNF:Weighted Mesh To Image: Difference between revisions
Jump to navigation
Jump to search
Spyridon97 (talk | contribs) |
Spyridon97 (talk | contribs) |
||
| (43 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
=Repository= | =Repository= | ||
# https://git-community.cs.odu.edu/crtc/ | # [https://git-community.cs.odu.edu/crtc/nuclear-physics/weightedmeshtoimage Gitlab] | ||
= | =Algorithms= | ||
==Summer 2020== | ==Summer 2020== | ||
Create a new image using the weights of: | Create a new image using the weights of: | ||
| Line 13: | Line 13: | ||
## Note 1: If the Intersection set is empty, then the algorithm `2` will be used. | ## Note 1: If the Intersection set is empty, then the algorithm `2` will be used. | ||
## Note 2: If the pixel point is not inside a cell, then the algorithm `1` will be used. | ## Note 2: If the pixel point is not inside a cell, then the algorithm `1` will be used. | ||
# cell points as values in a weighted-mean, were weight[i] = | # cell points as values in a weighted-mean, were weight[i] = interpolation-value[i] based on the location of each pixel point inside a cell. Interpolation-values are the result of the FindCell function. | ||
## Note: If the pixel point is not inside a cell, then the algorithm `1` will be used. | ## Note: If the pixel point is not inside a cell, then the algorithm `1` will be used. | ||
Comparison Metrics | =Comparison Metrics= | ||
# | ==Summer 2020== | ||
# Let a and b be the sets of pixel values of input and output image, then the mean weighted pixel difference value is: | |||
## [[File:MeanWeightedPixelValueFormula.png|300px|File:MeanWeightedPixelValueFormula.png]] | ## [[File:MeanWeightedPixelValueFormula.png|300px|File:MeanWeightedPixelValueFormula.png]] | ||
# Average Hausdorff Distance (itk filter) | # Average Hausdorff Distance (itk filter) | ||
# Similarity Index (itk filter) | # Similarity Index (itk filter) | ||
=Examples= | =Comparison Examples= | ||
==Summer 2020== | |||
'''Left: Image, Middle: Algorithm Result. Right: Mesh''' | |||
=== KNN, number of points = 4, power = 1.5 === | |||
<gallery mode="packed" heights=400px> | |||
File:NT-image.png | |||
File:NT-a_1-n_4-p_1.5.png | |||
File:NT-mesh.png | |||
</gallery> | |||
# Mean Weighted pixel value difference: 0.000395461 | |||
# Average Hausdorff Distance: 0.030885 | |||
# Similarity Index: 0.986463 | |||
=== Cell Points, number of points = 4, power = 1.5 === | |||
<gallery mode="packed" heights=400px> | |||
File:NT-image.png | |||
NT-a_2-n_4-p_1.5.png | |||
File:NT-mesh.png | |||
</gallery> | |||
# Mean Weighted pixel value difference: 0.0002258 | |||
# Average Hausdorff Distance: 0.030885 | |||
# Similarity Index: 0.986463 | |||
=== Intersection of KNN and Cell points, number of points = 5, power = 1.5 === | |||
<gallery mode="packed" heights=400px> | |||
File:NT-image.png | |||
File:NT-a_3-n_5-p_1.5.png | |||
File:NT-mesh.png | |||
</gallery> | |||
# Mean Weighted pixel value difference: 0.000273839 | |||
# Average Hausdorff Distance: 0.030885 | |||
# Similarity Index: 0.986463 | |||
=== Cell points with interpolation weights, number of points = 4, power = 1.5 === | |||
<gallery mode="packed" heights=400px> | |||
File:NT-image.png | |||
File:NT-a_4-n_4-p_1.5.png | |||
File:NT-mesh.png | |||
</gallery> | |||
# Mean Weighted pixel value difference: 9.17551e-05 | |||
# Average Hausdorff Distance: 0.030885 | |||
# Similarity Index: 0.986463 | |||
===Best Algorithm=== | |||
Evidently, the best algorithm both visually and by looking into the metrics is algorithm 4. | |||
=Examples of PODM with changed weights= | |||
==Summer 2020== | ==Summer 2020== | ||
<gallery mode="packed" heights=300px> | |||
File:NT-image.png | |||
File:NT-mesh.png | |||
File:NT_140519,d=5,wl=0.07,me=1.png | |||
</gallery> | |||
===Modifying Area based on X coordinate=== | |||
'''Algorithm 4 will be used''' | |||
<syntaxhighlight lang="c++" line='line'> | |||
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end()); | |||
for (size_t i = 0; i < numberOfPoints; ++i) { | |||
if (points[i][0] >= 15 && points[i][0] <= 20) | |||
pointWeights[i] = maxWeight + pointWeights[i]; | |||
} | |||
</syntaxhighlight> | |||
<gallery mode="packed" heights=400px> | |||
File:NT-x_15_20_image.png | |||
File:NT-x_15_20_mesh.png | |||
</gallery> | |||
===Modifying Area based on Y coordinate=== | |||
'''Algorithm 4 will be used''' | |||
<syntaxhighlight lang="c++" line='line'> | |||
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end()); | |||
for (size_t i = 0; i < numberOfPoints; ++i) { | |||
if (points[i][1] >= 95 && points[i][1] <= 101) | |||
pointWeights[i] = maxWeight + pointWeights[i]; | |||
} | |||
</syntaxhighlight> | |||
<gallery mode="packed" heights=450px> | |||
File:NT-y_95_101_image.png | |||
File:NT-y_95_101_mesh.png | |||
</gallery> | |||
===Modifying Area based on Z coordinate=== | |||
'''Algorithm 4 will be used''' | |||
<syntaxhighlight lang="c++" line='line'> | |||
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end()); | |||
for (size_t i = 0; i < numberOfPoints; ++i) { | |||
if (points[i][2] >= 43 && points[i][2] <= 53) | |||
pointWeights[i] = maxWeight + pointWeights[i]; | |||
} | |||
</syntaxhighlight> | |||
<gallery mode="packed" heights=400px> | |||
File:NT-z_43_53_image.png | |||
File:NT-z_43_53_mesh.png | |||
</gallery> | |||
Latest revision as of 11:10, 13 April 2021
Repository
Algorithms
Summer 2020
Create a new image using the weights of:
- k-nearest-neighbors points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, neighbor-point[i]) ^ power.
- cell points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, cell-point[i]) ^ power.
- Note: If the pixel point is not inside a cell, then the algorithm `1` will be used.
- the intersection set of k-nearest-neighbors points and cell points as values in a weighted-mean, were weight[i] = 1 / distance(pixel-point, intersection-point[i]) ^ power.
- Note 1: If the Intersection set is empty, then the algorithm `2` will be used.
- Note 2: If the pixel point is not inside a cell, then the algorithm `1` will be used.
- cell points as values in a weighted-mean, were weight[i] = interpolation-value[i] based on the location of each pixel point inside a cell. Interpolation-values are the result of the FindCell function.
- Note: If the pixel point is not inside a cell, then the algorithm `1` will be used.
Comparison Metrics
Summer 2020
- Let a and b be the sets of pixel values of input and output image, then the mean weighted pixel difference value is:
- Average Hausdorff Distance (itk filter)
- Similarity Index (itk filter)
Comparison Examples
Summer 2020
Left: Image, Middle: Algorithm Result. Right: Mesh
KNN, number of points = 4, power = 1.5
- Mean Weighted pixel value difference: 0.000395461
- Average Hausdorff Distance: 0.030885
- Similarity Index: 0.986463
Cell Points, number of points = 4, power = 1.5
- Mean Weighted pixel value difference: 0.0002258
- Average Hausdorff Distance: 0.030885
- Similarity Index: 0.986463
Intersection of KNN and Cell points, number of points = 5, power = 1.5
- Mean Weighted pixel value difference: 0.000273839
- Average Hausdorff Distance: 0.030885
- Similarity Index: 0.986463
Cell points with interpolation weights, number of points = 4, power = 1.5
- Mean Weighted pixel value difference: 9.17551e-05
- Average Hausdorff Distance: 0.030885
- Similarity Index: 0.986463
Best Algorithm
Evidently, the best algorithm both visually and by looking into the metrics is algorithm 4.
Examples of PODM with changed weights
Summer 2020
Modifying Area based on X coordinate
Algorithm 4 will be used
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
if (points[i][0] >= 15 && points[i][0] <= 20)
pointWeights[i] = maxWeight + pointWeights[i];
}
Modifying Area based on Y coordinate
Algorithm 4 will be used
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
if (points[i][1] >= 95 && points[i][1] <= 101)
pointWeights[i] = maxWeight + pointWeights[i];
}
Modifying Area based on Z coordinate
Algorithm 4 will be used
auto maxWeight = *std::max_element(pointWeights.begin(), pointWeights.end());
for (size_t i = 0; i < numberOfPoints; ++i) {
if (points[i][2] >= 43 && points[i][2] <= 53)
pointWeights[i] = maxWeight + pointWeights[i];
}