Hi,
I'm relying on batch macros that usually use the "Open Image Sequence..." command at the beginning. However sometimes I use these macros for a single image in a folder, and the macros used to work based on the fact that the resulting stack would have the name of the folder as title and the name of each images as labels, whereas a single image would have the name of the image file as its title. So I usually did something like this: // Test if it is a stack or a single image to retrieve the correct name if (SliceNumber==1) { ImageName=getTitle(); } else { ImageName=getInfo("slice.label"); } Now when the output of the "Import Image Sequence" is a single image, its title is no longer the image title but the parent folder name (i.e. consistent with the multiple images case). However, this single image does not have any label (being a single image and not a stack), so there is no way to retrieve the name of the image itself (without resorting to separately parse the folder content and figure which file was open). As a consequence I can't use the same macro for single images and batch treatment of images... Would it be possible to revert to having the title of a single image output corresponding to the image file name rather than its parent folder, or having its name as the label of the "slice" (treating the single image as a trivial case of a stack with nSlices = 1) ? Thanks for your input, Christophe -- Christophe Leterrier Researcher Axonal Domains Architecture Team CRN2M CNRS UMR 7286 Aix Marseille University, France -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On May 27, 2013, at 8:15 AM, Christophe Leterrier wrote:
> Hi, > > I'm relying on batch macros that usually use the "Open Image Sequence..." > command at the beginning. However sometimes I use these macros for a single > image in a folder, and the macros used to work based on the fact that the > resulting stack would have the name of the folder as title and the name of > each images as labels, whereas a single image would have the name of the > image file as its title. Starting with the ImageJ 1.47r daily build, getInfo("slice.label") returns the image name even when the folder opened by File>Import>Sequence contains a single image. -wayne > So I usually did something like this: > > // Test if it is a stack or a single image to retrieve the correct name > if (SliceNumber==1) { > ImageName=getTitle(); > } > else { > ImageName=getInfo("slice.label"); > } > > Now when the output of the "Import Image Sequence" is a single image, its > title is no longer the image title but the parent folder name (i.e. > consistent with the multiple images case). However, this single image does > not have any label (being a single image and not a stack), so there is no > way to retrieve the name of the image itself (without resorting to > separately parse the folder content and figure which file was open). As a > consequence I can't use the same macro for single images and batch > treatment of images... > > Would it be possible to revert to having the title of a single image output > corresponding to the image file name rather than its parent folder, or > having its name as the label of the "slice" (treating the single image as a > trivial case of a stack with nSlices = 1) ? > > Thanks for your input, > > Christophe > > -- > Christophe Leterrier > Researcher > Axonal Domains Architecture Team > CRN2M CNRS UMR 7286 > Aix Marseille University, France > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |