Comments (9)
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.
Some more informations: VTK uses Zeiss 3D TIFF and MeVisLab uses SGI 3D TIFF.
from itk.
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.
I wonder if the OpenSlide ImageIO would be any better? #139
from itk.
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.
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.
P.S. openslide, to my knowledge, does not support writing slides/tiffs. If it did, ITKIOOpenSlide would have supported that ability.
from itk.
More info about these tags in this ITK discourse thread:
https://discourse.itk.org/t/unknown-tags-reading-tiff/1719/2
from itk.
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)
- Clean up advanced CMake variables
- Unable to work with Raw Projection Images in ITK-RTK HOT 1
- ITK_x86 failed to run test on Asan mode HOT 6
- pip install itk failed, file name too long HOT 4
- pip install itk fails HOT 3
- Error in importing SimpleITK installed via miniconda HOT 2
- Issue in ITK-RTK reconstruction with Shepp-Logan phantom HOT 1
- Calling python itk.meshread on the linked file causes itk to segfault. HOT 2
- Report coverage diffs in PRs or dashboard builds HOT 1
- Split handling of standard conforming DICOM from non-standard DICOM
- itkSLICImageFilterTest1 fails on macOS ARM HOT 2
- encoding bug in OpenJPEG third party module HOT 6
- SymmetricEigenAnalysisImageFilter incorrect python wrapping HOT 6
- Add a documentation FAQ entry on ITK and AI
- Upgrade SWIG from version 4.0.2 to version 4.1.0 or higher, please! HOT 1
- ImageScanlineConstIterator not working with RLEImage module in ITK 5.4 rc02 HOT 26
- Build in Debug mode fails after "fix-32bits-dicom-read-crash" HOT 1
- Visual Studio build error - misspell in the variable "ITK_TRY_EXPECT_NO_EXCEPTIION" (double "I" symbol) HOT 1
- GDCM fails to compile using MSVC 2019, 2022 after bump to 3.0.23 HOT 20
- Update clang-format version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itk.