by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VM/Voxels
Introduced first in SolidGeometry 2.1, Creation date: 2015-01-24, Last change: 2025-09-14
h=VMmontage(V)
V: | Voxel model |
h: | handle of image |
load AIM.mat; VM=V; [AM,as]=VMresize(VM,[0.5 0.5 0.5],vs); AM(:,230:256,:)=0;
VMmontage(AM)
This function, VMmontage, is designed to display all images of a 3D image stack in a single figure. It is part of the SG-Library and was created by Tim Lueth.
V into a 4D matrix I. This is done using the reshape function. The dimensions of I are set to be the same as the first two dimensions of V, with the third dimension set to 1, and the fourth dimension set to the third dimension of V. This effectively prepares the data for the montage function by treating each slice of the voxel model as a separate image.montage function with the reshaped matrix I. The DisplayRange parameter is set to [0 4095], which specifies the range of intensity values to be displayed. This range is typical for 12-bit images, where the intensity values can range from 0 to 4095.montage function creates a single figure displaying all the images in the stack, arranged in a grid. The handle to this figure is returned as the output h.An example is provided in the comments of the function:
load AIM.mat; VM=V; [AM,as]=VMresize(VM,[0.5 0.5 0.5],vs); AM(:,230:256,:)=0; VMmontage(AM)
In this example, a voxel model is loaded, resized, and then a portion of it is set to zero before being passed to the VMmontage function for display.