Skip to main content

Append new image to already stored multipage tiff file

1 reply [Last post]

A forum list member encouraged me to post my problem here.

Recently I've got a problem concerning multipage tiff's. I have to
handle a lot of images (about 1000 slices of MR or CT images). It
isn't possible to load the entire image stack into the main memory, so
I have to leave it on the hard disk. There is one multipage tiff file
on the hard disk and and the task is to load and save only single
images. I've already managed to load single images but I can't save
them back into the multipage tiff file. Furthermore I also want to
append an image to an existing and already stored multipage tiff file.
Does anybody know a solution in JAVA, eventually using JAI?
The solutions I've found so far need to load the entire image stack
into the main memory and therefore aren’t usable for my task.

I tried setExtraImages in a loop, but without success. Only the last image of the loop is stored:

if (i == 0) JAI.create("filestore", pi, "fileName","TIFF");
if (i != 0){
ArrayList list = new ArrayList(1);
TIFFEncodeParam param = new TIFFEncodeParam();
ParameterBlock pb = new ParameterBlock();
pb.add( "fileName");
JAI.create("filestore", pb);

Many thanks for any input,

Message was edited by: helaha

Message was edited by: helaha

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hello again,
so I think it isn't possible to append an image to a multi page tiff file. Does anybody know if there is any other method in order to append images to an existing file?