pr4deepr / GutAnalysisToolbox

Analysis and characterisation of cells within the gut wall using deep learning models. The current focus is on studying enteric neurons and enteric glia.
https://gut-analysis-toolbox.gitbook.io/docs/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

Image already open checkbox not working #2

Closed NargesMahdavian closed 2 years ago

NargesMahdavian commented 2 years ago

When I tick "image_already_open" in the test segmentation dialog, and I concurrently have a sample image open, the code terminates with a dialog popping up saying "'path' is required but unset." When unticked and I set the path to the image, this error does not happen. Perhaps the code is still pointing to a path, even when the image is opened already, and that checkbox is ticked? Thank you image_already_open_error !

pr4deepr commented 2 years ago

Hi @NargesMahdavian Great first issue. As we are using script parameters to get the file path, we can't leave the text field empty. There has to be some text in it. If you're selecting image_already_open, it doesn't need to be a file path . You could use random text in it or even just enter NA.. Could you try this and see if it works?

Perhaps, I'll leave a default value in it and then clarify this in the documentation.. I can see this becoming a problem.. These are the limitations of using macro language as well..

pr4deepr commented 2 years ago

So, I've made it bold to emphasise it. You can enter NA if the field is empty. image

To be safe, I've also updated the code so it has a default value. If you are starting up for the first time, the fiji directory will appear in the field for now.

var fiji_dir=getDirectory("imagej");
#@ File (style="open", label="<html>Choose the image to segment.<br><b>Enter NA if image is open.</b><html>", value=fiji_dir) path

Now, it should look like this: image

Hopefully, this should help.