Skip to content

Commit

Permalink
v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jollion committed Feb 22, 2018
1 parent 8078e8e commit a27235d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>ljp</groupId>
<artifactId>functional-bioimage_core</artifactId>
<version>1.4.7-SNAPSHOT</version>
<version>1.5-SNAPSHOT</version>

<name>functional-bioimage-core</name>
<description>Bacteria Analyzer</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import boa.plugins.plugins.processing_scheme.SegmentAndTrack;
import boa.plugins.plugins.processing_scheme.SegmentThenTrack;
import boa.plugins.plugins.segmenters.BacteriaIntensity;
import boa.plugins.plugins.segmenters.MicroChannelFluo2D;
import boa.plugins.plugins.segmenters.MicrochannelFluo2D;
import boa.plugins.plugins.segmenters.MutationSegmenter;
import boa.plugins.plugins.trackers.MutationTracker;
import boa.plugins.plugins.trackers.MicrochannelTracker;
Expand Down Expand Up @@ -172,7 +172,7 @@ public static Experiment generateXPFluo(String name, String outputDir, boolean s
Structure mutation = new Structure("Mutation", 0, mutChan); // parent structure 1 segParentStructure 0
xp.getStructures().insert(mc, bacteria, mutation);

mc.setProcessingScheme(new SegmentAndTrack(new MicrochannelTracker().setSegmenter(new MicroChannelFluo2D())));
mc.setProcessingScheme(new SegmentAndTrack(new MicrochannelTracker().setSegmenter(new MicrochannelFluo2D())));
//bacteria.setProcessingScheme(new SegmentAndTrack(new BacteriaClosedMicrochannelTrackerLocalCorrections(new BacteriaFluo()).setCostParameters(0.1, 0.5)));
bacteria.setProcessingScheme(new SegmentThenTrack(new BacteriaIntensity(), new BacteriaClosedMicrochannelTrackerLocalCorrections().setCostParameters(0.1, 0.5)));
mutation.setProcessingScheme(new SegmentAndTrack(
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/boa/core/generateXP/GenerateXP.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
import boa.plugins.plugins.processing_scheme.SegmentOnly;
import boa.plugins.plugins.processing_scheme.SegmentThenTrack;
import boa.plugins.plugins.segmenters.BacteriaIntensity;
import boa.plugins.plugins.segmenters.MicroChannelFluo2D;
import boa.plugins.plugins.segmenters.MicrochannelFluo2D;
import boa.plugins.plugins.segmenters.MicrochannelPhase2D;
import boa.plugins.plugins.segmenters.MutationSegmenter;
import boa.plugins.plugins.thresholders.IJAutoThresholder;
Expand Down Expand Up @@ -479,8 +479,7 @@ public static void setParametersFluo(Experiment xp, boolean processing, boolean
mutation.setSegmentationParentStructure(1);
if (processing) {
mc.setProcessingScheme(new SegmentAndTrack(
new MicrochannelTracker().setSegmenter(
new MicroChannelFluo2D()
new MicrochannelTracker().setSegmenter(new MicrochannelFluo2D()
).setTrackingParameters(40, 0.5).setYShiftQuantile(0.05)
).addTrackPostFilters(new RemoveMicrochannelsTouchingBackgroundOnSides(2),
new RemoveMicrochannelsWithOverexpression(99, 5).setTrim(true),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/boa/plugins/PluginFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class PluginFactory {

private final static TreeMap<String, Class> plugins = new TreeMap<>();
private final static Logger logger = LoggerFactory.getLogger(PluginFactory.class);
private final static Map<String, String> refactoredNamesOldMapNew = new HashMap<String, String>(){{put("BacteriaFluo", "BacteriaIntensity");}};
private final static Map<String, String> refactoredNamesOldMapNew = new HashMap<String, String>(){{put("BacteriaFluo", "BacteriaIntensity");put("MicroChannelFluo2D", "MicrochannelFluo2D");put("LAPTracker", "MutationTracker");put("MutationSegmenter", "MutationSegmenter");}};

public static void findPlugins(String packageName) {
logger.info("looking for plugin in package: {}", packageName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*
* @author jollion
*/
public class MicroChannelFluo2D implements MicrochannelSegmenter, TrackParametrizable<MicroChannelFluo2D>, ToolTip {
public class MicrochannelFluo2D implements MicrochannelSegmenter, TrackParametrizable<MicrochannelFluo2D>, ToolTip {

NumberParameter channelHeight = new BoundedNumberParameter("Microchannel Height", 0, 430, 5, null).setToolTipText("Height of microchannel in pixels");
NumberParameter channelWidth = new BoundedNumberParameter("Microchannel Width", 0, 40, 5, null);
Expand All @@ -69,9 +69,9 @@ public class MicroChannelFluo2D implements MicrochannelSegmenter, TrackParametri
+ "<ol><li>Rough segmentation of cells using \"Threshold\" computed the whole track prior to segmentation step</li>"
+ "<li>Selection of filled channels: lengh in X direction should be over \"Microchannel Height\" x \"Microchannel filling proportion\"</li>"
+ "<li>Computation of Y start: min value of the min y coordinate of the selected objects at step 2</li></ol></html>";
public MicroChannelFluo2D() {}
public MicrochannelFluo2D() {}

public MicroChannelFluo2D(int channelHeight, int channelWidth, int yMargin, double fillingProportion, int minObjectSize) {
public MicrochannelFluo2D(int channelHeight, int channelWidth, int yMargin, double fillingProportion, int minObjectSize) {
this.channelHeight.setValue(channelHeight);
this.channelWidth.setValue(channelWidth);
this.yShift.setValue(yMargin);
Expand Down Expand Up @@ -105,7 +105,7 @@ public Parameter[] getParameters() {


@Override
public ApplyToSegmenter<MicroChannelFluo2D> run(int structureIdx, List<StructureObject> parentTrack) {
public ApplyToSegmenter<MicrochannelFluo2D> run(int structureIdx, List<StructureObject> parentTrack) {
double thld = TrackParametrizable.getGlobalThreshold(structureIdx, parentTrack, this.threshold.instanciatePlugin());
return (p, s)->s.thresholdValue=thld;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
import boa.utils.Utils;
import static boa.utils.Utils.plotProfile;
import boa.plugins.OverridableThresholdMap;
import boa.plugins.plugins.segmenters.MicroChannelFluo2D;
import boa.plugins.plugins.segmenters.MicrochannelFluo2D;
import boa.plugins.MicrochannelSegmenter.Result;

/**
Expand Down Expand Up @@ -110,7 +110,7 @@ public BoundingBox getBoundingBox(Image image) {

public BoundingBox getBoundingBox(Image image, ImageInteger thresholdedImage, double threshold) {
if (debug) testMode = true;
Result r = MicroChannelFluo2D.segmentMicroChannels(image, thresholdedImage, 0, 0, this.channelHeight.getValue().intValue(), this.fillingProportion.getValue().doubleValue(), threshold, this.minObjectSize.getValue().intValue(), testMode);
Result r = MicrochannelFluo2D.segmentMicroChannels(image, thresholdedImage, 0, 0, this.channelHeight.getValue().intValue(), this.fillingProportion.getValue().doubleValue(), threshold, this.minObjectSize.getValue().intValue(), testMode);
if (r == null) return null;
int cropMargin = this.cropMarginY.getValue().intValue();
int xStart = this.xStart.getValue().intValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import boa.plugins.PluginFactory;
import boa.plugins.Segmenter;
import boa.plugins.plugins.segmenters.BacteriaIntensity;
import boa.plugins.plugins.segmenters.MicroChannelFluo2D;
import boa.plugins.plugins.segmenters.MicrochannelFluo2D;
import boa.plugins.plugins.transformations.CropMicroChannelFluo2D;
import boa.plugins.OverridableThresholdMap;

Expand All @@ -64,7 +64,7 @@ public static void testSegMicrochannelsFromXP(String dbName, int fieldNumber, in
StructureObject root = mDAO.getDao(f.getName()).getRoot(timePoint);
logger.debug("field name: {}, root==null? {} frame: {}", f.getName(), root==null, root.getFrame());
Image input = root.getRawImage(0);
MicroChannelFluo2D.debug=true;
MicrochannelFluo2D.debug=true;
CropMicroChannelFluo2D.debug=true;
//ObjectPopulation pop = MicroChannelFluo2D.run(input, 355, 40, 20, 50, 0.6d, 100);
//ObjectPopulation pop = MicroChannelFluo2D.run2(input, 355, 40, 20);
Expand Down

0 comments on commit a27235d

Please sign in to comment.