Ejemplo n.º 1
0
  protected Element echoAnalyzers(final Settings settings) {
    final Element analyzersElement = new Element(ANALYZER_COLLECTION_ELEMENT_KEY);

    // Spot analyzers
    final Element spotAnalyzersEl = new Element(SPOT_ANALYSERS_ELEMENT_KEY);
    for (final SpotAnalyzerFactory<?> analyzer : settings.getSpotAnalyzerFactories()) {
      final Element el = new Element(ANALYSER_ELEMENT_KEY);
      el.setAttribute(ANALYSER_KEY_ATTRIBUTE, analyzer.getKey());
      spotAnalyzersEl.addContent(el);
    }
    analyzersElement.addContent(spotAnalyzersEl);

    // Edge analyzers
    final Element edgeAnalyzersEl = new Element(EDGE_ANALYSERS_ELEMENT_KEY);
    for (final EdgeAnalyzer analyzer : settings.getEdgeAnalyzers()) {
      final Element el = new Element(ANALYSER_ELEMENT_KEY);
      el.setAttribute(ANALYSER_KEY_ATTRIBUTE, analyzer.getKey());
      edgeAnalyzersEl.addContent(el);
    }
    analyzersElement.addContent(edgeAnalyzersEl);

    // Track analyzers
    final Element trackAnalyzersEl = new Element(TRACK_ANALYSERS_ELEMENT_KEY);
    for (final TrackAnalyzer analyzer : settings.getTrackAnalyzers()) {
      final Element el = new Element(ANALYSER_ELEMENT_KEY);
      el.setAttribute(ANALYSER_KEY_ATTRIBUTE, analyzer.getKey());
      trackAnalyzersEl.addContent(el);
    }
    analyzersElement.addContent(trackAnalyzersEl);

    logger.log("  Added spot, edge and track analyzers.\n");
    return analyzersElement;
  }
Ejemplo n.º 2
0
 @Override
 public void setModel(TrackMateModel model) {
   super.setModel(model);
   this.settings = model.getSettings();
   this.imp = settings.imp;
   this.calibration = settings.getCalibration();
 }
Ejemplo n.º 3
0
  protected Element echoTrackFilters(final Settings settings) {
    final List<FeatureFilter> filters = settings.getTrackFilters();

    final Element trackFiltersElement = new Element(TRACK_FILTER_COLLECTION_ELEMENT_KEY);
    for (final FeatureFilter filter : filters) {
      final Element thresholdElement = new Element(FILTER_ELEMENT_KEY);
      thresholdElement.setAttribute(FILTER_FEATURE_ATTRIBUTE_NAME, filter.feature);
      thresholdElement.setAttribute(FILTER_VALUE_ATTRIBUTE_NAME, filter.value.toString());
      thresholdElement.setAttribute(FILTER_ABOVE_ATTRIBUTE_NAME, "" + filter.isAbove);
      trackFiltersElement.addContent(thresholdElement);
    }
    logger.log("  Added track feature filters.\n");
    return trackFiltersElement;
  }
Ejemplo n.º 4
0
  protected Element echoSpotFilters(final Settings settings) {
    final List<FeatureFilter> featureThresholds = settings.getSpotFilters();

    final Element filtersElement = new Element(SPOT_FILTER_COLLECTION_ELEMENT_KEY);
    for (final FeatureFilter threshold : featureThresholds) {
      final Element thresholdElement = new Element(FILTER_ELEMENT_KEY);
      thresholdElement.setAttribute(FILTER_FEATURE_ATTRIBUTE_NAME, threshold.feature);
      thresholdElement.setAttribute(FILTER_VALUE_ATTRIBUTE_NAME, threshold.value.toString());
      thresholdElement.setAttribute(FILTER_ABOVE_ATTRIBUTE_NAME, "" + threshold.isAbove);
      filtersElement.addContent(thresholdElement);
    }
    logger.log("  Added spot feature filters.\n");
    return filtersElement;
  }
Ejemplo n.º 5
0
 /**
  * Update the specified settings object, with the parameters set in this panel.
  *
  * @param settings the Settings to update. Cannot be <code>null</code>.
  */
 public void updateTo(Model model, Settings settings) {
   settings.imp = imp;
   // Crop cube
   settings.tstart = Math.round(Float.parseFloat(jTextFieldTStart.getText()));
   settings.tend = Math.round(Float.parseFloat(jTextFieldTEnd.getText()));
   settings.xstart = Math.round(Float.parseFloat(jTextFieldXStart.getText()));
   settings.xend = Math.round(Float.parseFloat(jTextFieldXEnd.getText()));
   settings.ystart = Math.round(Float.parseFloat(jTextFieldYStart.getText()));
   settings.yend = Math.round(Float.parseFloat(jTextFieldYEnd.getText()));
   settings.zstart = Math.round(Float.parseFloat(jTextFieldZStart.getText()));
   settings.zend = Math.round(Float.parseFloat(jTextFieldZEnd.getText()));
   // Image info
   settings.dx = Float.parseFloat(jTextFieldPixelWidth.getText());
   settings.dy = Float.parseFloat(jTextFieldPixelHeight.getText());
   settings.dz = Float.parseFloat(jTextFieldVoxelDepth.getText());
   settings.dt = Float.parseFloat(jTextFieldTimeInterval.getText());
   settings.width = imp.getWidth();
   settings.height = imp.getHeight();
   settings.nslices = imp.getNSlices();
   settings.nframes = imp.getNFrames();
   // Units
   model.setPhysicalUnits(jLabelUnits1.getText(), jLabelUnits4.getText());
   // Roi
   Roi roi = imp.getRoi();
   if (null != roi) {
     settings.polygon = roi.getPolygon();
   }
   // File info
   if (null != imp.getOriginalFileInfo()) {
     settings.imageFileName = imp.getOriginalFileInfo().fileName;
     settings.imageFolder = imp.getOriginalFileInfo().directory;
   }
 }