Commit 8b826a93 authored by Aliaksandr Halavatyi's avatar Aliaksandr Halavatyi
Browse files

distabce filter to 3D reference object

parent b56615a9
......@@ -14,7 +14,7 @@
-->
<groupId>embl.almf</groupId>
<artifactId>AutoMicTools_</artifactId>
<version>1.1.17-SNAPSHOT</version>
<version>1.1.18-SNAPSHOT</version>
<name>plugins/AutoMicTools_.jar</name>
<description>Collection of tools for automated (feedback) microscopy data acquisition and analysis</description>
......
......@@ -290,6 +290,31 @@ public class RoiFilter3D {
}
public void filterDistanceRefObject(Object3D _referenceObject, double _minDistance,double _maxDistance,boolean _inPixels){
if (_referenceObject==null){
if (Double.isInfinite(_maxDistance))
return;
else{
this.setAllPassedFlags(false);
return;
}
}
double distance;
Object3D targetObject;
for (int i=0;i<nObj;i++){
if (Passed[i]){//check only those ROIs which were not filtered out before
targetObject=objects.getObject(i);
if (_inPixels)
distance=targetObject.distBorderPixel(_referenceObject);
else
distance=targetObject.distBorderUnit(_referenceObject);
Passed[i]=(distance>=_minDistance)&&(distance<=_maxDistance);
}
}
}
private void setAllPassedFlags(boolean _value){
for (int i=0;i<nObj;i++)
Passed[i]=_value;
......
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