|
Notes |
|
|
(0016715)
|
|
Bill Lorensen
|
|
2009-06-12 14:19
|
|
I tried to reproduce the problem. I ran Insight/Testing/Code/IO/itkImageFileWriterTest with an argument foo.tif.
I ran tiffdump on the file and it reported:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 58 (0x3a) next 0 (0)
ImageWidth (256) SHORT (3) 1<5>
ImageLength (257) SHORT (3) 1<5>
BitsPerSample (258) SHORT (3) 1<16>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 1<8>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) SHORT (3) 1<819>
StripByteCounts (279) LONG (4) 1<50>
PlanarConfig (284) SHORT (3) 1<1>
Software (305) ASCII (2) 15<InsightToolkit\0>
SampleFormat (339) SHORT (3) 1<2>
Note that the SampleFormat is set correctly to the value 2, which indicates two's complement signed integer data. The resul seems correct. I looked at itkTIFFImageIO.cxx and see that in the InternalWrite method the folloing logic is correct:
if(this->GetComponentType() == SHORT
|| this->GetComponentType() == CHAR)
{
TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT,SAMPLEFORMAT_INT);
}
In summary, I cannot reproduce the reporter's problem.
|
|
|
|
(0016726)
|
|
Bill Lorensen
|
|
2009-06-15 19:55
|
|
|
Reminder sent to: woerz Please see my note on this bug. I cannot reproduce your problem.
|
|
|
|
(0016798)
|
|
Bradley Lowekamp
|
|
2009-07-01 14:21
|
|
|
I believe I just ran into this problem too. I saved and tiff image as short and photoshop did not deal with it correctly. I will try to narrow this now... and produce a test case. |
|
|
|
(0016810)
|
|
Bradley Lowekamp
|
2009-07-02 15:07
(edited on: 2009-07-02 15:08) |
|
The reporter's provided code is 3-D and the test is 2-D. Writing a "3-D" tif image I am able to reproduce the problem, get the following from tiff dump:
test.tif:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 571656 (0x8b908) next 0 (0)
SubFileType (254) LONG (4) 1<2>
ImageWidth (256) SHORT (3) 1<638>
ImageLength (257) SHORT (3) 1<448>
BitsPerSample (258) SHORT (3) 1<16>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
StripOffsets (273) LONG (4) 75<8 7664 15320 22976 30632 38288 45944 53600 61256 68912 76568 84224 91880 99536 107192 114848 122504 130160 137816 145472 153128 160784 168440 176096 ...>
Orientation (274) SHORT (3) 1<1>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) SHORT (3) 1<6>
StripByteCounts (279) LONG (4) 75<7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 ...>
PlanarConfig (284) SHORT (3) 1<1>
PageNumber (297) SHORT (3) 2<1 0>
Software (305) ASCII (2) 15<InsightToolkit\0>
The TiffImageIO also reports that the file is unsigned short also.
Perhaps this attribute needs to be set for each page in itkTIFFImageIO?
|
|
|
|
(0016814)
|
|
Bill Lorensen
|
|
2009-07-03 11:57
|
|
As Brad pointed out, the problem was with 3D tigg images. I was able to reporduce the bug. I added code to set the SampleFormat properly if the image is 3D.
|
|