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

IJ.showMessage("outputDir: fi<strong>le</strong>s[0].getPar<strong>en</strong>tFi<strong>le</strong>()+Fi<strong>le</strong>.se<strong>par</strong>ator", outputDir+<br />

"\n"+fi<strong>le</strong>name);<br />

new Fi<strong>le</strong>Saver(projImagePLU).saveAsTiff("fi<strong>le</strong>name");<br />

}<br />

return projImagePLU;<br />

}<br />

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

*/<br />

/*<br />

Performs the projection using the curr<strong>en</strong>t projection method.<br />

Calculates the values of pixels located at the same position<br />

in each slice of the stack<br />

<strong>par</strong>am imp: the ImagePlus object on which to perform the projection<br />

Return the resulting ImagePlus object (projection of stackPLU)<br />

ImagePlus computePLUProjection(ImagePlus PLUImgStack) {<br />

// Validate the argum<strong>en</strong>ts.<br />

if(PLUImgStack==null) { IJ.noImage(); return null; }<br />

stackPLUSize = PLUImgStack.getStackSize();<br />

if (stackPLUSize==0)<br />

throw new Il<strong>le</strong>galArgum<strong>en</strong>tException("Empty stack.");<br />

// Create an empty stack to hold the projections.<br />

// It will have the same width, height, and color model as stackPLU.<br />

ImageStack tmp_out_stack = PLUImgStack.createEmptyStack();<br />

// Initialize the ZProjector object.<br />

ZProjector zproj = new ZProjector(PLUImgStack);<br />

// Slices are numbered 1,2,...,n where n is the number of slices in the stack.<br />

startSlice = 1;<br />

stopSlice = stackPLUSize;<br />

zproj.setStartSlice(startSlice);<br />

zproj.setStopSlice(stopSlice);<br />

zproj.setMethod(method);<br />

// Check for RGB image (RGB stacks are supported)<br />

if(PLUImgStack.getBitDepth()==24 )<br />

zproj.doRGBProjection();<br />

else<br />

zproj.doProjection();<br />

// Image to hold z-projection<br />

ImagePlus projImage = null;<br />

// ImageJ retourne une l'image de la + rec<strong>en</strong>te operation de projection<br />

projImage = zproj.getProjection();<br />

// PROJECTION DONE<br />

ImageProcessor improc = projImage.getProcessor();<br />

tmp_out_stack.addSlice("Projection_of_"+PLUImgStack.getTit<strong>le</strong>(), improc);<br />

// Constructs an ImagePlus from a stack.<br />

ImagePlus out_image = new ImagePlus("Projection_of_"+PLUImgStack.getTit<strong>le</strong>(),<br />

tmp_out_stack);<br />

out_image.show();<br />

-8

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

Saved successfully!

Ooh no, something went wrong!