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

Method update

ij/src/main/java/ij/plugin/frame/Channels.java:155–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153 }
154
155 public void update() {
156 CompositeImage ci = getImage();
157 if (ci==null || checkbox==null)
158 return;
159 int n = checkbox.length;
160 int nChannels = ci.getNChannels();
161 if (nChannels!=n && nChannels<=CompositeImage.MAX_CHANNELS) {
162 instance = null;
163 location = getLocation();
164 close();
165 new Channels();
166 return;
167 }
168 boolean[] active = ci.getActiveChannels();
169 for (int i=0; i<checkbox.length; i++)
170 checkbox[i].setState(active[i]);
171 int index = 0;
172
173 String cmode = ci.getProp("CompositeProjection");
174 int cindex = COMP;
175 if (cmode!=null) {
176 if (cmode.contains("Max")||cmode.contains("max")) cindex=MAX;
177 if (cmode.contains("Min")||cmode.contains("min")) cindex=MIN;
178 if (cmode.contains("Invert")||cmode.contains("invert")) cindex=INVERT;
179 }
180 switch (ci.getMode()) {
181 case IJ.COMPOSITE: index=cindex; break;
182 case IJ.COLOR: index=COLOR; break;
183 case IJ.GRAYSCALE: index=GRAY; break;
184 }
185 choice.select(index);
186 }
187
188 public static void updateChannels() {
189 if (instance!=null)

Callers 2

ChannelsMethod · 0.95
updateChannelsMethod · 0.45

Calls 10

getImageMethod · 0.95
closeMethod · 0.95
getActiveChannelsMethod · 0.95
getModeMethod · 0.95
getLocationMethod · 0.80
setStateMethod · 0.80
getPropMethod · 0.80
getNChannelsMethod · 0.45
containsMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected