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 />

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

, rgbip);<br />

}<br />

/*<br />

//stats = rgbPLUmask[rgbcyc<strong>le</strong>].getStatistics();<br />

doub<strong>le</strong> mean, stdDev, hMin, hMax, binWidth;<br />

mean = stats.mean;<br />

stdDev = stats.stdDev;<br />

hMax = stats.max;<br />

hMin = stats.min;<br />

int nBins = stats.histogram.<strong>le</strong>ngth;<br />

// Means stats by Channel<br />

// [0] -> red Pixels, [1] -> gre<strong>en</strong> Pixels, [2] -> blue Pixels<br />

pw.println("\tMean of channel "+RGB[rgbcyc<strong>le</strong>]+ "\t= "+ dec.format(mean)+<br />

"\tnBins="+nBins+"\tstdDev="+dec.format(stdDev));<br />

/*******************************************************************************/<br />

/* Point operation: All pixels divided by a mean value (scalar multiplication) */<br />

/*******************************************************************************/<br />

rgbip = rgbip.convertToFloat(); // 32-bit conversion<br />

rgbip.multiply(1.0D/mean);<br />

rgbPLUmask[rgbcyc<strong>le</strong>] = new ImagePlus("Projection_of_Mask_PLU_("+RGB[rgbcyc<strong>le</strong>]+")"<br />

if (debug==1) {<br />

//rgbPLUmask[rgbcyc<strong>le</strong>].show();<br />

String fi<strong>le</strong>Name = outputDir+rgbPLUmask[rgbcyc<strong>le</strong>].getTit<strong>le</strong>()+".tif";<br />

new Fi<strong>le</strong>Saver(rgbPLUmask[rgbcyc<strong>le</strong>]).saveAsTiff(fi<strong>le</strong>Name);<br />

}<br />

} // <strong>en</strong>d rgbcyc<strong>le</strong><br />

Splits the specified RGB image or stack into a stack of three 8-bit images or stacks<br />

repres<strong>en</strong>ting the red, gre<strong>en</strong> and blue compon<strong>en</strong>ts of the original image.<br />

*/<br />

public ImageStack splitStack(ImagePlus imp) {<br />

ImageProcessor ip = imp.getProcessor();<br />

if (!(ip instanceof ColorProcessor)) {<br />

IJ.showMessage("Only RGB images are curr<strong>en</strong>tly supported.");<br />

return null;<br />

}<br />

// Split the RGB image or stack Channels into three 8-bit images<br />

RGBStackSplitter splitter = new RGBStackSplitter();<br />

// Method RGBStackSplitter.split(ImageStack rgb, boo<strong>le</strong>an keepSource)<br />

splitter.split(imp.getStack(), true);<br />

// Fetch the three stacks created by the split method<br />

ImagePlus red = new ImagePlus("Red", splitter.red); // stack red channel<br />

ImagePlus gre<strong>en</strong> = new ImagePlus("Gre<strong>en</strong>", splitter.gre<strong>en</strong>); // gre<strong>en</strong><br />

ImagePlus blue = new ImagePlus("Blue", splitter.blue); // blue<br />

// image stacks consist of images (slices)<br />

// access the stack by retrieving it from the ImagePlus using ImageStack getStack()<br />

ImageStack is = imp.getStack();<br />

ImageStack rgbStack = new ImageStack(is.getWidth(), is.getHeight());<br />

// color images can be decomposed into the se<strong>par</strong>ate 8-bit R,G and B graysca<strong>le</strong> images<br />

// using the Image > Color > RGB split function<br />

byte[] r,g,b;<br />

ColorProcessor cp; // ColorProcessor returns the se<strong>par</strong>ated RGB compon<strong>en</strong>ts<br />

-10

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

Saved successfully!

Ooh no, something went wrong!