Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Ability to determine maximum and minimum feret diameter of features. #944

Open
2 tasks done
StopkaKris opened this issue May 1, 2024 · 8 comments · May be fixed by #948
Open
2 tasks done

ENH: Ability to determine maximum and minimum feret diameter of features. #944

StopkaKris opened this issue May 1, 2024 · 8 comments · May be fixed by #948
Labels
enhancement New feature or request

Comments

@StopkaKris
Copy link

Is there an existing plan for this?

  • I have searched the existing discussions, release notes, and documentation.

Description of the Feature, Filter, or Functionality?

This is a follow up to a previous post on the Google help page. Is it possible to implement a filter (or perhaps add this functionality to the Find Feature Shapes filter) to determine the feret diameter of features? Currently, we can compute the equivalent diameter and Axis lengths/Euler angles of the "best-fit" ellipsoid. This works well for ellipsoidal grains but not for other features, such as lack of fusion (LOF) pores in metals/alloys (first image below) or thin annealing twins (second image below).

The Compute Feature Corners filter writes six values to the Features.csv file that users can then use to manually determine the XYZ bounding box of each feature, but this would not work to measure the feret diameter of the annealing twin in the second screenshot below, since these are oriented arbitrarily within models. Ideally, this functionality would report the maximum and minimum feret diameter of each feature.

image001
image

Version

7.0.x (DREAM3DNX beta)

What section did you foresee your suggestion falling in? [Further details may be required during triage process]

No response

High Level Steps To Implement

No response

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@StopkaKris StopkaKris added the enhancement New feature or request label May 1, 2024
@imikejackson
Copy link
Contributor

imikejackson commented May 2, 2024

@StopkaKris From this page: https://en.wikipedia.org/wiki/Feret_diameter

The Feret diameter should be calculated along a particular axis. Do we want to store all the Feret diameters for a given bounding box? This would give the X, Y, Z, and space diagonal values. Given our Image Geom (and RectGridGeom) have orthogonal axis, there are certain combinations that would give the same results.

Thinking more about this, there are 7 total measurements that might be interesting:

  1. X Axis
  2. Y Axis
  3. Z Axis
  4. XY Face Diagonal
  5. XZ Face Diagonal
  6. YZ Face Diagonal
  7. XYZ Space Diagonal

I started to code this up but ran into these questions.

@StopkaKris
Copy link
Author

Hi @imikejackson, thanks for looking into this so quickly.

I think the measurements that would be useful (in order from most useful to least useful) for each feature would be:

  1. Longest distance.
  2. Shortest distance, to characterize thin features like the twin shown above.
  3. X, Y, and Z axis measurements.

It seems it would be simple to also include the three face diagonals and space diagonal, so maybe the fitler into which this is implemented can have check boxes for the user to select?

I can also provide a .dream3d file of a 3D microstructure model with twins for testing purposes if you need.

Best regards,
Kris

@imikejackson
Copy link
Contributor

imikejackson commented May 2, 2024

@StopkaKris Having a data file to test against would be great. Here is a screen shot of the filter results as it stands now.
I implemented all 7 measurements. I added this to the "Find Feature Sizes" filter. I can make this an option as it takes up a 7 component DataArray.

I used the "Create Element Array from Feature Array" filter to be able to color the data. The order in the 7 components are as above:

X Axis
Y Axis
Z Axis
XY Face Diagonal
XZ Face Diagonal
YZ Face Diagonal
XYZ Space Diagonal

I just used the (02) Image Segmentation prebuilt pipeline for an initial test.

Screenshot 2024-05-02 at 11 57 30

imikejackson added a commit to imikejackson/simplnx that referenced this issue May 2, 2024
- BlueQuartzSoftware#944

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@imikejackson
Copy link
Contributor

#948

imikejackson added a commit to imikejackson/simplnx that referenced this issue May 2, 2024
- BlueQuartzSoftware#944

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
@StopkaKris
Copy link
Author

Hi @imikejackson

Below is a microstructure model with twins, in which FeatureId=12 corresponds to the second ParaView screenshot I posted above: microstructure_with_twins.zip.

To clarify your comment above: i) would the "XYZ Space Diagonal" measure be the longest distance of a feature (~201 for the twin shown above), and ii) is it possible to also include the shortest distance of a feature (~7.08 for the twin shown above)?

@imikejackson
Copy link
Contributor

imikejackson commented May 3, 2024

@StopkaKris This is what I am getting for that feature. There would need to be some sort of transformation to align the thickness with an axis in order to get the values that you are seeing. Maybe using the morphological orientation from the shape description, you could use the major axis as the primary axis and do a transform?

Screenshot 2024-05-02 at 20 22 39

@imikejackson
Copy link
Contributor

Here is all the data:

Index,Feret Diameter_0,Feret Diameter_1,Feret Diameter_2,Feret Diameter_3,Feret Diameter_4,Feret Diameter_5,Feret Diameter_6
0,0,0,0,0,0,0,0
1,60,66,32,89.196411,68,73.34848,94.762863
2,68,64,64,93.380943,93.380943,90.509666,113.20777
3,52,88,94,102.21546,107.42439,128.76335,138.86684
4,62,56,64,83.546394,89.106674,85.041168,105.24258
5,36,38,38,52.345009,52.345009,53.740116,64.683846
6,52,54,58,74.96666,77.897369,79.246452,94.783966
7,52,44,20,68.117546,55.713554,48.332184,70.992958
8,116,106,100,157.13689,153.15352,145.72577,186.25789
9,52,50,52,72.138756,73.539108,72.138756,88.926933
10,78,44,68,89.554451,103.47947,80.993828,112.44554
11,96,66,80,116.49892,124.964,103.71114,141.32233
12,140,130,148,191.04973,203.72531,196.9873,241.66919
13,96,110,112,146,147.51271,156.98407,184.01086
14,94,86,112,127.40487,146.21901,141.20906,169.6349
15,70,46,56,83.761566,89.643738,72.47068,100.75713
16,90,62,72,109.28861,115.25623,95.015785,130.87398
17,54,78,62,94.868332,82.219215,99.639351,113.33138
18,46,70,26,83.761566,52.839378,74.672615,87.704048
19,40,82,80,91.235954,89.442719,114.56003,121.34249
20,130,124,40,179.65523,136.01471,130.29198,184.05434
21,82,54,74,98.183502,110.45361,91.607857,122.94714
22,20,86,86,88.29496,88.29496,121.62237,123.25583
23,34,78,78,85.088188,85.088188,110.30865,115.42963
24,94,68,82,116.01724,124.73973,106.52699,142.0704
25,42,52,52,66.843102,66.843102,73.539108,84.68766
26,86,62,74,106.01887,113.45483,96.540146,129.29037
27,70,92,100,115.60277,122.06556,135.88231,152.85287
28,58,92,106,108.75661,120.83046,140.35669,151.86836
29,112,64,108,128.99612,155.5892,125.53884,168.23793
30,66,76,32,100.65784,73.34848,82.462112,105.62197
31,24,82,80,85.440041,83.522453,114.56003,117.047
32,18,76,84,78.102493,85.906929,113.27842,114.69961
33,56,78,70,96.020828,89.643738,104.80458,118.82761
34,84,64,122,105.60303,148.12157,137.76791,161.35675
35,28,30,24,41.036568,36.878178,38.418747,47.539455
36,50,44,48,66.603302,69.31089,65.11528,82.097504
37,74,42,48,85.088188,88.204308,63.780876,97.693398
38,132,22,146,133.82077,196.8248,147.64822,198.05049
39,14,64,66,65.513359,67.468513,91.934761,92.994621
40,56,62,64,83.546394,85.041168,89.106674,105.24258
41,130,96,138,161.60446,189.58904,168.1071,212.50882
42,52,52,30,73.539108,60.033325,60.033325,79.42292
43,16,72,80,73.756355,81.584312,107.62899,108.81177
44,26,62,64,67.230942,69.079666,89.106674,92.822411
45,86,44,104,96.60228,134.95184,112.92475,141.94365
46,42,42,46,59.396969,62.289646,62.289646,75.126556
47,106,76,68,130.43005,125.93649,101.98039,147.09181
48,78,44,54,89.554451,94.868332,69.656296,104.57533
49,68,32,92,75.153175,114.40279,97.406364,118.79394
50,114,100,180,151.64432,213.06337,205.9126,235.36356
51,28,36,28,45.607018,39.59798,45.607018,53.516354
52,94,82,42,124.73973,102.9563,92.130341,131.62067
53,134,130,146,186.69762,198.17165,195.48914,237.00633
54,58,40,50,70.455658,76.576759,64.031242,86.394447
55,58,120,106,133.28166,120.83046,160.11246,170.29387
56,70,76,40,103.32473,80.622574,85.883644,110.79711
57,36,40,70,53.814495,78.714676,80.622574,88.29496
58,50,44,64,66.603302,81.215759,77.665955,92.368828
59,102,90,170,136.0294,198.25237,192.35384,217.72459
60,138,34,150,142.12671,203.82346,153.80507,206.63979
61,116,90,104,146.81961,155.79474,137.53545,179.92221
62,78,56,74,96.020828,107.51744,92.800865,121.22706
63,70,82,82,107.81466,107.81466,115.96552,135.45479
64,92,108,96,141.87318,132.96616,144.49913,171.3009
65,132,144,148,195.34584,198.31288,206.49455,245.07957
66,176,176,190,248.90158,258.99036,258.99036,313.13257
67,120,56,104,132.42357,158.79547,118.11858,168.38052
68,12,30,30,32.310989,32.310989,42.426407,44.090816
69,64,52,52,82.462112,82.462112,73.539108,97.488464
70,44,82,70,93.05912,82.680107,107.81466,116.44741
71,50,36,28,61.611687,57.306194,45.607018,67.675697
72,108,48,108,118.18629,152.73506,118.18629,160.09998
73,52,42,20,66.843102,55.713554,46.518814,69.771057
74,16,104,72,105.22357,73.756355,126.4911,127.49902
75,168,98,174,194.49422,241.86774,199.69977,260.96744
76,94,46,70,104.6518,117.20068,83.761566,125.90472
77,6,98,72,98.183502,72.249565,121.60592,121.75385
78,96,46,84,106.45187,127.56175,95.770561,135.60236
79,36,42,40,55.317268,53.814495,58,68.264191
80,72,42,44,83.354668,84.380089,60.827625,94.254974
81,32,44,28,54.405884,42.520584,52.153618,61.188232
82,64,58,64,86.371292,90.509666,86.371292,107.49884
83,42,64,66,76.550636,78.230431,91.934761,101.07423
84,28,76,82,80.993828,86.64872,111.8034,115.25623
85,100,54,108,113.64858,147.18695,120.74767,156.78011
86,70,56,52,89.643738,87.20092,76.419891,103.63397
87,88,80,48,118.92855,100.23972,93.295227,128.24976
88,44,38,26,58.137768,51.107731,46.043457,63.686733
89,38,34,36,50.990196,52.345009,49.517673,62.417946
90,82,66,70,105.26158,107.81466,96.208107,126.41203
91,60,60,34,84.852814,68.96376,68.96376,91.411156
92,58,66,64,87.863533,86.371292,91.934761,108.70142
93,90,50,74,102.9563,116.51609,89.308456,126.79117
94,92,64,82,112.0714,123.2396,104.01923,138.86684
95,82,62,84,102.80078,117.38824,104.40307,132.75542
96,54,32,16,62.769421,56.320511,35.777088,64.776543
97,12,116,78,116.61904,78.917679,139.78555,140.29968
98,16,70,64,71.80529,65.969688,94.847244,96.187317
99,42,28,46,50.477718,62.289646,53.851646,68.293488
100,92,82,38,123.2396,99.53894,90.376991,128.96512
101,36,44,34,56.850681,49.517673,55.605755,66.241982
102,110,138,154,176.47662,189.25116,206.78491,234.22212
103,62,50,76,79.649231,98.081596,90.972527,110.09087
104,54,44,48,69.656296,72.249565,65.11528,84.593147
105,134,74,116,153.07515,177.23431,137.5936,192.06248
106,52,86,76,100.49876,92.086914,114.76933,126
107,126,120,46,174,134.13426,128.51459,179.97778
108,14,68,80,69.426216,81.215759,104.99524,105.9245
109,138,20,150,139.44174,203.82346,151.32745,204.80234
110,122,106,102,161.61684,159.02202,147.10541,191.11253
111,66,52,62,84.023804,90.553848,80.919716,104.42222
112,132,22,144,133.82077,195.34584,145.67087,196.58076
113,22,62,78,65.787537,81.043198,99.639351,102.03921
114,52,48,40,70.767227,65.604881,62.481998,81.289604
115,36,96,70,102.52805,78.714676,118.81078,124.14507
116,34,68,72,76.026314,79.624115,99.035347,104.70912
117,78,72,44,106.15083,89.554451,84.380089,114.90866
118,74,64,40,97.836601,84.118965,75.471848,105.69769
119,12,98,72,98.731964,72.993149,121.60592,122.19656
120,60,52,42,79.397736,73.239334,66.843102,89.822044
121,18,74,82,76.15773,83.95237,110.45361,111.91068
122,64,48,48,80,80,67.882248,93.295227
123,6,96,72,96.187317,72.249565,120,120.14991
124,92,104,100,138.85243,135.88231,144.27751,171.114
125,66,80,36,103.71114,75.179787,87.726852,109.7816
126,68,48,48,83.234612,83.234612,67.882248,96.083298
127,76,48,74,89.888817,106.07545,88.204308,116.43024
128,70,46,64,83.761566,94.847244,78.816238,105.41348
129,82,70,120,107.81466,145.34097,138.92444,161.31956
130,22,60,60,63.906181,63.906181,84.852814,87.658424
131,68,52,64,85.603737,93.380943,82.462112,106.88311
132,52,44,20,68.117546,55.713554,48.332184,70.992958
133,80,62,118,101.21265,142.56227,133.29666,155.4606
134,56,48,58,73.756355,80.622574,75.286118,93.829636
135,52,50,64,72.138756,82.462112,81.215759,96.436508
136,34,50,38,60.464867,50.990196,62.801273,71.414284
137,120,184,144,219.67249,187.446,233.64931,262.66327
138,86,50,74,99.478638,113.45483,89.308456,123.98387
139,106,110,54,152.76125,118.96218,122.53979,162.02469
140,16,70,80,71.80529,81.584312,106.30146,107.49884
141,42,40,42,58,59.396969,58,71.610054
142,58,60,28,83.450584,64.404968,66.211784,88.022728
143,102,78,36,128.40561,108.16654,85.906929,133.35666
144,134,138,44,192.35384,141.039,144.84474,197.32207
145,74,82,86,110.45361,113.45483,118.82761,139.98572
146,40,28,30,48.826221,50,41.036568,57.306194
147,58,48,48,75.286118,75.286118,67.882248,89.286057
148,42,22,64,47.413078,76.550636,67.675697,79.649231
149,38,36,38,52.345009,53.740116,52.345009,64.683846
150,128,72,126,146.86047,179.61069,145.12064,193.50452
151,68,74,30,100.49876,74.323616,79.849861,104.88088
152,72,74,36,103.24728,80.498444,82.29216,109.3435
153,84,48,74,96.747093,111.94642,88.204308,121.80312
154,60,72,72,93.723,93.723,101.82338,118.18629
155,132,24,144,134.16408,195.34584,145.9863,196.81464
156,72,50,36,87.658424,80.498444,61.611687,94.762863
157,136,138,74,193.75243,154.82893,156.58864,207.40298
158,74,84,32,111.94642,80.622574,89.888817,116.43024
159,72,82,76,109.12378,104.69002,111.8034,132.9812
160,136,130,152,188.13824,203.96078,200.00999,241.86774
161,126,76,126,147.14618,178.1909,147.14618,193.72145
162,138,16,136,138.92444,193.75243,136.93794,194.41193
163,52,44,44,68.117546,68.117546,62.225395,81.092537
164,74,36,62,82.29216,96.540146,71.693794,103.03397
165,58,48,54,75.286118,79.246452,72.249565,92.649879
166,64,50,58,81.215759,86.371292,76.576759,99.799797
167,94,84,38,126.06348,101.39034,92.195442,131.66624
168,86,92,50,125.93649,99.478638,104.70912,135.49908
169,118,54,108,129.76903,159.96249,120.74767,168.83128
170,36,42,40,55.317268,53.814495,58,68.264191
171,54,92,100,106.67709,113.64858,135.88231,146.21901
172,118,60,112,132.37825,162.6899,127.05904,173.40128
173,76,74,118,106.07545,140.35669,139.28389,158.66946
174,144,114,112,183.66273,182.42807,159.81239,215.11858
175,44,38,38,58.137768,58.137768,53.740116,69.455025
176,86,48,76,98.488579,114.76933,89.888817,124.40257
177,46,42,32,62.289646,56.035702,52.801514,70.028564
178,36,26,62,44.407207,71.693794,67.230942,76.262703
179,70,80,38,106.30146,79.649231,88.56636,112.88933
180,100,86,52,131.89389,112.71202,100.49876,141.77448
181,104,112,134,152.83978,169.62311,174.64249,203.26338
182,8,36,58,36.878178,58.549126,68.264191,68.731361
183,146,150,68,209.32272,161.05899,164.69365,220.0909
184,58,48,48,75.286118,75.286118,67.882248,89.286057
185,10,106,74,106.47065,74.672615,129.2749,129.6611
186,52,36,16,63.245552,54.405884,39.395432,65.238029
187,130,52,146,140.01428,195.48914,154.98387,202.28693
188,100,64,74,118.72658,124.40257,97.836601,139.89996
189,78,44,76,89.554451,108.90363,87.817993,117.45638
190,74,74,40,104.6518,84.118965,84.118965,112.03571
191,26,66,54,70.936592,59.933296,85.276024,89.151558
192,64,34,24,72.47068,68.352028,41.617306,76.341339
193,78,78,104,110.30865,130,130,151.60475
194,114,132,90,174.4133,145.24461,159.76233,196.26512
195,112,112,38,158.39192,118.27087,118.27087,162.88646
196,48,42,36,63.780876,60,55.317268,73.239334
197,44,52,46,68.117546,63.655323,69.426216,82.194893
198,32,32,14,45.254833,34.928497,34.928497,47.370876
199,14,32,28,34.928497,31.304953,42.520584,44.76606
200,80,68,52,104.99524,95.414886,85.603737,117.16655
201,72,90,118,115.25623,138.23169,148.40485,164.94847
202,24,32,20,40,31.240999,37.735924,44.721359
203,50,40,18,64.031242,53.141319,43.863426,66.513153
204,98,116,130,151.85519,162.80049,174.22974,199.89998

@StopkaKris
Copy link
Author

Hi @imikejackson

I think it would be a hassle to perform a transform based on the morphological orientation, as this may differ for each feature of interest. I think the X, Y, and Z (first three) measures you show here are useful, but I am unsure about the other four. And since they are just combinations of the first three, the users can calculate these themselves.

For the feret diameter/longest distance measure of a feature: can we set up something where we identify all boundary cells in a feature (in order to minimize the computational burden of this calculation) and then find the largest distance between these cells? However, I don't see a good way to compute the "thinnest" measure of a feature, such as an annealing twin. I think the only option would be to define an arbitrarily rotated bounding box of each feature, and then extract the minor axis, as is done in the ParaView Bounding Ruler filter. I could see this being useful, however, for example if a user was concerned that a feature such as a twin is very thin, with a thickness of only 1-2 voxels based on the current resolution.

At the least, can we look into implementing the longest distance measure of a feature as described above? ParaView reports this as 201.125 for the twin shown above, and Feret Diameter[3:5] are in the ballpark, but are just different measures altogether.

imikejackson added a commit to imikejackson/simplnx that referenced this issue May 6, 2024
- BlueQuartzSoftware#944

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
imikejackson added a commit to imikejackson/simplnx that referenced this issue May 17, 2024
- BlueQuartzSoftware#944

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants