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

Method conversions

ij/src/main/java/ij/plugin/Options.java:182–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 // Conversion Options
182 void conversions() {
183 double[] weights = ColorProcessor.getWeightingFactors();
184 boolean weighted = !(weights[0]==1d/3d && weights[1]==1d/3d && weights[2]==1d/3d);
185 //boolean weighted = !(Math.abs(weights[0]-1d/3d)<0.0001 && Math.abs(weights[1]-1d/3d)<0.0001 && Math.abs(weights[2]-1d/3d)<0.0001);
186 GenericDialog gd = new GenericDialog("Conversion Options");
187 gd.addCheckbox("Scale when converting", ImageConverter.getDoScaling());
188 gd.setInsets(0,40,0);
189 gd.addCheckbox("Calibrate", Prefs.calibrateConversions);
190 String prompt = "Weighted RGB conversions";
191 if (weighted)
192 prompt += " (" + IJ.d2s(weights[0]) + "," + IJ.d2s(weights[1]) + ","+ IJ.d2s(weights[2]) + ")";
193 gd.addCheckbox(prompt, weighted);
194 gd.addCheckbox("Full range 16-bit inversions", Prefs.fullRange16bitInversions);
195 gd.addHelp(IJ.URL2+"/docs/menus/edit.html#conversions");
196 gd.showDialog();
197 if (gd.wasCanceled())
198 return;
199 ImageConverter.setDoScaling(gd.getNextBoolean());
200 Prefs.calibrateConversions = gd.getNextBoolean();
201 Prefs.weightedColor = gd.getNextBoolean();
202 Prefs.fullRange16bitInversions = gd.getNextBoolean();
203 if (Prefs.calibrateConversions)
204 ImageConverter.setDoScaling(true);
205 if (!Prefs.weightedColor)
206 ColorProcessor.setWeightingFactors(1d/3d, 1d/3d, 1d/3d);
207 else if (Prefs.weightedColor && !weighted)
208 ColorProcessor.setWeightingFactors(0.299, 0.587, 0.114);
209 return;
210 }
211
212 // replaced by AppearanceOptions class
213 void appearance() {

Callers 1

runMethod · 0.95

Calls 11

getWeightingFactorsMethod · 0.95
addCheckboxMethod · 0.95
getDoScalingMethod · 0.95
setInsetsMethod · 0.95
d2sMethod · 0.95
addHelpMethod · 0.95
showDialogMethod · 0.95
wasCanceledMethod · 0.95
setDoScalingMethod · 0.95
getNextBooleanMethod · 0.95
setWeightingFactorsMethod · 0.95

Tested by

no test coverage detected