MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getStackIndex

Method getStackIndex

ij/src/main/java/ij/ImagePlus.java:2026–2034  ·  view source on GitHub ↗

Returns that stack index (one-based) corresponding to the specified position.

(int channel, int slice, int frame)

Source from the content-addressed store, hash-verified

2024
2025 /** Returns that stack index (one-based) corresponding to the specified position. */
2026 public int getStackIndex(int channel, int slice, int frame) {
2027 if (channel<1) channel = 1;
2028 if (channel>nChannels) channel = nChannels;
2029 if (slice<1) slice = 1;
2030 if (slice>nSlices) slice = nSlices;
2031 if (frame<1) frame = 1;
2032 if (frame>nFrames) frame = nFrames;
2033 return (frame-1)*nChannels*nSlices + (slice-1)*nChannels + channel;
2034 }
2035
2036 /* Hack needed to make the HyperStackReducer work. */
2037 public void resetStack() {

Callers 15

zScaleHyperstackMethod · 0.95
makeSubhyperstackMethod · 0.95
resliceHyperstackMethod · 0.95
updateImageMethod · 0.80
reduceMethod · 0.80
reduceHyperstackMethod · 0.80
getHyperstackProfileMethod · 0.80
getVolumeMethod · 0.80
runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected