TIFF Tags Exceptions (linux Debian 8.1)

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

TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
Greetings,

I am getting an exception when trying to use TIFF Tags under linux Debian 8.1 "jessie"). Calling from the menu, the Exception window has:
 
ImageJ 1.49v; Java 1.6.0_24 [64-bit]; Linux 3.14.45; 42MB of 1820MB (2%)
 
java.lang.NullPointerException
        at TIFF_Tags.run(TIFF_Tags.java:102)
        at ij.IJ.runUserPlugIn(IJ.java:199)
        at ij.IJ.runPlugIn(IJ.java:163)
        at ij.Executer.runCommand(Executer.java:132)
        at ij.Executer.run(Executer.java:65)
        at java.lang.Thread.run(Thread.java:662)

...and nothing is listed in the TIFF Tags table.

I get the following when called from a macro with:

 mOffsetS1 = call("TIFF_Tags.getTag", path+infile, 273);   // get offset from TIFF tag

java.lang.NullPointerException
        at TIFF_Tags.getTag(TIFF_Tags.java:276)
        at TIFF_Tags.getTag(TIFF_Tags.java:263)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at ij.macro.Functions.call(Functions.java:4058)
        at ij.macro.Functions.getStringFunction(Functions.java:271)
        at ij.macro.Interpreter.getStringTerm(Interpreter.java:1290)
        at ij.macro.Interpreter.getString(Interpreter.java:1269)
        at ij.macro.Interpreter.doStringAssignment(Interpreter.java:928)
        at ij.macro.Interpreter.doAssignment(Interpreter.java:722)
        at ij.macro.Interpreter.doStatement(Interpreter.java:242)
        at ij.macro.Interpreter.doBlock(Interpreter.java:605)
        at ij.macro.Interpreter.runFirstMacro(Interpreter.java:704)
        at ij.macro.Interpreter.doStatement(Interpreter.java:260)
        at ij.macro.Interpreter.doStatements(Interpreter.java:215)
        at ij.macro.Interpreter.run(Interpreter.java:112)
        at ij.macro.Interpreter.run(Interpreter.java:82)
        at ij.macro.MacroRunner.run(MacroRunner.java:139)
        at java.lang.Thread.run(Thread.java:662)

I need the offset to access the imagery. Any idea why? Are there any workarounds? Works perfectly on my MacBook Pro (10.10.1).

 Mark

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
I installed libtiff and used tiffdump to look at one of the the TIFFs I have to work with; this is the output:

$ tiffdump g_WV01_10AUG192149480-P1BS_R1C1-102001000F95F800_orth.tif
g_WV01_10AUG192149480-P1BS_R1C1-102001000F95F800_orth.tif:
Magic: 0x4949 <little-endian> Version: 0x2b <BigTIFF>
OffsetSize: 0x8 Unused: 0
Directory 0: offset 16 (0x10) next 0 (0)
ImageWidth (256) SHORT (3) 1<39002>
ImageLength (257) SHORT (3) 1<61309>
BitsPerSample (258) SHORT (3) 1<16>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
StripOffsets (273) LONG8 (16) 61309<981557 1059561 1137565 1215569 1293573 1371577 1449581 1527585 1605589 1683593 1761597 1839601 1917605 1995609 2073613 2151617 2229621 2307625 2385629 2463633 2541637 2619641 2697645 2775649 ...>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) SHORT (3) 1<1>
StripByteCounts (279) LONG8 (16) 61309<78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 78004 ...>
PlanarConfig (284) SHORT (3) 1<1>
SampleFormat (339) SHORT (3) 1<1>
33550 (0x830e) DOUBLE (12) 3<0.529681 0.529681 0>
33922 (0x8482) DOUBLE (12) 6<0 0 0 650247 6.88007e+06 0>
34735 (0x87af) SHORT (3) 32<1 1 0 7 1024 0 1 1 1025 0 1 1 1026 34737 21 0 2049 34737 7 21 2054 0 1 9102 ...>
34737 (0x87b1) ASCII (2) 29<WGS 84 / UTM zone 5N|WGS ...>
42112 (0xa480) ASCII (2) 76<<GDALMetadata>\n  <Item n ...>
42113 (0xa481) ASCII (2) 7<-32768\0>

Is there something about these TIFFs that upsets the TIFF Tags plugin? They were written with GDAL. Anyone have any idea why this plugin fails for these TIFFs?

Also, in the line StripOffsets (273) LONG8 (16) 61309<981557 1059561... which number is the byte count to the start of imagery: 61309 or 981557?

--Mark

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Mark J. Chopping
> On Aug 19, 2015, at 5:04 PM, Mark Chopping <[hidden email]> wrote:
>
> Greetings,
>
> I am getting an exception when trying to use TIFF Tags under linux Debian 8.1 "jessie"). Calling from the menu, the Exception window has:

Please post a TIFF file that exhibits this problem. You have to be able to reproduce a bug in order to fix it.

-wayne

> ImageJ 1.49v; Java 1.6.0_24 [64-bit]; Linux 3.14.45; 42MB of 1820MB (2%)
>
> java.lang.NullPointerException
> at TIFF_Tags.run(TIFF_Tags.java:102)
> at ij.IJ.runUserPlugIn(IJ.java:199)
> at ij.IJ.runPlugIn(IJ.java:163)
> at ij.Executer.runCommand(Executer.java:132)
> at ij.Executer.run(Executer.java:65)
> at java.lang.Thread.run(Thread.java:662)
>
> ...and nothing is listed in the TIFF Tags table.
>
> I get the following when called from a macro with:
>
> mOffsetS1 = call("TIFF_Tags.getTag", path+infile, 273);   // get offset from TIFF tag
>
> java.lang.NullPointerException
> at TIFF_Tags.getTag(TIFF_Tags.java:276)
> at TIFF_Tags.getTag(TIFF_Tags.java:263)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at ij.macro.Functions.call(Functions.java:4058)
> at ij.macro.Functions.getStringFunction(Functions.java:271)
> at ij.macro.Interpreter.getStringTerm(Interpreter.java:1290)
> at ij.macro.Interpreter.getString(Interpreter.java:1269)
> at ij.macro.Interpreter.doStringAssignment(Interpreter.java:928)
> at ij.macro.Interpreter.doAssignment(Interpreter.java:722)
> at ij.macro.Interpreter.doStatement(Interpreter.java:242)
> at ij.macro.Interpreter.doBlock(Interpreter.java:605)
> at ij.macro.Interpreter.runFirstMacro(Interpreter.java:704)
> at ij.macro.Interpreter.doStatement(Interpreter.java:260)
> at ij.macro.Interpreter.doStatements(Interpreter.java:215)
> at ij.macro.Interpreter.run(Interpreter.java:112)
> at ij.macro.Interpreter.run(Interpreter.java:82)
> at ij.macro.MacroRunner.run(MacroRunner.java:139)
> at java.lang.Thread.run(Thread.java:662)
>
> I need the offset to access the imagery. Any idea why? Are there any workarounds? Works perfectly on my MacBook Pro (10.10.1).
>
> Mark
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
In reply to this post by Mark J. Chopping
Hi Wayne, list,

Thanks. I understand and I would have posted a test image but 1. they are 4 Gb+ and 2. (and more importantly) they live on a secure NASA server and I am not allowed to distribute by virtue of the licensing agreement.  I will ask whether it is possible to generate a small sample TIFF that we could use in debugging. In the meantime I am using tiffdump (libtiff) to get hold of the information (written to file and parsed by the macro) -- TIFF_tags was more elegant though.

Best,

Mark

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
In reply to this post by Mark J. Chopping
Hi Wayne, list,

I have attached a small subset image that has been processed, for testing purposes.

Mark

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

g_test_sub.tif (429K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
In reply to this post by Mark J. Chopping
p.s. the image is intentionally "empty" (all zero); we just want to test the TIFF Tags functionality.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
In reply to this post by Mark J. Chopping
Unfortunately, the TIFF Tags plugin works with that small subset.  I cannot distribute the original (large) TIFF, so I think I will have to close this query and just go with tiffdump to get the rows, columns, and offset to imagery (throw me a line at chopping@pegasus if you would like a copy of the macro code).

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

ctrueden
Hi Mark,

Since your problematic TIFF is over 4GB, it is probably a BigTIFF [1]. I am
guessing that the TIFF Tags plugin does not support BigTIFF. You could try
my TIFF Dumper plugin [2], which might work because it uses Bio-Formats [3]
(which supports BigTIFF), although I haven't tested it in years.

Regards,
Curtis

[1] https://en.wikipedia.org/wiki/Tagged_Image_File_Format#BigTIFF
[2] http://imagej.net/plugins/tiff-dumper.html
[3] http://imagej.net/Bio-Formats

On Thu, Aug 20, 2015 at 12:59 PM, Mark Chopping <
[hidden email]> wrote:

> Unfortunately, the TIFF Tags plugin works with that small subset.  I
> cannot distribute the original (large) TIFF, so I think I will have to
> close this query and just go with tiffdump to get the rows, columns, and
> offset to imagery (throw me a line at chopping@pegasus if you would like
> a copy of the macro code).
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: TIFF Tags Exceptions (linux Debian 8.1)

Mark J. Chopping
In reply to this post by Mark J. Chopping
Hi Curtis,

Many thanks -- I managed to implement a solution that uses libtiff's tiffdump.

Mark

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