Dear all on ImageJ listserve.
I am pretty new to image processing and this is my 1st post. We have some images of arteries in mouse brains. We want to locate the artery edges with some precision as we want to measure the waveforms that result from the heartbeats. We anticipate that no off-the-shelf edge detector algorithm will do the whole job, so we're prepared to learn to do some programming in ImageJ. To start, we have applied the Canny edge detector. The results can be rather good, but still some false positives for the edge we want, and some of that edge is missing. Not surprising -- one set of parameters can't work for the whole image. Question: are there approaches to extending a given edge? I hope such approaches might be able to adjust the local parameters as they go, just guessing as best they can using local data. Is this just a pipe dream? Thanks, Dave -- J. David Schaffer Visiting Research Professor College of Community and Public Affairs Binghamton University Binghamton, NY 13902-6000 [hidden email] 607-777-9145 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Dave,
without any sampe images it is extremely difficut, if not impossible, to judge the situation. What you write appears sound, but please let us see at least a *typical*, not the best, image and please tell us *exactly* where you define the artery edge because for colleagues who are not immediately involved in such research it is often quite difficult to come up with correct guesses ... If possible, don't provide jpg-image and please let us access images in original resolution. As far as I understand, you are mainly interested in the widths of the arteries. Regards Herbie -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by David Schaffer
Welcome to image processing (and image understanding).
Yours is a classic problem. I alway taught my students to call the low level process "edge-element detection". This is a bottom-up, local operation that produces little pieces of edges. Linking these edge elements into larger, higher level structures requires moving up one level of abstraction. You cannot profitably think of the data as an "image" anymore. Instead, you have a collection of edge-elements. What *you* want in this particular case is a set of arteries, characterized by a central spine and a width (probably indicated by continuous boundaries on either side. (I suppose you *could* still structure this information as "images", but I don't personally think that's the right idea) A lot depends on the form of imagery you have, but a common first step is to try to link edge-elements into longer curvilinear features. Branching introduces another level of complexity - which you might choose to avoid at this stage. You are looking first for long chains of edge-elements. You might then look for matching CHAINS (the two sides of the same artery). At this stage, I would settle for identifying unbranching sections of artery. For your problem, I suspect this is as far as you need to go. Others might then consider building a graph structure showing how these tubes connect together into a branching structure. In all of these steps (except the first one), you may not need to look at the image once you have detected a large pile of "edge-elements". The processing becomes more symbolic. On the other hand, sophisticated version of these processes may refer back to the image data to confirm or refute hypotheses about where the arteries are. So...action items: a) search for plugins that talk about vasculature b) write your own code to accept a set of edge elements (which should include x,y location and dx,dy orientation) and output long chains of consistent edge-elements (endpoints match, orientations agree). Call these "boundary-segments". Orientation matters here, too (which side is "inside" and which side is "outside") c) write your own code to look for matching boundary-segments that are roughly parallel, but have opposite orientation. You now have "tube-segments". For your problem, I think you are done - you can analyze each tube-segment and measure artery width at each point along each tube-segment. ------------------- Now...backing away from this...it is possible to measure the CHANGE in artery wall position using much lower level information (staying at the image level). Given two images in a sequence, find edge-elements in each and then try to pair edge elements in one image with those in the second. Some of them will be in approximately the same place, at the same orientation. These might be considered to be pieces of artery wall that have moved. You can do the same thing with longer boundary-segments. Try to match boundary-segments in image A with those in image B. The approach outlined at the top takes you all the way to matching tube-segments. ------------------ Approach 3 - at the lowest level, you can estimate local MOTION of "whatever is there" by looking at pairs (or sequences) of images. This is a very low level, image processing approach that produces an image where the pixels have values (dx,dy) giving the estimated motion from image A to image B. This can reliably detect motion of everything you can see in the image. That includes vessel walls - but might include other stuff as well.. Now, you are back to the question of linking up curvilinear features with consistent information, perhaps even finding "motion-tube-sequences" which indicate a pair of boundaries moving towards/away from each other. You might do a literature search on "OCT-A" to find current application of this sort of motion processing (although there, they are measuring blood flow and not artery pulsing). I think it's unlikely that you will find anything "off-the-shelf" (but I am largely ignorant of what's available in ImageJ-plugin form. Every problem is just different enough that you will have to roll your own. My main point is that you probably need to move away from a pure image-based solution, and deal with data structures more complicated than an image array of pixels. I hope this helps. -- Kenneth Sloan [hidden email] Vision is the art of seeing what is invisible to others. > On 18 Jan 2018, at 16:01 , David Schaffer <[hidden email]> wrote: > > Dear all on ImageJ listserve. > > I am pretty new to image processing and this is my 1st post. > > We have some images of arteries in mouse brains. > We want to locate the artery edges with some precision as we want to > measure the waveforms that result from the heartbeats. > > We anticipate that no off-the-shelf edge detector algorithm will do > the whole job, so we're prepared to learn to do some programming in > ImageJ. > > To start, we have applied the Canny edge detector. > The results can be rather good, but still some false positives for the > edge we want, and some of that edge is missing. > Not surprising -- one set of parameters can't work for the whole image. > > Question: are there approaches to extending a given edge? > I hope such approaches might be able to adjust the local parameters > as they go, just guessing as best they can using local data. > > Is this just a pipe dream? > > Thanks, > Dave > > > -- > J. David Schaffer > Visiting Research Professor > College of Community and Public Affairs > Binghamton University > Binghamton, NY 13902-6000 > [hidden email] > 607-777-9145 > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Herbie
Thanks, Herbie.
I figured folks would want to see an example image. OK, Here's one attached. You can see some speckle, and some artifacts (actually other small arteries orthogonal to the image plane). There's one main artery in the image plane. We chose the image plane so this is so. The Canny edge detector, can to a pretty good job of suppressing artifacts, but we also loose some of the desired edges. So now we search for a way to fill in the lost edge segments. I could also send an image with the Canny edges superimposed if that would help. > As far as I understand, you are mainly interested in the widths of the arteries. We're really trying to extract the waveforms of each (left,right) edge that's in the image. We have a stack of these, and want to be able to extract the dynamics of the artery walls (as they respond to heart pulses. And we expect to have LOTS of such image sequences, so we'd love to come up w a robust algorithm -- no manual inputs. Needn't be truly general; just for our types of images. Any help appreciated. Thanks, Dave On Fri, Jan 19, 2018 at 9:39 AM, Herbie <[hidden email]> wrote: > Dear Dave, > > without any sampe images it is extremely difficut, if not impossible, to > judge the situation. > > What you write appears sound, but please let us see at least a *typical*, > not the best, image and please tell us *exactly* where you define the artery > edge because for colleagues who are not immediately involved in such > research it is often quite difficult to come up with correct guesses ... > > If possible, don't provide jpg-image and please let us access images in > original resolution. > > As far as I understand, you are mainly interested in the widths of the > arteries. > > Regards > > Herbie > > > > -- > Sent from: http://imagej.1557.x6.nabble.com/ > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- J. David Schaffer Visiting Research Professor College of Community and Public Affairs Binghamton University Binghamton, NY 13902-6000 [hidden email] 607-777-9145 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html Ch3-Vessel_830nm_Zoom6_Res_Z0_00001_000010028.tif (700K) Download Attachment |
In reply to this post by Kenneth Sloan-2
Thanks, Kenneth.
Actually, our problem may be simpler that I gave the impression. We choose our images so that there is one big artery in the image plane. No worries about branching (at least for now). What I have in mind is, starting from an edge segment (from Canny, or some such), I expect to have to write code that tries to "follow the edge" into the unknown. Something like ridge-following in the derivative of the intensities, even if they get pretty noisy. We'll have to fiddle with criteria for choosing the best next-point, and so on. OK, I don't even know how to write low-level ImageJ code. Could someone send me an example or two of such a thing? Perhaps someone has already written such an edge-extender before. Or, failing that, some code that accesses the same image info I need, given an xy pixel location, how to get the neighbors in a particular direction and compute intensity gradients, ... Hoping I can learn the art of ImageJ programming from a few examples. Thanks, Dave On Fri, Jan 19, 2018 at 10:01 AM, Kenneth Sloan <[hidden email]> wrote: > Welcome to image processing (and image understanding). > > Yours is a classic problem. I alway taught my students to call the low level process "edge-element detection". > This is a bottom-up, local operation that produces little pieces of edges. > > Linking these edge elements into larger, higher level structures requires moving up one level of abstraction. You cannot profitably think of the data as an "image" anymore. Instead, you have a collection of edge-elements. What *you* want in this particular case is a set of arteries, characterized by a central spine and a width (probably indicated by continuous boundaries on either side. (I suppose you *could* still structure this information as "images", but I don't personally think that's the right idea) > > A lot depends on the form of imagery you have, but a common first step is to try to link edge-elements into longer curvilinear features. Branching introduces another level of complexity - which you might choose to avoid at this stage. You are looking first for long chains of edge-elements. You might then look for matching CHAINS (the two sides of the same artery). At this stage, I would settle for identifying unbranching sections of artery. > > For your problem, I suspect this is as far as you need to go. > > Others might then consider building a graph structure showing how these tubes connect together into a branching structure. > > In all of these steps (except the first one), you may not need to look at the image once you have detected a large pile of "edge-elements". The processing becomes more symbolic. On the other hand, sophisticated version of these processes may refer back to the image data to confirm or refute hypotheses about where the arteries are. > > So...action items: > > a) search for plugins that talk about vasculature > b) write your own code to accept a set of edge elements (which should include x,y location and dx,dy orientation) and output long chains of consistent edge-elements (endpoints match, orientations agree). Call these "boundary-segments". Orientation matters here, too (which side is "inside" and which side is "outside") > c) write your own code to look for matching boundary-segments that are roughly parallel, but have opposite orientation. You now have "tube-segments". > > For your problem, I think you are done - you can analyze each tube-segment and measure artery width at each point along each tube-segment. > > ------------------- > > Now...backing away from this...it is possible to measure the CHANGE in artery wall position using much lower level information (staying at the image level). Given two images in a sequence, find edge-elements in each and then try to pair edge elements in one image with those in the second. Some of them will be in approximately the same place, at the same orientation. These might be considered to be pieces of artery wall that have moved. > > You can do the same thing with longer boundary-segments. Try to match boundary-segments in image A with those in > image B. > > The approach outlined at the top takes you all the way to matching tube-segments. > > ------------------ > > Approach 3 - at the lowest level, you can estimate local MOTION of "whatever is there" by looking at pairs (or sequences) of images. This is a very low level, image processing approach that produces an image where the pixels have values (dx,dy) giving the estimated motion from image A to image B. This can reliably detect motion of everything you can see in the image. That includes vessel walls - but might include other stuff as well.. > Now, you are back to the question of linking up curvilinear features with consistent information, perhaps even finding "motion-tube-sequences" which indicate a pair of boundaries moving towards/away from each other. > > You might do a literature search on "OCT-A" to find current application of this sort of motion processing (although there, they are measuring blood flow and not artery pulsing). > > I think it's unlikely that you will find anything "off-the-shelf" (but I am largely ignorant of what's available in ImageJ-plugin form. Every problem is just different enough that you will have to roll your own. My main point is that you probably need to move away from a pure image-based solution, and deal with data structures more complicated than an image array of pixels. > > I hope this helps. > > -- > Kenneth Sloan > [hidden email] > Vision is the art of seeing what is invisible to others. > > > > > >> On 18 Jan 2018, at 16:01 , David Schaffer <[hidden email]> wrote: >> >> Dear all on ImageJ listserve. >> >> I am pretty new to image processing and this is my 1st post. >> >> We have some images of arteries in mouse brains. >> We want to locate the artery edges with some precision as we want to >> measure the waveforms that result from the heartbeats. >> >> We anticipate that no off-the-shelf edge detector algorithm will do >> the whole job, so we're prepared to learn to do some programming in >> ImageJ. >> >> To start, we have applied the Canny edge detector. >> The results can be rather good, but still some false positives for the >> edge we want, and some of that edge is missing. >> Not surprising -- one set of parameters can't work for the whole image. >> >> Question: are there approaches to extending a given edge? >> I hope such approaches might be able to adjust the local parameters >> as they go, just guessing as best they can using local data. >> >> Is this just a pipe dream? >> >> Thanks, >> Dave >> >> >> -- >> J. David Schaffer >> Visiting Research Professor >> College of Community and Public Affairs >> Binghamton University >> Binghamton, NY 13902-6000 >> [hidden email] >> 607-777-9145 >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- J. David Schaffer Visiting Research Professor College of Community and Public Affairs Binghamton University Binghamton, NY 13902-6000 [hidden email] 607-777-9145 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by David Schaffer
Dear Dave,
thanks for the sample image! Here is a first attempt to trace one artery boundary: <http://imagej.1557.x6.nabble.com/file/t380516/Ch3-Vessel_830nm_Zoom6_Res_Z0_00001_000010028-6.png> Please tell us how you judge this result. Regards Herbie -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by David Schaffer
yes - that's pretty simple, as vasculature goes. Herbie seems to be on track to help you
on your plan to find and trace boundaries, so I won't intrude there. But...it might be helpful to make available a complete stack of images - because I think your *real* question is "how are the boundaries moving" and not so much "where are the boundaries in each individual frame". If I may, I suggest first converting to 8-bit, and perhaps apply some smoothing to get rid of the speckle. And then, find a way to share an entire stack. If all else fails, I can create a "Box" folder where you can upload a sequence of images. Personally, I'm a bit interested in whether it will work to concentrate on identifying MOTION without actually tracing the boundaries. On the other hand, Herbie has demonstrated that *he* can easily find your boundaries in your images, and if that works for you there's no need to look further. As you can probably appreciate, there is a mountain of literature on solving this problem. The question is: does someone here have something you can use, more or less "off the shelf". I suspect that Herbie does. I don't. -- Kenneth Sloan [hidden email] Vision is the art of seeing what is invisible to others. > On 19 Jan 2018, at 16:16 , David Schaffer <[hidden email]> wrote: > > Thanks, Kenneth. > Actually, our problem may be simpler that I gave the impression. > We choose our images so that there is one big artery in the image plane. > No worries about branching (at least for now). > > What I have in mind is, starting from an edge segment (from Canny, or > some such), I expect to have to write code that tries to "follow the > edge" into the unknown. > Something like ridge-following in the derivative of the intensities, > even if they get pretty noisy. > We'll have to fiddle with criteria for choosing the best next-point, and so on. > > OK, I don't even know how to write low-level ImageJ code. > Could someone send me an example or two of such a thing? > Perhaps someone has already written such an edge-extender before. > Or, failing that, some code that accesses the same image info I need, > given an xy pixel location, how to get the neighbors in a particular > direction and compute intensity gradients, ... > > Hoping I can learn the art of ImageJ programming from a few examples. > > Thanks, > Dave > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Good day Kenneth,
and thanks for continuing with comments and suggestions! "But...it might be helpful to make available a complete stack of images [...]" I fully agree that it would be very helpful to now see at least a short sequence of images. Furthermore, it appears quite essential to know whether the thickness-variations over time need to be measured along the imaged part of the artery (mean, stdDev, max, min) or only to be visualized by contour lines. If they are to be measured, it is necessary to get a reasonable idea of the desired accuracy. Concerning my approach, please see the related task/solution: <http://forum.imagej.net/t/corrosion-thickness-measurement/8310> (Image quality is much better in this case, hence the necessary pre-processing is simpler than in the present situation.) Best Herbie -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by David Schaffer
Hi Dave,
Another possibility for your task is the Tubeness plugin bundled with Fiji. Attached is an image showing the result after manually editing an orthogonal vessel touching the artery (I cut and pasted a neighboring region of the background over the bright object; a similar approach to get rid of all the orthogonal vessels could be automated), converting to 32-bit with Image>Type>32-bit to remove noise with Process>Noise>ROF Denoise (theta=100), converting to 8-bit with Image>Type>8-bit to run Plugins>Analyze>Tubeness (Sigma=10, uncheck Use calibration information), thresholding the result manually with Image>Adjust>Threshold followed by Edit>Selection>Create Selection and the letter "t" to send the region of interest to the ROI Manager. The ROI was then superimposed on the original image with Ctrl-D after selecting Image>Type>RGB Color and switching the default foreground color in the menubar to yellow. Maybe this approach with some tweaking could reveal not only the width of the outer artery wall but also fluctuations in the width of the lumen and/or the walls themselves. An important issue is whether to assess changes in the width of the full extent of the imaged artery, which may be straightforward (divide total area by the length of the binary skeleton of the artery) or to assess changes at regular intervals along the artery, which is more difficult (assess the width normal to the longitudinal axis of the artery at regular intervals). I suspect that for a pulsatile change the latter may be the more appropriate solution. Also, there is of course a degree of arbitrariness in the thresholding operation, but if your images have similar intensities and you use the same thresholding parameters for all of them then you may be likely to obtain good relative results in monitoring fluctuations in artery parameters with the pulse. Herbie's concern about the desired accuracy is an important consideration. For automation, the best way to start writing code is to turn on Plugins>Macros>Record as you perform the steps listed. By saving a *.ijm file from the result, you can create a snippet of code that will perform the steps on a selected image that you have open in Fiji/ImageJ. With experience you'll find that there are ways to run this snippet on folders containing many files, or on a stack of images, etc. I hope this is helpful. Cheers, Mark -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html Ch3-Vessel_830nm_Zoom6_Res_Z0_00001_000010028-1.jpg (87K) Download Attachment |
In reply to this post by Herbie
Thanks, Herbie.
This looks like a quite good start. There are some obvious jaggednesses that need to be smoothed out. But I think we can be up to that, if we can just learn the ImageJ tools. May we inquire how you did that? Some manual steps involved? Pax, Dave On Fri, Jan 19, 2018 at 6:04 PM, Herbie <[hidden email]> wrote: > Dear Dave, > > thanks for the sample image! > > Here is a first attempt to trace one artery boundary: > <http://imagej.1557.x6.nabble.com/file/t380516/Ch3-Vessel_830nm_Zoom6_Res_Z0_00001_000010028-6.png> > > Please tell us how you judge this result. > > Regards > > Herbie > > > > -- > Sent from: http://imagej.1557.x6.nabble.com/ > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- J. David Schaffer Visiting Research Professor College of Community and Public Affairs Binghamton University Binghamton, NY 13902-6000 [hidden email] 607-777-9145 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Dear Dave,
we are still far away from a robust and automatic solution but I know that it is the goal! ----------------------------------------------------------------------------------- It would help if to read my previous reply to Kenneth: 1. It would be very helpful to now see at least a short sequence of images. 2. It appears quite essential to know whether the thickness-variations over time need to be measured along the imaged part of the artery (mean, stdDev, max, min) or only to be visualized/dislayed by contour lines. 3. If they are to be measured, it is necessary to get a reasonable idea of the desired accuracy. ----------------------------------------------------------------------------------- "May we inquire how you did that?" Concerning my approach, please see the related task/solution: <http://forum.imagej.net/t/corrosion-thickness-measurement/8310> Image quality is much better in this case, hence the necessary pre-processing is less involved than it will be in the present situation. "There are some obvious jaggednesses that need to be smoothed out." More recent results show less jaggednesses. If perfect "smoothing" is possible depends on your answer to point 2. "Some manual steps involved?" I guess not, but I can only judge it after the inspection of a typical short image sequence. Please be aware that the previously posted contour image was obtained from your sample image and I can't guarantee that my approach works for other images as well. It depends on their quality and the form of the imaged vessels. (Although being in 16bit format, the provided sample image shows a rather low gray-value dynamic of 109 levels. Furthermore, it suffers from line-like artifacts but they appear to be inherent to the image acquisition process. Please comment!) Presently, I assume that the imaged part of the vessel is and over time stays more or less straight, as in the sample image. In general, I prefer to first orient the vessel horizontally. This is mandatory in case you need to measure its thickness (cf. point 2.). Regards Herbie -- Sent from: http://imagej.1557.x6.nabble.com/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi,
since the aim is "... to measure the waveforms that result from the heartbeats" , after you succesfullly determine edges of arteries, you can make a cross line selection over binarized edges and create a kymograph over whole timelaps sample and thus get an idea about your heartbeat frequencies. Having more lines / kymographs, you can correlate the results etc. Hope I understood the problem well. Good luck. Ondrej. 2018-01-21 17:05 GMT+01:00 Herbie <[hidden email]>: > Dear Dave, > > we are still far away from a robust and automatic solution but I know that > it is the goal! > > ------------------------------------------------------------ > ----------------------- > It would help if to read my previous reply to Kenneth: > > 1. It would be very helpful to now see at least a short sequence of images. > > 2. It appears quite essential to know whether the thickness-variations over > time need to be measured along the imaged part of the artery (mean, stdDev, > max, min) or only to be visualized/dislayed by contour lines. > > 3. If they are to be measured, it is necessary to get a reasonable idea of > the desired accuracy. > ------------------------------------------------------------ > ----------------------- > > "May we inquire how you did that?" > > Concerning my approach, please see the related task/solution: > <http://forum.imagej.net/t/corrosion-thickness-measurement/8310> > Image quality is much better in this case, hence the necessary > pre-processing is less involved than it will be in the present situation. > > "There are some obvious jaggednesses that need to be smoothed out." > > More recent results show less jaggednesses. If perfect "smoothing" is > possible depends on your answer to point 2. > > "Some manual steps involved?" > > I guess not, but I can only judge it after the inspection of a typical > short > image sequence. > > Please be aware that the previously posted contour image was obtained from > your sample image and I can't guarantee that my approach works for other > images as well. It depends on their quality and the form of the imaged > vessels. > (Although being in 16bit format, the provided sample image shows a rather > low gray-value dynamic of 109 levels. Furthermore, it suffers from > line-like > artifacts but they appear to be inherent to the image acquisition process. > Please comment!) > > Presently, I assume that the imaged part of the vessel is and over time > stays more or less straight, as in the sample image. In general, I prefer > to > first orient the vessel horizontally. This is mandatory in case you need to > measure its thickness (cf. point 2.). > > Regards > > Herbie > > > > > > -- > Sent from: http://imagej.1557.x6.nabble.com/ > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Mgr. Ondřej Šebesta Laboratory of Confocal and Fluorescence Microscopy Faculty of Science, Charles University in Prague Vinicna 7 128 44 Prague Czech Republic Phone: +420 2 2195 1061 e-mail: [hidden email] -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |