Writing function to isolate tif files from text files and return array with just tiff files. From macro, list of all files (tif and text) are passed to “get_imagefile(filelist).” Within the function, I created an array variable (pathfile2) that will contain tif files. Being that the tif file array length may be initially unknown, I used the expandable array functions. Version 1.53c Fiji is being used so “setOption(“ExpandableArrays”, true)” is used.
My issue is that when the tiff array is returned (line 35 in code), it contains a NaN line. When the main macro tries to process that array, the program does not execute properly.
I can obviously bypass an expandable array command and just create an array with length equal to master list (both tif and text). What results in the final array are tif files with the rest of the array padded with "0"s. I can use the “Array.deleteValue()” before being returned, but I was looking for a more straight forward solution.