Syntax
VL=VLofVM(VM,[vs])
Input Parameter
VM : | | Voxel model (mxmxn) or image stack |
vs : | | optional voxel size |
Output Parameter
Examples
VL=VLofVM(V(:,:,64)>1400); VLplot(VL,'m.')
[VL,EL,FL]=VLofimage(:,:,64)>1200, 1 , 2);
[VL,C]=VLofVM(V(:,:,1:10)>1400); C=V(V(:,:,1:10)>1400);
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, VLofVM, is designed to extract voxel coordinates from a 3D voxel model or image stack. It can also convert these coordinates into Cartesian coordinates if a voxel size is provided.
Input Parameters
- VM: A 3D matrix representing the voxel model or image stack. It is expected to be of size (mxmxn).
- vs: An optional parameter representing the voxel size. It is a vector with three elements corresponding to the size in each dimension.
Output Results
- VL: A list of vertex coordinates extracted from the voxel model.
- C: A list of voxel intensities corresponding to the vertex list.
Algorithm Steps
- Use the
find
function to locate non-zero elements in the voxel model VM
. This returns row indices r
and column indices c
.
- Determine the number of columns
n
in VM
.
- Calculate the z-coordinates by dividing the column indices
c
by n
and taking the ceiling of the result.
- Adjust the column indices
c
using the modulus operation to ensure they are within the correct range.
- Construct the vertex list
VL
using the row, column, and z-coordinates.
- If a voxel size
vs
is provided, convert the voxel coordinates to Cartesian coordinates by scaling each dimension accordingly.
- Extract the voxel intensities
C
from VM
using the indices of non-zero elements.
- If no output arguments are specified, plot the vertex list using
VLplot
with specific visualization settings.
Algorithm explaination created using ChatGPT on 2025-08-19 01:29. (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