Syntax
NI=VMimrot90(I)
Input Parameter
Output Parameter
NI : | | new image or image stack |
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 algorithm is designed to rotate an image or a stack of images by 90 degrees. The function is named VMimrot90
and is part of the SG-Library, specifically within the VOXELS class. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- I: This is the input parameter representing the image or image stack. It can be a 2D matrix for a single image or a 3D matrix for a stack of images.
Output Results
- NI: This is the output, which is the new image or image stack after being rotated by 90 degrees.
Algorithm Steps
- The function starts by determining the size of the input
I
using the size
function, storing the dimensions in n
.
- It checks if the input is a 2D image by evaluating
length(n) == 2
. If true, it rotates the image by 90 degrees using fliplr(I')
and returns the result immediately.
- If the input is a 3D image stack, the function initializes an output matrix
NI
with dimensions (n(2), n(1), n(3))
to accommodate the rotated images.
- The function then iterates over each image in the stack using a
for
loop, where i
ranges from 1 to n(3)
.
- Within the loop, each image slice
I(:,:,i)
is rotated by 90 degrees using fliplr(I(:,:,i)')
and stored in the corresponding slice of NI
.
- After processing all slices, the function returns the rotated image stack
NI
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:21. (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