Sets the current hyperstack position and updates the display, where 'channel', 'slice' and 'frame' are one-based indexes.
(int channel, int slice, int frame)
| 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. */ |
no test coverage detected