Concatenating Tiff stacks from ImageJ using libtiff tifftools

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Concatenating Tiff stacks from ImageJ using libtiff tifftools

Chang, Joshua
We use ImageJ pretty heavily in our lab, but we would like to transition off it somewhat for doing batch jobs. I am trying to simply concatenate tiff stacks that we generated in ImageJ together using libtiff's tifftools, or Imagemagick(Also uses libtiff) but I get the same strange result.

each of the two tiffs below are 500 slices, I would expect the result to be a 1000 slice stack

KCB:Desktop joshchang$ tiffcp 060106dd.tif 060106ee.tif result.tif
TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag 50838 (0xc696) encountered.

... I think once for each slice

TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.


When I open the result file in ImageJ it shows as 500 slices, and the slices after the first are all combined and offset in weird ways as if one lined up the slices side by side and just decided to arbitrary chop it up every w width pixels from some offset.

If anybody uses tifftools along with ImageJ and can give me some assistance I would be very much obliged. Thanks in advance.

Josh Chang
[hidden email]
Brennan Lab
UCLA Department of Neurology

----------------------------------------------------------
IMPORTANT WARNING:  This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential.  You, the recipient, are obligated to maintain it in a safe, secure and confidential manner.  Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
----------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Antwort: Concatenating Tiff stacks from ImageJ using libtiff tifftools

Joachim Wesner
Hi Josh,

I have some experience with libtiff and use it with a VB apllication to
write stacks I analyze with IJ.
However I did not yet try tifftools on stacks. I also have an IJ plugin to
analyze TIFF structure
and read all fields/tags.

Tag 50868 is a private registered ImageJ tag that is used for things like
scale factors etc.
Tifftools will probably not be able to correctly copy these over to the
output file, but it *should*
not cause any harm, but simply skip over the entry.

A stack uses multiple TIFF directories for the separate images. If you
like, you can send me
some example files (before/after concatination) so I can take a look what
is going on by
PM!?

Joachim


ImageJ Interest Group <[hidden email]> schrieb am 23.04.2008 20:01:27:

> We use ImageJ pretty heavily in our lab, but we would like to
> transition off it somewhat for doing batch jobs. I am trying to
> simply concatenate tiff stacks that we generated in ImageJ together
> using libtiff's tifftools, or Imagemagick(Also uses libtiff) but I
> get the same strange result.
>
> each of the two tiffs below are 500 slices, I would expect the
> result to be a 1000 slice stack
>
> KCB:Desktop joshchang$ tiffcp 060106dd.tif 060106ee.tif result.tif
> TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag
> 50838 (0xc696) encountered.
> TIFFFieldWithTag: Internal error, unknown tag 0xc697.
> TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag
> 50838 (0xc696) encountered.
>
> ... I think once for each slice
>
> TIFFFieldWithTag: Internal error, unknown tag 0xc697.
> TIFFReadDirectory: Warning, 060106dd.tif: unknown field with tag
> 50838 (0xc696) encountered.
> TIFFFieldWithTag: Internal error, unknown tag 0xc697.
>
>
> When I open the result file in ImageJ it shows as 500 slices, and
> the slices after the first are all combined and offset in weird ways
> as if one lined up the slices side by side and just decided to
> arbitrary chop it up every w width pixels from some offset.
>
> If anybody uses tifftools along with ImageJ and can give me some
> assistance I would be very much obliged. Thanks in advance.
>
> Josh Chang
> [hidden email]
> Brennan Lab
> UCLA Department of Neurology


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Concatenating Tiff stacks from ImageJ using libtiff tifftools

Chang, Joshua
Thanks Joachim, I appreciate your help.

I uploaded a part of a representative image here:

http://brennanlab.mednet.ucla.edu/example/5slices.tiff  (5 tiff directories, 8-bit, 320x240, 375K total)

KCB:example joshchang$ tiffinfo 5slices.tiff
TIFFReadDirectory: Warning, 5slices.tiff: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFF Directory at offset 0x8 (8)
Subfile Type: (0 = 0x0)
Image Width: 320 Image Length: 240
Bits/Sample: 8
Compression Scheme: None
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Rows/Strip: 240
Planar Configuration: single image plane
ImageDescription: ImageJ=1.40c
images=5
slices=5
loop=false

Now say I want to take slices 2, 3 and 4 out and combine them into a new image I did

KCB:example joshchang$ tiffcp 5slices.tiff,2,3,4 result.tiff
TIFFReadDirectory: Warning, 5slices.tiff: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFFReadDirectory: Warning, 5slices.tiff: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFFReadDirectory: Warning, 5slices.tiff: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.
TIFFReadDirectory: Warning, 5slices.tiff: unknown field with tag 50838 (0xc696) encountered.
TIFFFieldWithTag: Internal error, unknown tag 0xc697.

And the result is http://brennanlab.mednet.ucla.edu/example/result.tiff

The first slice looks like it should, but the slices afterward are weird.

Concatenation across files gives the same type of result:

tiffcp 5slices.tiff 5slices.tiff combined.tiff   http://brennanlab.mednet.ucla.edu/example/combined.tiff

Thanks!



----------------------------------------------------------
IMPORTANT WARNING:  This email (and any attachments) is only intended for the use of the person or entity to which it is addressed, and may contain information that is privileged and confidential.  You, the recipient, are obligated to maintain it in a safe, secure and confidential manner.  Unauthorized redisclosure or failure to maintain confidentiality may subject you to federal and state penalties. If you are not the intended recipient, please immediately notify us by return email, and delete this message from your computer.
----------------------------------------------------------