feat: add Tofwerk pFIB-ToF-SIMS HDF5 extractor and preview generator#90
Merged
feat: add Tofwerk pFIB-ToF-SIMS HDF5 extractor and preview generator#90
Conversation
…89) - Add TofwerkPfibExtractor (priority 150) with content sniffing for fibTOF FIB-SIMS HDF5 files; extracts creation time, FIB parameters (voltage, current, FOV, pixel size), mass range, ion mode, chamber pressure, and file variant (raw vs. opened) - Add TofwerkPfibPreviewGenerator with composite layout: FIB SE image, TIC map, depth profile/RGB composite, and annotated sum spectrum - Add synthetic HDF5 test fixture generator and 30 unit tests - Add PII-stripped real pFIB-ToF-SIMS files to test_record_files.tar.gz (Computer ID, FileSignature, and DataPath anonymized); update record builder tests to cover the new Tofwerk-pFIB-TOFSIMS instrument session
Add quick reference table entry, full format section (file format detection, two file variants, extracted metadata fields, preview generator layouts), and API reference link for the new TofwerkPfibExtractor and TofwerkPfibPreviewGenerator plugins.
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. |
- Add 11 new tests covering exception paths, edge cases in _norm_channel, _read_attr_scalar, _depth_plot_style, _tic_display_limits, _parse_creation_time, and _extract_fib_params - Fix IndexError in RGB channel padding when no peaks exceed min_mass: pre-compute _zero_channel so the padding loop has a valid fallback when rgb_channels is still empty - Fix ValueError in depth-profile y-limit calculation when an opened file has peaks but none above min_mass (top_idx empty): fall back to depth_prof.sum(axis=1) instead of concatenating an empty list
…integration test, fix warnings - Rename extension keys to Title Case: FIB Hardware, Pixel Size, Number of Peaks, Ion Mode, FibLys GUI Version, TofDAQ Version, Chamber Pressure, File Variant, Mass Range Minimum/Maximum; keep standard EM Glossary snake_case keys unchanged - Rename file variant value "opened" to "pre-processed" - Increase preview output resolution to 1500x1500 - Guard ax.legend() calls to only fire when labeled artists exist, eliminating UserWarnings in zero-peaks-above-min-mass test case - Add tofwerk_integration_record fixture and test_tofwerk_pfib_record integration test for end-to-end record build and CDCS upload validation - Update all unit test assertions to match new key/value names
… preview resolution - Replace "opened/processed" and "Opened" with "pre-processed" throughout - Update File Variant key names from snake_case to "File Variant" (Title Case) - Change preview size from 500×500 to 1500×1500 px
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.
Closes #89
Summary
TofwerkPfibExtractorplugin (priority 150) with content sniffing for Tofwerk fibTOF FIB-SIMS.h5files. Extracts: creation time (fromAcquisitionLogwith timezone, with fallbacks), FIB hardware, accelerating voltage (kV), beam current (A), field of view (mm), pixel size (µm), data dimensions, mass range min/max (Da), ion mode, chamber pressure (Pa), GUI/DAQ versions, and file variant (raw vs. opened).TofwerkPfibPreviewGeneratorplugin (priority 150) producing a 500×500 px composite PNG. Raw layout: FIB SE image, TIC map, depth profile, and annotated sum spectrum. Opened layout: FIB SE image, TIC map, RGB composite (top-3 peaks), sum spectrum, and per-peak depth profiles.generate_tofwerk_test_files.py) and 30 unit tests covering both extractor and preview generator.test_record_files.tar.gz(Computer ID,FileSignature, andDataPathusername anonymized) and extend record builder tests to include aTofwerk-pFIB-TOFSIMSinstrument session.Implementation notes
FIBParams.ViewFieldis stored in millimeters; pixel size =ViewField_mm × 1e3 / NbrXµm/pixel.Configuration File ContentsINICh*FullScalevalues are ADC voltage ranges, not spatial dimensions -- not used for pixel size.EventListone write at a time to avoid loading the full ragged 4D array into memory.nx_meta["extensions"]viaadd_to_extensions(), not at the top level.Test plan
tests/unit/test_extractors/test_tofwerk_pfib.pypass (extractor supports/extract, preview supports/generate)TestRecordBuilder(27 tests) passes with updated 4-session assertions