diff --git a/pom.xml b/pom.xml index 2bf68fefeb4b87229a2465743c70cdfbf18e42d8..42b022e282f3bd3a93310467f0a9894fb6e4c247 100644 --- a/pom.xml +++ b/pom.xml @@ -8,12 +8,12 @@ <parent> <groupId>org.bioimageanalysis.icy</groupId> <artifactId>parent-pom-plugin</artifactId> - <version>1.0.3</version> + <version>1.0.6</version> </parent> <!-- Project Information --> <artifactId>path-intensity-profiler</artifactId> - <version>1.2.2</version> + <version>1.2.3</version> <packaging>jar</packaging> diff --git a/src/main/java/plugins/stef/roi/quantify/PathIntensityProfiler.java b/src/main/java/plugins/stef/roi/quantify/PathIntensityProfiler.java index ff206a0b8091cd62e7a758911516843d1d0dd488..462a5052e9994c91a15a127813fc07b7a494acc6 100644 --- a/src/main/java/plugins/stef/roi/quantify/PathIntensityProfiler.java +++ b/src/main/java/plugins/stef/roi/quantify/PathIntensityProfiler.java @@ -11,6 +11,7 @@ import javax.swing.JComponent; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import icy.gui.dialog.MessageDialog; +import icy.gui.frame.progress.FailedAnnounceFrame; import icy.math.Line3DIterator; import icy.math.MathUtil; import icy.roi.BooleanMask2D; @@ -18,6 +19,7 @@ import icy.roi.ROI; import icy.roi.ROI2D; import icy.roi.ROI3D; import icy.sequence.Sequence; +import icy.system.IcyExceptionHandler; import icy.type.collection.CollectionUtil; import icy.type.geom.Line3D; import icy.type.point.Point3D; @@ -171,6 +173,14 @@ public class PathIntensityProfiler extends EzPlug implements Block, EzStoppable varWorkbook.setValue( getPathIntensityProfil(sequence, validRois, varRealUnit.getValue().booleanValue(), getUI())); } + catch (IllegalArgumentException e) + { + IcyExceptionHandler.handleException(e, true); + } + catch (InterruptedException e) + { + new FailedAnnounceFrame("Path intensity profile process interrupted.."); + } finally { // interactive mode @@ -187,8 +197,10 @@ public class PathIntensityProfiler extends EzPlug implements Block, EzStoppable * Computes intensity profil along path (contour for area ROI) for the given list of ROI. * * @return result in a XLSX workbook where we have one sheet per ROI. + * @throws InterruptedException */ private static XSSFWorkbook getPathIntensityProfil(Sequence sequence, List<ROI> rois, boolean useRealUnit, EzGUI ui) + throws InterruptedException { final XSSFWorkbook result = (XSSFWorkbook) Workbooks.createEmptyWorkbook(WorkbookFormat.XLSX); @@ -401,8 +413,10 @@ public class PathIntensityProfiler extends EzPlug implements Block, EzStoppable * Computes intensity profil along path (contour for area ROI) for the given list of ROI.<br> * * @return result in a XLSX workbook where we have one sheet per ROI. + * @throws InterruptedException */ public static XSSFWorkbook getPathIntensityProfil(Sequence sequence, List<ROI> rois, boolean useRealUnit) + throws InterruptedException { return getPathIntensityProfil(sequence, rois, useRealUnit, null); }