Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
56 posts
|
Dear ImageJ users,
I'm trying import->Image sequence in a directory, which contains 44 files. File names are: 01_s1_t1.tif, ..., 01_s1_t11.tif 01_s2_t1.tif, ..., 01_s2_t11.tif 02_s1_t1.tif, ..., 02_s1_t11.tif 02_s2_t1.tif, ..., 02_s2_t11.tif To import all the files containing "s1", I enter "s1" in the field "File name contains:" and check "Sort names numerically". But I find that the files ending with "t10.tif" and "t11.tif" do not appear after "t9.tif", rather they appear at the end of the stack. Is this a bug? Is there a better way to import these files? I'm running ImageJ 1.46b5 on a Windows 7 machine. Ved |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
22 posts
|
>Dear ImageJ users,
> >I'm trying import->Image sequence in a directory, which contains 44 >files. File names are: > >01_s1_t1.tif, ..., 01_s1_t11.tif >01_s2_t1.tif, ..., 01_s2_t11.tif >02_s1_t1.tif, ..., 02_s1_t11.tif >02_s2_t1.tif, ..., 02_s2_t11.tif > >To import all the files containing "s1", I enter "s1" in the field >"File name contains:" and check "Sort names numerically". But I find >that the files ending with "t10.tif" and "t11.tif" do not appear >after "t9.tif", rather they appear at the end of the stack. Is this >a bug? Is there a better way to import these files? > >I'm running ImageJ 1.46b5 on a Windows 7 machine. > >Ved ... [show rest of quote] What about using t09.tiff instead of t9.tiff ? If this poses problems, then you might use a utility for batch renaming files before you open them in IJ. I don't know about such utilities for Windows but they must exist and most probably some of them are free. HTH Herbie ------------------------ <http://www.gluender.de> |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
10 posts
|
In reply to this post by ved sharma
The option "Sort Numerically" only picks the digits of the file name and concatenates them to a number. Then these numbers are sorted.
This behaviour has frequently created confusion also in our lab. If you have this file list: 1a9.tif 1a10.tif 2a9.tif the extracted and sorted numbers are 19, 29, 110 and result in: 1a9.tif 2a9.tif 1a10.tif Wayne, my suggestion is that the filename would be split into an alphanumerical prefix and a purely numerical suffix. Then, prefixes should be sorted alphabetically, and only where they are equal ("1a" in the example), suffixes should sorted numerically. The above sequence would then be sorted like this: 1a9.tif 1a10.tif 2a9.tif Norbert Vischer Research engineer Centre for Advanced Microscopy Swammerdam Institute for Life Sciences (SILS) Science Park 904 1098 XH Amsterdam, the Netherlands |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
169 posts
|
In reply to this post by Herbie-6
Am 22.11.2011 18:59, schrieb Herbie:
>> Dear ImageJ users, >> >> I'm trying import->Image sequence in a directory, which contains 44 >> files. File names are: >> >> 01_s1_t1.tif, ..., 01_s1_t11.tif >> 01_s2_t1.tif, ..., 01_s2_t11.tif >> 02_s1_t1.tif, ..., 02_s1_t11.tif >> 02_s2_t1.tif, ..., 02_s2_t11.tif >> >> To import all the files containing "s1", I enter "s1" in the field >> "File name contains:" and check "Sort names numerically". But I find >> that the files ending with "t10.tif" and "t11.tif" do not appear after >> "t9.tif", rather they appear at the end of the stack. Is this a bug? >> Is there a better way to import these files? >> >> I'm running ImageJ 1.46b5 on a Windows 7 machine. >> >> Ved > > What about using t09.tiff instead of t9.tiff ? > > If this poses problems, then you might use a utility for batch renaming > files before you open them in IJ. I don't know about such utilities for > Windows but they must exist and most probably some of them are free. > > HTH > > Herbie > > ------------------------ > <http://www.gluender.de> > > ... [show rest of quote] On Windows I would recommend these free tools.. http://www.bulkrenameutility.co.uk or http://www.xnview.com/ Interesting read Norbert and I would second your suggestion. regards, Rainer |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
56 posts
|
In reply to this post by ved sharma
Hi Herbie,
Yes, changing the file name from t1.tif -> t01.tif helped me sort the files numerically. I realized that renaming can be done in ImageJ itself. So I wrote a little macro and I'm attaching it here(see below) if someone else wants to use it. Currently it is only doing two running digits, but can be easily extended to 3, 4 or more digits. // start macro "pad_zeros"{ dir = getDirectory("Choose a Directory"); filelist = getFileList(dir); for (i=0; i<filelist.length; i++) { if(endsWith(filelist[i], ".tif")) { index = lastIndexOf(filelist[i], "."); a = substring(filelist[i], index-1, index); b = substring(filelist[i], index-2, index-1); if(!isNaN(a) && isNaN(b)) { old = substring(filelist[i], index-1); new = replace(filelist[i], old, "0"+old); flag = File.rename(dir+filelist[i], dir+new); } } } } // end Ved PS: Text editor or the browser adds "amp;" in the second if statement, which you'll need to delete to run this macro. On Wed, 23 Nov 2011 10:57:24 +0100, Rainer M. Engel <[hidden email]> wrote: >Am 22.11.2011 18:59, schrieb Herbie: >>> Dear ImageJ users, >>> >>> I'm trying import->Image sequence in a directory, which contains 44 >>> files. File names are: >>> >>> 01_s1_t1.tif, ..., 01_s1_t11.tif >>> 01_s2_t1.tif, ..., 01_s2_t11.tif >>> 02_s1_t1.tif, ..., 02_s1_t11.tif >>> 02_s2_t1.tif, ..., 02_s2_t11.tif >>> >>> To import all the files containing "s1", I enter "s1" in the field >>> "File name contains:" and check "Sort names numerically". But I find >>> that the files ending with "t10.tif" and "t11.tif" do not appear after >>> "t9.tif", rather they appear at the end of the stack. Is this a bug? >>> Is there a better way to import these files? >>> >>> I'm running ImageJ 1.46b5 on a Windows 7 machine. >>> >>> Ved >> >> What about using t09.tiff instead of t9.tiff ? >> >> If this poses problems, then you might use a utility for batch renaming >> files before you open them in IJ. I don't know about such utilities for >> Windows but they must exist and most probably some of them are free. >> >> HTH >> >> Herbie >> >> ------------------------ >> <http://www.gluender.de> >> >> > >On Windows I would recommend these free tools.. >http://www.bulkrenameutility.co.uk >or http://www.xnview.com/ > >Interesting read Norbert and I would second your suggestion. > >regards, >Rainer ... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
1064 posts
|
In reply to this post by ved sharma
On Nov 22, 2011, at 12:51 PM, Ved Sharma wrote:
> Dear ImageJ users, > > I'm trying import->Image sequence in a directory, which contains 44 files. File names are: > > 01_s1_t1.tif, ..., 01_s1_t11.tif > 01_s2_t1.tif, ..., 01_s2_t11.tif > 02_s1_t1.tif, ..., 02_s1_t11.tif > 02_s2_t1.tif, ..., 02_s2_t11.tif > > To import all the files containing "s1", I enter "s1" in the field "File name contains:" and check "Sort names numerically". But I find that the files ending with "t10.tif" and "t11.tif" do not appear after "t9.tif", rather they appear at the end of the stack. Is this a bug? Is there a better way to import these files? This bug is fixed in the ImageJ 1.46b daily build, thanks to a new sorting routine contributed by Norbert Vischer. Your sequence is now opened as: 01_s1_t1.tif 01_s1_t11.tif 01_s2_t1.tif 01_s2_t11.tif 02_s1_t1.tif 02_s1_t11.tif 02_s2_t1.tif 02_s2_t11.tif Or as 01_s1_t1.tif 01_s1_t11.tif 02_s1_t1.tif 02_s1_t11.tif if you enter "s1" in the "File name contains:" field. -wayne |
Free forum by Nabble | Disable Popup Ads | Edit this page |