VMimrot90

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VM/Voxels
Introduced first in SolidGeometry 2.1, Creation date: 2015-01-13, Last change: 2025-09-14

returns an 90 degree rotated image (nxm) or image stack (nxmxk)

Description

+90 degree: fliplr(I')
180 degree: flipud(I)
-90 degree: flipud(I')

See Also: , VMimage , VMmontage , VMplot , VMpseudo3D , VMreaddicom , VMreaddicomdir , VMuidicom

Example Illustration

 missing image of VMimrot90(I)

Syntax

NI=VMimrot90(I)

Input Parameter

I: image or image stack

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

Output Results

Algorithm Steps

  1. The function starts by determining the size of the input I using the size function, storing the dimensions in n.
  2. 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.
  3. 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.
  4. The function then iterates over each image in the stack using a for loop, where i ranges from 1 to n(3).
  5. 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.
  6. 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