Code Monkey home page Code Monkey logo

Comments (9)

maekclena avatar maekclena commented on May 18, 2024 1

There is no standard way of storing a Z spacing in TIFF but the format allows private tags. For example, MIPAV handles ZResolution and GeoTIFF defines ModelPixelScaleTag.

For DICOM slices, here's an example to preserve metadata:

itk::GDCMImageIO::Pointer gdcmIO = itk::GDCMImageIO::New();
ReaderType::DictionaryRawPointer dict = (*(reader->GetMetaDataDictionaryArray()))[sliceNumber];
gdcmIO->SetMetaDataDictionary(*dict);
writer->SetImageIO(gdcmIO);
writer->UseInputMetaDataDictionaryOff();
writer->SetInput(slice2D);
writer->Update();

from itk.

maekclena avatar maekclena commented on May 18, 2024 1

Some more informations: VTK uses Zeiss 3D TIFF and MeVisLab uses SGI 3D TIFF.

from itk.

blowekamp avatar blowekamp commented on May 18, 2024 1

There are also a couple ImageJ TIFF private tags which can contain 3D information: https://github.com/imagej/ImageJA/blob/master/src/main/java/ij/io/TiffDecoder.java#L43-L44

I can't seem to find a specification for them right now.

from itk.

blowekamp avatar blowekamp commented on May 18, 2024

I wonder if the OpenSlide ImageIO would be any better? #139

from itk.

zivy avatar zivy commented on May 18, 2024

Not sure about OpenSlide, they had a discussion about supporting 3D about three years ago (openslide/openslide#166) and the project isn't too active, at least on github (https://github.com/openslide/openslide/graphs/code-frequency).

from itk.

nslay avatar nslay commented on May 18, 2024

This also happens when writing individual DICOM slices/files from a 3D DICOM volume (it clobbers the SpacingBetweenSlices tag "0018|0088" with value 1.0, even if it was there before and not 1.0). My workaround (rather tedious) is to promote the 2D image slice to a 3D volume with a singleton z dimension and extracting/setting the spacing, direction cosines and origin... and then saving the 3D slice to a DICOM file.

from itk.

nslay avatar nslay commented on May 18, 2024

P.S. openslide, to my knowledge, does not support writing slides/tiffs. If it did, ITKIOOpenSlide would have supported that ability.

from itk.

blowekamp avatar blowekamp commented on May 18, 2024

More info about these tags in this ITK discourse thread:
https://discourse.itk.org/t/unknown-tags-reading-tiff/1719/2

from itk.

stale avatar stale commented on May 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from itk.

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.