Skip to content

Rewrite of blind-experiment to IJ2 plugin commands#1

Open
ScienceToolkit wants to merge 6 commits into
imagejan:masterfrom
ScienceToolkit:ij2
Open

Rewrite of blind-experiment to IJ2 plugin commands#1
ScienceToolkit wants to merge 6 commits into
imagejan:masterfrom
ScienceToolkit:ij2

Conversation

@ScienceToolkit

Copy link
Copy Markdown

I am making changes to the blind-experiment plugin to move it into the IJ2 framework and make it as user-friendly as possible. The following changes were introduced:

  • Format each function as an IJ2 plugin command.
  • Use PrefService to record the properties file location and retrieve it for unblinding
  • Introduce a function to record a generic string comment in a results table

The functionality of the blinding and unblinding commands is encased in public methods. I think these should be made static as they could be useful without an instance of the plugin class, but would like some insight into if that is the sensible thing to do.

Also, any comments on how I can make future pull requests better are also appreciated. :octocat:

@imagejan imagejan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks a lot, @ScienceToolkit!
I'll try to have a more detailed look soon, but already added some first comments.

Comment thread README.md
* *Plugins > Blind Experiment > Mask filenames* to mask filenames before analysis
* *Plugins > Blind Experiment > Unmask filenames* to unmask filenames after analysis
* *Plugins > Blind Experiment > Unmask results table* to unmask labels of a results table
* *Analyze > Blind Experiment > Blind Files* to mask filenames before analysis

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is to blind/unblind the right term, and clear enough to users what it means? I was unsure and chose mask/unmask at the time, but would be fine with whatever you or others think works best.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just went with the terminology we have been using around the lab, I will change that if most prefer mask/unmask.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about it for a while, I'd still prefer mask/unmask.

Comment thread doc/allclasses-frame.html Outdated
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_181) on Thu Sep 06 14:54:08 EDT 2018 -->

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The javadoc should not be part of the source code, it can be generated with maven any time. How comes that you have it in ./doc/? Maven should put it into ./target/site/apidocs/ (and /target/ is in .gitignore and therefore ignored).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is my bad completely. I was playing around in Eclipse and generated that. I will remove the folder.

@@ -0,0 +1,105 @@
package imagejan.plugins;

@imagejan imagejan Sep 6, 2018

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with the sc.fiji.blind_experiment package, and move the repository to the fiji org as discussed on the forum.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will refactor that.

@imagejan imagejan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @ScienceToolkit, that it took me so long to get back to this. I added a few more comments.

My major remaining point now is that we should also enable unmasking files when their folder isn't saved in the prefs (either because some other folder was processed in the meantime, or because the unmasking is done on a different machine).

Comment thread pom.xml
<licenses>
<license>
<name>Simplified BSD License</name>
<name>GPL</name>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to stick to the license names supported by maven-license-plugin: http://www.mojohaus.org/license-maven-plugin/examples/example-license-list.html
Let's change this to gpl_v3.

Comment thread README.md
* *Plugins > Blind Experiment > Mask filenames* to mask filenames before analysis
* *Plugins > Blind Experiment > Unmask filenames* to unmask filenames after analysis
* *Plugins > Blind Experiment > Unmask results table* to unmask labels of a results table
* *Analyze > Blind Experiment > Blind Files* to mask filenames before analysis

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about it for a while, I'd still prefer mask/unmask.

@Override
public void run() {
// Unblind the files using the saved props file
File propsFile = new File(prefs.get("blindPropsPath"));

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves no possibility to unmask files/results that were masked earlier in the past. If you masked several folders, only the last one will be saved in the prefs, no?
Let's keep the directory as an input parameter as I had it in my original implementation. We can still use a DynamicCommand with an initializer method to pre-fill the path with the one saved in the prefs.

Plugins>Blind Experiment, "Unmask results table", imagejan.plugins.Blind_Experiment("unblind_results")
Plugins>Blind Experiment, "Mask filenames", sc.fiji.blind_experiment.Blind_Experiment("blind_files")
Plugins>Blind Experiment, "Unmask filenames", sc.fiji.blind_experiment.Blind_Experiment("unblind_files")
Plugins>Blind Experiment, "Unmask results table", sc.fiji.blind_experiment.Blind_Experiment("unblind_results")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that all commands are implemented as SciJava Commands, this plugins.config is not needed any more. Let's remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants