Skip to content

Improve error handling, fix issues #3 and #4, fix a very rare bug with Canny 3D, and fix a bug with virtual stacks

Latest
Compare
Choose a tag to compare
@hansenjn hansenjn released this 21 Sep 01:38
8d51752

Several issues fixed

(1) Issue #3 was fixed in this version

From now on CiliaQ Preparator will warn you if you try to process an unsaved image and advice you to save it first and then retry processing in CiliaQ Preparator:

UNSAVED IMAGE ERROR

(2) Issue #4 was fixed with this version

(3) A bug occurring when processing an image loaded into FIJI as a virtual stack was fixed

If an image was processed that was loaded into FIJI / ImageJ as a virtual stack, CiliaQ Preparator crashed with the following error message:

Virtual Stack Error Message

The new version of CiliaQ Preparator automatically detects virtual stack input images and avoids the error by copying them into the memory for processing. CiliaQ Preparator notifies the user about this process in the LOG section of the "Multi-Task Manager" window with a message, such as Task 1/5: Image <image name> was a virtual stack image. Copied into work space for processing!

(4) A bug in Canny 3D was fixed with this version

It was noticed that low and high threshold that is applied in Canny 3D were mixed up twice in the code: First, when fetching the values entered by the user and second when the Canny3D processing was applied. Thus, this was not noticable when running the plugin and had no consequences for performance of the Canny 3D method under default settings. It also did not impact reloading Canny 3D settings since when saving the settings and when reading in the settings, not the variables entered in the dialog but the variables applied were saved / loaded.

SHORT AND SIMPLE EXPLANATION
  • The new plugin version is fully compatible to older versions: The new plugin version can read the old settings files and reproduce the image processing and segmentation applied by previous versions!
  • Analysis approaches conducted with default settings are still fully valid. The bug did not affect common Canny 3D segmentation outputs (e.g. performed with default settings).
  • Only in one very special condition that likely nobody ever has applied with the old versions of the plugin, the new plugin cannot reproduce the performance of the older plugin versions: In case you have conducted Canny3D segmentation and selected a CUSTOM threshold for only the higher or lower threshold method but an automated threshold method for the other one. In that case, however, the new plugin will warn you when you try to load the older setting! So you are also safe!
DETAILED EXPLANATION (for geeks)

PROBLEM:

The variables entered in the Canny 3D dialog were stored in to the following variables in the program:

Variable entered in dialog Default value Stored into software variable
Method for low threshold Triangle Method for high threshold
Value for low threshold (if custom threshold selected) 0.0 Value for low threshold
Method for high threshold Otsu Method for low threshold
Value for high threshold (if custom threshold selected) 0.0 Value for high threshold

When applying these variables within the Canny 3D workflow the following was applied:

Software variable Default value Applied as
Method for high threshold Otsu Method for low threshold
Value for high threshold (if custom threshold selected) 0.0 Value for high threshold
Method for low threshold Triangle Method for high threshold
Value for low threshold (if custom threshold selected) 0.0 Value for low threshold

Due to the double swap no bug would occur if for both thresholds, one of the threshold algorithms was selected (as under default settings: Triangle and Otsu). Also no bug would occur if CUSTOM values are entered for high and low threshold.
However, a bug would occur, if a CUSTOM value was selected for one of the thresholds but an algorithm was selected for the other threshold method. Then, the CUSTOM value would not be applied and an unpredictable threshold would be used for the other threshold. In that case the user was alerted by the following error message in the LOG window indicating a problem with the processing:

Example error occuring when problematic setting was applied

Example settings for a problematic setting with previous versions:

Example for a problematic settings dialog selection

It is however very unlikely that this combination ever someone would have applied since the resulting segmentation is very likely very bad.

FIX:

This bug is corrected with version v0.1.2. The settings dialog has not been changed (except for cosmetics):

Old Canny3D Dialog New Canny3D Dialog
Left: Old Canny3D settings dialog. Right: New Canny3D settings dialog.

However a difference can be noticed in the log file CQP.txt stored for reloading settings. Due to the swap old settings files would contain the swapped threshold method information:

Log files
Left: Log CQP.txt file created with versions before v0.1.2 for entering Otsu as high and Triangle as low threshold method. Right: Log CQP.txt file created with the new version, containing the correct variable information as entered.

