spreadmax

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Images
Introduced first in SolidGeometry 5.1, Creation date: 2021-11-27, Last change: 2025-09-15

spreads the values of a matrix for a desired intervall min to max

Description

used in imstackofSGprojection


See Also: imadjustwhite , imstackofSGprojection

Example Illustration

 missing image of spreadmax(IS,mm)

Syntax

ISN=spreadmax(IS,[mm])

Input Parameter

IS: matrix
mm: [min max]; defualt is [0 255]

Output Parameter

ISN: new matrix




Copyright 2021-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 algorithm is designed to spread the values of a matrix to fit within a specified interval, typically used for image processing tasks.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the desired range mm using the function getfuncparams. If not provided, default to [0 255].
  2. Determine the minimum and maximum values of the input matrix IS using minmaxall, storing them in vc.
  3. Normalize the matrix IS by subtracting the minimum value vc(1) and dividing by the range (vc(2) - vc(1)).
  4. Scale the normalized values to the desired range mm by multiplying by (mm(2) - mm(1)) and adding mm(1).
  5. If no output is requested (nargout == 0), calculate the new min and max of ISN using minmaxall and print the original and spreaded matrix value ranges using dbprintf.
Algorithm explaination created using ChatGPT on 2025-08-18 22:51. (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