From: Steven_Lord on 21 Jul 2010 13:38 "Erik " <stevesmith121(a)gmail.com> wrote in message news:i25prc$7bq$1(a)fred.mathworks.com... > It's no problem. I just felt it was being picky about the wording when we > both knew what I meant. If there was a misunderstanding due to the wording > that's another story. > Anyways, I guess to help clear up the problem think of an MRI in the > coronal view. Cross sections of the breast are taken such that the breast > appears as an ellipsoid. To be more specific, cross sections are taken > approximately every millimeter. I am trying to mask the breast so as to > eliminate information outside of the breast. > So I have these slices every millimeter that each have a set of XYZ > coordinates where Z is simply the slice number multiplied by 1mm. These > coordinates are eventually converted to binary masks. Occasionally the > masking program outputs XYZ coordinates such that the ellipsoid shape is > cut by a line. I would like to interpolate the ellipsoid to accurately > identify the boundary of the breast. This sounds like a pretty hard problem without doing something like ellipse fitting (which is a topic I know has been discussed on this newsgroup in the past.) Using an analogy: x = 0:20; y = sin(x); plot(x, y, 'o') At this point, all this looks like is a bunch of circles. If you connect-the-dots: hold on plot(x, y, '-') then it becomes clearer that this is probably a sine curve, but connect-the-dots simply gives straight lines -- there's not enough information to get the curved shape of the actual sine curve. Only if you fit a curve, evaluate it on a finer grid, and plot the interpolated data like: xcol = x'; coeffs = [ones(size(xcol)), sin(xcol), cos(xcol)] \ y'; xinterp = 0:0.1:20; yfitted = coeffs(1) + coeffs(2)*sin(xinterp) + coeffs(3)*cos(xinterp); plot(xinterp, yfitted, '+') do you really get a smooth picture. > Because the total volume represents a continuous surface, using > information from all of the other slices to interpolate this region, which > is missing points, should be much more accurate than doing simple 2D > interpolation. If you're looking to try this approach, using INTERPN may be sufficient for your needs. The V input to INTERPN would indicate whether the known points given by your initial X, Y, and Z grids are inside or outside the breast, and you'd interpolate on a finer grid. > Hopefully this additional information helps. I've been working on this for > 2 months now and this small problem is keeping me from calling the project > finished. Thanks again for any help anyone can provide. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Erik on 21 Jul 2010 14:08 I have an idea that I'm going to try, but I thought I'd throw it on here first to spark possible other ideas. I'm considering turning this into a 1D interpolation. Using polar coordinates I believe this problem becomes a little simpler. By keeping theta fixed, I can look at the radii down the edge of the breast as a function of Z. The Z axis will be defined to be through the center of the breast running the entire length of the breast. Now, slices that are cut off will be missing points at that particular theta. Then it will be such that I can do 1D interpolation where I interpolate the radius over the particular Z that I'm at. I will then repeat this process over a number of thetas. One problem I foresee is that in order for this to work, there must be particular thetas for which on each slice I have a point. To do this, I will try to interpolate the radius over particular thetas for all slices beforehand. I will have to look for large gaps in these data sets however so as to not use this form of interpolation on the slices that are missing points. That would defeat the entire purpose. I'll report back if this works. I think I just wanted to type out my idea before trying it. If anyone sees a problem with this or generates other ideas from it, please let me know.
From: Erik on 21 Jul 2010 14:39 Actually, it seems like I could just use interp2 and switch around the arguments. I could use something of the form: radiiI = interp2(Theta, Z, radii, ThetaI, ZI); I'll post the findings in the next few hours...
From: Walter Roberson on 21 Jul 2010 22:54 Erik wrote: > So I have these slices every millimeter that each have a set of XYZ > coordinates where Z is simply the slice number multiplied by 1mm. These > coordinates are eventually converted to binary masks. Occasionally the > masking program outputs XYZ coordinates such that the ellipsoid shape is > cut by a line. I would like to interpolate the ellipsoid to accurately > identify the boundary of the breast. Is it possible to characterize the conditions under which the line is produced?
First
|
Prev
|
Pages: 1 2 3 Prev: Convert M file to Simulink Model Next: constraints in system of non-linear equations |