On 4/23/07, Maggie Christman <
[hidden email]> wrote:
> I am trying to determine the proportion of total perimeter of a cell that is
> in contact with another cell (actually fractions of total wall perimeter of
> xylem vessels in contact with other vessels as viewed in cross section)
> without having to manually outline individual regions. Is there an easy way
> to do this?
Will close edges have some distinctive form? For instance, will they
be intensity valleys? You might be able to use a valley detector in
such a case. It really depends on what they look like, though.
If the number of things is fairly small, you might just draw a
polyline by hand along the sections that touch and measure its length.
But then you'll have to find the total perimeter some other way.
If your vessels are bright in a dark background, you could just do a
crude threshold to isolate them, but which doesn't separate the ones
which you consider touching. Then just find the total perimeter of the
resulting blob.
> If I begin with cells that are all outlined, is there a way to
> count the number of pixels that are within a certain distance of other pixels?
Certainly. Iterate over every boundary pixel of one blob, and in each
iteration iterate over every boundary pixel of the other blob. If you
find a point in the second blob within your accepted distance, stop
that iteration, increment a counter, and jump to the next pixel in the
first blob. Something like:
distanceThreshold = 5;
int numTouchingPoints = 0;
for (int i = 0; i < firstBlobPointList.length; i++) {
for (int j = 0; j < secondBlobPointList.length; j++) {
if (distance(firstBlobPointList[i],secondBlobPointList[j]) <
distanceThreshold) {
numTouchingPoints++;
break;
}
}
--
Frederick Ross
Graduate Fellow, (|Siggia> + |McKinney>)/sqrt(2) Lab
The Rockefeller University
Je ne suis pas Fred Cross!