Binary Image File Viewer
A Visual Studio Code extension for viewing and analyzing binary image files with advanced visualization capabilities. Perfect for researchers, engineers, and data scientists working with raw binary image data from scientific instruments, medical devices, or custom imaging systems.
Features
🖼️ Binary Image Visualization
- Multi-format Support: View binary files as grayscale images with configurable data types
- Real-time Rendering: Interactive canvas-based visualization with automatic scaling
- Multiple Data Types: Support for uint8, uint16, int16, int32, float32, and float64 formats
- Endianness Control: Toggle between little-endian and big-endian byte ordering
🎛️ Interactive Controls
- Metadata Input: Specify image dimensions (width × height) and data type
- Multi-Plane Viewing: Toggle between axial and coronal viewing planes
- Slice Navigation: Navigate through multi-slice volumes with:
- Range slider for quick navigation
- Mouse wheel scrolling on canvas
- Keyboard shortcuts (←/→ arrow keys)
- Direct slice number input
- Window/Level Controls: Adjust image contrast and brightness with interactive sliders
- Auto-scaling: Images automatically scale to fit the viewer window
- File Statistics: View file size, dimensions, and calculated slice count
- Current Slice Info: Track which slice you're currently viewing
- Smart Validation: Automatic bounds checking and error handling
Supported File Types
.raw
files (raw binary image data)
.bin
files (binary data files)
- Any binary file containing image data (configurable through VS Code settings)
Installation
- Install from the VS Code Marketplace (coming soon)
- Or install from VSIX:
- Download the
.vsix
file
- Run
code --install-extension binary-image-file-viewer.vsix
Usage
Opening Binary Files
- Open a
.raw
or .bin
file in VS Code
- The Binary Image Viewer will automatically activate
- Configure the image parameters in the control panel
Basic Workflow
- Set Dimensions: Enter the width and height of your image data
- Choose Data Type: Select the appropriate data type (uint8, float32, etc.)
- Set Endianness: Choose little-endian or big-endian based on your data format
- Load Slice: Click "Load Slice" to render the image
- Navigate: Use the slider, mouse wheel, or arrow keys to browse through slices
- Switch Views: Click the "Plane" button to toggle between axial and coronal views
- Adjust Display: Use window/level controls to optimize image contrast and brightness
Keyboard Shortcuts
←/→
or ↑/↓
: Navigate between slices
Mouse Wheel
: Scroll through slices when hovering over the image
Data Types Supported
Type |
Description |
Bytes per Pixel |
uint8 |
Unsigned 8-bit integer (0-255) |
1 |
int8 |
Signed 8-bit integer (-128 to 127) |
1 |
uint16 |
Unsigned 16-bit integer (0-65535) |
2 |
int16 |
Signed 16-bit integer (-32768 to 32767) |
2 |
uint32 |
Unsigned 32-bit integer (0 to 4294967295) |
4 |
int32 |
Signed 32-bit integer |
4 |
float32 |
32-bit floating point |
4 |
float64 |
64-bit floating point |
8 |
Configuration
Currently, the extension works with files having .raw
and .bin
extensions. Future versions will support custom file extension configuration through VS Code settings.
Examples
Medical Imaging Data
Width: 512
Height: 512
Data Type: uint16
Endianness: Little-Endian
Scientific Instrument Data
Width: 1024
Height: 768
Data Type: float32
Endianness: Big-Endian
Raw Camera Data
Width: 2048
Height: 1536
Data Type: uint8
Endianness: Little-Endian
Roadmap
Recent Updates
- [x] Multi-plane viewing (axial and coronal)
- [x] Window/level controls for contrast adjustment
- [x] Enhanced error handling
- [x] Global min/max computation for optimal windowing
Future Enhancements
- [ ] Sagittal plane viewing
- [ ] MIP rendering
- [ ] Multi-slice view modes
- [ ] PNG export functionality
- [ ] Performance optimizations for large datasets
Requirements
- Visual Studio Code 1.101.0 or higher
- No additional dependencies required
Known Issues
- Large files (>100MB) may experience slower loading times
- Maximum recommended image size: 4096×4096 pixels
- Memory usage scales with image dimensions and bit depth
Contributing
This extension is under active development. Contributions, bug reports, and feature requests are welcome!
Development
Building from Source
git clone <repository-url>
cd binary-image-file-viewer
npm install
npm run compile
Testing
npm run test
Packaging
npm run package
License
[Add your license information here]
Release Notes
0.3.0
Latest release with enhanced visualization:
- Multi-plane viewing (axial and coronal)
- Window/level controls for contrast adjustment
- Global min/max computation for optimal windowing
- Enhanced error handling and validation
Enjoy visualizing your binary image data! 🚀
For questions, issues, or feature requests, please visit our GitHub repository.