| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,8 +68,8 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 68 | 68 | #@ UIService ui | |
| 69 | 69 | #@ ImgPlus img | |
| 70 | 70 | #@ String (visibility = MESSAGE, value = "<b>Channel settings</b>", required = false) ch_msg | |
| 71 | - #@ String (label = "Channel A name", value = "a") ch_a_name | ||
| 72 | - #@ String (label = "Channel B name", value = "b") ch_b_name | ||
| 71 | + #@ String (label = "Channel A name", value = "Vif") ch_a_name | ||
| 72 | + #@ String (label = "Channel B name", value = "Nuclei") ch_b_name | ||
| 73 | 73 | #@ Integer (label = "Channel A position", value = 1) ch_a | |
| 74 | 74 | #@ Integer (label = "Channel B position", value = 2) ch_b | |
| 75 | 75 | #@ String (visibility = MESSAGE, value = "<b>Image calibration</b>", required = false) cal_msg | |
@@ -86,8 +86,6 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 86 | 86 | ||
| 87 | 87 | from org.scijava.table import DefaultGenericTable | |
| 88 | 88 | ||
| 89 | - from jarray import array | ||
| 90 | - | ||
| 91 | 89 | ||
| 92 | 90 | def extract_channel(image, ch): | |
| 93 | 91 | """Extract a channel from the input image. | |
@@ -108,7 +106,6 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 108 | 106 | """ | |
| 109 | 107 | # find C and Z axis indicies | |
| 110 | 108 | c_idx = find_axis_index(image, "Channel") | |
| 111 | - z_idx = find_axis_index(image, "Z") | ||
| 112 | 109 | ||
| 113 | 110 | return ops.op("transform.hyperSliceView").input(image, c_idx, ch - 1).apply() | |
| 114 | 111 | ||
@@ -208,7 +205,6 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 208 | 205 | ch_b_ths= ops.op("create.img").input(ch_b_img, BitType()).apply() | |
| 209 | 206 | ops.op("threshold.otsu").input(ch_b_img).output(ch_b_ths).compute() | |
| 210 | 207 | ch_b_mask = ops.op("morphology.open").input(ch_b_ths, HyperSphereShape(2), 4).apply() | |
| 211 | - ch_b_mask = ops.op("morphology.fillHoles").input(ch_b_mask, HyperSphereShape(2)).apply() | ||
| 212 | 208 | ||
| 213 | 209 | # extract mask "A" data from mask "B" region | |
| 214 | 210 | ch_ab_mask = extract_inside_mask(ch_a_mask, ch_b_mask) | |
@@ -217,7 +213,7 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 217 | 213 | ab_labeling = ops.op("labeling.cca").input(ch_ab_mask, StructuringElement.EIGHT_CONNECTED).apply() | |
| 218 | 214 | b_labeling = ops.op("labeling.cca").input(ch_b_mask, StructuringElement.EIGHT_CONNECTED).apply() | |
| 219 | 215 | ||
| 220 | - # create a table and make measurement | ||
| 216 | + # create a table for the "AB" mask and make mesurements | ||
| 221 | 217 | ab_table = DefaultGenericTable(3, 0) | |
| 222 | 218 | ab_table.setColumnHeader(0, "{} size (pixels)".format(ch_a_name)) | |
| 223 | 219 | ab_table.setColumnHeader(1, "{} volume (um^3)".format(ch_a_name)) | |
@@ -235,11 +231,12 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 235 | 231 | ).apply() | |
| 236 | 232 | mesh = ops.op("geom.marchingCubes").input(crop).apply() | |
| 237 | 233 | ab_table.appendRow() | |
| 234 | + # measure mesh/sample geometry and stats | ||
| 238 | 235 | ab_table.set("{} size (pixels)".format(ch_a_name), i, ops.op("stats.size").input(sample).apply()) | |
| 239 | 236 | ab_table.set("{} volume (um^3)".format(ch_a_name), i, ops.op("geom.size").input(mesh).apply().getRealFloat() * (x_cal * y_cal * z_cal)) | |
| 240 | 237 | ab_table.set("{} sphericity".format(ch_a_name), i, ops.op("geom.sphericity").input(mesh).apply()) | |
| 241 | 238 | i += 1 | |
| 242 | - | ||
| 239 | + # create a table for the "B" mask and make measurements | ||
| 243 | 240 | b_table = DefaultGenericTable(3, 0) | |
| 244 | 241 | b_table.setColumnHeader(0, "{} size (pixels)".format(ch_b_name)) | |
| 245 | 242 | b_table.setColumnHeader(1, "{} volume (um^3)".format(ch_b_name)) | |
@@ -257,12 +254,13 @@ and a pixel width and height of 0.0650 μm with a step size of 0.1 μm (see the | |||
| 257 | 254 | ).apply() | |
| 258 | 255 | mesh = ops.op("geom.marchingCubes").input(crop).apply() | |
| 259 | 256 | b_table.appendRow() | |
| 257 | + # measure mesh/sample geometry and stats | ||
| 260 | 258 | b_table.set("{} size (pixels)".format(ch_b_name), j, ops.op("stats.size").input(sample).apply()) | |
| 261 | 259 | b_table.set("{} volume (um^3)".format(ch_b_name), j, ops.op("geom.size").input(mesh).apply().getRealFloat() * (x_cal * y_cal * z_cal)) | |
| 262 | 260 | b_table.set("{} sphericity".format(ch_b_name), j, ops.op("geom.sphericity").input(mesh).apply()) | |
| 263 | 261 | j += 1 | |
| 264 | 262 | ||
| 265 | - # display table and labeling | ||
| 263 | + # display results tables and labeling image | ||
| 266 | 264 | ui.show(ab_labeling.getIndexImg()) | |
| 267 | 265 | ui.show("{} results table".format(ch_a_name), ab_table) | |
| 268 | 266 | ui.show("{} results table".format(ch_b_name), b_table) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments