Very large 3D label matrix
8 次查看(过去 30 天)
显示 更早的评论
I am doing analysis on X-Ray microtomography data, the data comes in the form of several thousand gray scale images that represent horizontal slices of my sample. I import these images one by one, convert them to binary using im2bw, and "stack" them on top of each other by storing each binary image as one layer of a logical 3D array. I only have 16Gb of ram available so I store the 3D array as a disk file using the matfile function. I then identify the connected volumes in the matrix using bwcompconn() and create a label matrix (also a disk variable) using the labelmatrix() function.
I have sucessfully created a label matrix for a 2000x2000x1000 matrix but when I tried a 4000x4000x2000 matrix I got an "Out of Memory" error. I also tried the bwlabeln function with the same error.
any Idea how I can create a label matrix for very large, binary, 3d arrays using less than 16Gb of ram?
EDIT: Sorry I should have been a little more clear, I get the memory error when computing bwconncomp() on matrices bigger than 4000x4000x1000.
But after I get the label matrix I calculate a "metric" for each volume, then replace the numbers in the label matrix with the metric value corresponding to their volume. Then I can visualize the results using isosurface() or export the data to view it with other software, such as Paraview.
0 个评论
回答(1 个)
Image Analyst
2015-3-23
Why do you need that - you already have the output of bwconncomp()? What are you going to do afterwards?
2 个评论
Image Analyst
2015-3-23
Subsample your volume and work with a smaller one. It will probably be just as good. You can't visualize that size on a regular monitor anyway - you'd have to zoom way in.
Sean de Wolski
2015-3-23
I agree with IA:
You get an 8x reduction in memory consumption for every element you skip in each dimension:
Ismall = I(1:2:end,1:2:end,1:2:end);
~Someone else who worked with largish (1000x1000x1000) CT data
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!