<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="font-family: FiraSans-Regular;" class="">We have a Tiff image that is GrayScale (8 bit) and Palette (photometric interpretation=3) and the indices into the palette are 16 bit but the values in the palette are 8 bit? When trying to use ITK to figure out what type of array we should be allocating our logic is coming back with 16 bit unsigned shorts because we have the following code:</span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class=""> itk::ImageIOBase::Pointer imageIO = itk::ImageIOFactory::CreateImageIO(getInputFileName(), itk::ImageIOFactory::ReadMode);</span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">itk::ImageIOBase::IOComponentType componentType = imageIO->GetComponentType();</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">…</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class=""> else if(itk::ImageIOBase::USHORT == componentType)</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class=""> {</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class=""> data = UInt16ArrayType::CreateArray(0, "Temp", false);</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class=""> }</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">…</span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Here is the header of the tiff file as put out by “tiffdump”</span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">/Users/XXXXXXXX/Downloads/image_01.tif:</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Magic: 0x4949 <little-endian> Version: 0x2a <ClassicTIFF></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Directory 0: offset 8 (0x8) next 113277976 (0x6c07c18)</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">ImageWidth (256) LONG (4) 1<12288></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">ImageLength (257) LONG (4) 1<9216></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">BitsPerSample (258) SHORT (3) 1<8></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Compression (259) SHORT (3) 1<1></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Photometric (262) SHORT (3) 1<3></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">StripOffsets (273) LONG (4) 1<31768></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">RowsPerStrip (278) LONG (4) 1<4294967295></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">StripByteCounts (279) LONG (4) 1<113246208></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">XResolution (282) RATIONAL (5) 1<1></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">YResolution (283) RATIONAL (5) 1<1></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">ResolutionUnit (296) SHORT (3) 1<1></span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Colormap (320) SHORT (3) 768<0 256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4096 4352 4608 4864 5120 5376 5632 5888 …></span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">My question is this: what can we interrogate from the imageIO object to really nail down that this really turns out to be an 8 bit image?</span><br style="font-family: FiraSans-Regular;" class=""><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Thanks</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">--</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">Michael A. Jackson</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">BlueQuartz Software, LLC</span><br style="font-family: FiraSans-Regular;" class=""><span style="font-family: FiraSans-Regular;" class="">[e]: </span><a href="mailto:mike.jackson@bluequartz.net" style="font-family: FiraSans-Regular;" class="">mike.jackson@bluequartz.net</a></body></html>