spreka / annotatorj

AnnotatorJ: ImageJ plugin for object annotation in 2D
GNU General Public License v3.0
23 stars 6 forks source link

Can't edit config file to enable enableMaskLoad and autoMaskLoad #3

Closed jasperblee closed 3 years ago

jasperblee commented 3 years ago

Hello,

I am trying to use the batch mask load function, which requires that autoMaskLoad=yes and enableMaskLoad=yes. I added these lines to the AnnotatorJconfig.txt file, but have ran into issues where the lines are not recognized - upon startup, the ImageJ console does not display these lines along with the other config settings. As a result, I am unable to use the batch mask load function. Do you know how I might fix this? I have attached my config file to this. Also, if it matters, I directly downloaded the release version, and did not build. Thank you!

AnnotatorJconfig.txt

spreka commented 3 years ago

Hi @jasperblee , thank you for reaching out. I cannot seem to reproduce your issue. I just tested on Windows10 with your config file both the built and the pre-built release (latest, v0.0.3-beta) and it worked for me. The configs are printed on startup and when enabled, masks are loaded automatically when you step to the next/previous image with the < or > button - given that the images have corresponding masks with matching names in .tiff format in the folder you located with the Load button.

Can you please specify details about your system?

The project was previously tested on Win10 (Oracle jdk1.8) and Ubuntu 18.04 (openjdk 1.8).

The config file is expected to be located in the model folder (as in the release, under \plugins\models\AnnotatorJconfig.txt), when you specify a different model folder, the plugin will also look for the config file there. Also, if you change settings in the plugin (e.g. in the Options via the ... button) it will write your new settings to the config file automatically. If it cannot find the config file on startup, it should print the following defaults:

Properties file does not exist: S:\SZBK\annotator\jasperblee\AnnotatorJ_v0.0.3-beta\plugins\\models\AnnotatorJconfig.txt
-------------
Properties:
----
classes:        normal,cancerous
annotationColor:        yellow
overlayColor:       red
semanticBrushSize:      50
contourAssistMaxDistance:       17
contourAssistThresholdGray:     0.1
contourAssistThresholdR:        0.2
contourAssistThresholdG:        0.4
contourAssistThresholdB:        0.2
contourAssistBrushsize:     10
contourAssistMethod:        UNet
modelFolder:    
modelJsonFile:      model_real.json
modelWeightsFile:       model_real_weights.h5
modelFullFile:      model_real.hdf5
saveAnnotTimes:     no
defaultAnnotType:   
rememberAnnotType:      no
saveOutlines:       no
enableMaskLoad:     no
autoMaskLoad:       no
loaded config model folder: 
Properties file does not exist: S:\SZBK\annotator\jasperblee\AnnotatorJ_v0.0.3-beta\plugins\\models\AnnotatorJconfig.txt
-------------

If no lines are printed about the config in the Log window on startup I think it cannot initialize the plugin. Can you please check that no other running instance of AnnotatorJ exists when you run into this issue?

Please note that the batch mask load mode of AnnotatorJ is intended to work on image-mask pairs in the following folder structure: [any folder]\[image folder]\*.{png,jpg,jpeg,tif,tiff,bmp...} [any other folder]\[mask folder]\*.tiff where [image folder] is located by selecting an image in it with the Open button, and [mask folder] by selecting such a folder with the Load button provided the config is set to enable batch mask load - otherwise Load expects an ImageJ/Fiji ROI.zip file to load contours from.