<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Bill,<div><br></div><div>Sorry for finding my answer so quickly after my prior e-mail. This method looks right:</div><div><b style="font-family: Times;"><br></b></div><div><b style="font-family: Times;">int TIFFIsCODECConfigured(uint16</b><span style="font-family: Times; font-size: medium;"> </span><i style="font-family: Times;">scheme</i><b style="font-family: Times;">);</b></div><div><b style="font-family: Times;"><br></b></div><div><a href="http://www.remotesensing.org/libtiff/man/TIFFcodec.3tiff.html">http://www.remotesensing.org/libtiff/man/TIFFcodec.3tiff.html</a></div><div><br></div><div>Updating ITK...</div><div><br></div><div>Brad</div><div><br></div><div><br></div><div><div><div>On Nov 14, 2014, at 12:44 PM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I added that compression option to the possibilities<br><br><br>On Fri, Nov 14, 2014 at 12:08 PM, Bradley Lowekamp<br><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><blockquote type="cite">Bill,<br><br>Your images have an odd compression:<br><br>$ tiffinfo<br>/scratch/blowekamp/build/VTK/ExternalData/Testing/Data/libtiff/tiled_64x64_tiff_example.tif<br>TIFF Directory at offset 0x81f6 (33270)<br>  Image Width: 256 Image Length: 256<br>  Tile Width: 64 Tile Length: 64<br>  Bits/Sample: 8<br>  Compression Scheme: AdobeDeflate<br>  Photometric Interpretation: min-is-black<br>  FillOrder: msb-to-lsb<br>  Orientation: row 0 top, col 0 lhs<br>  Samples/Pixel: 1<br>  Rows/Strip: 256<br>  Planar Configuration: single image plane<br>  Page Number: 0-1<br>  DocumentName: foo.tif<br>  White Point: 0.3127-0.329<br>  PrimaryChromaticities:<br>0.640000,0.330000,0.300000,0.600000,0.150000,0.060000<br>  Predictor: horizontal differencing 2 (0x2)<br><br>This "AdobeDeflate" is not supported by the<br>itk::TIFFImageIOInternal::CanRead method. This is what is causing the usage<br>of TIFFRGBARead and not the fact that it's a tiled image.<br><br>How is VTK handling this odd compression?<br><br>Brad<br><br>On Nov 14, 2014, at 11:09 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br><br>Yes, from the vtk tests. I created them with imagemagik<br><br><br>On Fri, Nov 14, 2014 at 11:06 AM, Bradley Lowekamp<br><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><br>Actually further reading the TIFFReadScanline documentation says that should<br>not work for tiled images. So I guess it must be using the RGBA read method,<br>but I am not sure how that is happening either.<br><br>Are you used the tiled tiff images from the VTK tests?<br><br>Brad<br><br><br>On Nov 14, 2014, at 10:46 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br><br>Meant to say:<br>Wow. The new itk tiff reader read my tiled images.<br><br><br>On Fri, Nov 14, 2014 at 10:45 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>wrote:<br><br>Wow. The new itk tiff reader sad my tiled images.<br><br>On Fri, Nov 14, 2014 at 10:25 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>><br>wrote:<br><br>There is a TIFFReadTile call in lib tiff. I some tiled images I will<br>try with the updated itk reader. I'll be really syprised if it works<br>since reading tiled images is tricky and took quite a bit of code.<br><br>I'll keep you posted.<br><br>Bill<br><br>On Fri, Nov 14, 2014 at 10:19 AM, Bradley Lowekamp<br><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><br>Bill,<br><br>There was a tile block of code before, but that was not covered, looked<br>unreachable and was removed.<br><br>Currently there are two ways that a tiff page can be read with the<br>TIFFReadRGBAImageOriented, and with the TIFFReadScanline. The RGBA method<br>from libtiff is fairly robust but reads the image into an RGBA buffer so is<br>not memory efficient. Our custom method uses the scanline method [1], which<br>should work with both stripped and tiled pages.<br><br>But please test, and add a test? I'm not 100% if there is a test image for<br>tiled images.<br><br>Where the difference between stripped and tiled images would really matter<br>is streaming, but that is not there...yet.<br><br>Brad<br><br>[1] <a href="http://www.remotesensing.org/libtiff/libtiff.html#scanlines">http://www.remotesensing.org/libtiff/libtiff.html#scanlines</a><br><br><br>On Nov 14, 2014, at 10:04 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:<br><br>Brad,<br><br>I recently added tiled image reading to VTK's tiff reader. Do you<br>think that would be useful in IUTK. I don't know how often tiled tiff<br>images are encountered.<br><br>BTW I do not mean tiled pyramid tiff images.<br><br>Bill<br><br>On Fri, Nov 14, 2014 at 9:53 AM, Bradley Lowekamp<br><<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br><br>Greetings,<br><br>I have recently refactored ITK's TIFFImageIO to remove a significant amount<br>of dead code, and improve performance up to 3-5X. A number of bug related to<br>reading BigTIFF files have been addressed. Additionally, Tiff tags are now<br>place into the Meta-DataDictionary to allow access to additional TIFF fields<br>such as OME-XML tags ( Originally contributed by Richard Beare<br><a href="http://www.insight-journal.org/browse/publication/728">http://www.insight-journal.org/browse/publication/728</a> ).<br><br>Significant performance improvements were made to both scalar images and<br>palette images. Handling of certain orientations are now "better" handled,<br>while not changing how the default TOPLEFT orientation is loaded or written.<br>There were a number of cases which appear unreachable and illogical such as<br>support from Zeiss two-componet types, and support for some type of SGI<br>tiled tiff as a 3D image. These were removed.<br><br>If you are an active user of TIFF images with ITK, please checkout the<br>latest ITK master and test the refactored TIFFImageIO.<br><br>Thanks,<br>Brad<br><br>p.s. Here is the git log for the recent changes.<br><br>$git log --no-merges 6791b4a3613aade07e3f11f765f1316faf03b113..<br><br>commit 46f4125df47aeff9c42c9f2b3699c06e67ffaca9<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Fri Oct 31 14:25:13 2014 -0400<br><br> ENH: adding TIFFImageIO test for RGB palette images<br><br> Change-Id: I320acc8beac8225616451d11b291b1d7e12a17d0<br><br>commit 9adc54c7f53b4da84a41f500d561ae494cb85158<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Fri Oct 24 13:42:02 2014 -0400<br><br> BUG: Adding missing parentheses around boolean expression<br><br> Change-Id: I669d160ff3ba830f3c33ac87de434db41472eb79<br><br>commit 40afd95161727be3274f8094ce19fe45e2c3aa50<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Wed Oct 22 15:05:39 2014 -0400<br><br> PERF: Refactor color table lookup<br><br> Change to use a index lookup for the color and gray scale<br> palettes. The remove excessive exception checking done on a per pixel<br> basis with the GetColor method. Additionally the InitializeColor<br> method was change do initialize the color palette variables.<br><br> An exception no longer occurs when an index exceeds the number of<br> entries in a palette. Instead a module operator is used to prevent<br> out of bounds memory access.<br><br> Change-Id: Ia62c65cd8b1be0d66c488540709a8fb961190cc9<br><br>commit d98cbeb7206f6007f7d0c25fd4a4becad8973053<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Fri Oct 3 09:01:28 2014 -0400<br><br> ENH: Refactor per pixel conversion function to per scan-line method<br><br> This patch changes the implementation of conversion from the TIFF<br> scanline buffer from a function call on each pixel to a function call<br> per scanline. The enable efficient copying of similar scanline and<br> better reuse of variables for palette look ups.<br><br> This can increase the performance of reading grayscale images by up to<br> 3X for cached files.<br><br> Change-Id: I24bb744fda35629f1c1ed7154e26e5708e912059<br><br>commit 8e488f40e8cb7defa046700798b77e3944ac33c9<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Tue Sep 30 08:56:58 2014 -0400<br><br> ENH: RGBA read images should stay unchanged.<br><br> The image that are read with the TIFFReadRGBAImage should not have<br> their pixel types converted. This libtiff method always read images<br> into an ABGR uint8 format. When the tiff file is read by this method<br> it should report that uint8 and RGBA is the component an pixel type<br> for the image. This allows the standard ITK buffer conversion to be<br> performed.<br><br> This change remove extra cases and template instantiations.<br><br> Additionally the RGBAImageToBuffer method was flipping the image along<br> the y-axis, this has been more explicitly done with the call to<br> TIFFReadRGBAImageOriented.<br><br> Change-Id: I022b12921d406edb09730f905213b0db811f1bd4<br><br>commit e5834d5b00e4e3fab3255d88e7d8fd917ee722e9<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Fri Sep 26 14:04:09 2014 -0400<br><br> ENH: Remove support for TIFF tile as 3D and dead code<br><br> This TIFF file format is a file which contains a list of directories,<br> if there are no directories in the file it's not a valid tiff. Code<br> which supported 3D tiles was conditioned on a file with no directories<br> and no data. Additional code was removed related to a private SGI tag<br> TIFFTAG_TILEDEPTH, ImageJ specific tag also pre-conditioned on this<br> invalid case.<br><br> Change-Id: Id4ef171c5dbe0c797be206e0059c7488719ef6e6<br><br>commit 3ac19a9ffd94e02254900dd0e5e2661c329e3183<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Mon Oct 6 10:01:50 2014 -0400<br><br> BUG: Address Coverity warning about null pointer dereferences<br><br> The patch addressed the following Coverity warnings:<br><br> ** CID 1243373:  Explicit null dereferenced  (FORWARD_NULL)<br> itkTIFFImageIO.cxx:<br> 1192 in itk::TIFFImageIO::ReadTIFFTags()()<br><br> ** CID 1243372:  Dereference null return value  (NULL_RETURNS)<br> itkTIFFImageIO.cxx:<br> 1096 in itk::TIFFImageIO::ReadTIFFTags()()<br><br> ** CID 1243371:  Dereference before null check  (REVERSE_INULL)<br> itkTIFFImageIO.cxx:<br> 1100 in itk::TIFFImageIO::ReadTIFFTags()()<br> Last login: Fri Oct  3 19:47:29 on ttys004<br><br> Change-Id: I02c8435628c860ff03889b9b57e9dd1543bf82da<br><br>commit 52ce992f3a57ef9f187f9c4b4ebd7ce20db365bd<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Fri Sep 26 11:04:38 2014 -0400<br><br> ENH: Reduce code duplicate in TIFFImageIO::ReadCurrentPage<br><br> Refactoring of the pixelOffset to include the number of components<br> remove the need for a separate block for RGB multi-component files.<br><br>commit 97b33787ec17b76a61fdb43b5f1e1ea708bbac2c<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Wed Sep 24 15:00:54 2014 -0400<br><br> ENH: add arbitrary TIFF TAGs to meta-data dictionary<br><br> A more general approach to adding custom tiff tags to the meta-data<br> dictionary has been used based on the implementation of libtiff's<br> PrintDirectory method and the libtiff "Defining New TIFF Tags"<br> documentation.<br><br> Additionally a new test image was added generated in Photoshop, which<br> has a novel pixel layout, and also contains additional tag types such<br> as byte, and size specified ascii.<br><br> Change-Id: Idb2e669e540cfbe27a932444011f4b9896ca403d<br><br>commit 795c71abb8b5c3a09d461ec7b34eefbfdcb460e9<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Mon Sep 22 15:08:36 2014 -0400<br><br> BUG: Use array delete operator for array new allocations<br><br> Change-Id: Ic9bc3c3792083a1a1b3fd842486a7436a4086150<br><br>commit 83e8b6e699b3d9e2da8533dd1ea36dc0692bc9eb<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Tue Sep 23 11:14:15 2014 -0400<br><br> STYLE: Fix minor kwstyle defects in test and test results<br><br> Change-Id: I4b2641d31acb5c764de4041bb7d21c08b3c99846<br><br>commit 869f3275120646829b27d5cd75c23800d9df01cd<br>Author: Richard Beare <<a href="mailto:Richard.Beare@ieee.org">Richard.Beare@ieee.org</a>><br>Date:   Tue Sep 23 11:11:34 2014 -0400<br><br> ENH: Include TIFF tags in the MetaDataDictionary<br><br> Add contribution from the Insight Journal:<br> <a href="http://hdl.handle.net/10380/3170">http://hdl.handle.net/10380/3170</a><br><br> Change-Id: I20b02394d92c421bad75c5d0af496a6e80089ac0<br><br>commit c7a76c9acb319862647a651a2060dd3fb16560d7<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Mon Sep 22 14:46:44 2014 -0400<br><br> BUG: Remove dead separated plannar code, add test<br><br> The PLANARCONFIG_SEPARATE block in TIFFImageIO::ReadGenericImage, was<br> preceded by a unreachable due to a conditional and exception<br> check. Support for this configuration remains in the TIFFReadRGBAImage<br> method. A test for the configuration has been added.<br><br> A new input image is added from the from the libTiff test images:<br><br> PlanarConfiguration = 2 (separated samples)<br> -------------------------------------------<br> oxford.tif      601x81 8-bit RGB (lzw) screendump off oxford<br><br> Change-Id: Ibb874f80809b70b1aee7a2c9ff1fc8544ed56c04<br><br>commit 1b57d75964496dd2cc9e050a4a4425f1163d4b22<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Mon Sep 22 13:32:23 2014 -0400<br><br> BUG: Fix right oriented tiff images<br><br> The TIFFImageIO::ReadGenericImage method correctly handled top-left<br> oriented images, and bottom-right image, however images oriented with<br> right were non-correctly handled. These cases are now handled<br> correctly by the TIFFRGBAImage generic path.<br><br> New test images of the cthead1 image were added which have been<br> flipped the to the different orientation, and the matching orientation<br> tag specified so that they should all be read as equivalent<br> images. These have been added as a test case.<br><br> Change-Id: I058382d6d2e18341ab87edd165490be2187c1d15<br><br>commit 6263f4389026f1bd770054e86c428b56629d705b<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Thu Sep 18 16:20:41 2014 -0400<br><br> ENH: Refactor duplicated code to read a page<br><br> Created a method to read a single page or sub-image in a tiff<br> file. Simular code was both in the ReadVolume method for 3-d and the<br> Read method for 2-d. The code block from ReadVolume was used because<br> it contained more typed cases. There for this patch does improve the<br> 2d reading capabilities for tiffio, so that they are consistent with<br> the 3d.<br><br> Change-Id: I0fbfb19f04435a703bb3fa09ea4e79179592e443<br><br>commit 233571f1e626917bce872e450907bc8e8521e371<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Thu Sep 18 14:59:58 2014 -0400<br><br> ENH: Refactor method to convert RGBA image to output buffer<br><br> BUG: Address overflow issue when computing page offset with<br> TIFFReadRGBAImage method.<br><br> Extract repeated code to convert from ReadRGBAImage to output image<br> type.<br><br> Change-Id: Ia90b5e104f22c77493b8a4cd5bf640fd793b8b4b<br><br>commit 1cd59825fa65f1123726a32f67c1a443015b40ec<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Thu Sep 18 11:30:41 2014 -0400<br><br> BUG: Remove Zeiss 2-channel support code in TIFFImageIO ( and LSMImageIO<br>)<br><br> There are no tests for this branch of code. It only works in 3D under<br> certain cases. There are apparent bugs in the code such as not setting<br> all of the input image, and logically dead branches. Some downloaded<br> test images for similar described format do not load. This may effect<br> files with the extensions tif, tiff, or lsm.<br><br> Removal of this code will enable expansion of the current code to more<br> generically support multi-sample per pixel images.<br><br> For more robust reading of this type of image the SCIFIO remote<br> module should be used.<br><br> Change-Id: Idb98d69538db3bc8520881ea4a5e22476238c41e<br><br>commit 690cfdc89343fcc8c7d3cc266d652cfb14de9d41<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Tue Sep 16 15:31:52 2014 -0400<br><br> ENH: Refactor GenericReadImage into template function<br><br> Reduce code duplication by using template method.<br><br> Change-Id: I79411ad6595258d54cbfa5a4152cc55994acd8e0<br><br>commit 5f73f24bfb668fa9f33804218c0db05cf5cadb3f<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Tue Sep 16 12:09:59 2014 -0400<br><br> ENH: Refactor ReadTwoSamplePerPixelImage into template function<br><br> Reduce code duplication by using template method.<br><br> Change-Id: I45f417486e60a4d3e67ff31fa967dac069b3ce3e<br><br>commit 0b573136d636613217df9683ea846db8039f9312<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Tue Sep 16 11:12:45 2014 -0400<br><br> ENH: Extract TiffReaderInternal to separate file<br><br> Refactored private class to be in separate private header.<br><br> Change-Id: Icb4008c1605a3a0b62c563350cf2e3bbe948ec6d<br><br>commit 6791b4a3613aade07e3f11f765f1316faf03b113<br>Author: Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>><br>Date:   Mon Sep 15 16:46:26 2014 -0400<br><br> BUG: Fix overflows computing size of read tiff image<br><br> When multiplying the height and width of an tiff image (32-bits),<br> at least one element should be converted to size_t to help prevent<br> numeric overflow.<br><br> This change enables reading of larger RGB and large 2D image, that<br> were previously truncated when reading. This does not address<br> potential buffer overflow or resource limits which could occur.<br><br> Change-Id: I192370606677c8dc1a903c67c2a0701026256d5a<br><br>commit b6fabfeb2a5b8d339b2d459edd3e3c50232b55ff<br>Author: Matt McCormick <<a href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>><br>Date:   Mon Aug 25 00:35:48 2014 -0400<br><br> COMP: Do not use _stat64 with MinGW-32.<br><br> Unlike MinGW-w64, MinGW-32 aka MinGW, does not define as much of the API<br> including _stat64.  Do not use use _stat64 in TIFFImageIO when building<br>with<br> MinGW-32.<br><br> Change-Id: I8f13a4500cdadf4f4adae7b5cf8893fe8b8cad55<br><br><br><br><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://public.kitware.com/mailman/listinfo/insight-developers<br><br><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br><br><br><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br><br><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br><br><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br><br><br><br><br><br>--<br>Unpaid intern in BillsBasement at noware dot com<br><br><br></blockquote><br><br><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br></blockquote></div><br></div></body></html>