VMmontage

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

plots all images of an image stack into one figure

Description

Based on Matlab function montage
I=reshape(V,size(V,1),size(V,2),1,size(V,3));
h=montage(I,'DisplayRange',[0 4095]);



See Also: VMimage , VMintensityscale , VMresize , VMimrot90 , VMplot , VMpseudo3D , VMreaddicom , VMreaddicomdir , VMuidicom

Example Illustration

 missing image of VMmontage(V)

Syntax

h=VMmontage(V)

Input Parameter

V: Voxel model

Output Parameter

h: handle of image

Examples


load AIM.mat; VM=V; [AM,as]=VMresize(VM,[0.5 0.5 0.5],vs); AM(:,230:256,:)=0;
VMmontage(AM)




Copyright 2015-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

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.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by reshaping the input voxel model 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.
  2. Next, the function calls the 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.
  3. The 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.

Example Usage

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.

Algorithm explaination created using ChatGPT on 2025-08-18 23:36. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21