Hallo everyone,
I attempt to write a plugin to evaluate nerve fiber density. To do so, I like to create a grid consisting of circles (10µm diameter), with 50µm horizontal spacing; in the first line I require 8 circles, alltogether there should be a number of 32 lines. every second line should have the points offset by 25µm horizontally as well as vertically in respect to the last line. Then I like to lay this (maybe as a mask) over a photograph and count the fibers intersecting/touching (automatically?). Do you have experiences with plugins simliliar to this or can you please give me some advice to accomplish that without any detours? I appreciate your help a lot |
First of all, I think that the macro/plugin that you are looking for is highly specific, so I don't think something like that already exists. You can, however, program something like that.
I don't have time to write the macro, but the general plan would be something like: 1) Analyze Set scale aka tell the computer how many pixels equal a micrometer 2) Create a grid of circle ROI's and a corresponding double array. ex: first row, first column circle ROI would be array[0][0] 3) Iterate through the ROI's and perform image analysis on each This is the tricky part. You have to determine what makes the fiber unique compared to the background. For example, perhaps the fiber is red while the background is black? Or maybe it's bright while the background is dim? Or maybe you can see a clear edge? You'll either want to perform Find Edges or Autothreshold to "look" for the fiber. The image processing pipeline would look like this. Autothreshold or Find Edges -> Binarize -> Particle Analysis If the amount of ROI's in your roiManager increased, then you have found a fiber and can record the result (1 for "found fiber" or 0 for "no fiber") into your double array, array[][] 4) Analyze your array to determine which fibers are connected. Here is something that someone else wrote to make a grid of squares. Maybe it will help you get started: "x = 8; y = 8; width = 40; height = 40; spacing = 3; numRow = 10; numCol = 6; for(i = 0; i < numRow; i++) { for(j = 0; j < numCol; j++) { xOffset = j * (width + spacing); print(xOffset); yOffset = i * (height + spacing); print(yOffset); makeRectangle(x + xOffset, y + yOffset, width, height); roiManager("Add"); if (roiManager("count") > 100) { print("Maximum reached: 100 entries have been created."); exit; } } }"
|
Free forum by Nabble | Edit this page |