Example batch file for Windows

This batch file converts all DICOM images in separate sub-folders to Analyze 7.5 format, and calculates sum images (also in Analyze format) for ROI drawing. Original DICOM images are not modified, and Analyze images are written in the same sub-folders with DICOM files.

Save the code in text editor (for example Notepad) into a file with extension .bat, for example alldcmtoana.bat, into the working folder under which the DICOM image folders are. Note that directory names must not contain any space characters! Then execute the .bat file in command prompt window.

@echo off
setlocal enableExtensions enableDelayedExpansion

for /r %%P in (?1.dcm) do (
  set var1=%%P
  set var2=!var1:~0,-7!
  @echo !var2!
  ImageConverter !var2! -c=Analyze75 -n -o=!var2!\analyze -s -v
  imginteg !var2!\analyze 0 0 !var2!\sum
  img2tif -rb !var2!\sum !var2!\sum.tif

See also:

Tags: , ,

Updated at: 2020-02-22
Created at: 2016-01-15
Written by: Vesa Oikonen