Skip to content

Commit 658fd2d

Browse files
committed
Clean up imports and improve SACA Op descriptions
1 parent dbd0628 commit 658fd2d

File tree

7 files changed

+40
-34
lines changed

7 files changed

+40
-34
lines changed

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/AdaptiveSmoothedKendallTau.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* ImageJ2 software for multidimensional image processing and analysis.
44
* %%
5-
* Copyright (C) 2014 - 2023 ImageJ2 developers.
5+
* Copyright (C) 2014 - 2024 ImageJ2 developers.
66
* %%
77
* Redistribution and use in source and binary forms, with or without
88
* modification, are permitted provided that the following conditions are met:
@@ -49,7 +49,9 @@
4949
import net.imglib2.type.numeric.real.DoubleType;
5050

5151
/**
52-
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) op.
52+
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) framework.
53+
* This class is used by the "coloc.saca.heatmapZScore" Op to produce the Z-score
54+
* heatmap of pixel colocalization strength.
5355
*
5456
* @author Shulei Wang
5557
* @author Ellen TA Dobson

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/PNorm.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
import org.apache.commons.math3.distribution.NormalDistribution;
3737

3838
/**
39-
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) op.
39+
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) framework.
40+
* This class is used by the "coloc.saca.heatmapPValue" Op to produce a heatmap of
41+
* pixelwise p-values. This class replicates R's pnorm function.
4042
*
4143
* @author Edward Evans
4244
*/
@@ -51,7 +53,8 @@ public static void compute(RandomAccessibleInterval<DoubleType> input,
5153
// compute normal distribution over the image
5254
NormalDistribution normalDistribution = new NormalDistribution();
5355

54-
LoopBuilder.setImages(input, output).multiThreaded().forEachPixel((i, o) -> {
56+
LoopBuilder.setImages(input, output).multiThreaded().forEachPixel((i,
57+
o) -> {
5558
double normDistValue = normalDistribution.cumulativeProbability(i.get());
5659
if (!lowerTail) {
5760
normDistValue = 1 - normDistValue;

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/QNorm.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
import org.apache.commons.math3.distribution.NormalDistribution;
3333

3434
/**
35-
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) op.
35+
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) framework.
36+
* This class is used by the "coloc.saca.sigMask" Op to produce a binary mask of
37+
* significantly colocalized pixels. This class replicates R's qnorm function.
3638
*
3739
* @author Shulei Wang
3840
* @author Ellen TA Dobson

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/SACAHeatmapPValue.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636
import org.scijava.ops.spi.Nullable;
3737

3838
/**
39-
* Spatially Adaptive Colocalization Analysis (SACA) Adapted from Shulei's
40-
* original Java code for AdaptiveSmoothedKendallTau from his RKColocal R
41-
* package.
42-
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz)
43-
*
4439
* @author Shulei Wang
4540
* @author Curtis Rueden
4641
* @author Ellen TA Dobson
@@ -53,21 +48,25 @@ public class SACAHeatmapPValue implements
5348
{
5449

5550
/**
56-
* Spatially Adaptive Colocalization Analysis (SACA) P Value heatmap
51+
* Spatially Adaptive Colocalization Analysis (SACA) p-value heatmap. This Op
52+
* returns the pixelwise p-value of the input Z-score heatmap produced by the
53+
* SACA framework. SACA was adapted from Shulei's java code for
54+
* AdaptiveSmoothedKendallTau in his RKColocal package
55+
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz).
5756
*
58-
* @param heatmap input heatmap returned from 'coloc.saca.heatmapZScore'
57+
* @param heatmap input Z-score heatmap returned from 'coloc.saca.heatmapZScore'
5958
* @param lowerTail lower tail (default=false)
60-
* @param result P value heatmap output
59+
* @param result p value heatmap output
6160
*/
6261

6362
@Override
6463
public void compute(final RandomAccessibleInterval<DoubleType> heatmap,
6564
@Nullable Boolean lowerTail, RandomAccessibleInterval<DoubleType> result)
6665
{
67-
// set lowerTail if necessary
68-
if (lowerTail == null) lowerTail = true;
66+
// set lowerTail if necessary
67+
if (lowerTail == null) lowerTail = true;
6968

70-
// compute the normal distribution
69+
// compute the normal distribution
7170
PNorm.compute(heatmap, lowerTail, result);
7271
}
7372
}

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/SACAHeatmapZScore.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
import org.scijava.ops.spi.OpDependency;
4545

4646
/**
47-
* Spatially Adaptive Colocalization Analysis (SACA) Adapted from Shulei's
48-
* original Java code for AdaptiveSmoothedKendallTau from his RKColocal R
49-
* package.
50-
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz)
51-
*
5247
* @author Shulei Wang
5348
* @author Curtis Rueden
5449
* @author Ellen TA Dobson
@@ -68,14 +63,20 @@ public class SACAHeatmapZScore<I extends RealType<I>> implements
6863
private Function<Histogram1d<I>, I> otsuOp;
6964

7065
/**
71-
* Spatially Adaptive Colocalization Analysis (SACA)
66+
* Spatially Adaptive Colocalization Analysis (SACA) Z-score heatmap. This Op
67+
* utilizes the SACA framework to identify colocalized pixels and their
68+
* strength as a Z-score heatmap. The Z-score heatmap is a produced by
69+
* Shulei's adaptive smoothed kendall tau algorithim. SACA was adapted from
70+
* Shulei's java code for AdaptiveSmoothedKendallTau in his RKColocal package
71+
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz).
7272
*
7373
* @param image1 input image 1
7474
* @param image2 input image 2
7575
* @param thres1 threshold 1 value; otsu threshold applied if null
7676
* @param thres2 threshold 2 value; otsu threshold applied if null
77-
* @param seed seed to use; default 0xdeadbeefL
78-
* @param result result image
77+
* @param seed seed value to use; default 0xdeadbeefL
78+
* @param result Adaptive smoothed kendall tau Z-score heatmap (i.e.
79+
* colocalization strength)
7980
*/
8081

8182
@Override

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/SACASigMask.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,16 @@
2929

3030
package org.scijava.ops.image.coloc.saca;
3131

32-
import net.imglib2.img.Img;
3332
import net.imglib2.RandomAccessibleInterval;
3433
import net.imglib2.type.numeric.real.DoubleType;
3534
import net.imglib2.type.logic.BitType;
3635
import net.imglib2.util.Intervals;
37-
import net.imglib2.util.Util;
3836

3937
import org.scijava.function.Computers;
4038
import org.scijava.ops.spi.Nullable;
4139
import org.scijava.ops.spi.OpDependency;
4240

4341
/**
44-
* Spatially Adaptive Colocalization Analysis (SACA) Adapted from Shulei's
45-
* original Java code for AdaptiveSmoothedKendallTau from his RKColocal R
46-
* package.
47-
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz)
48-
*
4942
* @author Shulei Wang
5043
* @author Curtis Rueden
5144
* @author Ellen TA Dobson
@@ -61,9 +54,14 @@ public class SACASigMask implements
6154
private Computers.Arity2<RandomAccessibleInterval<DoubleType>, DoubleType, RandomAccessibleInterval<BitType>> thresOp;
6255

6356
/**
64-
* Spatially Adaptive Colocalization Analysis (SACA) Significant pixel mask.
57+
* Spatially Adaptive Colocalization Analysis (SACA) significant pixel mask.
58+
* This Op returns a binary mask of the significantly colocalized pixels from
59+
* the input Z-score heatmap produced by the SACA framework. SACA was adapted
60+
* from Shulei's java code for AdaptiveSmoothedKendallTau in his RKColocal
61+
* package
62+
* (https://github.com/lakerwsl/RKColocal/blob/master/RKColocal_0.0.1.0000.tar.gz).
6563
*
66-
* @param heatmap input heatmap returned from 'coloc.saca.heatmapZScore'
64+
* @param heatmap input Z-score heatmap returned from 'coloc.saca.heatmapZScore'
6765
* @param alpha significance cuttoff, type 1 error (default=0.05)
6866
* @param mean mean value (default=0)
6967
* @param sd standard div (default=1)

scijava-ops-image/src/main/java/org/scijava/ops/image/coloc/saca/WtKendallTau.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
import org.scijava.ops.image.coloc.IntComparator;
3838

3939
/**
40-
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) op.
40+
* Helper class for Spatially Adaptive Colocalization Analysis (SACA) framework.
41+
* This class is used by the AdaptiveSmoothedKendallTau class.
4142
*
4243
* @author Shulei Wang
4344
* @author Ellen TA Dobson

0 commit comments

Comments
 (0)