napari-imagej icon indicating copy to clipboard operation
napari-imagej copied to clipboard

Save-style file parameters pop open-style file choosers

Open ctrueden opened this issue 3 years ago • 3 comments

Commands using a save-style file widget still pop an open-style file chooser, which means there is no way to type in a new filename. Here is what the File → Export → Image... command looks like in napari-imagej:

save-image-dialog

And here is how the same command's file chooser dialog looks in Fiji:

save-image-fiji

Here is how that parameter looks in the source code:

@Parameter(label = "File to save", style = FileWidget.SAVE_STYLE,
	initializer = "initOutputFile", persist = false)
private File outputFile;

ctrueden avatar Oct 04 '22 17:10 ctrueden

I think this is mostly done at this point @ctrueden, thanks to #120. The only thing more that we could do is improve the initializer/guess a filename. Do you think this is possible in napari, or can we close this issue?

gselzer avatar Oct 20 '22 20:10 gselzer

Do you think this is possible in napari

So, napari-imagej doesn't run the InitializePreprocessor? Is that why there is no initial name? If not, why not? We ought to run all preprocessors up to but excluding the InputHarvester, no?

ctrueden avatar Oct 21 '22 01:10 ctrueden

Do you think this is possible in napari

So, napari-imagej doesn't run the InitializePreprocessor? Is that why there is no initial name? If not, why not? We ought to run all preprocessors up to but excluding the InputHarvester, no?

@ctrueden so org.scijava.module.process.InitPreprocessor is running. There is no initial name, because the name is derived from imageDisplayService.getActiveDataset(), which returns null. Unfortunately, calling that plugin with an image open in the ImageJ2 UI (which would make no sense, since saving that image would not be possible from the widget) results in really strange behavior.

gselzer avatar Dec 06 '22 20:12 gselzer