Sorry if this has been asked before (searched list archives - maybe not right combination of words?).
I need to import stacks of raw images using File->Import->Raw and selecting 'Open All Files in Folder'. The images have filenames that contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, ..., zz-48. When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... , zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, zz-11, ... 1) Can I tell ImageJ to do a numeric instead of alpha sort on the filename numbers when the stack is created? 2) If not, is there a better way to resort the stack than the 'Stack Sorter' plugin (nice, but tedious for 48 images/stack)? |
On Thursday 04 January 2007 20:38, McAuley, Grant (LLU) wrote:
> When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... , > zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, zz-11, ... The string sorting is based on the characters, not the value. Rename the files zz-1 to zz-9 as zz-01 to zz-09 and the import would be fine. Cheers, G. |
In reply to this post by McAuley, Grant (LLU)
Grant:
What I do (and I have normally over 200 images) is to rename the single digit files to 3 digits - e.g. .xx.1.IMA to .xx.001.IMA. If you have less than 99 images, you only need to renumber the 1-9 series. Professor Walter Wolf, Ph.D. Distinguished Professor of Pharmaceutical Sciences Director, Pharmacokinetic Imaging Program Department of Pharmaceutical Sciences, School of Pharmacy Chair, Biomedical Imaging Science Initiative University of Southern California 1985 Zonal Ave., Los Angeles, 90089-9121 Tel: 323-442-1405 Fax: 323-442-9804 E-mail: [hidden email] PLEASE NOTE NEW WEBSITE http://www.usc.edu/research/initiatives/bisi/ http://www.usc.edu/schools/pharmacy/faculty_directory/detail.php?id=59 ----- Original Message ----- From: "McAuley, Grant (LLU)" <[hidden email]> Date: Thursday, January 4, 2007 1:08 pm Subject: Raw Image Stacks: Image Ordering/Reordering To: [hidden email] > Sorry if this has been asked before (searched list archives - maybe > not right combination of words?). > > I need to import stacks of raw images using File->Import->Raw and > selecting 'Open All Files in Folder'. The images have filenames > that contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, > ..., zz-48. > > When the stack gets created the order becomes: zz-1, zz-10, zz-11, > ... , zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz- > 10, zz-11, ... > > 1) Can I tell ImageJ to do a numeric instead of alpha sort on the > filename numbers when the stack is created? > 2) If not, is there a better way to resort the stack than the > 'Stack Sorter' plugin (nice, but tedious for 48 images/stack)? > |
In reply to this post by McAuley, Grant (LLU)
I don't believe there is anyway to do this other than editing the
ImageJ code or writing your own plugin to implement your own sorting scheme. It would be much easier to rename the files, either when the image filenames are generated, or using a mass renamer like RenameIt, Renamer, or using awk/sed if you have *nix nearby. It's a good idea to always name files with zero padding, it generally saves a great deal of trouble. Josh D On 1/4/07, McAuley, Grant (LLU) <[hidden email]> wrote: > > Sorry if this has been asked before (searched list archives - maybe not > right combination of words?). > > I need to import stacks of raw images using File->Import->Raw and > selecting 'Open All Files in Folder'. The images have filenames that > contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, ..., zz-48. > > When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... , > zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, zz-11, ... > > 1) Can I tell ImageJ to do a numeric instead of alpha sort on the filename > numbers when the stack is created? > 2) If not, is there a better way to resort the stack than the 'Stack > Sorter' plugin (nice, but tedious for 48 images/stack)? > |
In reply to this post by McAuley, Grant (LLU)
Hi Grant,
For formats that the Bio-Formats Importer plugin understands, it supports whatever kind of file numbering you want, with or without zero padding, in its "stitch files with similar names" option. Choose one of the zz files, check the stitch option, and you should be prompted with a "file pattern" confirmation that displays the range of files detected and matched using an easy to understand notation: /path/to/my/files/zz-<1-48>.raw, or whatever. Unfortunately, since your files are raw and do not have width and height or other information embedded, they will not work properly in Bio-Formats. We can look into better support for raw files in a future release, though. -Curtis On 1/4/07, McAuley, Grant (LLU) <[hidden email]> wrote: > Sorry if this has been asked before (searched list archives - maybe not right combination of words?). > > I need to import stacks of raw images using File->Import->Raw and selecting 'Open All Files in Folder'. The images have filenames that contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, ..., zz-48. > > When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... , zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, zz-11, ... > > 1) Can I tell ImageJ to do a numeric instead of alpha sort on the filename numbers when the stack is created? > 2) If not, is there a better way to resort the stack than the 'Stack Sorter' plugin (nice, but tedious for 48 images/stack)? > |
In reply to this post by McAuley, Grant (LLU)
This bug is fixed in ImageJ 1.38g, due next week.
-wayne On Jan 4, 2007, at 3:38 PM, McAuley, Grant (LLU) wrote: > Sorry if this has been asked before (searched list archives - maybe > not right combination of words?). > > I need to import stacks of raw images using File->Import->Raw and > selecting 'Open All Files in Folder'. The images have filenames that > contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, ..., > zz-48. > > When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... > , zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, > zz-11, ... > > 1) Can I tell ImageJ to do a numeric instead of alpha sort on the > filename numbers when the stack is created? > 2) If not, is there a better way to resort the stack than the 'Stack > Sorter' plugin (nice, but tedious for 48 images/stack)? > |
In reply to this post by ctrueden
Thanks Gabriel, Josh, Prof Wolf, Curtis, and Wayne for your help.
I really appreciate the prompt response from the List! Sorting using the new 1.38 jar works great. Since I am stuck with the naming scheme from another piece of software, this saves *a lot* of renaming efforts. ~ Grant -----Original Message----- From: ImageJ Interest Group on behalf of Curtis Rueden Sent: Thu 1/4/2007 1:58 PM To: [hidden email] Subject: Re: Raw Image Stacks: Image Ordering/Reordering Hi Grant, For formats that the Bio-Formats Importer plugin understands, it supports whatever kind of file numbering you want, with or without zero padding, in its "stitch files with similar names" option. Choose one of the zz files, check the stitch option, and you should be prompted with a "file pattern" confirmation that displays the range of files detected and matched using an easy to understand notation: /path/to/my/files/zz-<1-48>.raw, or whatever. Unfortunately, since your files are raw and do not have width and height or other information embedded, they will not work properly in Bio-Formats. We can look into better support for raw files in a future release, though. -Curtis On 1/4/07, McAuley, Grant (LLU) <[hidden email]> wrote: > Sorry if this has been asked before (searched list archives - maybe not right combination of words?). > > I need to import stacks of raw images using File->Import->Raw and selecting 'Open All Files in Folder'. The images have filenames that contain letters and numbers: zz-1, zz-2, ... , zz-10, zz-11, ..., zz-48. > > When the stack gets created the order becomes: zz-1, zz-10, zz-11, ... , zz-2, zz-21, ... instead of what I want: zz-1, zz-2, ..., zz-10, zz-11, ... > > 1) Can I tell ImageJ to do a numeric instead of alpha sort on the filename numbers when the stack is created? > 2) If not, is there a better way to resort the stack than the 'Stack Sorter' plugin (nice, but tedious for 48 images/stack)? > |
Free forum by Nabble | Edit this page |