Allen Cell Discussion Forum

Changing the code of playground_filament3D to support a 2D image

Specifically, we’re trying to segment images of epithelial cells with an E-cadherin fluorescent label, so we sought to try the filament playground. However, our images are 2D and it looks like this script only works for 3D images. Do you have any suggestions here to move forward?

thanks for your interest in using our segmenter.

The primary goal of this package was to solve 3d problem. So, the jupyter notebook was indeed made to deal with 3D images. However, the key reason why we didn’t make the tool into a GUI-like software is that we want to keep the flexibiltiy. In other words, with a little extra work, users can build a solution for 2D images, even the package was designed for 3D images.

How?

(1) About viewer in jupyter notebook:

for 2d images, you do not need the fancy itk viewer. Simple imshow function should be enough:

https://matplotlib.org/3.3.0/api/_as_gen/matplotlib.pyplot.imshow.html

(2) About intensity normalization and smoothing:

intensity_normalization ,image_smoothing_gaussian_3d, edge_preserving_smoothing_3d should work for 2d images also (even named as _3d)

(3) About core segmentaiton function:

If you are trying filament filter, you can use this function:

For example, as in the SEC61b jupyter notebook:

################################
## PARAMETERS for this step ##
f2_param = [[1, 0.15]]
################################

bw = filament_2d_wrapper(structure_img_smooth, f2_param)

Hope this is helpful.

Feel free to let me know if you have more questions

Jianxu