Login  Register

Re: sorting bug in ij.plugin.FolderOpener?

Posted by Walter O'Dell PhD on Feb 04, 2013; 9:18pm
URL: http://imagej.273.s1.nabble.com/Re-sorting-bug-in-ij-plugin-FolderOpener-tp5001662.html

well I just spent a couple hours in the code to uncover the problem mentioned in this thread from 2007. Basically, I had a list of files, say
firstfile.jpg   and
secondfile2.jpg.

FolderOpener displays the 2 file in this order, so I select to read in just 1 file, starting at 1 and skipping none, and the program then opens the second file.  In the sorter program within FolderOpener the first file name gets changed to 000000000aaaaaafirstfile.jpg, while the second file gets changed to 000000000000002secondfile2.jpg.  And the latter file name then is higher alphanumerically than the first.

My personal solution is to set sortFileNames = false, within FolderOpener.java.  Since I have changed several of the base ImageJ files and compile everything from scratch anyway, this works for me.

The casual user won't know to write their own version of the sorter function, and won't understand that what is shown in the selection display is not what folderOpener is working with.  

My recommendation is to either have the sort routine applied before the list of files is displayed in the selection GUI so that the display matches what will be selected, or use the same sorter inside FolderOpener that the machine uses for the display, or make the default sortFileNames = false and let the powerusers turn it On if they feel the need for it.

have a nice day.

-Walter

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html