09.08.2013 Views

Analyse avec le logiciel imagej d'un lot d'images en microscopie par ...

Analyse avec le logiciel imagej d'un lot d'images en microscopie par ...

Analyse avec le logiciel imagej d'un lot d'images en microscopie par ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C:\Docum<strong>en</strong>ts and Settings\montarou\Bureau\correction\chandez\PLU_RGB_Avg_v3_.java jeudi 22 juil<strong>le</strong>t 2010 16:22<br />

}<br />

/*<br />

return result;<br />

Op<strong>en</strong> G<strong>en</strong>ericDialog for se<strong>le</strong>ct image fi<strong>le</strong>s<br />

*/<br />

private boo<strong>le</strong>an showDialog(ImagePlus imp) {<br />

width = imp.getWidth();<br />

height = imp.getHeight();<br />

// Conversion Options (/src/ij/plugin/Options.java)<br />

doub<strong>le</strong>[] weights = ColorProcessor.getWeightingFactors();<br />

boo<strong>le</strong>an weighted = !(weights[0]==1d/3d && weights[1]==1d/3d && weights[2]==1d/3d);<br />

G<strong>en</strong>ericDialog gd = new G<strong>en</strong>ericDialog("Plugin Options");<br />

String msg = "This plugin calibrates a RGB image from an average flat-field<br />

image.\n\n";<br />

gd.addMessage(msg);<br />

msg = "Number of images in flat-field sequ<strong>en</strong>ce: "+stackPLUSize;<br />

gd.addMessage(msg);<br />

in2p3-00530281, version 1 - 28 Oct 2010<br />

0);<br />

// Differ<strong>en</strong>t kinds of projections.<br />

msg = "Se<strong>le</strong>ct methods for producing average flat-field image:";<br />

gd.addMessage(msg);<br />

gd.addChoice("Projection Type", ZProjector.METHODS, ZProjector.METHODS[method]);<br />

msg = "Se<strong>le</strong>ct operator for calibration:";<br />

gd.addMessage(msg);<br />

gd.addChoice("Operation:", operators, operators[operator]);<br />

gd.addCheckbox("Sca<strong>le</strong> Wh<strong>en</strong> Converting", ImageConverter.getDoScaling());<br />

String prompt = "Weighted RGB Conversions";<br />

if (weighted)<br />

prompt+=" ("+IJ.d2s(weights[0])+","+IJ.d2s(weights[1])+","+IJ.d2s(weights[2])+")";<br />

gd.addCheckbox(prompt, weighted);<br />

gd.addNumericField("Save all images (Debug mode) (1) Display result only (0) ? ", 1,<br />

msg = "Saving images ("+width+"x"+height+") in output directory:\n "+outputDir;<br />

gd.addMessage(msg);<br />

gd.showDialog();<br />

if (gd.wasCance<strong>le</strong>d())<br />

return false;<br />

// Gets Projection methode<br />

method = gd.getNextChoiceIndex();<br />

// Gets Processing operator<br />

operator = gd.getNextChoiceIndex();<br />

// Gets do scaling option<br />

doScaling = gd.getNextBoo<strong>le</strong>an();<br />

ImageConverter.setDoScaling(doScaling);<br />

// Gets conversion option<br />

Prefs.weightedColor = gd.getNextBoo<strong>le</strong>an();<br />

if (!Prefs.weightedColor)<br />

ColorProcessor.setWeightingFactors(1d/3d, 1d/3d, 1d/3d);<br />

else if (Prefs.weightedColor && !weighted)<br />

ColorProcessor.setWeightingFactors(0.299, 0.587, 0.114);<br />

// Asking for debug mode<br />

-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!