Import Sequence: arbitrary limit on file name length

imagej

#1

if i import a file with more than 60 characters int he filename (before extension) the slice labels are also truncated, thus removing metadata i am storing in the file name.

is there a good reason for this limitation? i’m running a macro from the command line, so i really don’t care about how much room it takes up in the window. but i don’t like my metadata being silently destroyed…


#2

Hi @dpschreiner,

what do you mean by “truncated”? I just opened a file with more than 70 characters length, and everything appears fine when visualising the file name:
image

Cheers,
Robert


#3

I guess it’s the labels generated when importing an image sequence (mind the title of this topic), or dragging a folder onto the toolbar to open it.

@Wayne any comments on this?


#4

Internally they’re not truncated, it’s just the display in the subtitle bar that has this length. Consider this Groovy script for example:

#@ ImagePlus imp

stack = imp.getStack()
stack.setSliceLabel("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", 1)
imp.updateAndRepaintWindow()
println stack.getSliceLabel(1) // will print the full label

Note that the subtitle in the image window uses the ImageStack#getShortSliceLabel() method:


#5

The latest ImageJ daily build (1.52d7) fixes several problems related to the handling of image sequence metadata. The Image>Show Info command also no longer truncates one line slice labels to 60 characters.

@dpschreiner, if the daily build does not fix the problem you are experiencing, please upload a couple of images that can be used to reproduce the problem.

View the code changes at