I have the following problem: I would like to cut cells from several images and save each cell in a separate folder. I want to name the folders like “001”, “002”,… But I want to know the name and the directory of the original images. For this, I would like to make a table with two columns: one for the number of the cell (001, 002,…) and another for the path of the original image. I tried to use the IJ.pad function to set whole numbers in the first column with 3 digits (001, 002,…). But it did not work. In the following code there are two ways to try it (the last two lines):
value=newArray(IJ.pad(1,3)); Table.create("AllCells"); Table.setColumn("Cell number", value); Table.setColumn("Directory", value); Table.setLocationAndSize(200, 200, 800, 500); Table.set("Cell number", Table.size,(IJ.pad(5,3))); Table.set("Cell number", Table.size,(IJ.pad(Table.size,3)));
The result was a table with two columns headed “Cell number” and “Directory”, and the columns looked like this:
Cell number Directory 001 001 5 0 2 0
I tried many ways, but coud not make the code to set padded numbers into the table. How coulod I do it? There was a way when the value put in the table was not padded, but when I had it printed in the log window, it was. I do not remember how I did that, but anyway, that was not what I wanted.