Skip to content

Closes Bug #1273 mac os dcm2nii error#1966

Open
HenkMutsaerts wants to merge 5 commits intodevelopfrom
bug-#1273_macOS_dcm2nii_error
Open

Closes Bug #1273 mac os dcm2nii error#1966
HenkMutsaerts wants to merge 5 commits intodevelopfrom
bug-#1273_macOS_dcm2nii_error

Conversation

@HenkMutsaerts
Copy link
Member

Linked issue

Closes #1273

How to test

Required: if not defined in the linked issue, add a simple test description here

Comments

Optional: add helpful comments for the reviewers here

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes macOS dcm2nii error handling by standardizing path quoting across Unix-based systems and removing macOS-specific command line handling that was causing issues.

  • Standardized path quoting in system commands across Unix/Linux/macOS platforms
  • Removed macOS-specific command line formatting for dcm2nii operations
  • Added validation warnings for empty JSON fields and improved testing infrastructure

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Testing/xASL_test_Flavors.m Fixed typo, added screen clearing, and updated delete function call
Functions/InputOutput/xASL_io_dcm2nii.m Removed macOS-specific command line handling to use standardized quoting
Functions/BIDS/xASL_bids_BIDSifyASLJSON.m Added validation for empty fields in JSON and studyPar structures
External/SPMmodified/xASL/xASL_SysMove.m Standardized path quoting for Unix systems and commented out path conversion
External/SPMmodified/xASL/xASL_SysCopy.m Standardized path quoting for Unix systems and commented out path conversion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

system(['cp -r -f ' quote SrcPath quote '/* ' quote DstPath quote]); % -n is short for --noclober
else
system(['cp -r ' SrcPath '/* ' DstPath]);
system(['cp -r ' quote SrcPath '/*' quote ' ' quote DstPath quote]);
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quoting for the wildcard pattern is incorrect. The '/*' should be outside the quotes to be interpreted by the shell, not inside. This should be: system(['cp -r ' quote SrcPath quote '/* ' quote DstPath quote]);

Suggested change
system(['cp -r ' quote SrcPath '/*' quote ' ' quote DstPath quote]);
system(['cp -r ' quote SrcPath quote '/* ' quote DstPath quote]);

Copilot uses AI. Check for mistakes.
@HenkMutsaerts HenkMutsaerts linked an issue Sep 25, 2025 that may be closed by this pull request
8 tasks
@jan-petr jan-petr self-assigned this Sep 25, 2025
Copy link
Contributor

@jan-petr jan-petr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed what's the until now and fine with all. I will run flavor tests once the issue is finalized.

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.

macOS dcm2nii error

3 participants