How can I import files with certain strings in filename via Sequence Options in Fiji?

Hi, I’m a new user to Image J and Fiji. I was wondering if someone could help me with the Sequence Options under Import. I am having trouble with the “File name contains” parameter. I am trying to only import files with two strings (“f01” and “ch1”) in the filename. However, these two strings are not consecutive, so I am unsure how to make it so that only those files are imported without changing the names of all the files.
I’ve tried to write ([f01][ch1]) and ([f01]&&[ch1]) to no avail.
Any help is greatly appreciated! Thank you.

@alanasatsuki

I’m no regex expert… but I think you have the syntax wrong. If you enclose those characters within [brackets]'s … it will look at individual characters… so [f01] = f or 0 or 1… I think if you enclose them within (parentheses) - it will search for the group of characters… so (f01)(ch1) = f01 or ch1. I think??? You’ll have to test and play a bit to see… doesn’t matter if they are not consecutive - but are they at the same locations in all filenames? That might be important too…

Hi @alanasatsuki,

If the filenames contain both "f01" and "ch1", in that order, the regex should be:

(.*f01.*ch1.*)

where .* stands for “any character, zero or more times”.

You can try and test other regex here.

Cheers,
Nico

3 Likes

@alanasatsuki Could you please post the list of filenames? Just a couple of example names is fine. Then we can infer the pattern and suggest to you the exact regex to use.