Syntax
[c,V]=VMintensityscale(V,[cax])
Input Parameter
V : | | Voxel mode |
cax : | | desired intensity interval; default is [0 1] |
Output Parameter
c : | | [minc maxc] |
V : | | scaled to 0 to 1 |
Examples
load AIM.mat
VMintensityscale(V)
Copyright 2017-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, VMintensityscale
, is designed to scale the intensity of a voxel image to a specified range. It is part of the SG-Library and was introduced in SolidGeometry 3.8.
Input Parameters
- V: The voxel model that needs intensity scaling.
- cax: The desired intensity interval, with a default value of [0, 1]. This parameter is optional and can be provided as a second argument.
Output Results
- c: A vector containing the minimum and maximum intensity values of the original voxel model
V
.
- V: The voxel model scaled to the range specified by
cax
.
Algorithm Steps
- Initialize
cax
to [0, 1]. If a second argument is provided and is not empty, update cax
with this value.
- Calculate the minimum and maximum intensity values of the voxel model
V
and store them in c
.
- Store the original voxel model in
VO
for later use.
- Scale the voxel model
V
to the range [0, 1] using the formula: V = (V - c(1)) / (c(2) - c(1))
.
- Adjust the scaled voxel model to the desired intensity range specified by
cax
using the formula: V = V * (cax(2) - cax(1)) + cax(1)
.
- If a second argument is provided, update
c
with the scaled voxel model V
.
- If no output arguments are specified, display a histogram of the original voxel model
VO
and print the intensity range.
Example Usage
To use this function, load a voxel model from a file (e.g., AIM.mat
) and call VMintensityscale(V)
to scale its intensity.
Algorithm explaination created using ChatGPT on 2025-08-18 23:38. (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