Add Tescan PFIB TIFF extractor plugin with comprehensive metadata extraction#20
Merged
Add Tescan PFIB TIFF extractor plugin with comprehensive metadata extraction#20
Conversation
… testing
- Implement TescanTiffExtractor plugin for TESCAN AMBER X microscope files
- Support embedded HDR metadata in TIFF tag 50431 (primary source)
- Fall back to sidecar .hdr files and standard TIFF tags for metadata
- Extract 70+ metadata fields from [MAIN] and [SEM] sections
- Implement multi-tier extraction strategy with graceful degradation
- Add robust content sniffing for reliable file detection
- Support both standalone .hdr files and .tif files with sidecars
- Proper unit conversions: m→nm, Pa→mPa, V→kV, A→μA, A→pA
- Nested dictionary structure for complex metadata (Stage Position)
- Set priority to 150 to ensure correct detection over generic QuantaTiff
Testing:
- 37 comprehensive unit tests covering all code paths
- 100% line coverage (209/209 statements)
- Edge case testing: missing .hdr, corrupted files, various encodings
- Fallback scenario validation
- Real file extraction testing with pfib-tescan.{tif,hdr}
Documentation:
- NumPy-style docstrings with usage examples
- Changelog entry created (docs/changes/15.feature.md)
- Comprehensive error handling with helpful logging
Code Quality:
- All linting checks passed (ruff)
- Code properly formatted
- No security issues or type safety concerns
- Defensive programming pattern throughout
Closes #15
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
📚 Documentation PreviewThe documentation for this PR has been deployed to:
This preview will be updated on each push to this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a new extractor plugin for Tescan PFIB (Plasma Focused Ion Beam) and SEM microscopy files (Issue #15), following the plugin architecture established in PR #19 (Zeiss Orion/Fibics HIM extractor).
Key Features
.hdrfile parsing (INI format with[MAIN]and[SEM]sections)Implementation Details
Extractor Plugin:
nexusLIMS/extractors/plugins/tescan_tif.pyconfigparserfor INI parsing with case preservationArchitecture Pattern:
ExtractorPluginprotocol fromnexusLIMS/extractors/base.pysupports()methodTesting
Test Suite:
tests/unit/test_extractors/test_tescan_tif.pyTest Data:
pfib-tescan.{tif,hdr}tescan-pfib_dataZeroed.tar.gzDocumentation
docs/extractors.mdwith Tescan PFIB sectiondocs/changes/15.feature.md.claude/plans/issue-15-tescan-tiff-extractor-implementation.mdVerification
Files Changed
New Files (3):
nexusLIMS/extractors/plugins/tescan_tif.py- Main extractor (209 lines)tests/unit/test_extractors/test_tescan_tif.py- Test suite (1056 lines)docs/changes/15.feature.md- Changelog entryModified Files (7):
docs/extractors.md- Added Tescan PFIB sectiondocs/index.md- Updated extractor count.gitignore- Allow pfib-tescan.tif test fileCLAUDE.md- Added archive creation noteTest Data:
tests/unit/files/tescan-pfib_dataZeroed.tar.gz- Anonymized test fixturestests/unit/files/tescan_pfib_example_{hdr,tiff}_meta.txt- Metadata samplesKnown Limitations
Future Enhancements
Closes #15