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;
import icy.math.ArrayMath;
import icy.plugin.interface_.PluginBundled;
import icy.preferences.XMLPreferences;
import icy.sequence.Sequence;
import icy.util.XLSUtil;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
......@@ -273,8 +274,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeBoxWidth() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -284,8 +293,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue;
final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeX()
* contour.pixelSize.x;
double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeX() * contour.pixelSize.x;
result[trackIndex][det.getT()] = value;
}
}
......@@ -294,8 +302,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeBoxHeight() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -305,8 +321,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue;
final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeY()
* contour.pixelSize.y;
double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeY() * contour.pixelSize.y;
result[trackIndex][det.getT()] = value;
}
}
......@@ -315,8 +330,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeBoxDepth() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -326,8 +349,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
continue;
final Mesh3D contour = (Mesh3D) det;
double value = contour.toROI(ROIType.POLYGON, trackPool.getDisplaySequence()).getBounds5D().getSizeZ()
* contour.pixelSize.z;
double value = contour.toROI(ROIType.POLYGON, seq).getBounds5D().getSizeZ() * contour.pixelSize.z;
result[trackIndex][det.getT()] = value;
}
}
......@@ -414,6 +436,18 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
// time labels
for (int t = 0; t < trackPool.getDisplaySequence().getSizeT(); t++)
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
for (int i = 0; i < trackPool.getTrackSegmentList().size(); i++) {
......@@ -434,8 +468,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return
*/
private double[][] computeConvexity() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -484,8 +526,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeDimension(int order) {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -495,7 +545,7 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
if (!(det instanceof ActiveContour))
continue;
if (result[trackIndex].length > det.getT()) {
if (sizeT > det.getT()) {
double value = ((ActiveContour) det).getDimension(order);
result[trackIndex][det.getT()] = value;
}
......@@ -507,8 +557,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeElongation() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -529,8 +587,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
}
private double[][] computeFlatness() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -576,8 +642,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
private double[][] computeSmoothness() {
ExecutorService service = Executors.newCachedThreadPool();
final double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
final double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
ArrayList<Future<?>> results = new ArrayList<Future<?>>();
......@@ -680,8 +754,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return
*/
private double[][] computeRoundness() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
int trackIndex = trackPool.getTrackIndex(ts);
......@@ -726,8 +808,16 @@ public class DeformationProfiler extends PluginTrackManagerProcessor implements
* @return
*/
private double[][] computeSphericity() {
double[][] result = new double[trackPool.getTrackSegmentList().size()][trackPool.getDisplaySequence()
.getSizeT()];
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();
double[][] result = new double[trackPool.getTrackSegmentList().size()][sizeT];
for (TrackSegment ts : trackPool.getTrackSegmentList()) {
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