HOW TO CHANGE BINARY IMAGES TO 3D ARRAY (CONVERT TO 3D DIMENSION)
Show older comments
Hi all, I have 41 binary images.
Anyone know how convert it into 3D?
I means now my binary images just have dimension(let say 256 x 256). Then how to add thickness (as example thickness: 2.332) into that binary images?
So that my binary images now in 3D, (example 256x256x2.332)
Anyone can help me?
6 Comments
Rik
on 7 Oct 2021
You are confusing the position in your array with the position in the world. How is your image 2.3 pixels deep?
What you can do is use ndgrid to create a coordinate grid that stores the coordinates of each voxel center.
mohd akmal masud
on 7 Oct 2021
Rik
on 7 Oct 2021
That depends on what you want to do next. Presumably you want to do some calculations or visualizations. I expect it's more effective to ask how to do those.
For the single task of creating a coordinate grid, the documentation for ndgrid or meshgrid will do.
mohd akmal masud
on 8 Oct 2021
Image Analyst
on 8 Oct 2021
No, that just overwrites I every iteration.
mohd akmal masud
on 8 Oct 2021
Accepted Answer
More Answers (1)
Image Analyst
on 8 Oct 2021
0 votes
If you want, just consider your 256x256 image as having a thickness of 2.332 millimeters or centimeters or whatever. There is nothing to do to the image. However if you compute something like area of some region and want the volume in 3-D you have to multiply the area by the square of the lateral pixelsPerMm and then by the z-direction slice spacing of 2.332 to get the volume in mm.
2 Comments
mohd akmal masud
on 8 Oct 2021
Image Analyst
on 8 Oct 2021
Again, you're overwriting I on each iteration so it will only have the last image in it. I don't see where you're calling smooth3 but if you're passing it I, and if I is only a 2-D array, you'll get that error.
Categories
Find more on Image Preview and Device Configuration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!