Save Data Browser Selection as TIFF Files

//  SaveDataBrowserSelectionAsTIFF(pathName)
//  This function saves each 2D wave selected in the Data Browser as a TIFF file
//  with a ".tif" extension.
//  pathName is the name of an Igor symbolic path or "" to get a dialog.
//  WARNING: Overwrites pre-existing files with conflicting names.
Function SaveDataBrowserSelectionAsTIFF(pathName)
    String pathName             // Name of an Igor symbolic path or "" to get a dialog
   
    if (strlen(pathName) == 0)
        NewPath/O/M="Choose a folder for saving TIFFs" SaveIndexedTIFFPath
        if (V_flag != 0)
            return -1               // User cancelled
        endif
        pathName = "SaveIndexedTIFFPath"
    endif

    Variable index = 0
    do
        String path = GetBrowserSelection(index)
        if (strlen(path) == 0)
            break
        endif
        Wave w = $path
        if (WaveDims(w) == 2)
            String fileName = NameOfWave(w) + ".tif"
            ImageSave /O /T="TIFF" /P=$pathName w as fileName
        endif
        index += 1
    while(1)
End


Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More