http://imagej.273.s1.nabble.com/how-to-update-ImagePlus-in-Python-tp5011768p5011790.html
>
> On 2/25/15 9:55 PM, Rasband, Wayne (NIH/NIMH) [E] wrote:
>> Get the stack, delete or add slices, set the stack. Here is a JavaScript example:
>>
>> img = IJ.openImage("
http://imagej.nih.gov/ij/images/t1-rendering.zip");
>> img.show();
>> stack = img.getStack();
>> stack.deleteSlice(20);
>> img.setStack(stack);
>>
>> -wayne
>>
> Thank you Wayne -- works as advertised.
>
> I still see that at the top of the image, the information shows (for example for the first image in the stack):
> 1/5 (c:1/6 - Series 1); ...
>
> Before I removed a slice it showed:
> 1/6 (c:1/6 - Series 1); ...
>
> This occurs also if I use the GUI to remove a slice -- it is not related to the scripting.
>
> Is this a bug, or is it expected, and there is a way to update the part with c: 1/6?
This is expected. The text in the stack subtitle between “(“ and “)” is the slice label, which does not change when you delete or add slices. You can retrieve the slice label of the nth slice using the ImageStack.getSliceLabel(n) method and set it using ImageStack.setSliceLabel("text",n). It a macro, use getMetadata(“Label") and setMetadata(“Label","text”).