VMuidicom

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Import/Export
Introduced first in SolidGeometry 1.0, Creation date: 2012-11-05, Last change: 2025-09-14

reads in a dicom file or opens a dialog first

Description

If no file name for the current working directory is set, a dialog is opened.
For full information on the dicom format read: http://medical.nema.org/Dicom/2011/11_03pu.pdf

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

Example Illustration

 missing image of VMuidicom(filename)

Syntax

[X,tags]=VMuidicom([filename])

Input Parameter

filename: optional filename

Output Parameter

X: voxel model of dicom stack
tags: empty, if no dicom file




Copyright 2012-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, VMuidicom, is designed to read DICOM files and return a voxel model of the DICOM stack along with any associated tags. It is part of the SolidGeometry library and was introduced by Tim Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize pathname to the current directory ('.').
  2. Check if any input arguments are provided:
    • If nargin >= 1, set filename to the first argument.
  3. If no arguments are provided (nargin == 0), open a file dialog to select a DICOM file:
    • Use uigetfile to get filename and pathname.
  4. If a valid pathname is obtained:
    • Change the current directory to pathname.
    • Attempt to read DICOM file information using dicominfo:
      • If successful, store the information in tags.
      • If unsuccessful, set tags and X to empty and return.
    • Read the DICOM image data using dicomread and store it in X.
    • If no output arguments are specified (nargout == 0):
      • Display the image using imshow with transposed data X'.
      • Set the color limits to auto using clim('auto').
      • Enable axis display and set axis limits to the size of X.
      • Label the axes as 'x' and 'y'.
Algorithm explaination created using ChatGPT on 2025-08-19 01:22. (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