Anyway to do a 3D binary reconstruction without a huge contiguous 3D matrix?

7 views (last 30 days)
I need to do a 3D reconstruction with respect to a movie. I can get a sufficient binary of the masks and marker images for each frame wich suggests a 3D binary image reconstruction. However, as I understand it, there's no such thing as a 3d sparse matrix and, given 8bpp, I would need 2 3D arrays which would require 10GB of memory each (essentially to store tw versions of an entire binarized movie). That's not practical for me.
Anybody know a way around this maybe something that uses a cell array of 2d(movie frame binarized) images or something where I can feed my "dream function" a list of all the 2d component coordinate lists across all the frames?
  1 Comment
Walter Roberson
Walter Roberson on 19 Jun 2021
Perhaps you could use cell arrays of sparse arrays?
Or perhaps you could "unroll" a 3D sparse array to be a 2D sparse array?

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 19 Jun 2021
Not sure I understand. Do you have an actual movie file, like in an .mp4 format?
Otherwise, maybe check out the memmapfile() function for dealing with gigantic arrays.
  2 Comments
Andrew Diamond
Andrew Diamond on 19 Jun 2021
Edited: Andrew Diamond on 19 Jun 2021
re: Do you have an actual movie file, like in an .mp4 format?
Yup. I guess I could process the movie into some uncompressed simple file (of frames processed to binary images?) suitable for memmapfile() but I'm a bit worried how long a binary image reconstruction would take on such. Most of the processed binary processing results would be empty (i.e. zeros) so I was hoping I could take advantage of that.
At this point I guess I'm obliged to try this through considering that the whole file would be the entire single thing I need to processed, a single huge 3D cube of uint8s, as needed by imreconstruct, it's not clear to me whether this wouldn't just result in it reading it all into memory.
Thanks
Image Analyst
Image Analyst on 20 Jun 2021
What do you have already? Do you have 3-D arrays of markers and blobs already? And you want to pass those to imreconstruct() to do morphological reconstruction? Do you have just the segmented blobs array but not the marker array? Maybe you can label the array and process the markers slice by slice, but then the labeled array would take up more space than the marker array so that's probably no good.
I guess what I'd try is to downsample everything, do the reconstruction, then (optionally) upsample afterwards. The shapes might be somewhat different but that might not make too much difference depending on what you're doing after reconstruction.

Sign in to comment.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!