Syntax
I=VMpseudo3D(V,lim,[maxc,s])
Input Parameter
V : | | Voxel model |
lim : | | surface intensity value |
maxc : | | maximum used color; default is 4095 |
s : | | cut value: start to display the real slice values; default is 0 |
Output Parameter
Examples
I=VMpseudo3D(permute(V,[2 3 1]),1600,4095,100);
imshow(I,[0 4095]); axis square, view (-90,90); show
close all; VMpseudo3D(flip(permute(V,[3 2 1]),1),1400,'',200);
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, VMpseudo3D, generates a 2D image from a 3D voxel model by rendering a pseudo 3D surface. The function uses MATLAB functions like permute, flip, and view to achieve the desired output.
Input Parameters
- V: The voxel model, a 3D matrix representing volumetric data.
- lim: Surface intensity value. Default is 1400 if not provided.
- maxc: Maximum color value used in the image. Default is 4095 if not provided.
- s: Cut value, which determines the starting point to display real slice values. Default is 0 if not provided.
Output
- I: The resulting 2D image.
Algorithm Steps
- Initialize the size of the voxel model V with dimensions n, m, and k.
- Create a zero matrix I of size n by m to store the resulting image.
- Set default values for lim, maxc, and s, and update them if provided in varargin.
- Iterate over each voxel in V using three nested loops for indices i, j, and t.
- Check if the voxel value V(i,j,t) is greater than lim.
- If true, check if t is greater than s. If so, set I(i,j) to maxc minus a scaled value of t. Otherwise, set I(i,j) to the voxel value at slice s.
- Break the innermost loop once a voxel value greater than lim is found.
- If no output argument is specified, display the image using imshow with a color range of [0, 4095] and set the background color to black.
Algorithm explaination created using ChatGPT on 2025-08-19 06:43. (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