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

Method setPosition

ij/src/main/java/ij/ImagePlus.java:1960–1985  ·  view source on GitHub ↗

Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.

(int channel, int slice, int frame)

Source from the content-addressed store, hash-verified

1958 /** Sets the current hyperstack position and updates the display,
1959 where 'channel', 'slice' and 'frame' are one-based indexes. */
1960 public void setPosition(int channel, int slice, int frame) {
1961 //IJ.log("setPosition: "+channel+" "+slice+" "+frame+" "+noUpdateMode);
1962 verifyDimensions();
1963 if (channel<0) channel=0;
1964 if (slice<0) slice=0;
1965 if (frame<0) frame=0;
1966 if (channel==0) channel=getC();
1967 if (slice==0) slice=getZ();
1968 if (frame==0) frame=getT();
1969 if (channel>nChannels) channel=nChannels;
1970 if (slice>nSlices) slice=nSlices;
1971 if (frame>nFrames) frame=nFrames;
1972 if (isDisplayedHyperStack()) {
1973 if (noUpdateMode) {
1974 setSlice((frame-1)*nChannels*nSlices + (slice-1)*nChannels + channel);
1975 updatePosition(channel, slice, frame);
1976 } else
1977 ((StackWindow)win).setPosition(channel, slice, frame);
1978 } else {
1979 boolean channelChanged = channel!=getChannel();
1980 setSlice((frame-1)*nChannels*nSlices + (slice-1)*nChannels + channel);
1981 updatePosition(channel, slice, frame);
1982 if (channelChanged && isComposite() && !noUpdateMode)
1983 updateImage();
1984 }
1985 }
1986
1987 /** Sets the current hyperstack position without updating the display,
1988 where 'channel', 'slice' and 'frame' are one-based indexes. */

Callers 15

showMethod · 0.95
setStackMethod · 0.95
setCMethod · 0.95
setZMethod · 0.95
setTMethod · 0.95
setSliceMethod · 0.95
doStackMethod · 0.95
runMethod · 0.95
runMethod · 0.95
duplicateHyperstackMethod · 0.95
runMethod · 0.95

Calls 11

verifyDimensionsMethod · 0.95
getCMethod · 0.95
getZMethod · 0.95
getTMethod · 0.95
isDisplayedHyperStackMethod · 0.95
setSliceMethod · 0.95
updatePositionMethod · 0.95
getChannelMethod · 0.95
isCompositeMethod · 0.95
updateImageMethod · 0.95

Tested by

no test coverage detected