Since in log CQP.txt files from versions v0.1.1 or lower the threshold method information was falsely swapped for Canny settings, the new version includes an inbuild method to still correctly read old files and apply the settings correctly. If a combination of Canny settings is encountered that resulted in application of Canny that cannot be reproduced with this version, the plugin will warn the user with the following message:

CiliaQ_Preparator cannot finally import this setting since it is from an older CiliaQ Preparator version (<the version>) and running
CiliaQ_Preparator version <the version> with this setting was affected by a bug that has been fixed in version V0.1.2.
You may only reproduce this setting by running your file in CiliaQ Preparator version <the version>, which can be downloaded at
https://github.com/hansenjn/CiliaQ_Preparator/releases/tag/<the version> and manually installed to your FIJI/ImageJ.
Read more about the bug at the release notes of CiliaQ Preparator version V0.1.2:
https://github.com/hansenjn/CiliaQ_Preparator/releases/tag/v0.1.2

To sum up: This new version can correctly read and reproducibly apply old settings derived from CQP.txt files generated by older versions of CiliaQ Preparator! This plugin version is COMPATIBLE to older versions!

Improved handling of a common mistake

In previous versions, if a user forgot to install the 3D ImageJ Suite, cryptic errors were thrown such as...

  • ... when applying a hysteresis threshold method:

3D Hysteresis Threshold Command missing

  • ... when applying Canny 3D:

Canny Threshold Command missing

When this happens in the new version, CiliaQ Preparator informs about this error in the log window and gives an instruction on how to fix it, such as:

Canny Threshold Command missing Details

The full error message text is:

  • ... when applying a hysteresis threshold method:
Task 1/1: Hysteresis Thresholding failed.
Verify that you have the 3D ImageJ Suite installed - for more information see
https://github.com/hansenjn/CiliaQ/wiki/Installing-CiliaQ
If you had the 3D ImageJ Suite installed, please report the following information as an issue on the CiliaQ github page or contact developer with the error information:
Error message: Macro canceled
Error localized message: Macro canceled
Error cause: null
Detailed message:
 
 ij.IJ.abort(IJ.java:2170) 
 ij.IJ.testAbort(IJ.java:367) 
 ij.IJ.run(IJ.java:300) 
 ij.IJ.run(IJ.java:353) 
 ciliaQ_Prep_jnh.CiliaQPrepMain.doHysteresisThreshold(CiliaQPrepMain.java:1697) 
 ciliaQ_Prep_jnh.CiliaQPrepMain.segmentUsingHysteresis(CiliaQPrepMain.java:1662) 
 ciliaQ_Prep_jnh.CiliaQPrepMain.run(CiliaQPrepMain.java:654) 
 ij.IJ.runUserPlugIn(IJ.java:217) 
 ij.IJ.runPlugIn(IJ.java:181) 
 ij.Executer.runCommand(Executer.java:137) 
 ij.Executer.run(Executer.java:66) 
 java.lang.Thread.run(Thread.java:750)
  • ... when applying Canny 3D:
Task 1/1: Applying Canny 3D failed.
Verify that you have the 3D ImageJ Suite installed - for more information see
https://github.com/hansenjn/CiliaQ/wiki/Installing-CiliaQ
If you had the 3D ImageJ Suite installed, please report the following information as an issue on the CiliaQ github page or contact developer with the error information:
Error message: Macro canceled
Error localized message: Macro canceled
Error cause: null
Detailed message:
 
 ij.IJ.abort(IJ.java:2170) 
 ij.IJ.testAbort(IJ.java:367) 
 ij.IJ.run(IJ.java:300) 
 ij.IJ.run(IJ.java:353) 
 ciliaQ_Prep_jnh.canny3d_thresholder.Processing.doProcessing(Processing.java:28) 
 ciliaQ_Prep_jnh.CiliaQPrepMain.segmentUsingCanny3D(CiliaQPrepMain.java:1613) 
 ciliaQ_Prep_jnh.CiliaQPrepMain.run(CiliaQPrepMain.java:625) 
 ij.IJ.runUserPlugIn(IJ.java:217) 
 ij.IJ.runPlugIn(IJ.java:181) 
 ij.Executer.runCommand(Executer.java:137) 
 ij.Executer.run(Executer.java:66) 
 java.lang.Thread.run(Thread.java:750)