![]() | ![]() |
![]() |
Previous Message |
Next Message Previous in Topic | Next in Topic Previous by Same Author | Next by Same Author Previous Page (December 2007) | Back to Main IMAGEJ Page | | ![]()
Reply
| Post a New Message |
Join or Leave IMAGEJ, or Change Options
|
Search | ![]()
Chronologically |
Most Recent First |
Wrap Text (Proportional Font) |
Don't Wrap Text (Non-proportional Font) | ![]() |
Approved-By: [log in to unmask] Content-Type: text/plain; charset=ISO-8859-1 User-Agent: Internet Messaging Program (IMP) 3.2.3 Message-ID: <[log in to unmask]> Date: Thu, 20 Dec 2007 11:57:31 +0100 Reply-To: ImageJ Interest Group <[log in to unmask]> Sender: ImageJ Interest Group <[log in to unmask]> From: Pascal Lorentz <[log in to unmask]> Subject: Help with Batch PluginDear all, I need some help with a plugin. I have a folder with some lsm one color stacks. I would like to transfer the whole stacks to 8 bit and save the single Images as jpg in a different folder for example. Sometimes the plugin works sometimes not. I don't know why. Something must be wrong with the for loops I guess. Here is my code. Any help would be great: {requires("1.38x"); dir1 = getDirectory("Choose Source Directory "); dir2 = getDirectory("Choose Destination Directory "); Dialog.create("Output Depth and Format"); Dialog.addChoice(" Output Depth",newArray("8-bit","16-bit","32-bit","8-bit Color","RGB Color")); Dialog.addChoice(" Output Format",newArray("Tiff","Jpeg","Gif","BMP","PNG")); Dialog.show(); depth = Dialog.getChoice(); format = Dialog.getChoice(); list = getFileList(dir1); setBatchMode(true); for (i=0; i<list.length; i++) { open(dir1+list[i]); slicenumber = nSlices; run(depth); run("Stack to Images"); for (x=0; x<slicenumber; x++) { filename = getTitle; saveAs(format, dir2+filename); close(); showProgress(x+1, slicenumber); } showProgress(i+1, list.length); } } Cheers Pascal ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
![]() |
![]() Center for Information Technology National Institutes of Health Bethesda, Maryland 20892 301 594 6248 (v) 301 496 8294 (TDD) Comments and Assistance Accessibility ![]() |