Hello all,
I'm using a macro that analyzes images from 4 directories. It is important that the same file (when sorted by filename) is loaded from all 4 directories. When I run the macro pasted below in WinXP it gives the correct listing. However, when I run it in Linux (RH 9.2) it gives a different order of the files. Is this a common problem and related to it, how can I sort an array of strings in ImageJ (a simple sort() doesn't seem to work). Macro: dir = getDirectory("Choose main directory to analyze"); dir_ch1 = dir+"Channel 1/"; dir_ch2 = dir+"Channel 2/"; dir_ch3 = dir+"Channel 3/"; dir_ch4 = dir+"Channel BF/"; list_ch1 = getFileList(dir_ch1); list_ch2 = getFileList(dir_ch2); list_ch3 = getFileList(dir_ch3); list_ch4 = getFileList(dir_ch4); n = list_ch1.length for (i=0; i<n; i++) { print(list_ch1[i]); print(list_ch2[i]); print(list_ch3[i]); print(list_ch4[i]); } Regards, ----------------------------------------------------- Ir. Tycho Scholtens Biophysical Engineering Faculty of Science and Technology University of Twente P.O. Box 217 7500 AE Enschede The Netherlands Tel.: +31 (0) 53 489 2004 <http://by18fd.bay18.hotmail.msn.com/cgi-bin/compose?curmbox=F000000001&a=9c 73dd4dd02727df3cbc1ae5ce6f66a0c1278c3e949b7730438420053193ec8f&mailto=1&to=t .[hidden email]&msg=MSG1134382365.1&start=20682793&len=2184&src=&type= x> [hidden email] <javascript:ol('http://www.tnw.utwente.nl/bpe/');> http://www.tnw.utwente.nl/bpe/ |
Not sure if this will help, but it is not a good idea to use directories with
spaces. Use "_" instead. Cheers, G. On Friday 20 January 2006 15:25, Tycho Scholtens wrote: > I'm using a macro that analyzes images from 4 directories. > It is important that the same file (when sorted by filename) is loaded from > all 4 directories. > When I run the macro pasted below in WinXP it gives the correct listing. > However, when I run it in Linux (RH 9.2) it gives a different order of the > files. > Is this a common problem and related to it, how can I sort an array of > strings in ImageJ (a simple sort() doesn't seem to work). > > Macro: |
Linux and Windoze handle filelists differently - Linux is case
sensitive, listing capitals (uppercase) first. Also, I've noticed WinXP gets clever with numerical filenames, and guesses the correct (implied) order when you do file1.img, file2.img ... file34.img instead of file01.img, file02.img, ... file34.img - whereas Linux will get the numbers out of order, but listed more .... precisely. Linux may also give other characters (like spaces) a different precedence than WinXP, giving the OS-es different list orders. Hope this helps Mike Gabriel Landini wrote: >Not sure if this will help, but it is not a good idea to use directories with >spaces. Use "_" instead. > >Cheers, > >G. > >On Friday 20 January 2006 15:25, Tycho Scholtens wrote: > > >>I'm using a macro that analyzes images from 4 directories. >>It is important that the same file (when sorted by filename) is loaded from >>all 4 directories. >>When I run the macro pasted below in WinXP it gives the correct listing. >>However, when I run it in Linux (RH 9.2) it gives a different order of the >>files. >>Is this a common problem and related to it, how can I sort an array of >>strings in ImageJ (a simple sort() doesn't seem to work). >> >>Macro: >> >> -- Michael Doube BPhil BVSc MRCVS MPhil / PhD Student Dental Institute Barts and The London School of Medicine and Dentistry Queen Mary, University of London New Rd London E1 1BB United Kingdom Phone +44 (0)20 7377 7000 ext 2681 |
In reply to this post by Tycho Scholtens
Tycho,
See how I arrange the listing of files here, so it is always consistent: http://www.pensament.net/java/other_plugins.html#open_seq http://www.pensament.net/java/other_plugins.html#image_browser Albert -- Albert Cardona Molecular Cell Developmental Biology University of California Los Angeles Tel +1 310 2067376 Programming: http://www.pensament.net/java/ Research: http://www.mcdb.ucla.edu/Research/Hartenstein/ Web design: http://www.pixelets.com |
Free forum by Nabble | Edit this page |