Connect bwlabeled components
이전 댓글 표시
[EDIT: 20110623 22:06 CDT - reformat - WDR]
Hello, I need help on a very simple task...well..seemingly.
I have a series of images similarly to this: http://blogs.mathworks.com/images/steve/94/labeling_labeled_objects_03.png

except I have a tiff stack with numerous layers in series. In this image the blobs move around as one goes deeper into the tiff stack series (it is a spatial not temporal series). I am trying to do the following:
Find all unique objects per layer, connect objects from one plane to another that 'overlap'(thus indicating that both object x1 in layer a and x2 in layer b are the same object just at different spatial depths) as a line segment, generate a output with orientation in z of each line segment.
I have done the first instant. I am looking for advice on how to go about the object grouping, ie. connecting the same 'real object' in the serialized sections.
Any functions I should look at? Particle tracking functions perhaps?
Cheers,
채택된 답변
추가 답변 (3개)
Wolfgang Schwanghart
2011년 6월 24일
0 개 추천
I'd start with using the function bwlabeln to label the connected components in the 3d. This, however, requires them to never overlap or touch. If this occurs, you might want to use imerode prior to bwlabeln to let each object shrink a little.
댓글 수: 2
Sean de Wolski
2011년 6월 24일
Personally I'd recommend using bwconncomp and if necessary labelmatrix to get the label. bwlabeln (and label matrices in general) take up a lot of memory.
Wolfgang Schwanghart
2011년 6월 27일
Oh right. Somehow I thought bwconncomp works in 2D only, but I was wrong.
D
2011년 6월 24일
댓글 수: 1
Sean de Wolski
2011년 6월 24일
Yes - in 3D.
If you want the output structure identical to bwconncomp (for storage) purposes and you have a label matrix, you can use my label2CC function.
http://www.mathworks.com/matlabcentral/fileexchange/30702-label2cc
D
2011년 6월 24일
0 개 추천
댓글 수: 7
Sean de Wolski
2011년 6월 24일
You want the orientation of a circle?
D
2011년 6월 24일
Sean de Wolski
2011년 6월 27일
I don't understand your goal. The plane normal to a 2d image is axis into the third dimension.
xy coordinates are the 'pixellist' option in regionprops or you could use ind2sub on CC.PixelIdxList and CC.ImageSize from a connected components structure.
Wolfgang Schwanghart
2011년 6월 27일
If you have the three dimensional label matrix (L), I think it would be easiest to calculate the centroids of each object using regionprops for L(:,:,1) and L(:,:,end). It will then be easy to obtain vectors in 3d.
D
2011년 6월 27일
D
2011년 6월 27일
Sean de Wolski
2011년 6월 27일
length(..) returns the size of the _largest_ dimension. Therefore, don't use it, since it's unreliable and can change!
force SIZE to output the size of the dimension you want, in this case 3, size(L,3);
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!