Selecting some image files in a directory and returning path list

scifio
bio-formats
fiji
macro
Tags: #<Tag:0x00007fd542c83420> #<Tag:0x00007fd542c832b8> #<Tag:0x00007fd542c83100> #<Tag:0x00007fd542c82f98>

#1

Hello,
I have a macro calling Bioformat to open OlF files, do some MIP projection for each, merge the projections in a new stack and register the frames.
After setting “JFileChooser” in Edit/Option/Inputoutput, I can use Ctrl-Click to select the subset of files that I want to process. In a macro, this fails however since I cannot Ctrl-click (“Open” seems to ignore the “JFileChooser” setting). I do not want to process all the files in the folder. Ideally, I am looking for a function that would return a list of path+filename for files selected by user through Ctrl+click or Shift click.
(Fiji, ImageJ 1.51h, Java 1.6.0_24). Any help greatly appreciated.
Thomas


#2

Hey @T_Launey

So… I am still a newbie myself in this, but have you looked at all into Script Parameters? I have a feeling your solution is there…

You can go through this Scripting Workshop to learn more - specifically to try out @Parameters in this demo script (available via ImageJ Script Editor): Templates :arrow_forward: Intro :arrow_forward: Widgets (JavaScript). You can look at this widget demo code for help on this as well.

This is also a nice presentation with great info on parameterization in ImageJ.

Hope this helps a bit!

eta :slight_smile:


#3

Hi Eta,

Thanks for the advice, I use Ruby on other projects but I never considered writing Ruby scripts in Fiji instead of macros. Problem solved :slight_smile: