Login  Register

Re: Batch process, save and split channels

Posted by George Patterson on Sep 18, 2017; 7:02pm
URL: http://imagej.273.s1.nabble.com/Batch-process-save-and-split-channels-tp5019379p5019385.html

Hi Thomas,
A couple of points which might help.

1.  In these lines
saveAs("Jpeg", T + "Jpeg");
you'll probably need to specify the path to the directory in which you'd
like to store your images.
Adding something like
dir0 = getDirectory("Choose a directory");
to a some point before the saveAs lines and then edit those lines to
specify the path to that directory.
saveAs("Jpeg", dir0+T + "Jpeg");

2.  You can find many discussions on this and other lists discussing the
relative merits of image formats.
Most if not all agree that we're better off saving our files in an
uncompressed format rather than a jpeg as you are doing here.
Unless you have a specific reason for needing jpegs, I'd also suggest
changing
saveAs("Jpeg", dir0+T + "Jpeg");
to something like
saveAs("tiff", dir0+T + ".tif");

Best,
George



On Mon, Sep 18, 2017 at 2:14 AM, thomas.clarke <[hidden email]> wrote:

> Hi I'm new to imagej and macros,
>
> I'm splitting a nd2 file into the 3 channels, running z project, enhancing
> and then saving each of the 3 channels. When I run the macro bellow in
> batch
> processing it does everything correct however it only saves one of the
> channels and without the file name I want. Any suggestions on how I can
> achieve this?
>
> T = getTitle();
>
> run("Split Channels");
> selectWindow("C1-"+T);
> run("Z Project...", "projection=[Max Intensity]");
> run("Enhance Contrast", "saturated=0.35");
> selectWindow("C2-"+T);
> run("Z Project...", "projection=[Max Intensity]");
> run("Enhance Contrast", "saturated=0.35");
> selectWindow("C3-"+T);
> run("Z Project...", "projection=[Max Intensity]");
> run("Enhance Contrast", "saturated=0.35");
>
> selectWindow("MAX_C1-"+T);
> saveAs("Jpeg", T + "Jpeg");
> selectWindow("MAX_C2-"+T);
> saveAs("Jpeg", T + "GREEN.Jpeg");
> selectWindow("MAX_C3-"+T);
> saveAs("Jpeg", T + "RED.Jpeg");
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html