-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91c457c
commit 82389c0
Showing
9 changed files
with
139 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from ij import IJ | ||
from ij.process import StackStatistics | ||
from ij.measure import ResultsTable | ||
from fr.cnrs.mri.cialib.stats import Histogram | ||
|
||
|
||
TABLE = "DistCenterCenterUnit" | ||
|
||
table = ResultsTable.getResultsTable(TABLE) | ||
image = IJ.getImage() | ||
cal = image.getCalibration() | ||
width, height, _, nSlices, _ = image.getDimensions() | ||
print(width, height, nSlices) | ||
width = cal.getX(width) | ||
height = cal.getY(height) | ||
depth = cal.getZ(nSlices) | ||
print(width, height, depth) | ||
volume = width * height * depth | ||
print("volume", volume) | ||
|
||
N = int(StackStatistics(image).max) | ||
distances = [] | ||
|
||
for i in range(2, N+1): | ||
dists = list(table.getColumn("V" + str(i))) | ||
print(i, len(dists)) | ||
distances.extend(dists) | ||
|
||
print(max(distances)) | ||
print(len(distances)) | ||
|
||
hist = Histogram(distances, start=0, end=100, nBins=1000) | ||
hist.calculate() | ||
hist.getPlot().show() | ||
hist.cumulate() | ||
hist.normalizeRipley(volume) | ||
hist.getPlot().show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from fr.cnrs.mri.cialib.spatialstats import KFunction | ||
|
||
|
||
k = KFunction() | ||
plot = k.getPlot(0, 95, 1000) | ||
plot.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters