Commit 4be794ba authored by Daniel Felipe  GONZALEZ OBANDO's avatar Daniel Felipe GONZALEZ OBANDO
Browse files

Merge branch 'master' of

https://gitlab.pasteur.fr/bia/active-contour.git

Conflicts:
	src/plugins/adufour/activecontours/DeformationProfiler.java
parents 32850b5e 1f8d60eb
...@@ -38,6 +38,7 @@ import icy.gui.util.GuiUtil; ...@@ -38,6 +38,7 @@ import icy.gui.util.GuiUtil;
import icy.math.ArrayMath; import icy.math.ArrayMath;
import icy.plugin.interface_.PluginBundled; import icy.plugin.interface_.PluginBundled;
import icy.preferences.XMLPreferences; import icy.preferences.XMLPreferences;
import icy.sequence.Sequence;
import icy.util.XLSUtil; import icy.util.XLSUtil;
import jxl.write.WritableSheet; import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook; import jxl.write.WritableWorkbook;
...@@ -273,8 +274,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -273,8 +274,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeBoxWidth() { private double[][] computeBoxWidth() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -284,8 +293,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -284,8 +293,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue; continue;
final Mesh3D contour = (Mesh3D) det; final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeX() double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeX() * contour.pixelSize.x;
* contour.pixelSize.x;
result[trackIndex][det.getT()] = value; result[trackIndex][det.getT()] = value;
} }
} }
...@@ -294,8 +302,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -294,8 +302,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeBoxHeight() { private double[][] computeBoxHeight() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -305,8 +321,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -305,8 +321,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue; continue;
final Mesh3D contour = (Mesh3D) det; final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeY() double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeY() * contour.pixelSize.y;
* contour.pixelSize.y;
result[trackIndex][det.getT()] = value; result[trackIndex][det.getT()] = value;
} }
} }
...@@ -315,8 +330,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -315,8 +330,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeBoxDepth() { private double[][] computeBoxDepth() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -326,8 +349,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -326,8 +349,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue; continue;
final Mesh3D contour = (Mesh3D) det; final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeZ() double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeZ() * contour.pixelSize.z;
* contour.pixelSize.z;
result[trackIndex][det.getT()] = value; result[trackIndex][det.getT()] = value;
} }
} }
...@@ -414,6 +436,18 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -414,6 +436,18 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
// time labels // time labels
for (int t = 0; t < trackPool.getDisplaySequence().getSizeT(); t++) for (int t = 0; t < trackPool.getDisplaySequence().getSizeT(); t++)
XLSUtil.setCellNumber(sheet, t + 1, 0, t * tScale); XLSUtil.setCellNumber(sheet, t + 1, 0, t * tScale);
final Sequence seq = trackPool.getDisplaySequence();
final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
// time labels
for (int t = 0; t < sizeT; t++)
XLSUtil.setCellNumber(sheet, t + 1, 0, t * tScale);
// indexes + data // indexes + data
for (int i = 0; i < trackPool.getTrackSegmentList().size(); i++) { for (int i = 0; i < trackPool.getTrackSegmentList().size(); i++) {
...@@ -434,8 +468,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -434,8 +468,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return * @return
*/ */
private double[][] computeConvexity() { private double[][] computeConvexity() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -484,8 +526,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -484,8 +526,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeDimension(int order) { private double[][] computeDimension(int order) {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -495,7 +545,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -495,7 +545,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
if (!(det instanceof ActiveContour)) if (!(det instanceof ActiveContour))
continue; continue;
if (result[trackIndex].length > det.getT()) { if (sizeT > det.getT()) {
double value = ((ActiveContour) det).getDimension(order); double value = ((ActiveContour) det).getDimension(order);
result[trackIndex][det.getT()] = value; result[trackIndex][det.getT()] = value;
} }
...@@ -507,8 +557,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -507,8 +557,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeElongation() { private double[][] computeElongation() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -529,8 +587,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -529,8 +587,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
} }
private double[][] computeFlatness() { private double[][] computeFlatness() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -576,8 +642,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -576,8 +642,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
private double[][] computeSmoothness() { private double[][] computeSmoothness() {
ExecutorService service = Executors.newCachedThreadPool(); ExecutorService service = Executors.newCachedThreadPool();
final double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
final double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
ArrayList<Future<?>> results = new ArrayList<Future<?>>(); ArrayList<Future<?>> results = new ArrayList<Future<?>>();
...@@ -680,8 +754,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -680,8 +754,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return * @return
*/ */
private double[][] computeRoundness() { private double[][] computeRoundness() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
...@@ -726,8 +808,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements ...@@ -726,8 +808,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return * @return
*/ */
private double[][] computeSphericity() { private double[][] computeSphericity() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence() final Sequence seq = trackPool.getDisplaySequence();
.getSizeT()]; final int sizeT;
// FIX: better to use last detection time point in this case
if (seq == null)
sizeT = trackPool.getLastDetectionTimePoint();
else
sizeT = seq.getSizeT();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) { for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts); int trackIndex = trackPool.getTrackIndex(ts);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment