![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
Load All TIFF Files
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
![](/profiles/wavemetrics/themes/wavemetrics/images/icons/employee-icon.png)
hrodstein
// LoadAllTIFFFilesFromFolder(pathName, nameWaveAfterFileName, displayImages) // This function loads each TIFF file in a given file folder into Igor. // The name of the TIFF file is assumed to end with ".tif". // pathName is the name of an Igor symbolic path or "" to get a dialog. // If nameWaveAfterFileName is true, the output wave name is the file name less the extension. // Otherwise it is something like image0, image1 . . . // If displayImages is true, a new image plot is created for each image. Function LoadAllTIFFFilesFromFolder(pathName, nameWaveAfterFileName, displayImages) String pathName // Name of an Igor symbolic path or "" to get a dialog Variable nameWaveAfterFileName Variable displayImages // 1 to display each image in a plot if (strlen(pathName) == 0) NewPath/O/M="Choose a folder containing TIFFs" LoadIndexedTIFFPath if (V_flag != 0) return -1 // User cancelled endif pathName = "LoadIndexedTIFFPath" endif String fileName Variable index index = 0 do fileName = IndexedFile($pathName, index, ".tif") if (strlen(fileName) == 0) break // No more files. endif ImageLoad/P=$pathName/T=TIFF/N=image fileName if (V_flag > 0) String name = StringFromList(0, S_waveNames) Wave w = $name if (nameWaveAfterFileName) String desiredName = S_fileName // S_fileName is set by ImageLoad desiredName = ParseFilePath(3, S_fileName, ":", 0, 0) // Remove extension if (Exists(desiredName) != 0) desiredName = UniqueName(desiredName, 1, 0) endif Rename w, $desiredName endif if (displayImages) NewImage w endif endif index += 1 while (1) End
![](/sites/default/files/forum.png)
Forum
![](/sites/default/files/support.png)
Support
![](/sites/default/files/gallery.png)
Gallery
Igor Pro 9
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More