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

}<br />

/*<br />

r = new byte[width*height];<br />

g = new byte[width*height];<br />

b = new byte[width*height];<br />

cp = (ColorProcessor)is.getProcessor(1);<br />

cp.getRGB(r,g,b);<br />

//rgbStack.de<strong>le</strong>teSlice(1); // de<strong>le</strong>te 'imp' stack<br />

rgbStack.addSlice(null,r);<br />

rgbStack.addSlice(null,g);<br />

rgbStack.addSlice(null,b);<br />

pw.println("Se<strong>par</strong>ating channels and creating RGB mask for " + imp.getTit<strong>le</strong>());<br />

pw.println("rgb stack size= "+rgbStack.getSize());<br />

// Return an 'ImageStack' rgbStack with se<strong>par</strong>ating channels<br />

return rgbStack;<br />

Apply correction on sci<strong>en</strong>ceImg with PLUredmask, PLUgre<strong>en</strong>mask and PLUbluemask)<br />

For each channel, multiply sci<strong>en</strong>ce image by PLU/mean<br />

Creates a ImageStack("red"+"gre<strong>en</strong>"+"blue")<br />

Converts this Stack to RGB<br />

Image/Color/Stack to RGB<br />

Cree une stack <strong>avec</strong> <strong>le</strong>s canaux R, G, B corriges<br />

Converts a 2 or 3-slice stack to an RGB image assuming that the slices are in R, G, B order.<br />

Equiva<strong>le</strong>nce M<strong>en</strong>u:<br />

"Image/Color/Channels Tool.../More>>/Convert to RGB"<br />

Equiva<strong>le</strong>nce Commande:<br />

IJ.doCommand("Stack to RGB"); // The stack must be 8-bit or 16-bit graysca<strong>le</strong>.<br />

*/<br />

void applyCorrection(ImagePlus sci<strong>en</strong>ceImg) {<br />

if (rgbPLUmask[0] == null || rgbPLUmask[1]== null|| rgbPLUmask[2]== null) {<br />

IJ.showMessage("Chargem<strong>en</strong>t de l'image", "Impossib<strong>le</strong>");<br />

return;<br />

}<br />

// Splits the specified RGB image or stack into three 8-bit graysca<strong>le</strong> images or stacks.<br />

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

s.split(sci<strong>en</strong>ceImg.getStack(), true);<br />

// Get fi<strong>le</strong>name without Ext<strong>en</strong>sion<br />

int index = sci<strong>en</strong>ceImg.getTit<strong>le</strong>().lastIndexOf('.');<br />

String tit<strong>le</strong> = sci<strong>en</strong>ceImg.getTit<strong>le</strong>().substring(0, index);<br />

ImagePlus sci<strong>en</strong>ceRedChannel = new ImagePlus(tit<strong>le</strong> + " (Red)", s.red);<br />

ImagePlus sci<strong>en</strong>ceGre<strong>en</strong>Channel = new ImagePlus(tit<strong>le</strong> + " (Gre<strong>en</strong>)", s.gre<strong>en</strong>);<br />

ImagePlus sci<strong>en</strong>ceBlueChannel = new ImagePlus(tit<strong>le</strong> + " (Blue)", s.blue);<br />

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

String fi<strong>le</strong>Name = null;<br />

//sci<strong>en</strong>ceRedChannel.show();<br />

fi<strong>le</strong>Name = outputDir+"splitter "+sci<strong>en</strong>ceRedChannel.getTit<strong>le</strong>()+".tif";<br />

new Fi<strong>le</strong>Saver(sci<strong>en</strong>ceRedChannel).saveAsTiff(fi<strong>le</strong>Name);<br />

//sci<strong>en</strong>ceGre<strong>en</strong>Channel.show();<br />

fi<strong>le</strong>Name = outputDir+"splitter "+sci<strong>en</strong>ceGre<strong>en</strong>Channel.getTit<strong>le</strong>()+".tif";<br />

new Fi<strong>le</strong>Saver(sci<strong>en</strong>ceGre<strong>en</strong>Channel).saveAsTiff(fi<strong>le</strong>Name);<br />

-11

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

Saved successfully!

Ooh no, something went wrong!