Giter Club home page Giter Club logo

Comments (4)

boonepeter avatar boonepeter commented on June 11, 2024 1

Hey @vbelyakov,

I have some experience using OME-Tiff images with this library. Like @Bobrovsky said (and I'm sure you know) OME Tiff is just regular tiff with a bunch of metadata thrown into the Image description tag. It would be way too much work for this library to support the format...definitely out of the scope of this project. LibTiff.NET does a great job when it comes to reading and writing the raw tiff images (and you can just use .ome.tiff as the filename).

I auto-generated some classes based on the OME schema to help with the reading and writing of the metadata: https://github.com/boonepeter/OME-Tiff-Csharp.

It works for me, but I will warn you that you will have to do a bit of manual work when reading and writing OME-Tiff images. Let me know if you have more specific questions.

from libtiff.net.

Bobrovsky avatar Bobrovsky commented on June 11, 2024

Hello Victor,

The library knows nothing about OME-TIFF. Quick search revealed that OME-TIFF is a regular TIFF with some metadata. In theory, the library might be capable of reading such files.

Please try it for yourself and report any issues you find.

from libtiff.net.

vbelyakov avatar vbelyakov commented on June 11, 2024

Hi Sergey,

Thank you for the prompt response.

As a matter of fact, I tried it for myself and did not find a way to get to OME-TIFF comment.

Here's a spec with details on how to extract OME-TIFF comment: https://docs.openmicroscopy.org/ome-model/5.6.3/ome-tiff/code.html. It should be done by the library, not the code using it.

I found OME-TIFF file like the one attached to this comment, cannot be opened by libtiff.net library. ImageJ can open it.

So, I'm asking one question and reporting one issues:

Question: The file attached to issue description is a 16bit tiff which ImageJ can only display using Bio-Formats plugin. I wonder if you could give me some tips, as trusted expert with TIFF format, if I can convert that image using your library to one that can be viewed without plugin. ImageJ shows the following image info after importing with Bio-Formats plugin and I can save it and view it without the plugin:

 BitsPerPixel = 16
 DimensionOrder = XYCZT
 IsInterleaved = false
 IsRGB = false
 LittleEndian = true
 PixelType = uint16
 Series 0 Name = B2-1-C1.tif
 SizeC = 1
 SizeT = 1
 SizeX = 1392
 SizeY = 1040
 SizeZ = 1
BitsPerSample = 16
Compression = Deflate (Zlib)
DateTime = 2019:10:24 19:01:03
ImageLength = 1040
ImageWidth = 1392
Location = F:\Work\capture\EMD\EssenFiles\ScanData\1910\24\1900\238\B2-1-C1.tif
MetaDataPhotometricInterpretation = Monochrome
MetaMorph = no
NumberOfChannels = 1
Orientation = 1st row - top; 1st column - left
PhotometricInterpretation = BlackIsZero
PlanarConfiguration = Chunky
ResolutionUnit = Inch
SampleFormat = unsigned integer
SamplesPerPixel = 1
Software = SnTiffDl.dll v20181.1.0.0
TileByteCounts = 51424
TileLength = 256
TileOffsets = 8
TileWidth = 256
XResolution = 72.0
YResolution = 72.0

------------------------------------------------------
ImageJ 1.52o; Java 1.8.0_112 [64-bit]; Windows 10 10.0; 42MB of 12157MB (<1%)
 
Title: B2-1-C1.tif
Width:  491066.6667 microns (1392)
Height:  366888.8889 microns (1040)
Size:  2.8MB
Resolution:  0.0028 pixels per micron
Pixel size: 352.7778x352.7778 micron^2
ID: -3
Bits per pixel: 16 (unsigned)
Display range: 0 - 825
No threshold
Magnification: 0.75
ScaleToFit: false
Uncalibrated
Path: F:\Work\capture\EMD\EssenFiles\ScanData\1910\24\1900\238\B2-1-C1.tif
Screen location: 24,98 (2560x1080)
No overlay
No selection

Issue: libtiff.net library does not open OME-TIFF file that has OME-TIFF comment (see example file attached to this comment). Here's info from ImageJ:

ImageDescription: <?xml version="1.0" encoding="UTF-8"?><!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: http://loci.wisc.edu/ome/ome-tiff.html. -->
<OME xmlns:AML="http://www.openmicroscopy.org/Schemas/AnalysisModule/2008-09" xmlns:Bin="http://www.openmicroscopy.org/Schemas/BinaryFile/2008-09" xmlns:MLI="http://www.openmicroscopy.org/Schemas/MLI/2008-09" xmlns:SA="http://www.openmicroscopy.org/Schemas/SA/2008-09" xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2008-09" xmlns:SPW="http://www.openmicroscopy.org/Schemas/SPW/2008-09" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:CA="http://www.openmicroscopy.org/Schemas/CA/2008-09" xmlns:STD="http://www.openmicroscopy.org/Schemas/STD/2008-09" xmlns:CLI="http://www.openmicroscopy.org/Schemas/CLI/2008-09" xmlns="http://www.openmicroscopy.org/Schemas/OME/2008-09" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2008-09 http://www.openmicroscopy.org/Schemas/OME/2008-09/ome.xsd http://www.openmicroscopy.org/Schemas/BinaryFile/2008-09 http://www.openmicroscopy.org/Schemas/BinaryFile/2008-09/BinaryFile.xsd http://www.openmicroscopy.org/Schemas/CA/2008-09 http://www.openmicroscopy.org/Schemas/CA/2008-09/CA.xsd http://www.openmicroscopy.org/Schemas/SPW/2008-09 http://www.openmicroscopy.org/Schemas/SPW/2008-09/SPW.xsd http://www.openmicroscopy.org/Schemas/STD/2008-09 http://www.openmicroscopy.org/Schemas/STD/2008-09/STD.xsd" UUID="5f55993c-a1d6-4f00-b494-d012a32cc7df">
<Experimenter ID="urn:lsid:export.openmicroscopy.org:Experimenter:46be26c5-9fcf-497e-a913-48513759f00b_4"/>
<Group ID="urn:lsid:export.openmicroscopy.org:ExperimenterGroup:46be26c5-9fcf-497e-a913-48513759f00b_54:3259518"/>
<Image DefaultPixels="urn:lsid:export.openmicroscopy.org:Pixels:46be26c5-9fcf-497e-a913-48513759f00b_39146:20502813" ID="urn:lsid:export.openmicroscopy.org:Image:46be26c5-9fcf-497e-a913-48513759f00b_39146:20528812" Name="Bibby PSII Fig 3a PNAS 2003.tif">
<CreationDate>2011-11-24 00:12:53.0</CreationDate>
<ExperimenterRef ID="urn:lsid:export.openmicroscopy.org:Experimenter:46be26c5-9fcf-497e-a913-48513759f00b_4"/>
<Description>Annotated by CLW.</Description>
<GroupRef ID="urn:lsid:export.openmicroscopy.org:ExperimenterGroup:46be26c5-9fcf-497e-a913-48513759f00b_54:3259518"/>
<LogicalChannel ID="urn:lsid:export.openmicroscopy.org:LogicalChannel:46be26c5-9fcf-497e-a913-48513759f00b_78526:20502812" SamplesPerPixel="1"/>
<Pixels BigEndian="true" DimensionOrder="XYCZT" ID="urn:lsid:export.openmicroscopy.org:Pixels:46be26c5-9fcf-497e-a913-48513759f00b_39146:20502813" PixelType="uint8" SizeC="1" SizeT="1" SizeX="749" SizeY="388" SizeZ="1">
<TiffData>
<UUID FileName="__omero_export__6670401607227115567.ome.tiff">5f55993c-a1d6-4f00-b494-d012a32cc7df</UUID>
</TiffData>
</Pixels>
</Image>
</OME>

Software: LOCI Bio-Formats

------------------------------------------------------
ImageJ 1.52o; Java 1.8.0_112 [64-bit]; Windows 10 10.0; 49MB of 12157MB (<1%)
 
Title: 39146.tif
Width:  749   (749)
Height:  388   (388)
Size:  284K
Resolution:  1 pixels per  
Pixel size: 1x1  ^2
ID: -2
Bits per pixel: 8 (grayscale LUT)
Display range: 0-255
No threshold
ScaleToFit: false
Uncalibrated
Path: F:\Work\capture\39146.tif
Screen location: 684,129 (2560x1080)
No overlay
No selection

39146.zip

We've been using libtiff.net library for quite some time now and would like to stick to it. But it is only possible if it support TIFF format variants widely used in microscopy.
Appreciate your help.

Thanks,
Victor.

from libtiff.net.

vbelyakov avatar vbelyakov commented on June 11, 2024

Hi Sergey,

I found an answer to my questions. I had to juggle some bytes around before using libtiff.net to make it work.

Anyway, the issue about supported OME-TIFF format still stands. libtiff.net cannot open the previously attached 39146.zip OME-TIFF image. Let me know if you are going to support it.

Thanks,
Victor.

from libtiff.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.