Login  Register

Re: Macro to split images and save as title

Posted by Krs5 on May 26, 2020; 3:51pm
URL: http://imagej.273.s1.nabble.com/Macro-to-split-images-and-save-as-title-tp5023353p5023399.html

Dear Marc,

OK, so ImageJ does not recognize the file name opened by the plugin. So we can use something like

title = File.getNameWithoutExtension(path);

But we still have to take care that each channel is saved correctly. If the channels are split is the naming like "C1-imageName" or "imageName (red)"?

Kees

________________________________


Deer Kees,

Thank you very much for helping! I copied the macro into the editor and
removed gremlins as you described and checked that the " look the same (it
doesn't appear to have been changed). When running the macro I get asked
first source then destination directory as expected. It then asks me to
select a file (but only a single one, if I run it as batch would it be able
to take a whole directory of files?). However, after opening the file and
splitting it I get the following error message:

Number or numeric function expected in line 10
title = File.getNameWithoutExtension();

And it stops there unable to save.

Marc



--
Sent from: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.1557.x6.nabble.com%2F&data=02%7C01%7Ckrs5%40leicester.ac.uk%7C53b0809a43b241ee5a8508d8000946db%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637259387131383447&sdata=Y16D%2F3g4ZBwAt3h2UuY6H1cK62UHvfTLiiKf06N6t7k%3D&reserved=0

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&data=02%7C01%7Ckrs5%40leicester.ac.uk%7C53b0809a43b241ee5a8508d8000946db%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637259387131383447&sdata=GorCKFmH5IuAPZW07IkRAwM0hCZbLyiDiwm7XIEaBrU%3D&reserved=0

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