Re: sorting bug in ij.plugin.FolderOpener?
Posted by Albert Cardona on Mar 23, 2007; 6:40pm
URL: http://imagej.273.s1.nabble.com/sorting-bug-in-ij-plugin-FolderOpener-tp3699965p3699966.html
Xavier,
I've noticed the same problem, and I know it has to do with how the
ij.plugin.FolderOpener sorts the file list whenever any of the file
names are not of equal length.
What the ij.plugin.FolderOpener does is to prepend zeros to the file
name whenever it is shorter than the longest file name, which then when
applying the ij.util.StringSorter, will result in very unexpected sortings.
I always work it around by either making special plugins that read the
listing numbers specifically in the file name, putting them in a
Hashtable and then sorting the table by its keys; or by copying
FolderOpener code, modifying the class name and modifying the
sortFileList method.
All this hassle could be easily solved by making the sortFileList method
public in ij.plugin.FolderOpener, which would allow to create very
simplified extended versions of this class.
Now if we ask Wayne very kindly ... :)
Albert