Posted by
CARL Philippe (LBP) on
Apr 04, 2019; 6:56am
URL: http://imagej.273.s1.nabble.com/Java-How-to-save-an-ImageStack-tp5021973p5021976.html
Dear Robert, for Wayne I just present my best greetings since I would be
incredibly pretentious to think to teach you something within ImageJ :)
The ImageJ PLugins>Macros>Record... tool can as well be configured to record
Java code by changing the selection of the drop down menu on the top left of
the recording window from macro to Java.
And thus by opening "manually" a stack and saving it you can then easily
figure out the needed code.
My best regards,
Philippe
Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84
-----Message d'origine-----
De : ImageJ Interest Group [mailto:
[hidden email]] De la part de Wayne
Rasband
Envoyé : jeudi 4 avril 2019 01:08
À :
[hidden email]
Objet : Re: (Java) How to save an ImageStack
> On Apr 3, 2019, at 6:23 PM, Robert Lockwood <
[hidden email]> wrote:
>
> I've created and populated an ImageStack in my Java app, how do I save the
> stack?
>
> outRGBStack = ImageStack.create(NCOLS, NROWS, NSLICES, 24);
Here is JavaScript example that creates a stack, saves it in the temp
folder, re-opens it, and displays it:
NCOLS = NROWS = NSLICES = 256;
PATH = IJ.getDir("temp")+"RGB_Stack.tif";
rgbStack = ImageStack.create(NCOLS, NROWS, NSLICES, 24);
img = new ImagePlus("RGB Stack",rgbStack);
IJ.saveAs(img, "tif", PATH);
img = IJ.open(PATH);
img.show();
-wayne
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html