0

I have the following problem. If you take a look at the image below, you see a microscopic image of a circular strand of DNA, called a teardrop. An initial skeletonization (morphology.skeletonize) yielded the trace in red. The trace is an nd-array of shape (N, 2), where N is the number of points in my trace. In orange, the strand is traced after I applied some sort of improvement algorithm, which I designed myself. Now, as you can see, around the bright region, the trace twists a little bit and doesn't resemble the real shape. To work around that, I want to do the following:

  1. Define a radius around the blue dot which is fixed (i.e. 5 nanometres)
  2. Remove all points of the trace that lie within that radius (my problem)
  3. After those points are removed, connect the blue dot with the first point that lies outside the circle

In the end, I don't know how I can tell Python that for a given array of coordinates, I want to delete all those that lie within an area of my image. That area is, as explained, a circle around the blue dot.enter image description here

LionCereals
  • 171
  • 1
  • 10
  • What do you mean by original image? – LionCereals Jan 24 '21 at 15:54
  • Also, my idea in code would be: – LionCereals Jan 24 '21 at 15:55
  • You can create a mask from a contour using `skimage.draw.polygon` as discussed [here](https://stackoverflow.com/a/60888683/2912349). You can then use that mask do index into your image and set those pixels to whatever value you want, e.g. the minimum of the current image. If you just want to mask a circular region, you can just use `skimage.draw.circle` with your desired radius and position to get the mask. – Paul Brodersen Feb 03 '21 at 14:13

0 Answers0