Skip to content

Refactor MATLAB MEX sources and convert get_header to .m#17

Merged
stevevanhooser merged 4 commits intomainfrom
rename-matlab-mex-sources-3706797163850873221
Feb 25, 2026
Merged

Refactor MATLAB MEX sources and convert get_header to .m#17
stevevanhooser merged 4 commits intomainfrom
rename-matlab-mex-sources-3706797163850873221

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change streamlines the MATLAB interface by renaming the main MEX source file to pyraview.c and converting the header reading utility get_header from a C MEX file to a pure MATLAB function. This removes the compilation requirement for the header reader. Additionally, a helper function pyraview.macOneTime is introduced to assist macOS users in allowing the unsigned pyraview.mex binary to run via System Settings.


PR created automatically by Jules for task 3706797163850873221 started by @stevevanhooser

…acOS coaching.

Renames `pyraview_mex.c` to `pyraview.c` in `src/matlab/+pyraview/`.
Replaces `pyraview_get_header_mex.c` with a pure MATLAB implementation `get_header.m` to simplify usage and cross-platform compatibility.
Updates `build_pyraview.m`, `README.md`, and `toolboxPackaging.prj` to reflect these changes.
Adds `pyraview.macOneTime` function to guide macOS users through the security authorization process for the remaining MEX binary.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…hing, and clarify layout.

Renames `pyraview_mex.c` to `pyraview.c` in `src/matlab/+pyraview/`.
Replaces `pyraview_get_header_mex.c` with a pure MATLAB implementation `get_header.m` to avoid compilation and simplify cross-platform usage.
Adds `pyraview.macOneTime` function to coach macOS users through allowing the `pyraview.mex` binary.
Explicitly defines `PV_LAYOUT_COLUMN_MAJOR = 1` in `pyraview.c` to clarify that the engine correctly handles MATLAB's column-major data layout.
Updates build scripts and documentation to reflect these changes.
This change overhauls the Pyraview C++ engine and all reader APIs (MATLAB, Python) to use an Interleaved data layout (`[Sample0_Ch0, Sample0_Ch1...][Sample1_Ch0...]`) instead of the previous Planar format.
This ensures that appending data chunks maintains a consistent, globally readable file structure, addressing issues with fragmented planar files.
Refactors `src/c/pyraview.cpp` to use global interleaved buffers and single-threaded sequential writes per level.
Updates `src/matlab/+pyraview/readFile.m` and `src/python/pyraview/__init__.py` to correctly parse the new format.
Updates `include/pyraview_header.h` and documentation to reflect the new output standard.
Major overhaul of Pyraview I/O to support robust chunk appending:
-   Refactored `src/c/pyraview.cpp` to use global interleaved buffers and sequential writes, producing Sample-Major (Interleaved) output files (`[S0_AllCh][S1_AllCh]...`).
-   Updated `src/matlab/+pyraview/readFile.m` and `src/python/pyraview/__init__.py` to read this new format.
-   Updated `include/pyraview_header.h` and `pyraview_gateway.c` comments to reflect the layout change.

Maintenance and Cleanup:
-   Renamed `pyraview_mex.c` to `pyraview_gateway.c` to prevent object file name collisions with `pyraview.cpp` during MEX compilation.
-   Replaced `pyraview_get_header_mex.c` with a pure MATLAB implementation `get_header.m`.
-   Added `pyraview.macOneTime.m` for macOS security coaching.
-   Updated build scripts and documentation.
@stevevanhooser stevevanhooser merged commit d88b7a6 into main Feb 25, 2026
6 checks passed
@stevevanhooser stevevanhooser deleted the rename-matlab-mex-sources-3706797163850873221 branch February 25, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant