Search in sources :

Example 41 with FloatProcessor

use of ij.process.FloatProcessor in project GDSC-SMLM by aherbert.

the class IJImagePeakResultsTest method canAddToSinglePixels.

@Test
public void canAddToSinglePixels() {
    IJImagePeakResults r = new IJImagePeakResults(title, bounds, 1);
    FloatProcessor fp = new FloatProcessor(bounds.width, bounds.height);
    begin(r);
    add(fp, r, 1, 1, 1);
    add(fp, r, 1, 2, 4);
    add(fp, r, 0, 1, 2);
    r.end();
    float[] expecteds = getImage(fp);
    float[] actuals = getImage(r);
    Assert.assertArrayEquals(expecteds, actuals, 0);
}
Also used : FloatProcessor(ij.process.FloatProcessor) Test(org.junit.Test)

Example 42 with FloatProcessor

use of ij.process.FloatProcessor in project GDSC-SMLM by aherbert.

the class IJImagePeakResultsTest method noInterpolateDownInXAtImageEdge.

@Test
public void noInterpolateDownInXAtImageEdge() {
    IJImagePeakResults r = new IJImagePeakResults(title, bounds, 1);
    r.setDisplayFlags(IJImagePeakResults.DISPLAY_WEIGHTED);
    FloatProcessor fp = new FloatProcessor(bounds.width, bounds.height);
    begin(r);
    addValue(r, 0.5f, 1.5f, 2);
    fp.putPixelValue(0, 1, 2);
    r.end();
    float[] expecteds = getImage(fp);
    float[] actuals = getImage(r);
    Assert.assertArrayEquals(expecteds, actuals, 0);
}
Also used : FloatProcessor(ij.process.FloatProcessor) Test(org.junit.Test)

Example 43 with FloatProcessor

use of ij.process.FloatProcessor in project GDSC-SMLM by aherbert.

the class IJImagePeakResultsTest method canInterpolateDownInY.

@Test
public void canInterpolateDownInY() {
    IJImagePeakResults r = new IJImagePeakResults(title, bounds, 1);
    r.setDisplayFlags(IJImagePeakResults.DISPLAY_WEIGHTED);
    FloatProcessor fp = new FloatProcessor(bounds.width, bounds.height);
    begin(r);
    addValue(r, 1.5f, 1.25f, 2);
    fp.putPixelValue(1, 0, 0.5f);
    fp.putPixelValue(1, 1, 1.5f);
    r.end();
    float[] expecteds = getImage(fp);
    float[] actuals = getImage(r);
    Assert.assertArrayEquals(expecteds, actuals, 0);
}
Also used : FloatProcessor(ij.process.FloatProcessor) Test(org.junit.Test)

Example 44 with FloatProcessor

use of ij.process.FloatProcessor in project GDSC-SMLM by aherbert.

the class IJImagePeakResultsTest method canInterpolateUpInXAtPixelEdge.

@Test
public void canInterpolateUpInXAtPixelEdge() {
    IJImagePeakResults r = new IJImagePeakResults(title, bounds, 1);
    r.setDisplayFlags(IJImagePeakResults.DISPLAY_WEIGHTED);
    FloatProcessor fp = new FloatProcessor(bounds.width, bounds.height);
    begin(r);
    addValue(r, 2f, 1.5f, 2);
    fp.putPixelValue(1, 1, 1);
    fp.putPixelValue(2, 1, 1);
    r.end();
    float[] expecteds = getImage(fp);
    float[] actuals = getImage(r);
    Assert.assertArrayEquals(expecteds, actuals, 0);
}
Also used : FloatProcessor(ij.process.FloatProcessor) Test(org.junit.Test)

Example 45 with FloatProcessor

use of ij.process.FloatProcessor in project GDSC-SMLM by aherbert.

the class IJImagePeakResultsTest method canInterpolateDownInXAtPixelEdge.

@Test
public void canInterpolateDownInXAtPixelEdge() {
    IJImagePeakResults r = new IJImagePeakResults(title, bounds, 1);
    r.setDisplayFlags(IJImagePeakResults.DISPLAY_WEIGHTED);
    FloatProcessor fp = new FloatProcessor(bounds.width, bounds.height);
    begin(r);
    addValue(r, 1f, 1.5f, 2);
    fp.putPixelValue(0, 1, 1);
    fp.putPixelValue(1, 1, 1);
    r.end();
    float[] expecteds = getImage(fp);
    float[] actuals = getImage(r);
    Assert.assertArrayEquals(expecteds, actuals, 0);
}
Also used : FloatProcessor(ij.process.FloatProcessor) Test(org.junit.Test)

Aggregations

FloatProcessor (ij.process.FloatProcessor)49 Test (org.junit.Test)22 ImageProcessor (ij.process.ImageProcessor)11 Rectangle (java.awt.Rectangle)8 FHT2 (ij.process.FHT2)5 ImageStack (ij.ImageStack)4 Point (java.awt.Point)4 LinkedList (java.util.LinkedList)4 Future (java.util.concurrent.Future)4 ClusterPoint (gdsc.core.clustering.ClusterPoint)3 IJImagePeakResults (gdsc.smlm.ij.results.IJImagePeakResults)3 ImagePlus (ij.ImagePlus)3 RandomGenerator (org.apache.commons.math3.random.RandomGenerator)3 Well19937c (org.apache.commons.math3.random.Well19937c)3 BasePoint (gdsc.core.match.BasePoint)2 MaximaSpotFilter (gdsc.smlm.filters.MaximaSpotFilter)2 IJTablePeakResults (gdsc.smlm.ij.results.IJTablePeakResults)2 PeakResult (gdsc.smlm.results.PeakResult)2 ColorProcessor (ij.process.ColorProcessor)2 ShortProcessor (ij.process.ShortProcessor)2