# Analyzing images to differentiate cutting artifacts vs freezing artifacts

Hey,

I’m a master’s student in modern human anatomy and I am teaching myself python to help with my capstone project. I’m still a novice and want some advice for what functions are best for what I want to quantify.

My project involves block face milling of whole brains. The industrial mill I am using unsurprisingly doesn’t have published feed and speed rates for neural tissue or the PVA I am using as a substrate. I took sample cuts a wide range of RPMs and feed rates and want to quantify the presence of cutting artifacts.

Here is a link to an imgur gallery with some samples photos so you can see what the photos are like.

You can visually see that the some of the photos have big arcing cutting artifacts, while the others without cut arcs have chaotic ice crystal formation.

I haven’t started my code yet, but I’m thinking that a Probabilistic Hough Transform would be useful to differentiate the long regular arcs from the short random ice crystals.

Is this the best function for what I am trying to accomplish? Ridge filters and contour finding also look like they could be useful for my goal.

Thank you for reading, and thank you for your advice.

I saw “Canny” edge detection mentioned on Twitter recently, from someone’s talk at NEUBIAS, and it is probably worth a look for your problem. It’ll be sensible to do a grid search over the parameter space for the sigma and threshold values to find the best fit for your images.
It’s also best not to do any of this processing on compressed jpg files, so you should use tiffs if you have them.

Canny would give you a lot of edges.
You could also do a simpler Sobel transform like the Find edges in Fiji.
Then you can have a look at the intensity histogram of the edge map, it might be that you an differentiate cases based on its mean or standard deviation.

Otherwise I would try something that inform you about the texture of the image, like local binary patterns. If you use python, scikit iamge has some functions and tutorials for that.
https://scikit-image.org/docs/0.7.0/api/skimage.feature.texture.html

Otherwise KNIME also has a good “image feature node” including texture features.

Have you tried FFT ?

I have the raw images still, I did some pre-processing in a photoshop script and saved them out as PNGs, do you recommend saving as TIFFs instead?

I definitely want to use python to do the analysis, I’ll dig into the texture feature you linked.

I am looking at the documentation for OpenCV’s FFT package, and am not sure why FFT would be better than PHT.