Repository navigation
Fix/qsm gui nifti filter and lambda slider - #135
Merged
Merged
Conversation
The single semicolon-separated pattern '*.nii;*.nii.gz' in one filter string is unreliable in newer MATLAB, particularly with the native Linux file dialog, which doesn't handle a multi-extension list (and especially the double extension *.nii.gz) the same way the old dialog did. Split each filter into separate rows (combined pattern first as the default, then individual *.nii and *.nii.gz entries), which works consistently across MATLAB versions and platforms.
Three separate bugs prevented the MGF lambda parameter (a fractional threshold, default 0.7) from being set to non-integer values: - SliderStep was specified as a fraction of the slider range without accounting for Max-Min=4, so each step moved the value by a whole integer. - PopupTwoPassMasking_Callback set the lambda slider's Value to the two-pass masking popup's own Value (its selected item's index) instead of the actual lambda value, causing the slider to jump to an unrelated integer whenever the MGF option was selected. - The lambda edit field's callback was registered with isIntegerInput=true and bounds 0-10, rounding any typed value to the nearest integer and not matching the slider's 0-4 range. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kschan0214
added a commit
that referenced
this pull request
Sep 20, 2026
* Bump version to v1.3.0.1 Patch release covering the uigetfile NIfTI filter cross-platform fix and the QSM MGF lambda slider/edit field integer-only bug fix merged in #135. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Fix NIfTI filter not working on macOS uigetfile dialogs The semicolon-separated combined pattern '*.nii;*.nii.gz' in a single filter-spec string is not reliably filtered by macOS's native Cocoa file dialog (unlike Windows/Linux), so having it as the default first filter row broke file selection on Mac. Replace it with the single wildcard pattern '*.nii*', which matches both *.nii and *.nii.gz as one plain extension pattern and is filtered consistently across Windows, Linux, and macOS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Default NIfTI file dialogs to All Files to fix macOS .nii.gz visibility macOS's native uigetfile dialog filters by a file's literal last extension only, so it cannot match compound extensions like *.nii.gz through any filter-string pattern (semicolon list or embedded wildcard) - both previously tried approaches failed there. Make 'All Files' the default filter row so every file is visible regardless of platform, keeping *.nii and *.nii.gz as secondary, explicit filter options for platforms where they do work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Use a plain '*.*' filter instead of a multi-row cell array for NIfTI dialogs A multi-row filter cell array makes uigetfile show a file-type selector popup on macOS. Reports show .nii.gz files appearing grayed out/ unselectable there, meaning the popup was defaulting to a more restrictive row (e.g. *.nii) rather than the intended 'All Files' row, regardless of row order. Passing a single plain string ('*.*') instead of a cell array avoids the type-selector popup entirely on every platform, so there's no default row for the OS to pick incorrectly - all files are always shown and selectable. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Use plain All-Files filter only on macOS; keep descriptive filters on Windows/Linux Confirmed on Mac hardware: macOS's uigetfile file-type popup grays out *.nii.gz when given the multi-row filter cell array, regardless of row order or pattern used (semicolon list, '*.nii*' wildcard, or explicit 'All Files' row) - only a plain string filter with no type-selector popup avoids this. But that plain filter loses the descriptive *.nii/*.nii.gz filter options that already work correctly on Windows/Linux. New sepia_get_nifti_uigetfile_filter() centralises the platform check: returns '*.*' on macOS, and the descriptive multi-row filter (combined *.nii;*.nii.gz pattern first, then individual *.nii and *.nii.gz rows) on other platforms. All 16 uigetfile call sites for NIfTI selection now call this helper instead of hardcoding a filter spec. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Kwok Shing Chan <kc020@linen.nmr.mgh.harvard.edu> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
No description provided.